summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_pipe_aaline.c
diff options
context:
space:
mode:
authorRob Clark <robclark@freedesktop.org>2015-06-10 19:59:20 -0400
committerRob Clark <robclark@freedesktop.org>2015-06-21 07:52:07 -0400
commitb516e68afb548894eff6b1f375c01f6dfafb6aed (patch)
tree8a847b6c205a76f2fd5620d801bfb48281211165 /src/gallium/auxiliary/draw/draw_pipe_aaline.c
parentf481af110e6ab42b2d184f225bfe7eb1e66df393 (diff)
downloadexternal_mesa3d-b516e68afb548894eff6b1f375c01f6dfafb6aed.tar.gz
external_mesa3d-b516e68afb548894eff6b1f375c01f6dfafb6aed.tar.bz2
external_mesa3d-b516e68afb548894eff6b1f375c01f6dfafb6aed.zip
draw: updates to support SVIEW decls
To allow for shaders which use SVIEW decls for TEX* instructions, we need to preserve the constraint that the shader either has no SVIEW's or it has one matching SVIEW for each SAMP. Signed-off-by: Rob Clark <robclark@freedesktop.org> Reviewed-by: Roland Scheidegger <sroland@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_aaline.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_aaline.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
index 2f14efea96..936046ea5f 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
@@ -51,7 +51,7 @@
/** Approx number of new tokens for instructions in aa_transform_inst() */
-#define NUM_NEW_TOKENS 50
+#define NUM_NEW_TOKENS 53
/**
@@ -137,6 +137,7 @@ struct aa_transform_context {
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 */
@@ -165,6 +166,9 @@ aa_transform_decl(struct tgsi_transform_context *ctx,
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;
@@ -232,6 +236,17 @@ aa_transform_prolog(struct tgsi_transform_context *ctx)
/* 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);