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.hh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/draw/intern/draw_command.hh') diff --git a/source/blender/draw/intern/draw_command.hh b/source/blender/draw/intern/draw_command.hh index ea92b54d2ec..bbbc63e4c9c 100644 --- a/source/blender/draw/intern/draw_command.hh +++ b/source/blender/draw/intern/draw_command.hh @@ -134,6 +134,7 @@ struct ResourceBind { enum class Type : uint8_t { Sampler = 0, + BufferSampler, Image, UniformBuf, StorageBuf, @@ -149,6 +150,8 @@ struct ResourceBind { /** NOTE: Texture is used for both Sampler and Image binds. */ GPUTexture *texture; GPUTexture **texture_ref; + GPUVertBuf *vertex_buf; + GPUVertBuf **vertex_buf_ref; }; ResourceBind() = default; @@ -169,6 +172,10 @@ struct ResourceBind { : sampler(state), slot(slot_), is_reference(false), type(Type::Sampler), texture(res){}; ResourceBind(int slot_, GPUTexture **res, eGPUSamplerState state) : sampler(state), slot(slot_), is_reference(true), type(Type::Sampler), texture_ref(res){}; + ResourceBind(int slot_, GPUVertBuf *res) + : slot(slot_), is_reference(false), type(Type::BufferSampler), vertex_buf(res){}; + ResourceBind(int slot_, GPUVertBuf **res) + : slot(slot_), is_reference(true), type(Type::BufferSampler), vertex_buf_ref(res){}; void execute() const; std::string serialize() const; -- cgit v1.2.3