summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2016-05-26 23:01:37 +0200
committerSamuel Pitoiset <[email protected]>2016-05-26 23:51:22 +0200
commite01a48218205adc280d3da00720dfb3d1ca5bde5 (patch)
tree04c5d00af07464601f1b91462082d4a8cce84c84 /src/gallium/drivers/nouveau/nvc0/nvc0_tex.c
parent9f0bc0f2b311f719090701a345428bd42bf79488 (diff)
nvc0: invalidate textures/samplers between 3D and CP on Fermi
Like constant buffers, samplers and textures are aliased on Fermi and we need to invalidate the state when switching from 3D to CP and vice versa. This fixes rendering issues in the UE4 demos. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nvc0/nvc0_tex.c')
-rw-r--r--src/gallium/drivers/nouveau/nvc0/nvc0_tex.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c b/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c
index 2523c20edc7..d36cea7a60c 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c
@@ -588,6 +588,14 @@ void nvc0_validate_textures(struct nvc0_context *nvc0)
BEGIN_NVC0(nvc0->base.pushbuf, NVC0_3D(TIC_FLUSH), 1);
PUSH_DATA (nvc0->base.pushbuf, 0);
}
+
+ if (nvc0->screen->base.class_3d < NVE4_3D_CLASS) {
+ /* Invalidate all CP textures because they are aliased. */
+ for (int i = 0; i < nvc0->num_textures[5]; i++)
+ nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_CP_TEX(i));
+ nvc0->textures_dirty[5] = ~0;
+ nvc0->dirty_cp |= NVC0_NEW_CP_TEXTURES;
+ }
}
bool
@@ -700,6 +708,12 @@ void nvc0_validate_samplers(struct nvc0_context *nvc0)
BEGIN_NVC0(nvc0->base.pushbuf, NVC0_3D(TSC_FLUSH), 1);
PUSH_DATA (nvc0->base.pushbuf, 0);
}
+
+ if (nvc0->screen->base.class_3d < NVE4_3D_CLASS) {
+ /* Invalidate all CP samplers because they are aliased. */
+ nvc0->samplers_dirty[5] = ~0;
+ nvc0->dirty_cp |= NVC0_NEW_CP_SAMPLERS;
+ }
}
/* Upload the "diagonal" entries for the possible texture sources ($t == $s).