Add UAV (image) binding offset and HLSL register support

This PR adds:

1. The "u" register class for RW* objects.

2. --shift-image-bindings (== --sib), analogous to --shift-texture-bindings etc.

3. Case insensitive reg classes.

4. Tests for above.
This commit is contained in:
steve-lunarg
2016-11-01 10:31:42 -06:00
parent e5e58cfee3
commit 9088be4c07
13 changed files with 309 additions and 10 deletions

View File

@@ -46,6 +46,7 @@ struct IoMapData {
const char* entryPoint;
int baseSamplerBinding;
int baseTextureBinding;
int baseImageBinding;
int baseUboBinding;
bool autoMapBindings;
bool flattenUniforms;
@@ -123,6 +124,7 @@ TEST_P(HlslIoMap, FromFile)
Target::Spv, GetParam().entryPoint,
GetParam().baseSamplerBinding,
GetParam().baseTextureBinding,
GetParam().baseImageBinding,
GetParam().baseUboBinding,
GetParam().autoMapBindings,
GetParam().flattenUniforms);
@@ -136,6 +138,7 @@ TEST_P(GlslIoMap, FromFile)
Target::Spv, GetParam().entryPoint,
GetParam().baseSamplerBinding,
GetParam().baseTextureBinding,
GetParam().baseImageBinding,
GetParam().baseUboBinding,
GetParam().autoMapBindings,
GetParam().flattenUniforms);
@@ -283,10 +286,11 @@ INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_CASE_P(
Hlsl, HlslIoMap,
::testing::ValuesIn(std::vector<IoMapData>{
{ "spv.register.autoassign.frag", "main_ep", 5, 10, 20, true, false },
{ "spv.register.noautoassign.frag", "main_ep", 5, 10, 15, false, false },
{ "spv.register.autoassign-2.frag", "main", 5, 10, 15, true, true },
{ "spv.buffer.autoassign.frag", "main", 5, 10, 15, true, true },
{ "spv.register.autoassign.frag", "main_ep", 5, 10, 0, 20, true, false },
{ "spv.register.noautoassign.frag", "main_ep", 5, 10, 0, 15, false, false },
{ "spv.register.autoassign-2.frag", "main", 5, 10, 0, 15, true, true },
{ "spv.buffer.autoassign.frag", "main", 5, 10, 0, 15, true, true },
{ "spv.rw.autoassign.frag", "main", 5, 10, 20, 15, true, true },
{ "spv.register.autoassign.rangetest.frag", "main",
glslang::TQualifier::layoutBindingEnd-2,
glslang::TQualifier::layoutBindingEnd+5,
@@ -299,8 +303,8 @@ INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_CASE_P(
Hlsl, GlslIoMap,
::testing::ValuesIn(std::vector<IoMapData>{
{ "spv.glsl.register.autoassign.frag", "main", 5, 10, 20, true, false },
{ "spv.glsl.register.noautoassign.frag", "main", 5, 10, 15, false, false },
{ "spv.glsl.register.autoassign.frag", "main", 5, 10, 0, 20, true, false },
{ "spv.glsl.register.noautoassign.frag", "main", 5, 10, 0, 15, false, false },
}),
FileNameAsCustomTestSuffixIoMap
);