From 8c93f8c6cc9c7300a150118d8a29f98b1ba7bbdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Tue, 8 Feb 2022 23:19:31 +0100 Subject: DRW: Add support for GPUStorageBuf --- source/blender/draw/intern/draw_manager_exec.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/draw/intern/draw_manager_exec.c') diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index 07e47a0c691..319f63eebad 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -319,6 +319,7 @@ void DRW_state_reset(void) GPU_texture_unbind_all(); GPU_uniformbuf_unbind_all(); + GPU_storagebuf_unbind_all(); /* Should stay constant during the whole rendering. */ GPU_point_size(5); @@ -621,6 +622,12 @@ static void draw_update_uniforms(DRWShadingGroup *shgroup, case DRW_UNIFORM_BLOCK_REF: GPU_uniformbuf_bind(*uni->block_ref, uni->location); break; + case DRW_UNIFORM_STORAGE_BLOCK: + GPU_storagebuf_bind(uni->ssbo, uni->location); + break; + case DRW_UNIFORM_STORAGE_BLOCK_REF: + GPU_storagebuf_bind(*uni->ssbo_ref, uni->location); + break; case DRW_UNIFORM_BLOCK_OBMATS: state->obmats_loc = uni->location; GPU_uniformbuf_bind(DST.vmempool->matrices_ubo[0], uni->location); @@ -915,6 +922,7 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state) if (G.debug & G_DEBUG_GPU) { GPU_texture_unbind_all(); GPU_uniformbuf_unbind_all(); + GPU_storagebuf_unbind_all(); } } GPU_shader_bind(shgroup->shader); -- cgit v1.2.3