struct lp_tgsi_info *info;
unsigned num_imms;
- float imm[128][4];
+ float imm[LP_MAX_TGSI_IMMEDIATES][4];
struct lp_tgsi_channel_info temp[32][4];
};
case TGSI_TEXTURE_SHADOWCUBE:
readmask = TGSI_WRITEMASK_XYZW;
break;
+ case TGSI_TEXTURE_CUBE_ARRAY:
+ readmask = TGSI_WRITEMASK_XYZW;
+ break;
+ case TGSI_TEXTURE_SHADOWCUBE_ARRAY:
+ readmask = TGSI_WRITEMASK_XYZW;
+ break;
default:
assert(0);
return;
}
+ /* XXX
+ * For cube map arrays, this will not analyze lod or shadow argument.
+ * For shadow cube, this will not analyze lod bias argument.
+ * "Indirect" really has no meaning for such textures anyway though.
+ */
if (modifier == LP_BLD_TEX_MODIFIER_EXPLICIT_DERIV) {
/* We don't track explicit derivatives, although we could */
case TGSI_OPCODE_TXP:
analyse_tex(ctx, inst, LP_BLD_TEX_MODIFIER_PROJECTED);
break;
+ case TGSI_OPCODE_TEX2:
+ analyse_tex(ctx, inst, LP_BLD_TEX_MODIFIER_NONE);
+ break;
+ case TGSI_OPCODE_TXB2:
+ analyse_tex(ctx, inst, LP_BLD_TEX_MODIFIER_LOD_BIAS);
+ break;
+ case TGSI_OPCODE_TXL2:
+ analyse_tex(ctx, inst, LP_BLD_TEX_MODIFIER_EXPLICIT_LOD);
+ break;
case TGSI_OPCODE_SAMPLE:
analyse_sample(ctx, inst, LP_BLD_TEX_MODIFIER_NONE, FALSE);
break;
switch (inst->Instruction.Opcode) {
case TGSI_OPCODE_IF:
- case TGSI_OPCODE_IFC:
+ case TGSI_OPCODE_UIF:
case TGSI_OPCODE_ELSE:
case TGSI_OPCODE_ENDIF:
case TGSI_OPCODE_BGNLOOP:
&tex_info->coord[chan];
if (chan_info->file != TGSI_FILE_NULL) {
debug_printf(" %s[%u].%c",
- tgsi_file_names[chan_info->file],
+ tgsi_file_name(chan_info->file),
chan_info->u.index,
"xyzw01"[chan_info->swizzle]);
} else {
struct lp_tgsi_info *info)
{
struct tgsi_parse_context parse;
- struct analysis_context ctx;
+ struct analysis_context *ctx;
unsigned index;
unsigned chan;
tgsi_scan_shader(tokens, &info->base);
- memset(&ctx, 0, sizeof ctx);
- ctx.info = info;
+ ctx = CALLOC(1, sizeof(struct analysis_context));
+ ctx->info = info;
tgsi_parse_init(&parse, tokens);
goto finished;
}
- analyse_instruction(&ctx, inst);
+ analyse_instruction(ctx, inst);
}
break;
const unsigned size =
parse.FullToken.FullImmediate.Immediate.NrTokens - 1;
assert(size <= 4);
- if (ctx.num_imms < Elements(ctx.imm)) {
+ if (ctx->num_imms < Elements(ctx->imm)) {
for (chan = 0; chan < size; ++chan) {
float value = parse.FullToken.FullImmediate.u[chan].Float;
- ctx.imm[ctx.num_imms][chan] = value;
+ ctx->imm[ctx->num_imms][chan] = value;
if (value < 0.0f || value > 1.0f) {
info->unclamped_immediates = TRUE;
}
}
- ++ctx.num_imms;
+ ++ctx->num_imms;
}
}
break;
finished:
tgsi_parse_free(&parse);
+ FREE(ctx);
/*