diff options
author | Eric Anholt <[email protected]> | 2019-02-05 10:22:30 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2019-02-05 12:12:33 -0800 |
commit | aaef12702f3b3a9e0464468948b1cbfaf4a66cd2 (patch) | |
tree | 9c4762e7e55b4108a7d4b25764952df89329f15a /src/compiler | |
parent | 8943eb8f03fe67710ce65fc0a54024751ff2b5bd (diff) |
nir: Move V3D's "the shader was TGSI, ignore FS output types" flag to NIR.
Ken's rework of mesa/st builtins to NIR means that we'll have more NIR
shaders with color output types that are mismatched with the render target
types. Since this is behavior that GLSL doesn't require, add it as a
shader_info option so the driver can know that it needs to ignore the FS
output's base type in favor of the actual render target's. This prevents
needing additional variants in several mesa/st paths (clear, pbo upload,
pbo download), given that the driver already has to handle the variants
for any TGSI being passed to it (from u_blitter, for example).
Reviewed-by: Rob Clark <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/shader_info.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h index c3dbe764961..3d871938751 100644 --- a/src/compiler/shader_info.h +++ b/src/compiler/shader_info.h @@ -199,6 +199,25 @@ typedef struct shader_info { bool sample_interlock_ordered; bool sample_interlock_unordered; + /** + * Flags whether NIR's base types on the FS color outputs should be + * ignored. + * + * GLSL requires that fragment shader output base types match the + * render target's base types for the behavior to be defined. From + * the GL 4.6 spec: + * + * "If the values written by the fragment shader do not match the + * format(s) of the corresponding color buffer(s), the result is + * undefined." + * + * However, for NIR shaders translated from TGSI, we don't have the + * output types any more, so the driver will need to do whatever + * fixups are necessary to handle effectively untyped data being + * output from the FS. + */ + bool untyped_color_outputs; + /** gl_FragDepth layout for ARB_conservative_depth. */ enum gl_frag_depth_layout depth_layout; } fs; |