summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_sanity.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/tgsi/tgsi_sanity.c')
-rw-r--r--lib/mesa/src/gallium/auxiliary/tgsi/tgsi_sanity.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_sanity.c b/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_sanity.c
index a95bbfa98..d14372feb 100644
--- a/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_sanity.c
+++ b/lib/mesa/src/gallium/auxiliary/tgsi/tgsi_sanity.c
@@ -256,6 +256,7 @@ static const char *file_names[TGSI_FILE_COUNT] =
"SAMP",
"ADDR",
"IMM",
+ "PRED",
"SV",
"RES"
};
@@ -320,7 +321,7 @@ iter_instruction(
}
info = tgsi_get_opcode_info( inst->Instruction.Opcode );
- if (!info) {
+ if (info == NULL) {
report_error( ctx, "(%u): Invalid instruction opcode", inst->Instruction.Opcode );
return TRUE;
}
@@ -413,9 +414,9 @@ iter_declaration(
decl->Semantic.Name == TGSI_SEMANTIC_TESSOUTER ||
decl->Semantic.Name == TGSI_SEMANTIC_TESSINNER;
if (file == TGSI_FILE_INPUT && !patch && (
- processor == PIPE_SHADER_GEOMETRY ||
- processor == PIPE_SHADER_TESS_CTRL ||
- processor == PIPE_SHADER_TESS_EVAL)) {
+ processor == TGSI_PROCESSOR_GEOMETRY ||
+ processor == TGSI_PROCESSOR_TESS_CTRL ||
+ processor == TGSI_PROCESSOR_TESS_EVAL)) {
uint vert;
for (vert = 0; vert < ctx->implied_array_size; ++vert) {
scan_register *reg = MALLOC(sizeof(scan_register));
@@ -423,7 +424,7 @@ iter_declaration(
check_and_declare(ctx, reg);
}
} else if (file == TGSI_FILE_OUTPUT && !patch &&
- processor == PIPE_SHADER_TESS_CTRL) {
+ processor == TGSI_PROCESSOR_TESS_CTRL) {
uint vert;
for (vert = 0; vert < ctx->implied_out_array_size; ++vert) {
scan_register *reg = MALLOC(sizeof(scan_register));
@@ -484,11 +485,11 @@ iter_property(
{
struct sanity_check_ctx *ctx = (struct sanity_check_ctx *) iter;
- if (iter->processor.Processor == PIPE_SHADER_GEOMETRY &&
+ if (iter->processor.Processor == TGSI_PROCESSOR_GEOMETRY &&
prop->Property.PropertyName == TGSI_PROPERTY_GS_INPUT_PRIM) {
ctx->implied_array_size = u_vertices_per_prim(prop->u[0].Data);
}
- if (iter->processor.Processor == PIPE_SHADER_TESS_CTRL &&
+ if (iter->processor.Processor == TGSI_PROCESSOR_TESS_CTRL &&
prop->Property.PropertyName == TGSI_PROPERTY_TCS_VERTICES_OUT)
ctx->implied_out_array_size = prop->u[0].Data;
return TRUE;
@@ -498,8 +499,8 @@ static boolean
prolog(struct tgsi_iterate_context *iter)
{
struct sanity_check_ctx *ctx = (struct sanity_check_ctx *) iter;
- if (iter->processor.Processor == PIPE_SHADER_TESS_CTRL ||
- iter->processor.Processor == PIPE_SHADER_TESS_EVAL)
+ if (iter->processor.Processor == TGSI_PROCESSOR_TESS_CTRL ||
+ iter->processor.Processor == TGSI_PROCESSOR_TESS_EVAL)
ctx->implied_array_size = 32;
return TRUE;
}
@@ -558,7 +559,6 @@ tgsi_sanity_check(
const struct tgsi_token *tokens )
{
struct sanity_check_ctx ctx;
- boolean retval;
ctx.iter.prolog = prolog;
ctx.iter.iterate_instruction = iter_instruction;
@@ -580,12 +580,11 @@ tgsi_sanity_check(
ctx.implied_array_size = 0;
ctx.print = debug_get_option_print_sanity();
- retval = tgsi_iterate_shader( tokens, &ctx.iter );
+ if (!tgsi_iterate_shader( tokens, &ctx.iter ))
+ return FALSE;
+
regs_hash_destroy(ctx.regs_decl);
regs_hash_destroy(ctx.regs_used);
regs_hash_destroy(ctx.regs_ind_used);
- if (retval == FALSE)
- return FALSE;
-
return ctx.errors == 0;
}