diff options
author | Timothy Arceri <[email protected]> | 2018-08-29 15:48:46 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2018-08-30 09:54:40 +1000 |
commit | 9ce7d79cdc503ffddfa11609ffb91e297953c2ce (patch) | |
tree | a3d9edf11eb3da979600a2120c0a467d605306bc /src/mesa/main | |
parent | 28a3731e3f4688f98a909cddee261eceb47e3523 (diff) |
glsl: add a mechanism to allow layout qualifiers on function params
The spec is quite clear this is not allowed:
From Section 4.4. (Layout Qualifiers) of the GLSL 4.60 spec:
"Layout qualifiers can appear in several forms of declaration.
They can appear as part of an interface block definition or
block member, as shown in the grammar in the previous section.
They can also appear with just an interface-qualifier to establish
layouts of other declarations made with that qualifier:
layout-qualifier interface-qualifier ;
Or, they can appear with an individual variable declared with
an interface qualifier:
layout-qualifier interface-qualifier declaration ;"
From Section 4.10 (Memory Qualifiers) of the GLSL 4.60 spec:
"Layout qualifiers cannot be used on formal function parameters,
and layout qualification is not included in parameter matching."
However on the Nvidia binary driver they actually fail to compile
if image function params don't have a layout qualifier. This results
in applications such as No Mans Sky using layout qualifiers on params.
I've submitted a CTS test to expose this problem in the Nvidia driver
but until that is resolved this patch will help Mesa drivers work
around the issue.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/mtypes.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 718293be116..5ff0d3227a8 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3769,6 +3769,11 @@ struct gl_constants GLboolean AllowHigherCompatVersion; /** + * Allow layout qualifiers on function parameters. + */ + GLboolean AllowLayoutQualifiersOnFunctionParameters; + + /** * Force computing the absolute value for sqrt() and inversesqrt() to follow * D3D9 when apps rely on this behaviour. */ |