[Mesa-dev] [PATCH 2/3] anv/pipeline: Add sample locations for gen7-7.5

Jason Ekstrand jason at jlekstrand.net
Tue Aug 9 00:08:33 UTC 2016


I wish we could come up with some clever way to not have to repeat the
multisample positions all over the place.  Unfortunately, I don't have any
particularly fastastic ideas on how.  We can figure that out later.
Patches 1 and 2 are

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Mon, Aug 8, 2016 at 2:57 PM, Anuj Phogat <anuj.phogat at gmail.com> wrote:

> V1: Add multisample positions (Nanley)
> V2: Fix 8x sample positions (Anuj)
>
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>  src/intel/vulkan/genX_pipeline_util.h | 47 ++++++++++++++++++++++++++++++
> +++++
>  1 file changed, 47 insertions(+)
>
> diff --git a/src/intel/vulkan/genX_pipeline_util.h
> b/src/intel/vulkan/genX_pipeline_util.h
> index 52d386a..621edef 100644
> --- a/src/intel/vulkan/genX_pipeline_util.h
> +++ b/src/intel/vulkan/genX_pipeline_util.h
> @@ -470,6 +470,7 @@ emit_ms_state(struct anv_pipeline *pipeline,
>     anv_batch_emit(&pipeline->batch, GENX(3DSTATE_MULTISAMPLE), ms) {
>        ms.NumberofMultisamples       = log2_samples;
>
> +#if GEN_GEN >= 8
>        /* The PRM says that this bit is valid only for DX9:
>         *
>         *    SW can choose to set this bit only for DX9 API. DX10/OGL API's
> @@ -477,6 +478,52 @@ emit_ms_state(struct anv_pipeline *pipeline,
>         */
>        ms.PixelPositionOffsetEnable  = false;
>        ms.PixelLocation              = CENTER;
> +#else
> +      ms.PixelLocation              = PIXLOC_CENTER;
> +
> +      switch (samples) {
> +      case 1:
> +         ms.Sample0XOffset          = 0.5;
> +         ms.Sample0YOffset          = 0.5;
> +         break;
> +      case 2:
> +         ms.Sample0XOffset          = 0.25;
> +         ms.Sample0YOffset          = 0.25;
> +         ms.Sample1XOffset          = 0.75;
> +         ms.Sample1YOffset          = 0.75;
> +         break;
> +      case 4:
> +         ms.Sample0XOffset          = 0.375;
> +         ms.Sample0YOffset          = 0.125;
> +         ms.Sample1XOffset          = 0.875;
> +         ms.Sample1YOffset          = 0.375;
> +         ms.Sample2XOffset          = 0.125;
> +         ms.Sample2YOffset          = 0.625;
> +         ms.Sample3XOffset          = 0.625;
> +         ms.Sample3YOffset          = 0.875;
> +         break;
> +      case 8:
> +         ms.Sample0XOffset          = 0.4375;
> +         ms.Sample0YOffset          = 0.5625;
> +         ms.Sample1XOffset          = 0.5625;
> +         ms.Sample1YOffset          = 0.8125;
> +         ms.Sample2XOffset          = 0.6875;
> +         ms.Sample2YOffset          = 0.1875;
> +         ms.Sample3XOffset          = 0.8125;
> +         ms.Sample3YOffset          = 0.6875;
> +         ms.Sample4XOffset          = 0.0625;
> +         ms.Sample4YOffset          = 0.4375;
> +         ms.Sample5XOffset          = 0.3125;
> +         ms.Sample5YOffset          = 0.0625;
> +         ms.Sample6XOffset          = 0.9375;
> +         ms.Sample6YOffset          = 0.3125;
> +         ms.Sample7XOffset          = 0.1875;
> +         ms.Sample7YOffset          = 0.9375;
> +         break;
> +      default:
> +         break;
> +      }
> +#endif
>     }
>
>     anv_batch_emit(&pipeline->batch, GENX(3DSTATE_SAMPLE_MASK), sm) {
> --
> 2.5.5
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160808/a922b61e/attachment.html>


More information about the mesa-dev mailing list