freedreno/a4xx: lower srgb in shader for astc textures
authorRob Clark <robclark@freedesktop.org>
Tue, 19 Apr 2016 13:02:23 +0000 (09:02 -0400)
committerRob Clark <robclark@freedesktop.org>
Tue, 19 Apr 2016 21:14:04 +0000 (17:14 -0400)
commit899bd63acefd49a668e11c42d2ad92fa55aa157d
tree1afc85ddd51bf31412455d7c43fc78d35a91dd25
parenteddfc977096c63dc9699b63b05ad0e1212680fb1
freedreno/a4xx: lower srgb in shader for astc textures

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
by doing the srgb->linear conversion in the shader instead.

This fixes 392 dEQP tests: dEQP-GLES3.functional.texture.*astc*srgb*

(The remaining fails seem to be a bug w/ ASTC + linear filtering, also
possibly a420.0 specific.)

Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/a4xx/fd4_context.h
src/gallium/drivers/freedreno/a4xx/fd4_draw.c
src/gallium/drivers/freedreno/a4xx/fd4_texture.c
src/gallium/drivers/freedreno/a4xx/fd4_texture.h
src/gallium/drivers/freedreno/ir3/ir3_nir.c
src/gallium/drivers/freedreno/ir3/ir3_shader.c
src/gallium/drivers/freedreno/ir3/ir3_shader.h