[PATCH vkd3d 2/8] vkd3d-shader: Read constant buffer offsets from the second index for SM5.1.

Henri Verbeet hverbeet at gmail.com
Mon May 25 14:09:00 CDT 2020


On Sat, 23 May 2020 at 00:58, Zebediah Figura <zfigura at codeweavers.com> wrote:
> @@ -1600,6 +1600,10 @@ static bool shader_sm4_read_param(struct vkd3d_sm4_data *priv, const DWORD **ptr
>                  break;
>          }
>      }
> +    else if (register_type == VKD3D_SM4_RT_CONSTBUFFER)
> +    {
> +        param->u.cb_offset_param = shader_is_sm_5_1(priv) ? 2 : 1;
> +    }
This isn't really a property of the register, it's the same for all
the VKD3D_SM4_RT_CONSTBUFFER registers in the shader. If we're going
this way, I'd probably store it in the vkd3d_dxbc_compiler structure
instead. However, there's also an argument to be made that instead of
dealing with "cb_offset_param" in spirv.c, we should simply fix this
up in the parser. (I.e., as far as spirv.c would be concerned we'd
always have a SM 5.1 shader.)



More information about the wine-devel mailing list