/** Approx number of new tokens for instructions in aa_transform_inst() */
-#define NUM_NEW_TOKENS 50
+#define NUM_NEW_TOKENS 53
/**
uint tempsUsed; /**< bitmask */
int colorOutput; /**< which output is the primary color */
uint samplersUsed; /**< bitfield of samplers used */
+ bool hasSview;
int freeSampler; /** an available sampler for the pstipple */
int maxInput, maxGeneric; /**< max input index found */
int colorTemp, texTemp; /**< temp registers */
aactx->samplersUsed |= 1 << i;
}
}
+ else if (decl->Declaration.File == TGSI_FILE_SAMPLER_VIEW) {
+ aactx->hasSview = true;
+ }
else if (decl->Declaration.File == TGSI_FILE_INPUT) {
if ((int) decl->Range.Last > aactx->maxInput)
aactx->maxInput = decl->Range.Last;
/* declare new sampler */
tgsi_transform_sampler_decl(ctx, aactx->freeSampler);
+ /* if the src shader has SVIEW decl's for each SAMP decl, we
+ * need to continue the trend and ensure there is a matching
+ * SVIEW for the new SAMP we just created
+ */
+ if (aactx->hasSview) {
+ tgsi_transform_sampler_view_decl(ctx,
+ aactx->freeSampler,
+ TGSI_TEXTURE_2D,
+ TGSI_RETURN_TYPE_FLOAT);
+ }
+
/* declare new temp regs */
tgsi_transform_temp_decl(ctx, aactx->texTemp);
tgsi_transform_temp_decl(ctx, aactx->colorTemp);
/** Approx number of new tokens for instructions in pstip_transform_inst() */
-#define NUM_NEW_TOKENS 50
+#define NUM_NEW_TOKENS 53
/**
int wincoordInput;
int maxInput;
uint samplersUsed; /**< bitfield of samplers used */
+ bool hasSview;
int freeSampler; /** an available sampler for the pstipple */
int texTemp; /**< temp registers */
int numImmed;
pctx->samplersUsed |= 1 << i;
}
}
+ else if (decl->Declaration.File == TGSI_FILE_SAMPLER_VIEW) {
+ pctx->hasSview = true;
+ }
else if (decl->Declaration.File == TGSI_FILE_INPUT) {
pctx->maxInput = MAX2(pctx->maxInput, (int) decl->Range.Last);
if (decl->Semantic.Name == TGSI_SEMANTIC_POSITION)
/* declare new sampler */
tgsi_transform_sampler_decl(ctx, pctx->freeSampler);
+ /* if the src shader has SVIEW decl's for each SAMP decl, we
+ * need to continue the trend and ensure there is a matching
+ * SVIEW for the new SAMP we just created
+ */
+ if (pctx->hasSview) {
+ tgsi_transform_sampler_view_decl(ctx,
+ pctx->freeSampler,
+ TGSI_TEXTURE_2D,
+ TGSI_RETURN_TYPE_FLOAT);
+ }
+
/* declare new temp regs */
tgsi_transform_temp_decl(ctx, pctx->texTemp);