[Mesa-dev] [PATCH] radv: enable sample shading

Dave Airlie airlied at gmail.com
Mon Jul 24 07:31:11 UTC 2017


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 | 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 111bc7e..497ef21 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 8449464..496c06a 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.9.4



More information about the mesa-dev mailing list