diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-10-21 14:09:07 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-10-24 12:21:17 +0300 |
commit | 0ee9282b5c51066dfcf5a6c7a5ebcd3dd5290673 (patch) | |
tree | 4e02590a5b3148e626e9187e8ba88313d581789c /source/blender/gpu/intern/gpu_vertex_format.cc | |
parent | b27c831e0cdcbd5e9792a8311e53ca31654a1d9f (diff) |
GPencil: Use indexed rendering instead of instances
This allows using instancing in other ways, like resources indexing.
Diffstat (limited to 'source/blender/gpu/intern/gpu_vertex_format.cc')
-rw-r--r-- | source/blender/gpu/intern/gpu_vertex_format.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_vertex_format.cc b/source/blender/gpu/intern/gpu_vertex_format.cc index b30e3c358c8..76d95ac1b55 100644 --- a/source/blender/gpu/intern/gpu_vertex_format.cc +++ b/source/blender/gpu/intern/gpu_vertex_format.cc @@ -361,8 +361,12 @@ void VertexFormat_texture_buffer_pack(GPUVertFormat *format) * minimum per-vertex stride, which mandates 4-byte alignment in Metal. * This additional alignment padding caused smaller data types, e.g. U16, * to mis-align. */ - BLI_assert_msg(format->attr_len == 1, - "Texture buffer mode should only use a single vertex attribute."); + for (int i = 0; i < format->attr_len; i++) { + /* The buffer texture setup uses the first attribute for type and size. + * Make sure all attributes use the same size. */ + BLI_assert_msg(format->attrs[i].size == format->attrs[0].size, + "Texture buffer mode should only use a attributes with the same size."); + } /* Pack vertex format without minimum stride, as this is not required by texture buffers. */ VertexFormat_pack_impl(format, 1); |