radv: enable sample shading
authorDave Airlie <airlied@redhat.com>
Thu, 24 Nov 2016 00:44:28 +0000 (00:44 +0000)
committerDave Airlie <airlied@redhat.com>
Mon, 24 Jul 2017 07:45:03 +0000 (17:45 +1000)
This calculates ps_iter_samples from the minSampleShading input

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_device.c
src/amd/vulkan/radv_pipeline.c

index 111bc7e957fd038b81a45808d6b58f41691b641e..497ef21c6c82878d9461a8697446ef7e4a3ac2a8 100644 (file)
@@ -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,
index 84494647c0225be0f383ab698eb76fe324ce66ee..496c06a148533e90df73cbb0f2a65ccaa3977d6d 100644 (file)
@@ -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;
        }