1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-01 16:38:31 +00:00

Fix SHADER_UNIFORM_NAMES

This commit is contained in:
Alexander Hartmann
2025-11-26 15:36:21 +01:00
parent 9dd6c4dbac
commit d97496a99e
2 changed files with 14 additions and 1 deletions

View File

@@ -3403,8 +3403,20 @@ RID RenderingDevice::index_array_create(RID p_index_buffer, uint32_t p_index_off
/**** SHADER ****/ /**** SHADER ****/
/****************/ /****************/
// Keep the values in sync with the `UniformType` enum (file rendering_device_commons.h).
static const char *SHADER_UNIFORM_NAMES[RenderingDevice::UNIFORM_TYPE_MAX] = { static const char *SHADER_UNIFORM_NAMES[RenderingDevice::UNIFORM_TYPE_MAX] = {
"Sampler", "CombinedSampler", "Texture", "Image", "TextureBuffer", "SamplerTextureBuffer", "ImageBuffer", "UniformBuffer", "UniformBufferDynamic", "StorageBuffer", "StorageBufferDynamic", "InputAttachment" "Sampler",
"CombinedSampler", // UNIFORM_TYPE_SAMPLER_WITH_TEXTURE
"Texture",
"Image",
"TextureBuffer",
"SamplerTextureBuffer",
"ImageBuffer",
"UniformBuffer",
"StorageBuffer",
"InputAttachment",
"UniformBufferDynamic",
"StorageBufferDynamic",
}; };
String RenderingDevice::_shader_uniform_debug(RID p_shader, int p_set) { String RenderingDevice::_shader_uniform_debug(RID p_shader, int p_set) {

View File

@@ -630,6 +630,7 @@ public:
static const uint32_t MAX_UNIFORM_SETS = 16; static const uint32_t MAX_UNIFORM_SETS = 16;
// Keep the enum values in sync with the `SHADER_UNIFORM_NAMES` values (file rendering_device.cpp).
enum UniformType { enum UniformType {
UNIFORM_TYPE_SAMPLER, // For sampling only (sampler GLSL type). UNIFORM_TYPE_SAMPLER, // For sampling only (sampler GLSL type).
UNIFORM_TYPE_SAMPLER_WITH_TEXTURE, // For sampling only, but includes a texture, (samplerXX GLSL type), first a sampler then a texture. UNIFORM_TYPE_SAMPLER_WITH_TEXTURE, // For sampling only, but includes a texture, (samplerXX GLSL type), first a sampler then a texture.