From feef47bb593306aee2854e9bd146543c44d68468 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 24 Nov 2016 00:44:28 +0000 Subject: [PATCH] radv: enable sample shading This calculates ps_iter_samples from the minSampleShading input Reviewed-by: Bas Nieuwenhuizen Signed-off-by: Dave Airlie --- src/amd/vulkan/radv_device.c | 2 +- src/amd/vulkan/radv_pipeline.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 111bc7e957f..497ef21c6c8 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -570,7 +570,7 @@ void radv_GetPhysicalDeviceFeatures( .independentBlend = true, .geometryShader = !is_gfx9, .tessellationShader = !is_gfx9, - .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 84494647c02..496c06a1485 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -1349,7 +1349,9 @@ radv_pipeline_init_multisample_state(struct radv_pipeline *pipeline, else ms->num_samples = 1; - if (pipeline->shaders[MESA_SHADER_FRAGMENT]->info.fs.force_persample) { + if (vkms && vkms->sampleShadingEnable) { + ps_iter_samples = ceil(vkms->minSampleShading * ms->num_samples); + } else if (pipeline->shaders[MESA_SHADER_FRAGMENT]->info.fs.force_persample) { ps_iter_samples = ms->num_samples; } -- 2.30.2