From 8908fae243cb4c15a675006a1cc472f6c59b0d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 30 Sep 2014 15:48:22 +0200 Subject: tgsi: simplify shader properties in tgsi_shader_info Use an array of properties indexed by TGSI_PROPERTY_* definitions. --- src/gallium/auxiliary/util/u_pstipple.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/gallium/auxiliary/util/u_pstipple.c') diff --git a/src/gallium/auxiliary/util/u_pstipple.c b/src/gallium/auxiliary/util/u_pstipple.c index 4f2e702..ce1fe5d 100644 --- a/src/gallium/auxiliary/util/u_pstipple.c +++ b/src/gallium/auxiliary/util/u_pstipple.c @@ -407,7 +407,6 @@ util_pstipple_create_fragment_shader(struct pipe_context *pipe, struct pipe_shader_state *new_fs; struct pstip_transform_context transform; const uint newLen = tgsi_num_tokens(fs->tokens) + NUM_NEW_TOKENS; - unsigned i; new_fs = MALLOC(sizeof(*new_fs)); if (!new_fs) @@ -433,11 +432,8 @@ util_pstipple_create_fragment_shader(struct pipe_context *pipe, tgsi_scan_shader(fs->tokens, &transform.info); - /* find fragment coordinate origin property */ - for (i = 0; i < transform.info.num_properties; i++) { - if (transform.info.properties[i].name == TGSI_PROPERTY_FS_COORD_ORIGIN) - transform.coordOrigin = transform.info.properties[i].data[0]; - } + transform.coordOrigin = + transform.info.properties[TGSI_PROPERTY_FS_COORD_ORIGIN][0]; tgsi_transform_shader(fs->tokens, (struct tgsi_token *) new_fs->tokens, -- cgit v1.1