143
143
readmask = TGSI_WRITEMASK_XYZW;
144
144
/* modifier would be in another not analyzed reg so just say indirect */
145
145
if (modifier != LP_BLD_TEX_MODIFIER_NONE) {
149
149
case TGSI_TEXTURE_SHADOWCUBE_ARRAY:
150
150
readmask = TGSI_WRITEMASK_XYZW;
158
158
if (modifier == LP_BLD_TEX_MODIFIER_EXPLICIT_DERIV) {
159
159
/* We don't track explicit derivatives, although we could */
161
161
tex_info->sampler_unit = inst->Src[3].Register.Index;
162
162
tex_info->texture_unit = inst->Src[3].Register.Index;
175
175
if (readmask & (1 << chan)) {
176
176
analyse_src(ctx, chan_info, &inst->Src[0].Register, chan);
177
177
if (chan_info->file != TGSI_FILE_INPUT) {
181
181
memset(chan_info, 0, sizeof *chan_info);
202
202
analyse_sample(struct analysis_context *ctx,
203
203
const struct tgsi_full_instruction *inst,
204
204
enum lp_build_tex_modifier modifier,
207
207
struct lp_tgsi_info *info = ctx->info;
210
210
if (info->num_texs < ARRAY_SIZE(info->tex)) {
211
211
struct lp_tgsi_texture_info *tex_info = &info->tex[info->num_texs];
212
212
unsigned target = ctx->sample_target[inst->Src[1].Register.Index];
213
boolean indirect = FALSE;
214
boolean shadow = FALSE;
213
bool indirect = false;
215
215
unsigned readmask;
217
217
switch (target) {
245
245
tex_info->sampler_unit = inst->Src[2].Register.Index;
247
247
if (tex_info->texture_unit != tex_info->sampler_unit) {
248
info->sampler_texture_units_different = TRUE;
248
info->sampler_texture_units_different = true;
251
251
if (modifier == LP_BLD_TEX_MODIFIER_EXPLICIT_DERIV ||
252
252
modifier == LP_BLD_TEX_MODIFIER_EXPLICIT_LOD ||
253
253
modifier == LP_BLD_TEX_MODIFIER_LOD_BIAS || shadow) {
254
254
/* We don't track insts with additional regs, although we could */
258
258
for (chan = 0; chan < 4; ++chan) {
260
260
if (readmask & (1 << chan)) {
261
261
analyse_src(ctx, chan_info, &inst->Src[0].Register, chan);
262
262
if (chan_info->file != TGSI_FILE_INPUT) {
266
266
memset(chan_info, 0, sizeof *chan_info);
349
349
analyse_tex(ctx, inst, LP_BLD_TEX_MODIFIER_EXPLICIT_LOD);
351
351
case TGSI_OPCODE_SAMPLE:
352
analyse_sample(ctx, inst, LP_BLD_TEX_MODIFIER_NONE, FALSE);
352
analyse_sample(ctx, inst, LP_BLD_TEX_MODIFIER_NONE, false);
354
354
case TGSI_OPCODE_SAMPLE_C:
355
analyse_sample(ctx, inst, LP_BLD_TEX_MODIFIER_NONE, TRUE);
355
analyse_sample(ctx, inst, LP_BLD_TEX_MODIFIER_NONE, true);
357
357
case TGSI_OPCODE_SAMPLE_C_LZ:
358
analyse_sample(ctx, inst, LP_BLD_TEX_MODIFIER_LOD_ZERO, TRUE);
358
analyse_sample(ctx, inst, LP_BLD_TEX_MODIFIER_LOD_ZERO, true);
360
360
case TGSI_OPCODE_SAMPLE_D:
361
analyse_sample(ctx, inst, LP_BLD_TEX_MODIFIER_EXPLICIT_DERIV, FALSE);
361
analyse_sample(ctx, inst, LP_BLD_TEX_MODIFIER_EXPLICIT_DERIV, false);
363
363
case TGSI_OPCODE_SAMPLE_B:
364
analyse_sample(ctx, inst, LP_BLD_TEX_MODIFIER_LOD_BIAS, FALSE);
364
analyse_sample(ctx, inst, LP_BLD_TEX_MODIFIER_LOD_BIAS, false);
366
366
case TGSI_OPCODE_SAMPLE_L:
367
analyse_sample(ctx, inst, LP_BLD_TEX_MODIFIER_EXPLICIT_LOD, FALSE);
367
analyse_sample(ctx, inst, LP_BLD_TEX_MODIFIER_EXPLICIT_LOD, false);