From 08d008a5085bf57ba43c7aa76d51ea60b732a11a Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 18 Jan 2022 13:13:23 +0100 Subject: GPU: Create Info for GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR. This patch converts GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR shader to use the GPUShaderCreateInfo pattern. It can be used as a reference when converting other shaders. In this special case the flat uniform vector cannot be used anymore as it doesn't fit as push constants. To solve this a uniform buffer is used. --- source/blender/gpu/GPU_shader_shared.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/gpu/GPU_shader_shared.h') diff --git a/source/blender/gpu/GPU_shader_shared.h b/source/blender/gpu/GPU_shader_shared.h index 4d277921773..f400e151487 100644 --- a/source/blender/gpu/GPU_shader_shared.h +++ b/source/blender/gpu/GPU_shader_shared.h @@ -80,3 +80,10 @@ struct SimpleLightingData { float _pad; }; BLI_STATIC_ASSERT_ALIGN(struct SimpleLightingData, 16) + +#define MAX_CALLS 16 + +struct MultiRectCallData { + float4 calls_data[MAX_CALLS * 3]; +}; +BLI_STATIC_ASSERT_ALIGN(struct MultiRectCallData, 16) -- cgit v1.2.3