Module: Mesa
Branch: main
Commit: 58bf84044bbad292057bdc95c13bb030b57eb7c5
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=58bf84044bbad292057bdc95c13bb030b57eb7c5

Author: Samuel Pitoiset <[email protected]>
Date:   Thu Aug 11 14:22:38 2022 +0200

radv: copy the sample locations only if the state isn't dynamic

If user sample locations is enabled and the state is dynamic we don't
have to copy them to the dynamic state struct.

Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-By: Mike Blumenkrantz <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18007>

---

 src/amd/vulkan/radv_pipeline.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index afd8fa0c2e8..d7bbf8e9f69 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -2141,14 +2141,12 @@ radv_pipeline_init_dynamic_state(struct 
radv_graphics_pipeline *pipeline,
       }
    }
 
-   if (needed_states & RADV_DYNAMIC_SAMPLE_LOCATIONS) {
-      if (info->ms.sample_locs_enable) {
-         dynamic->sample_location.per_pixel = info->ms.sample_locs_per_pixel;
-         dynamic->sample_location.grid_size = info->ms.sample_locs_grid_size;
-         dynamic->sample_location.count = info->ms.sample_locs_count;
-         typed_memcpy(&dynamic->sample_location.locations[0], 
info->ms.sample_locs,
-                      info->ms.sample_locs_count);
-      }
+   if (states & RADV_DYNAMIC_SAMPLE_LOCATIONS) {
+      dynamic->sample_location.per_pixel = info->ms.sample_locs_per_pixel;
+      dynamic->sample_location.grid_size = info->ms.sample_locs_grid_size;
+      dynamic->sample_location.count = info->ms.sample_locs_count;
+      typed_memcpy(&dynamic->sample_location.locations[0], 
info->ms.sample_locs,
+                   info->ms.sample_locs_count);
    }
 
    if (states & RADV_DYNAMIC_LINE_STIPPLE) {

Reply via email to