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

Author: Charmaine Lee <[email protected]>
Date:   Tue Aug  9 19:39:29 2022 -0700

svga: fix SetConstantBufferOffset command opcode

This patch fixes the SetConstantBufferOffset command opcode which is
not mapped correctly after the reordering of the pipe shader type defines.

Acked-by: Dave Airlie <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17977>

---

 src/gallium/drivers/svga/svga_state_constants.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/svga/svga_state_constants.c 
b/src/gallium/drivers/svga/svga_state_constants.c
index 71ad3b96398..d6d379e2797 100644
--- a/src/gallium/drivers/svga/svga_state_constants.c
+++ b/src/gallium/drivers/svga/svga_state_constants.c
@@ -857,7 +857,8 @@ emit_constbuf(struct svga_context *svga,
                                                   new_buf_size);
    }
    else if (dst_handle){
-      unsigned command = SVGA_3D_CMD_DX_SET_VS_CONSTANT_BUFFER_OFFSET + shader;
+      unsigned command = SVGA_3D_CMD_DX_SET_VS_CONSTANT_BUFFER_OFFSET +
+                            svga_shader_type(shader) - SVGA3D_SHADERTYPE_VS;
       ret = SVGA3D_vgpu10_SetConstantBufferOffset(svga->swc,
                                                   command,
                                                   slot, /* index */

Reply via email to