From 3ff688ea299581e60caf5d6e1a464f68c717fe83 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 14 Dec 2009 16:34:07 -0500 Subject: tgsi: add properties and system value register adds support for properties to all parts of the tgsi framework, plus introduces a new register which will be used for system generated values. --- src/gallium/auxiliary/tgsi/tgsi_scan.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/gallium/auxiliary/tgsi/tgsi_scan.c') diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c index a5d2db04ec..5f5c95bfbd 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c @@ -97,7 +97,8 @@ tgsi_scan_shader(const struct tgsi_token *tokens, for (i = 0; i < fullinst->Instruction.NumSrcRegs; i++) { const struct tgsi_full_src_register *src = &fullinst->Src[i]; - if (src->Register.File == TGSI_FILE_INPUT) { + if (src->Register.File == TGSI_FILE_INPUT || + src->Register.File == TGSI_FILE_SYSTEM_VALUE) { const int ind = src->Register.Index; if (info->input_semantic_name[ind] == TGSI_SEMANTIC_FOG) { if (src->Register.SwizzleX == TGSI_SWIZZLE_X) { @@ -128,7 +129,7 @@ tgsi_scan_shader(const struct tgsi_token *tokens, info->file_count[file]++; info->file_max[file] = MAX2(info->file_max[file], (int)reg); - if (file == TGSI_FILE_INPUT) { + if (file == TGSI_FILE_INPUT || file == TGSI_FILE_SYSTEM_VALUE) { info->input_semantic_name[reg] = (ubyte)fulldecl->Semantic.Name; info->input_semantic_index[reg] = (ubyte)fulldecl->Semantic.Index; info->input_interpolate[reg] = (ubyte)fulldecl->Declaration.Interpolate; @@ -160,6 +161,19 @@ tgsi_scan_shader(const struct tgsi_token *tokens, info->file_max[file] = MAX2(info->file_max[file], (int)reg); } break; + case TGSI_TOKEN_TYPE_PROPERTY: + { + const struct tgsi_full_property *fullprop + = &parse.FullToken.FullProperty; + + info->properties[info->num_properties].name = + fullprop->Property.PropertyName; + memcpy(info->properties[info->num_properties].data, + fullprop->u, 8 * sizeof(unsigned));; + + ++info->num_properties; + } + break; default: assert( 0 ); @@ -212,6 +226,7 @@ tgsi_is_passthrough_shader(const struct tgsi_token *tokens) /* Do a whole bunch of checks for a simple move */ if (fullinst->Instruction.Opcode != TGSI_OPCODE_MOV || src->Register.File != TGSI_FILE_INPUT || + src->Register.File != TGSI_FILE_SYSTEM_VALUE || dst->Register.File != TGSI_FILE_OUTPUT || src->Register.Index != dst->Register.Index || @@ -235,6 +250,8 @@ tgsi_is_passthrough_shader(const struct tgsi_token *tokens) /* fall-through */ case TGSI_TOKEN_TYPE_IMMEDIATE: /* fall-through */ + case TGSI_TOKEN_TYPE_PROPERTY: + /* fall-through */ default: ; /* no-op */ } -- cgit v1.2.3