Merge pull request #332 from KhronosGroup/pr-325-fixup

Fixups for PR #325
This commit is contained in:
Hans-Kristian Arntzen 2017-11-20 22:02:08 +01:00 committed by GitHub
commit 2a8b964847
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 3 deletions

View File

@ -6,7 +6,7 @@ struct CBO_1
float4 d;
};
ConstantBuffer<CBO_1> cbo[2][4] : register(b4);
ConstantBuffer<CBO_1> cbo[2][4] : register(b4, space0);
cbuffer push
{
float4 PushMe_a : packoffset(c0);

View File

@ -2052,7 +2052,12 @@ string CompilerHLSL::to_resource_binding(const SPIRVariable &var)
if (!space)
return "";
return join(" : register(", space, get_decoration(var.self, DecorationBinding), ")");
// shader model 5.1 supports space
if (options.shader_model >= 51)
return join(" : register(", space, get_decoration(var.self, DecorationBinding), ", space",
get_decoration(var.self, DecorationDescriptorSet), ")");
else
return join(" : register(", space, get_decoration(var.self, DecorationBinding), ")");
}
string CompilerHLSL::to_resource_binding_sampler(const SPIRVariable &var)
@ -2060,7 +2065,12 @@ string CompilerHLSL::to_resource_binding_sampler(const SPIRVariable &var)
// For combined image samplers.
if (!has_decoration(var.self, DecorationBinding))
return "";
return join(" : register(s", get_decoration(var.self, DecorationBinding), ")");
if (options.shader_model >= 51)
return join(" : register(s", get_decoration(var.self, DecorationBinding), ", space",
get_decoration(var.self, DecorationDescriptorSet), ")");
else
return join(" : register(s", get_decoration(var.self, DecorationBinding), ")");
}
void CompilerHLSL::emit_modern_uniform(const SPIRVariable &var)