Module: Mesa
Branch: master
Commit: 66d7bb0f235fb5003abd8be98ea6e5046dbf08b2
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=66d7bb0f235fb5003abd8be98ea6e5046dbf08b2

Author: Samuel Pitoiset <[email protected]>
Date:   Mon Oct 12 19:14:32 2020 +0200

radv: fix adjusting vertex alpha

AC_FETCH_FORMAT_NONE is not zero... Oops.

Fixes: b0829c6af70 ("radv: replace RADV_ALPHA_ADJUST by AC_FETCH_FORMAT")
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7103>

---

 src/amd/vulkan/radv_pipeline.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index ab1d7560b8b..27cb9f34616 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -2444,10 +2444,10 @@ radv_generate_graphics_pipeline_key(struct 
radv_pipeline *pipeline,
                key.vertex_attribute_offsets[location] = desc->offset;
                key.vertex_attribute_strides[location] = 
radv_get_attrib_stride(input_state, desc->binding);
 
+               enum ac_fetch_format adjust = AC_FETCH_FORMAT_NONE;
                if (pipeline->device->physical_device->rad_info.chip_class <= 
GFX8 &&
                    pipeline->device->physical_device->rad_info.family != 
CHIP_STONEY) {
                        VkFormat format = 
input_state->pVertexAttributeDescriptions[i].format;
-                       uint64_t adjust;
                        switch(format) {
                        case VK_FORMAT_A2R10G10B10_SNORM_PACK32:
                        case VK_FORMAT_A2B10G10R10_SNORM_PACK32:
@@ -2462,11 +2462,10 @@ radv_generate_graphics_pipeline_key(struct 
radv_pipeline *pipeline,
                                adjust = AC_FETCH_FORMAT_SINT;
                                break;
                        default:
-                               adjust = AC_FETCH_FORMAT_NONE;
                                break;
                        }
-                       key.vertex_alpha_adjust[location] = adjust;
                }
+               key.vertex_alpha_adjust[location] = adjust;
 
                switch (desc->format) {
                case VK_FORMAT_B8G8R8A8_UNORM:

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to