summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/virgl/virgl_hw.h1
-rw-r--r--src/gallium/drivers/virgl/virgl_tgsi.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/virgl/virgl_hw.h b/src/gallium/drivers/virgl/virgl_hw.h
index c509e9b8a0a..4469515dd12 100644
--- a/src/gallium/drivers/virgl/virgl_hw.h
+++ b/src/gallium/drivers/virgl/virgl_hw.h
@@ -203,6 +203,7 @@ enum virgl_formats {
#define VIRGL_CAP_TEXTURE_VIEW (1 << 1)
#define VIRGL_CAP_SET_MIN_SAMPLES (1 << 2)
#define VIRGL_CAP_COPY_IMAGE (1 << 3)
+#define VIRGL_CAP_TGSI_PRECISE (1 << 4)
#define VIRGL_BIND_DEPTH_STENCIL (1 << 0)
#define VIRGL_BIND_RENDER_TARGET (1 << 1)
diff --git a/src/gallium/drivers/virgl/virgl_tgsi.c b/src/gallium/drivers/virgl/virgl_tgsi.c
index ff5abf6ddbd..d1f785d4d21 100644
--- a/src/gallium/drivers/virgl/virgl_tgsi.c
+++ b/src/gallium/drivers/virgl/virgl_tgsi.c
@@ -31,6 +31,7 @@
struct virgl_transform_context {
struct tgsi_transform_context base;
bool cull_enabled;
+ bool has_precise;
};
static void
@@ -76,7 +77,8 @@ static void
virgl_tgsi_transform_instruction(struct tgsi_transform_context *ctx,
struct tgsi_full_instruction *inst)
{
- if (inst->Instruction.Precise)
+ struct virgl_transform_context *vtctx = (struct virgl_transform_context *)ctx;
+ if (!vtctx->has_precise && inst->Instruction.Precise)
inst->Instruction.Precise = 0;
for (unsigned i = 0; i < inst->Instruction.NumSrcRegs; i++) {
@@ -104,6 +106,7 @@ struct tgsi_token *virgl_tgsi_transform(struct virgl_context *vctx, const struct
transform.base.transform_property = virgl_tgsi_transform_property;
transform.base.transform_instruction = virgl_tgsi_transform_instruction;
transform.cull_enabled = vscreen->caps.caps.v1.bset.has_cull;
+ transform.has_precise = vscreen->caps.caps.v2.capability_bits & VIRGL_CAP_TGSI_PRECISE;
tgsi_transform_shader(tokens_in, new_tokens, newLen, &transform.base);
return new_tokens;