Re: [Mesa-dev] [PATCH] radv: always export gl_SampleMask when the fragment shader uses it

2019-02-13 Thread Bas Nieuwenhuizen
Reviewed-by: Bas Nieuwenhuizen 

I'm assuming the real fix is for the shader to not write the sample
mask if we have 1 sample?

On Tue, Feb 12, 2019 at 6:52 PM Samuel Pitoiset
 wrote:
>
> For some reasons, this breaks trees rendering in Project Cars.
>
> Fixes: 85010585cde ("radv: only enable gl_SampleMask if MSAA is enabled too")
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109401
> Signed-off-by: Samuel Pitoiset 
> ---
>  src/amd/vulkan/radv_pipeline.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
> index fb6c61cf3f0..a9df2b94b93 100644
> --- a/src/amd/vulkan/radv_pipeline.c
> +++ b/src/amd/vulkan/radv_pipeline.c
> @@ -3183,11 +3183,11 @@ radv_compute_db_shader_control(const struct 
> radv_device *device,
> bool disable_rbplus = device->physical_device->has_rbplus &&
>   !device->physical_device->rbplus_allowed;
>
> -   /* Do not enable the gl_SampleMask fragment shader output if MSAA is
> -* disabled.
> +   /* It shouldn't be needed to export gl_SampleMask when MSAA is 
> disabled
> +* but this appears to break Project Cars (DXVK). See
> +* https://bugs.freedesktop.org/show_bug.cgi?id=109401
>  */
> -   bool mask_export_enable = ms->num_samples > 1 &&
> - ps->info.info.ps.writes_sample_mask;
> +   bool mask_export_enable = ps->info.info.ps.writes_sample_mask;
>
> return  S_02880C_Z_EXPORT_ENABLE(ps->info.info.ps.writes_z) |
> 
> S_02880C_STENCIL_TEST_VAL_EXPORT_ENABLE(ps->info.info.ps.writes_stencil) |
> --
> 2.20.1
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

[Mesa-dev] [PATCH] radv: always export gl_SampleMask when the fragment shader uses it

2019-02-12 Thread Samuel Pitoiset
For some reasons, this breaks trees rendering in Project Cars.

Fixes: 85010585cde ("radv: only enable gl_SampleMask if MSAA is enabled too")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109401
Signed-off-by: Samuel Pitoiset 
---
 src/amd/vulkan/radv_pipeline.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index fb6c61cf3f0..a9df2b94b93 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -3183,11 +3183,11 @@ radv_compute_db_shader_control(const struct radv_device 
*device,
bool disable_rbplus = device->physical_device->has_rbplus &&
  !device->physical_device->rbplus_allowed;
 
-   /* Do not enable the gl_SampleMask fragment shader output if MSAA is
-* disabled.
+   /* It shouldn't be needed to export gl_SampleMask when MSAA is disabled
+* but this appears to break Project Cars (DXVK). See
+* https://bugs.freedesktop.org/show_bug.cgi?id=109401
 */
-   bool mask_export_enable = ms->num_samples > 1 &&
- ps->info.info.ps.writes_sample_mask;
+   bool mask_export_enable = ps->info.info.ps.writes_sample_mask;
 
return  S_02880C_Z_EXPORT_ENABLE(ps->info.info.ps.writes_z) |

S_02880C_STENCIL_TEST_VAL_EXPORT_ENABLE(ps->info.info.ps.writes_stencil) |
-- 
2.20.1

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev