dzn: Fix independent blend check
authorJesse Natalie <jenatali@microsoft.com>
Sat, 21 Jan 2023 00:48:27 +0000 (16:48 -0800)
committerMarge Bot <emma+marge@anholt.net>
Tue, 24 Jan 2023 17:22:25 +0000 (17:22 +0000)
Memcmp returns 0 on equal, so !memcmp means equal.

Fixes: c92729c3 ("dzn: Enable independent blending")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20823>

src/microsoft/vulkan/dzn_pipeline.c

index 7603d0b..17faa50 100644 (file)
@@ -1563,8 +1563,8 @@ dzn_graphics_pipeline_translate_blend(struct dzn_graphics_pipeline *pipeline,
 
    for (uint32_t i = 0; i < in_blend->attachmentCount; i++) {
       if (i > 0 &&
-          !memcmp(&in_blend->pAttachments[i - 1], &in_blend->pAttachments[i],
-                  sizeof(*in_blend->pAttachments)))
+          memcmp(&in_blend->pAttachments[i - 1], &in_blend->pAttachments[i],
+                 sizeof(*in_blend->pAttachments)) != 0)
          desc->IndependentBlendEnable = true;
 
       desc->RenderTarget[i].BlendEnable =