diff options
author | Rob Clark <[email protected]> | 2016-04-19 09:02:23 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2016-04-24 13:40:57 -0400 |
commit | adf795432f788b33822d3a94b704be4ca536c8f1 (patch) | |
tree | ea8b334ab469492fa9666eabba7a75a19172aca8 /src/gallium/drivers/freedreno/ir3/ir3_shader.h | |
parent | a148300b13fbda239146c163549868cc903c0a70 (diff) |
freedreno/a4xx: better workaround for astc+srgb
This *seems* like a hw bug, and maybe only applies to certain a4xx
variants/revisions. But setting the SRGB bit in sampler view state
(texconst0) causes invalid alpha for ASTC textures. Work around this
setting up a second texture state and using that to sample alpha
separately.
This way, srgb->linear conversion happens in hw *prior* to
interpolation.
This fixes 546 dEQP tests: dEQP-GLES3.functional.texture.*astc*srgb*
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3/ir3_shader.h')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_shader.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_shader.h b/src/gallium/drivers/freedreno/ir3/ir3_shader.h index c89dc29ff08..e81e80d328f 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_shader.h +++ b/src/gallium/drivers/freedreno/ir3/ir3_shader.h @@ -104,6 +104,9 @@ struct ir3_shader_key { * shader: */ uint16_t fsaturate_s, fsaturate_t, fsaturate_r; + + /* bitmask of samplers which need astc srgb workaround: */ + uint16_t vastc_srgb, fastc_srgb; }; static inline bool @@ -222,6 +225,14 @@ struct ir3_shader_variant { uint32_t val[4]; } immediates[64]; + /* for astc srgb workaround, the number/base of additional + * alpha tex states we need, and index of original tex states + */ + struct { + unsigned base, count; + unsigned orig_idx[16]; + } astc_srgb; + /* shader variants form a linked list: */ struct ir3_shader_variant *next; |