From c3eaf8fe5746e5b29a46a076247ba072c84e2ec5 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 11 Jul 2018 15:28:30 +0100 Subject: [PATCH] forward precise-flag if supported New versions of virglrenderer supports the precise-flag, so let's forward it from TGSI if that's the case. This fixes a few dEQP-GLES31 tests: - dEQP-GLES31.functional.tessellation.common_edge.quads_equal_spacing_precise - dEQP-GLES31.functional.tessellation.common_edge.quads_fractional_even_spacing_precise - dEQP-GLES31.functional.tessellation.common_edge.quads_fractional_odd_spacing_precise - dEQP-GLES31.functional.tessellation.common_edge.triangles_equal_spacing_precise - dEQP-GLES31.functional.tessellation.common_edge.triangles_fractional_even_spacing_precise - dEQP-GLES31.functional.tessellation.common_edge.triangles_fractional_odd_spacing_precise Signed-off-by: Erik Faye-Lund Reviewed-by: Dave Airlie --- src/gallium/drivers/virgl/virgl_hw.h | 1 + src/gallium/drivers/virgl/virgl_tgsi.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) 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; -- 2.30.2