[Mesa-dev] [PATCH] forward precise-flag if supported

Dave Airlie airlied at gmail.com
Mon Jul 23 11:17:11 UTC 2018


On 23 July 2018 at 20:48, Erik Faye-Lund <erik.faye-lund at collabora.com> wrote:
> New versions of virglrenderer supports the precise-flag, so let's
> forward it from TGSI if that's the case.

Reviewed-by: Dave Airlie <airlied at redhat.com>
>
> 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 <erik.faye-lund at collabora.com>
> ---
>
> This matches this virglrenderer-series, which has been merged upstrea:
> https://patchwork.freedesktop.org/series/46361/
>
>  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 ee6aa68c5a..8f4f0ab6d8 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 ff5abf6ddb..d1f785d4d2 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.18.0
>


More information about the mesa-dev mailing list