[*] Fix SM3.0 combined sampler register offsets

This commit is contained in:
Reece Wilson 2024-08-18 17:55:28 +01:00
parent 351791143c
commit bda1a93aa3

View File

@ -4198,9 +4198,22 @@ void CompilerHLSL::emit_legacy_uniform(const SPIRVariable &var)
SPIRV_CROSS_THROW("Separate image and samplers not supported in legacy HLSL."); SPIRV_CROSS_THROW("Separate image and samplers not supported in legacy HLSL.");
default: default:
statement(variable_decl(var), ";"); {
uint32_t desc_set = 0;
uint32_t binding = 0;
char space = 's';
HLSLBindingFlagBits resource_flags = HLSL_BINDING_AUTO_SRV_BIT;
if (has_decoration(var.self, DecorationBinding))
binding = get_decoration(var.self, DecorationBinding);
if (has_decoration(var.self, DecorationDescriptorSet))
desc_set = get_decoration(var.self, DecorationDescriptorSet);
auto that = to_resource_register(resource_flags, space, binding, desc_set);
statement(variable_decl(var), that, ";");
break; break;
} }
}
} }
void CompilerHLSL::emit_uniform(const SPIRVariable &var) void CompilerHLSL::emit_uniform(const SPIRVariable &var)