From c255be2d02393d538be1ef0dbf2cc1f7279e57ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sun, 13 Nov 2022 16:47:43 +0100 Subject: DRW: Manager: Add `bind_texture` command for vertex buffer This allows the same behavior as with `DRW_shgroup_buffer_texture`. --- source/blender/draw/intern/draw_command.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source/blender/draw/intern/draw_command.cc') diff --git a/source/blender/draw/intern/draw_command.cc b/source/blender/draw/intern/draw_command.cc index 3ef33f13c4a..7a053933cc1 100644 --- a/source/blender/draw/intern/draw_command.cc +++ b/source/blender/draw/intern/draw_command.cc @@ -44,6 +44,9 @@ void ResourceBind::execute() const case ResourceBind::Type::Sampler: GPU_texture_bind_ex(is_reference ? *texture_ref : texture, sampler, slot, false); break; + case ResourceBind::Type::BufferSampler: + GPU_vertbuf_bind_as_texture(is_reference ? *vertex_buf_ref : vertex_buf, slot); + break; case ResourceBind::Type::Image: GPU_texture_image_bind(is_reference ? *texture_ref : texture, slot); break; @@ -251,6 +254,9 @@ std::string ResourceBind::serialize() const return std::string(".bind_texture") + (is_reference ? "_ref" : "") + "(" + std::to_string(slot) + (sampler != GPU_SAMPLER_MAX ? ", sampler=" + std::to_string(sampler) : "") + ")"; + case Type::BufferSampler: + return std::string(".bind_vertbuf_as_texture") + (is_reference ? "_ref" : "") + "(" + + std::to_string(slot) + ")"; case Type::Image: return std::string(".bind_image") + (is_reference ? "_ref" : "") + "(" + std::to_string(slot) + ")"; -- cgit v1.2.3