Signed-off-by: Giovanni Mascellani gmascellani@codeweavers.com -- I don't really know much about SM1, so I wouldn't swear the patch is correct. But it looks sensible and it doesn't appear to be breaking totally unrelated things.
Only thing I would change is to leave "put_u32(buffer, var->data_type->reg_size / 4)" out of the conditional, since I think I remember that textures and samplers have register size 4. But it's not a big deal.
On 09/11/21 04:39, Zebediah Figura wrote:
Signed-off-by: Zebediah Figura zfigura@codeweavers.com
libs/vkd3d-shader/hlsl_sm1.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl_sm1.c b/libs/vkd3d-shader/hlsl_sm1.c index c3d27eea1..875f521f7 100644 --- a/libs/vkd3d-shader/hlsl_sm1.c +++ b/libs/vkd3d-shader/hlsl_sm1.c @@ -352,8 +352,18 @@ static void write_sm1_uniforms(struct hlsl_ctx *ctx, struct vkd3d_bytecode_buffe if (!var->semantic.name && var->reg.allocated) { put_u32(buffer, 0); /* name */
put_u32(buffer, vkd3d_make_u32(D3DXRS_FLOAT4, var->reg.id));
put_u32(buffer, var->data_type->reg_size / 4);
if (var->data_type->type == HLSL_CLASS_OBJECT
&& (var->data_type->base_type == HLSL_TYPE_SAMPLER
|| var->data_type->base_type == HLSL_TYPE_TEXTURE))
{
put_u32(buffer, vkd3d_make_u32(D3DXRS_SAMPLER, var->reg.id));
put_u32(buffer, 1);
}
else
{
put_u32(buffer, vkd3d_make_u32(D3DXRS_FLOAT4, var->reg.id));
put_u32(buffer, var->data_type->reg_size / 4);
} put_u32(buffer, 0); /* type */ put_u32(buffer, 0); /* FIXME: default value */ }