mirror of
https://github.com/RPCS3/glslang.git
synced 2024-11-23 11:19:40 +00:00
Spirv_intrinsics: Remove early return in layoutTypeCheck
Previously, when GL_EXT_spirv_intrinsics are enabled, we disable all checks in layoutTypeCheck. This is too coarse because we can use nothing in GL_EXT_spirv_intrinsics in a shader while the necessary processing is skipped, such as addUsedLocation. In this change, we apply fine check and more might be added if we encounter new cases in the future.
This commit is contained in:
parent
e69f74f010
commit
0da98c51c4
6
Test/baseResults/spv.intrinsicsFakeEnable.vert.out
Normal file
6
Test/baseResults/spv.intrinsicsFakeEnable.vert.out
Normal file
@ -0,0 +1,6 @@
|
||||
spv.intrinsicsFakeEnable.vert
|
||||
ERROR: 0:7: 'location' : overlapping use of location 0
|
||||
ERROR: 1 compilation errors. No code generated.
|
||||
|
||||
|
||||
SPIR-V is not generated for failed compile or link
|
10
Test/spv.intrinsicsFakeEnable.vert
Normal file
10
Test/spv.intrinsicsFakeEnable.vert
Normal file
@ -0,0 +1,10 @@
|
||||
#version 460 core
|
||||
#extension GL_EXT_spirv_intrinsics : enable
|
||||
|
||||
// ERROR: Overlapped input location. Make sure it could be detected even
|
||||
// if GL_EXT_spirv_intrinsics is enabled.
|
||||
layout(location = 0) in vec4 v4;
|
||||
layout(location = 0) in vec3 v3;
|
||||
|
||||
void main() {
|
||||
}
|
@ -6324,9 +6324,6 @@ void TParseContext::layoutMemberLocationArrayCheck(const TSourceLoc& loc, bool m
|
||||
// Do layout error checking with respect to a type.
|
||||
void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
|
||||
{
|
||||
if (extensionTurnedOn(E_GL_EXT_spirv_intrinsics))
|
||||
return; // Skip any check if GL_EXT_spirv_intrinsics is turned on
|
||||
|
||||
const TQualifier& qualifier = type.getQualifier();
|
||||
|
||||
// first, intra-layout qualifier-only error checking
|
||||
@ -6380,6 +6377,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
|
||||
case EvqCallableData:
|
||||
case EvqCallableDataIn:
|
||||
case EvqHitObjectAttrNV:
|
||||
case EvqSpirvStorageClass:
|
||||
break;
|
||||
case EvqTileImageEXT:
|
||||
break;
|
||||
@ -6436,7 +6434,7 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
|
||||
// an array of size N, all elements of the array from binding through binding + N - 1 must be within this
|
||||
// range."
|
||||
//
|
||||
if (! type.isOpaque() && type.getBasicType() != EbtBlock)
|
||||
if (!type.isOpaque() && type.getBasicType() != EbtBlock && type.getBasicType() != EbtSpirvType)
|
||||
error(loc, "requires block, or sampler/image, or atomic-counter type", "binding", "");
|
||||
if (type.getBasicType() == EbtSampler) {
|
||||
int lastBinding = qualifier.layoutBinding;
|
||||
|
@ -757,6 +757,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||
"vulkan.vert",
|
||||
"vulkan.comp",
|
||||
"samplerlessTextureFunctions.frag",
|
||||
"spv.intrinsicsFakeEnable.vert",
|
||||
"spv.specConstArrayCheck.vert",
|
||||
})),
|
||||
FileNameAsCustomTestSuffix
|
||||
|
Loading…
Reference in New Issue
Block a user