From e7912dfa1959be671f77e4e67eab01de9de86c77 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Fri, 4 Feb 2022 10:29:11 -0600 Subject: Attributes: Infrastructure for generic 8-bit integer data type This commit adds infrastructure for 8 bit signed integer attributes. This can be useful given the discussion in T94193, where we want to store spline type, Bezier handle type, and other small enums as attributes. This is only exposed in the interface in the attribute lists, so it shouldn't be an option in geometry nodes, at least for now. I expect that this type won't be used directly very often, it should mostly be cast to an enum type. However, with support for 8 bit integers, it also makes sense to add things like mixing implementations for consistency. Differential Revision: https://developer.blender.org/D13721 --- .../draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/draw/intern/mesh_extractors') diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc index 4dcd821e607..b27633405b9 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc @@ -99,6 +99,7 @@ static uint gpu_component_size_for_attribute_type(CustomDataType type) { switch (type) { case CD_PROP_BOOL: + case CD_PROP_INT8: case CD_PROP_INT32: case CD_PROP_FLOAT: { /* TODO(@kevindietrich): should be 1 when scalar attributes conversion is handled by us. See @@ -326,6 +327,10 @@ static void extract_attr_init(const MeshRenderData *mr, extract_attr_generic(mr, vbo, request); break; } + case CD_PROP_INT8: { + extract_attr_generic(mr, vbo, request); + break; + } case CD_PROP_INT32: { extract_attr_generic(mr, vbo, request); break; @@ -378,6 +383,10 @@ static void extract_attr_init_subdiv(const DRWSubdivCache *subdiv_cache, extract_attr_generic(mr, src_data, request); break; } + case CD_PROP_INT8: { + extract_attr_generic(mr, src_data, request); + break; + } case CD_PROP_INT32: { extract_attr_generic(mr, src_data, request); break; -- cgit v1.2.3