diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-11-13 18:47:43 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-11-13 18:47:43 +0300 |
commit | c255be2d02393d538be1ef0dbf2cc1f7279e57ed (patch) | |
tree | 9c87e2a409fa72d4b30e29f485dbed15a77fc5ae /source/blender/draw/intern/draw_command.hh | |
parent | cd64615425248eaf8dc80653626fe5f2dbb084a2 (diff) |
DRW: Manager: Add `bind_texture` command for vertex buffer
This allows the same behavior as with `DRW_shgroup_buffer_texture`.
Diffstat (limited to 'source/blender/draw/intern/draw_command.hh')
-rw-r--r-- | source/blender/draw/intern/draw_command.hh | 7 |
1 files changed, 7 insertions, 0 deletions
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; |