summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-09-30 15:48:22 +0200
committerMarek Olšák <[email protected]>2014-10-04 15:16:14 +0200
commit8908fae243cb4c15a675006a1cc472f6c59b0d43 (patch)
tree144042cc0d57a340427827836ae245a89fa0249c /src/gallium/drivers/nouveau
parent5233568861b082ee288d845f447012fa47e8bd1e (diff)
tgsi: simplify shader properties in tgsi_shader_info
Use an array of properties indexed by TGSI_PROPERTY_* definitions.
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r--src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
index 1f1fba202df..774b14b0a47 100644
--- a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
+++ b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c
@@ -1138,24 +1138,12 @@ _nvfx_fragprog_translate(uint16_t oclass, struct nv30_fragprog *fp)
fpc->num_regs = 2;
memset(fp->texcoord, 0xff, sizeof(fp->texcoord));
- for (unsigned i = 0; i < fp->info.num_properties; ++i) {
- switch (fp->info.properties[i].name) {
- case TGSI_PROPERTY_FS_COORD_ORIGIN:
- if (fp->info.properties[i].data[0])
- fp->coord_conventions |= NV30_3D_COORD_CONVENTIONS_ORIGIN_INVERTED;
- break;
- case TGSI_PROPERTY_FS_COORD_PIXEL_CENTER:
- if (fp->info.properties[i].data[0])
- fp->coord_conventions |= NV30_3D_COORD_CONVENTIONS_CENTER_INTEGER;
- break;
- case TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS:
- if (fp->info.properties[i].data[0])
- fp->rt_enable |= NV30_3D_RT_ENABLE_MRT;
- break;
- default:
- break;
- }
- }
+ if (fp->info.properties[TGSI_PROPERTY_FS_COORD_ORIGIN][0])
+ fp->coord_conventions |= NV30_3D_COORD_CONVENTIONS_ORIGIN_INVERTED;
+ if (fp->info.properties[TGSI_PROPERTY_FS_COORD_PIXEL_CENTER][0])
+ fp->coord_conventions |= NV30_3D_COORD_CONVENTIONS_CENTER_INTEGER;
+ if (fp->info.properties[TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS][0])
+ fp->rt_enable |= NV30_3D_RT_ENABLE_MRT;
if (!nvfx_fragprog_prepare(fpc))
goto out_err;