turnip: fix update_stencil_mask
authorJonathan Marek <jonathan@marek.ca>
Sun, 21 Jun 2020 03:34:53 +0000 (23:34 -0400)
committerMarge Bot <eric+marge@anholt.net>
Thu, 25 Jun 2020 03:02:56 +0000 (03:02 +0000)
The previous value was not being cleared, resulting in some dynamic stencil
state failures. Fixes these two tests:

dEQP-VK.dynamic_state.ds_state.stencil_params_advanced
dEQP-VK.dynamic_state.ds_state.stencil_params_basic_1

Fixes: 233610f8cf8d8810 ("turnip: refactor draw states and dynamic states")
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5586>

src/freedreno/vulkan/tu_cmd_buffer.c

index 6b58a154c44d64617caccb195b83e349e4fcd88d..4441e5f725a09efcdfa61a96d0d04d7fe61f8966 100644 (file)
@@ -2336,9 +2336,9 @@ static void
 update_stencil_mask(uint32_t *value, VkStencilFaceFlags face, uint32_t mask)
 {
    if (face & VK_STENCIL_FACE_FRONT_BIT)
-      *value |= A6XX_RB_STENCILMASK_MASK(mask);
+      *value = (*value & 0xff00) | (mask & 0xff);
    if (face & VK_STENCIL_FACE_BACK_BIT)
-      *value |= A6XX_RB_STENCILMASK_BFMASK(mask);
+      *value = (*value & 0xff) | (mask & 0xff) << 8;
 }
 
 void