mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
glsl: Allow invariant flags on sysvals, such as gl_PointCoord.
When you set PIPE_CAP_FS_POINT_IS_SYSVAL, we'd fall out of is_allowed_invariant(), despite it being allowed on special builtins. Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22950>
This commit is contained in:
parent
c58518226b
commit
0e943bc3f2
2 changed files with 36 additions and 2 deletions
|
|
@ -2774,6 +2774,42 @@ is_allowed_invariant(ir_variable *var, struct _mesa_glsl_parse_state *state)
|
|||
if (is_varying_var(var, state->stage))
|
||||
return true;
|
||||
|
||||
/* ES2 says:
|
||||
*
|
||||
* "For the built-in special variables, gl_FragCoord can only be declared
|
||||
* invariant if and only if gl_Position is declared invariant. Similarly
|
||||
* gl_PointCoord can only be declared invariant if and only if gl_PointSize
|
||||
* is declared invariant. It is an error to declare gl_FrontFacing as
|
||||
* invariant. The invariance of gl_FrontFacing is the same as the invariance
|
||||
* of gl_Position."
|
||||
*
|
||||
* ES3.1 says about invariance:
|
||||
*
|
||||
* "How does this rule apply to the built-in special variables?
|
||||
*
|
||||
* Option 1: It should be the same as for varyings. But gl_Position is used
|
||||
* internally by the rasterizer as well as for gl_FragCoord so there may be
|
||||
* cases where rasterization is required to be invariant but gl_FragCoord is
|
||||
* not.
|
||||
*
|
||||
* RESOLUTION: Option 1."
|
||||
*
|
||||
* and the ES3 spec has similar text but the "RESOLUTION" is missing.
|
||||
*
|
||||
* Any system values should be from built-in special variables.
|
||||
*/
|
||||
if (var->data.mode == ir_var_system_value) {
|
||||
if (state->is_version(0, 300)) {
|
||||
return true;
|
||||
} else {
|
||||
/* Note: We don't actually have a check that the VS's PointSize is
|
||||
* invariant, even when it's treated as a varying.
|
||||
*/
|
||||
if (var->data.location == SYSTEM_VALUE_POINT_COORD)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/* From Section 4.6.1 ("The Invariant Qualifier") GLSL 1.20 spec:
|
||||
* "Only variables output from a vertex shader can be candidates
|
||||
* for invariance".
|
||||
|
|
|
|||
|
|
@ -542,8 +542,6 @@ spec@glsl-1.20@execution@variable-indexing@vs-varying-mat4-col-row-wr,Fail
|
|||
spec@glsl-1.20@execution@variable-indexing@vs-varying-mat4-col-wr,Fail
|
||||
spec@glsl-1.20@execution@variable-indexing@vs-varying-mat4-row-wr,Fail
|
||||
spec@glsl-1.20@execution@variable-indexing@vs-varying-mat4-wr,Fail
|
||||
spec@glsl-es-1.00@linker@glsl-pcoord-invariant,Fail
|
||||
spec@glsl-es-1.00@linker@glsl-pcoord-invariant-pass,Fail
|
||||
spec@intel_performance_query@intel_performance_query-issue_2235,Fail
|
||||
spec@khr_texture_compression_astc@basic-gles,Fail
|
||||
spec@khr_texture_compression_astc@miptree-gles srgb,Fail
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue