[Mesa-dev] [PATCH] radv: enable sample shading
Ilia Mirkin
imirkin at alum.mit.edu
Thu Nov 24 01:30:19 UTC 2016
On Wed, Nov 23, 2016 at 7:51 PM, Dave Airlie <airlied at gmail.com> wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> This calculates ps_iter_samples from the minSampleShading input
>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
> ---
> src/amd/vulkan/radv_device.c | 2 +-
> src/amd/vulkan/radv_pipeline.c | 6 ++++--
> 2 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
> index aa2b021..a75ad27 100644
> --- a/src/amd/vulkan/radv_device.c
> +++ b/src/amd/vulkan/radv_device.c
> @@ -370,7 +370,7 @@ void radv_GetPhysicalDeviceFeatures(
> .independentBlend = true,
> .geometryShader = false,
> .tessellationShader = false,
> - .sampleRateShading = false,
> + .sampleRateShading = true,
> .dualSrcBlend = true,
> .logicOp = true,
> .multiDrawIndirect = true,
> diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
> index 652a2c4..6bec7c7 100644
> --- a/src/amd/vulkan/radv_pipeline.c
> +++ b/src/amd/vulkan/radv_pipeline.c
> @@ -1021,8 +1021,10 @@ radv_pipeline_init_multisample_state(struct radv_pipeline *pipeline,
>
> ms->num_samples = vkms->rasterizationSamples;
>
> - if (pipeline->shaders[MESA_SHADER_FRAGMENT]->info.fs.force_persample) {
> - ps_iter_samples = vkms->rasterizationSamples;
> + if (vkms->sampleShadingEnable) {
> + ps_iter_samples = ms->num_samples * vkms->minSampleShading;
I think you want a ceilf() here.
> + } else if (pipeline->shaders[MESA_SHADER_FRAGMENT]->info.fs.force_persample) {
> + ps_iter_samples = ms->num_samples;
> }
>
> ms->pa_sc_line_cntl = S_028BDC_DX10_DIAMOND_TEST_ENA(1);
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list