mirror of
https://github.com/KhronosGroup/glslang
synced 2024-09-19 12:19:53 +00:00
Allow compute derivative modes when the workgroup dimensions are spec constants
This commit is contained in:
parent
f7f0f3067c
commit
708d560c23
@ -1,6 +1,31 @@
|
|||||||
spv.computeShaderDerivativesSpec.comp
|
spv.computeShaderDerivativesSpec.comp
|
||||||
ERROR: 0:5: 'derivative_group_quadsNV' : requires local_size_x and local_size_y to be multiple of two
|
// Module Version 10000
|
||||||
ERROR: 1 compilation errors. No code generated.
|
// Generated by (magic number): 8000b
|
||||||
|
// Id's are bound by 12
|
||||||
|
|
||||||
|
Capability Shader
|
||||||
SPIR-V is not generated for failed compile or link
|
Capability ComputeDerivativeGroupQuadsNV
|
||||||
|
Extension "SPV_NV_compute_shader_derivatives"
|
||||||
|
1: ExtInstImport "GLSL.std.450"
|
||||||
|
MemoryModel Logical GLSL450
|
||||||
|
EntryPoint GLCompute 4 "main"
|
||||||
|
ExecutionMode 4 LocalSize 1 1 1
|
||||||
|
ExecutionMode 4 DerivativeGroupQuadsNV
|
||||||
|
Source GLSL 450
|
||||||
|
SourceExtension "GL_NV_compute_shader_derivatives"
|
||||||
|
Name 4 "main"
|
||||||
|
Decorate 7 SpecId 0
|
||||||
|
Decorate 8 SpecId 1
|
||||||
|
Decorate 11 BuiltIn WorkgroupSize
|
||||||
|
2: TypeVoid
|
||||||
|
3: TypeFunction 2
|
||||||
|
6: TypeInt 32 0
|
||||||
|
7: 6(int) SpecConstant 1
|
||||||
|
8: 6(int) SpecConstant 1
|
||||||
|
9: 6(int) Constant 1
|
||||||
|
10: TypeVector 6(int) 3
|
||||||
|
11: 10(ivec3) SpecConstantComposite 7 8 9
|
||||||
|
4(main): 2 Function None 3
|
||||||
|
5: Label
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
||||||
|
@ -1,6 +1,31 @@
|
|||||||
spv.computeShaderDerivativesSpec2.comp
|
spv.computeShaderDerivativesSpec2.comp
|
||||||
ERROR: 0:5: 'derivative_group_linearNV' : requires total group size to be multiple of four
|
// Module Version 10000
|
||||||
ERROR: 1 compilation errors. No code generated.
|
// Generated by (magic number): 8000b
|
||||||
|
// Id's are bound by 12
|
||||||
|
|
||||||
|
Capability Shader
|
||||||
SPIR-V is not generated for failed compile or link
|
Capability ComputeDerivativeGroupLinearNV
|
||||||
|
Extension "SPV_NV_compute_shader_derivatives"
|
||||||
|
1: ExtInstImport "GLSL.std.450"
|
||||||
|
MemoryModel Logical GLSL450
|
||||||
|
EntryPoint GLCompute 4 "main"
|
||||||
|
ExecutionMode 4 LocalSize 1 1 1
|
||||||
|
ExecutionMode 4 DerivativeGroupLinearNV
|
||||||
|
Source ESSL 320
|
||||||
|
SourceExtension "GL_NV_compute_shader_derivatives"
|
||||||
|
Name 4 "main"
|
||||||
|
Decorate 7 SpecId 0
|
||||||
|
Decorate 8 SpecId 1
|
||||||
|
Decorate 11 BuiltIn WorkgroupSize
|
||||||
|
2: TypeVoid
|
||||||
|
3: TypeFunction 2
|
||||||
|
6: TypeInt 32 0
|
||||||
|
7: 6(int) SpecConstant 1
|
||||||
|
8: 6(int) SpecConstant 1
|
||||||
|
9: 6(int) Constant 1
|
||||||
|
10: TypeVector 6(int) 3
|
||||||
|
11: 10(ivec3) SpecConstantComposite 7 8 9
|
||||||
|
4(main): 2 Function None 3
|
||||||
|
5: Label
|
||||||
|
Return
|
||||||
|
FunctionEnd
|
||||||
|
@ -9924,8 +9924,8 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
|
|||||||
|
|
||||||
if (publicType.shaderQualifiers.layoutDerivativeGroupQuads) {
|
if (publicType.shaderQualifiers.layoutDerivativeGroupQuads) {
|
||||||
if (publicType.qualifier.storage == EvqVaryingIn) {
|
if (publicType.qualifier.storage == EvqVaryingIn) {
|
||||||
if ((intermediate.getLocalSize(0) & 1) ||
|
if ((intermediate.getLocalSizeSpecId(0) == TQualifier::layoutNotSet && (intermediate.getLocalSize(0) & 1)) ||
|
||||||
(intermediate.getLocalSize(1) & 1))
|
(intermediate.getLocalSizeSpecId(1) == TQualifier::layoutNotSet && (intermediate.getLocalSize(1) & 1)))
|
||||||
error(loc, "requires local_size_x and local_size_y to be multiple of two", "derivative_group_quadsNV", "");
|
error(loc, "requires local_size_x and local_size_y to be multiple of two", "derivative_group_quadsNV", "");
|
||||||
else
|
else
|
||||||
intermediate.setLayoutDerivativeMode(LayoutDerivativeGroupQuads);
|
intermediate.setLayoutDerivativeMode(LayoutDerivativeGroupQuads);
|
||||||
@ -9935,7 +9935,10 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
|
|||||||
}
|
}
|
||||||
if (publicType.shaderQualifiers.layoutDerivativeGroupLinear) {
|
if (publicType.shaderQualifiers.layoutDerivativeGroupLinear) {
|
||||||
if (publicType.qualifier.storage == EvqVaryingIn) {
|
if (publicType.qualifier.storage == EvqVaryingIn) {
|
||||||
if((intermediate.getLocalSize(0) *
|
if (intermediate.getLocalSizeSpecId(0) == TQualifier::layoutNotSet &&
|
||||||
|
intermediate.getLocalSizeSpecId(1) == TQualifier::layoutNotSet &&
|
||||||
|
intermediate.getLocalSizeSpecId(2) == TQualifier::layoutNotSet &&
|
||||||
|
(intermediate.getLocalSize(0) *
|
||||||
intermediate.getLocalSize(1) *
|
intermediate.getLocalSize(1) *
|
||||||
intermediate.getLocalSize(2)) % 4 != 0)
|
intermediate.getLocalSize(2)) % 4 != 0)
|
||||||
error(loc, "requires total group size to be multiple of four", "derivative_group_linearNV", "");
|
error(loc, "requires total group size to be multiple of four", "derivative_group_linearNV", "");
|
||||||
|
Loading…
Reference in New Issue
Block a user