Skip to content

Commit

Permalink
Update minimum SPIR-V requirement
Browse files Browse the repository at this point in the history
Require SPIR-V 1.3 when using GL_EXT_buffer_reference.
Migrate tests to SPIR-V 1.3 fixture as necessary.
Fix extension table key.
Fix whitespace.
  • Loading branch information
jeremy-lunarg committed Mar 29, 2021
1 parent 2c7c84c commit 97dfbe2
Show file tree
Hide file tree
Showing 22 changed files with 47 additions and 64 deletions.
3 changes: 1 addition & 2 deletions Test/baseResults/spv.bufferhandle1.frag.out
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
spv.bufferhandle1.frag
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 52

Capability Shader
Capability VulkanMemoryModelKHR
Capability PhysicalStorageBufferAddressesEXT
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
Extension "SPV_KHR_vulkan_memory_model"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT VulkanKHR
Expand Down
3 changes: 1 addition & 2 deletions Test/baseResults/spv.bufferhandle10.frag.out
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
spv.bufferhandle10.frag
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 40

Capability Shader
Capability VulkanMemoryModelKHR
Capability PhysicalStorageBufferAddressesEXT
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
Extension "SPV_KHR_vulkan_memory_model"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT VulkanKHR
Expand Down
3 changes: 1 addition & 2 deletions Test/baseResults/spv.bufferhandle11.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ spv.bufferhandle11.frag
WARNING: 0:6: '' : all default precisions are highp; use precision statements to quiet warning, e.g.:
"precision mediump int; precision highp float;"

// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 61

Expand All @@ -11,7 +11,6 @@ WARNING: 0:6: '' : all default precisions are highp; use precision statements to
Capability PhysicalStorageBufferAddressesEXT
Extension "SPV_KHR_8bit_storage"
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
EntryPoint Fragment 4 "main"
Expand Down
4 changes: 1 addition & 3 deletions Test/baseResults/spv.bufferhandle12.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ spv.bufferhandle12.frag
WARNING: 0:6: '' : all default precisions are highp; use precision statements to quiet warning, e.g.:
"precision mediump int; precision highp float;"

// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 183

Capability Shader
Capability StorageUniformBufferBlock16
Capability PhysicalStorageBufferAddressesEXT
Extension "SPV_KHR_16bit_storage"
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
EntryPoint Fragment 4 "main"
Expand Down
3 changes: 1 addition & 2 deletions Test/baseResults/spv.bufferhandle13.frag.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
spv.bufferhandle13.frag
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 58

Capability Shader
Capability PhysicalStorageBufferAddressesEXT
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
EntryPoint Fragment 4 "main"
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/spv.bufferhandle14.frag.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
spv.bufferhandle14.frag
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 46

Expand Down
3 changes: 1 addition & 2 deletions Test/baseResults/spv.bufferhandle15.frag.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ spv.bufferhandle15.frag
WARNING: 0:16: '' : all default precisions are highp; use precision statements to quiet warning, e.g.:
"precision mediump int; precision highp float;"

// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 60

Capability Shader
Capability PhysicalStorageBufferAddressesEXT
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
EntryPoint Fragment 4 "main" 37
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/spv.bufferhandle16.frag.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
spv.bufferhandle16.frag
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 48

Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/spv.bufferhandle18.frag.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
spv.bufferhandle18.frag
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 196

Expand Down
3 changes: 1 addition & 2 deletions Test/baseResults/spv.bufferhandle2.frag.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
spv.bufferhandle2.frag
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 45

Capability Shader
Capability PhysicalStorageBufferAddressesEXT
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
EntryPoint Fragment 4 "main"
Expand Down
3 changes: 1 addition & 2 deletions Test/baseResults/spv.bufferhandle3.frag.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
spv.bufferhandle3.frag
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 50

Capability Shader
Capability PhysicalStorageBufferAddressesEXT
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
EntryPoint Fragment 4 "main" 42
Expand Down
3 changes: 1 addition & 2 deletions Test/baseResults/spv.bufferhandle4.frag.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
spv.bufferhandle4.frag
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 61

Capability Shader
Capability PhysicalStorageBufferAddressesEXT
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
EntryPoint Fragment 4 "main"
Expand Down
2 changes: 1 addition & 1 deletion Test/baseResults/spv.bufferhandle5.frag.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
spv.bufferhandle5.frag
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 22

Expand Down
3 changes: 1 addition & 2 deletions Test/baseResults/spv.bufferhandle6.frag.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
spv.bufferhandle6.frag
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 165

Capability Shader
Capability PhysicalStorageBufferAddressesEXT
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
EntryPoint Fragment 4 "main" 154
Expand Down
3 changes: 1 addition & 2 deletions Test/baseResults/spv.bufferhandle7.frag.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
spv.bufferhandle7.frag
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 24

Capability Shader
Capability PhysicalStorageBufferAddressesEXT
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
EntryPoint Fragment 4 "main"
Expand Down
3 changes: 1 addition & 2 deletions Test/baseResults/spv.bufferhandle8.frag.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
spv.bufferhandle8.frag
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 27

Capability Shader
Capability PhysicalStorageBufferAddressesEXT
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
EntryPoint Fragment 4 "main"
Expand Down
3 changes: 1 addition & 2 deletions Test/baseResults/spv.bufferhandle9.frag.out
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
spv.bufferhandle9.frag
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 56

Capability Shader
Capability Int64
Capability PhysicalStorageBufferAddressesEXT
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
EntryPoint Fragment 4 "main" 16 19
Expand Down
3 changes: 1 addition & 2 deletions Test/baseResults/spv.bufferhandleUvec2.frag.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
spv.bufferhandleUvec2.frag
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 71

Capability Shader
Capability PhysicalStorageBufferAddressesEXT
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
1: ExtInstImport "GLSL.std.450"
MemoryModel PhysicalStorageBuffer64EXT GLSL450
EntryPoint Fragment 4 "main" 16 19
Expand Down
4 changes: 1 addition & 3 deletions Test/baseResults/spv.coopmat.comp.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
spv.coopmat.comp
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 228

Expand All @@ -9,9 +9,7 @@ spv.coopmat.comp
Capability VulkanMemoryModelKHR
Capability PhysicalStorageBufferAddressesEXT
Capability CooperativeMatrixNV
Extension "SPV_KHR_16bit_storage"
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
Extension "SPV_KHR_vulkan_memory_model"
Extension "SPV_NV_cooperative_matrix"
1: ExtInstImport "GLSL.std.450"
Expand Down
3 changes: 1 addition & 2 deletions Test/baseResults/spv.intcoopmat.comp.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
spv.intcoopmat.comp
// Module Version 10000
// Module Version 10300
// Generated by (magic number): 8000a
// Id's are bound by 262

Expand All @@ -12,7 +12,6 @@ spv.intcoopmat.comp
Capability CooperativeMatrixNV
Extension "SPV_KHR_8bit_storage"
Extension "SPV_KHR_physical_storage_buffer"
Extension "SPV_KHR_storage_buffer_storage_class"
Extension "SPV_KHR_vulkan_memory_model"
Extension "SPV_NV_cooperative_matrix"
1: ExtInstImport "GLSL.std.450"
Expand Down
7 changes: 4 additions & 3 deletions glslang/MachineIndependent/Versions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,13 @@ void TParseVersions::initializeExtensionBehavior()
EShTargetLanguageVersion minSpvVersion;
} extensionData;

const extensionData exts[] = { {E_GL_EXT_ray_tracing, EShTargetSpv_1_4} };
const extensionData exts[] = { {E_GL_EXT_ray_tracing, EShTargetSpv_1_4},
{E_GL_EXT_buffer_reference, EShTargetSpv_1_3} };

for (size_t ii = 0; ii < sizeof(exts) / sizeof(exts[0]); ii++) {
// Add only extensions which require > spv1.0 to save space in map
if (exts[ii].minSpvVersion > EShTargetSpv_1_0) {
extensionMinSpv[E_GL_EXT_ray_tracing] = exts[ii].minSpvVersion;
extensionMinSpv[exts[ii].extensionName] = exts[ii].minSpvVersion;
}
}

Expand Down Expand Up @@ -875,7 +876,7 @@ void TParseVersions::updateExtensionBehavior(int line, const char* extension, co
checkExtensionStage(getCurrentLoc(), extension);

// check if extension has additional requirements
extensionRequires(getCurrentLoc(), extension ,behaviorString);
extensionRequires(getCurrentLoc(), extension, behaviorString);

// update the requested extension
updateExtensionBehavior(extension, behavior);
Expand Down
46 changes: 23 additions & 23 deletions gtests/Spv.FromFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,27 +289,6 @@ INSTANTIATE_TEST_SUITE_P(
"spv.bool.vert",
"spv.boolInBlock.frag",
"spv.branch-return.vert",
"spv.bufferhandle1.frag",
"spv.bufferhandle10.frag",
"spv.bufferhandle11.frag",
"spv.bufferhandle12.frag",
"spv.bufferhandle13.frag",
"spv.bufferhandle14.frag",
"spv.bufferhandle15.frag",
"spv.bufferhandle16.frag",
"spv.bufferhandle17_Errors.frag",
"spv.bufferhandle18.frag",
"spv.bufferhandle19_Errors.frag",
"spv.bufferhandle2.frag",
"spv.bufferhandle3.frag",
"spv.bufferhandle4.frag",
"spv.bufferhandle5.frag",
"spv.bufferhandle6.frag",
"spv.bufferhandle7.frag",
"spv.bufferhandle8.frag",
"spv.bufferhandle9.frag",
"spv.bufferhandleUvec2.frag",
"spv.bufferhandle_Error.frag",
"spv.builtInXFB.vert",
"spv.conditionalDemote.frag",
"spv.conditionalDiscard.frag",
Expand All @@ -318,7 +297,6 @@ INSTANTIATE_TEST_SUITE_P(
"spv.constConstruct.vert",
"spv.controlFlowAttributes.frag",
"spv.conversion.frag",
"spv.coopmat.comp",
"spv.coopmat_Error.comp",
"spv.dataOut.frag",
"spv.dataOutIndirect.frag",
Expand Down Expand Up @@ -353,7 +331,6 @@ INSTANTIATE_TEST_SUITE_P(
"spv.GeometryShaderPassthrough.geom",
"spv.interpOps.frag",
"spv.int64.frag",
"spv.intcoopmat.comp",
"spv.intOps.vert",
"spv.layer.tese",
"spv.layoutNested.vert",
Expand Down Expand Up @@ -493,6 +470,28 @@ INSTANTIATE_TEST_SUITE_P(
"spv.1.3.8bitstorage-ubo.vert",
"spv.1.3.8bitstorage-ssbo.vert",
"spv.1.3.coopmat.comp",
"spv.bufferhandle1.frag",
"spv.bufferhandle10.frag",
"spv.bufferhandle11.frag",
"spv.bufferhandle12.frag",
"spv.bufferhandle13.frag",
"spv.bufferhandle14.frag",
"spv.bufferhandle15.frag",
"spv.bufferhandle16.frag",
"spv.bufferhandle17_Errors.frag",
"spv.bufferhandle18.frag",
"spv.bufferhandle19_Errors.frag",
"spv.bufferhandle2.frag",
"spv.bufferhandle3.frag",
"spv.bufferhandle4.frag",
"spv.bufferhandle5.frag",
"spv.bufferhandle6.frag",
"spv.bufferhandle7.frag",
"spv.bufferhandle8.frag",
"spv.bufferhandle9.frag",
"spv.bufferhandleUvec2.frag",
"spv.bufferhandle_Error.frag",
"spv.coopmat.comp",
"spv.deviceGroup.frag",
"spv.drawParams.vert",
"spv.int8.frag",
Expand All @@ -501,6 +500,7 @@ INSTANTIATE_TEST_SUITE_P(
"spv.explicittypes.frag",
"spv.float32.frag",
"spv.float64.frag",
"spv.intcoopmat.comp",
"spv.memoryScopeSemantics.comp",
"spv.memoryScopeSemantics_Error.comp",
"spv.multiView.frag",
Expand Down

0 comments on commit 97dfbe2

Please sign in to comment.