X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fr300%2Fr300_tgsi_to_rc.c;h=07a3f3caee72e0f1449cc45a7752bb9f09f47922;hb=4683529048ee133481b2d8f1cae1685aa1736f9a;hp=2ac52906d13af7018e1e3c5ab581bcfa23382fed;hpb=596f09aa7bafd769912b1c0efe97434dff4c3f0b;p=mesa.git diff --git a/src/gallium/drivers/r300/r300_tgsi_to_rc.c b/src/gallium/drivers/r300/r300_tgsi_to_rc.c index 2ac52906d13..07a3f3caee7 100644 --- a/src/gallium/drivers/r300/r300_tgsi_to_rc.c +++ b/src/gallium/drivers/r300/r300_tgsi_to_rc.c @@ -22,10 +22,8 @@ #include "r300_tgsi_to_rc.h" -#include "radeon_compiler.h" -#include "radeon_program.h" +#include "compiler/radeon_compiler.h" -#include "util/u_math.h" #include "tgsi/tgsi_info.h" #include "tgsi/tgsi_parse.h" #include "tgsi/tgsi_scan.h" @@ -169,7 +167,6 @@ static unsigned translate_register_file(unsigned file) /* fall-through */ case TGSI_FILE_TEMPORARY: return RC_FILE_TEMPORARY; case TGSI_FILE_ADDRESS: return RC_FILE_ADDRESS; - case TGSI_FILE_SYSTEM_VALUE: return RC_FILE_INPUT; } } @@ -181,17 +178,6 @@ static int translate_register_index( if (file == TGSI_FILE_IMMEDIATE) return ttr->immediate_offset + index; - if (file == TGSI_FILE_SYSTEM_VALUE) { - if (index == ttr->instance_id) { - return ttr->num_inputs; - } else { - fprintf(stderr, "Unknown system value semantic index: %i\n", - index); - ttr->error = TRUE; - return 0; - } - } - return index; } @@ -279,10 +265,10 @@ static void transform_texture(struct rc_instruction * dst, struct tgsi_instructi *shadowSamplers |= 1 << dst->U.I.TexSrcUnit; break; } + dst->U.I.TexSwizzle = RC_SWIZZLE_XYZW; } -static void transform_instruction(struct tgsi_to_rc * ttr, - struct tgsi_full_instruction * src) +static void transform_instruction(struct tgsi_to_rc * ttr, struct tgsi_full_instruction * src) { struct rc_instruction * dst; int i; @@ -342,27 +328,6 @@ static void handle_immediate(struct tgsi_to_rc * ttr, } } -static void handle_declaration(struct tgsi_to_rc *ttr, - struct tgsi_full_declaration *decl) -{ - switch (decl->Declaration.File) { - case TGSI_FILE_INPUT: - ttr->num_inputs = MAX2(ttr->num_inputs, decl->Range.First + 1); - break; - - case TGSI_FILE_SYSTEM_VALUE: - if (decl->Semantic.Name == TGSI_SEMANTIC_INSTANCEID) { - printf("Got instance id\n"); - ttr->instance_id = decl->Range.First; - } else { - fprintf(stderr, "Unknown system value semantic: %i.\n", - decl->Semantic.Name); - ttr->error = TRUE; - } - break; - } -} - void r300_tgsi_to_rc(struct tgsi_to_rc * ttr, const struct tgsi_token * tokens) { @@ -371,8 +336,6 @@ void r300_tgsi_to_rc(struct tgsi_to_rc * ttr, unsigned imm_index = 0; int i; - ttr->num_inputs = 0; - ttr->instance_id = -1; ttr->error = FALSE; /* Allocate constants placeholders. @@ -399,29 +362,21 @@ void r300_tgsi_to_rc(struct tgsi_to_rc * ttr, switch (parser.FullToken.Token.Type) { case TGSI_TOKEN_TYPE_DECLARATION: - handle_declaration(ttr, &parser.FullToken.FullDeclaration); - if (ttr->error) - goto end_while; break; - case TGSI_TOKEN_TYPE_IMMEDIATE: handle_immediate(ttr, &parser.FullToken.FullImmediate, imm_index); imm_index++; break; - case TGSI_TOKEN_TYPE_INSTRUCTION: inst = &parser.FullToken.FullInstruction; if (inst->Instruction.Opcode == TGSI_OPCODE_END) { - goto end_while; + break; } transform_instruction(ttr, inst); - if (ttr->error) - goto end_while; break; } } -end_while: tgsi_parse_free(&parser);