mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Allow offsets for scalar and vector variables.
Signed-off-by: Francisco Casas <fcasas@codeweavers.com> Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
committed by
Alexandre Julliard
parent
ee764359d0
commit
84059d61c3
@@ -870,6 +870,8 @@ static void sm4_register_from_deref(struct hlsl_ctx *ctx, struct sm4_register *r
|
||||
|
||||
if (hlsl_sm4_register_from_semantic(ctx, &var->semantic, false, ®->type, swizzle_type, &has_idx))
|
||||
{
|
||||
unsigned int offset = hlsl_offset_from_deref_safe(ctx, deref);
|
||||
|
||||
if (has_idx)
|
||||
{
|
||||
reg->idx[0] = var->semantic.index;
|
||||
@@ -877,11 +879,11 @@ static void sm4_register_from_deref(struct hlsl_ctx *ctx, struct sm4_register *r
|
||||
}
|
||||
|
||||
reg->dim = VKD3D_SM4_DIMENSION_VEC4;
|
||||
*writemask = (1u << data_type->dimx) - 1;
|
||||
*writemask = ((1u << data_type->dimx) - 1) << (offset % 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
struct hlsl_reg hlsl_reg = hlsl_reg_from_deref(ctx, deref, data_type);
|
||||
struct hlsl_reg hlsl_reg = hlsl_reg_from_deref(ctx, deref);
|
||||
|
||||
assert(hlsl_reg.allocated);
|
||||
reg->type = VKD3D_SM4_RT_INPUT;
|
||||
@@ -899,6 +901,8 @@ static void sm4_register_from_deref(struct hlsl_ctx *ctx, struct sm4_register *r
|
||||
|
||||
if (hlsl_sm4_register_from_semantic(ctx, &var->semantic, true, ®->type, swizzle_type, &has_idx))
|
||||
{
|
||||
unsigned int offset = hlsl_offset_from_deref_safe(ctx, deref);
|
||||
|
||||
if (has_idx)
|
||||
{
|
||||
reg->idx[0] = var->semantic.index;
|
||||
@@ -909,11 +913,11 @@ static void sm4_register_from_deref(struct hlsl_ctx *ctx, struct sm4_register *r
|
||||
reg->dim = VKD3D_SM4_DIMENSION_SCALAR;
|
||||
else
|
||||
reg->dim = VKD3D_SM4_DIMENSION_VEC4;
|
||||
*writemask = (1u << data_type->dimx) - 1;
|
||||
*writemask = ((1u << data_type->dimx) - 1) << (offset % 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
struct hlsl_reg hlsl_reg = hlsl_reg_from_deref(ctx, deref, data_type);
|
||||
struct hlsl_reg hlsl_reg = hlsl_reg_from_deref(ctx, deref);
|
||||
|
||||
assert(hlsl_reg.allocated);
|
||||
reg->type = VKD3D_SM4_RT_OUTPUT;
|
||||
@@ -925,7 +929,7 @@ static void sm4_register_from_deref(struct hlsl_ctx *ctx, struct sm4_register *r
|
||||
}
|
||||
else
|
||||
{
|
||||
struct hlsl_reg hlsl_reg = hlsl_reg_from_deref(ctx, deref, data_type);
|
||||
struct hlsl_reg hlsl_reg = hlsl_reg_from_deref(ctx, deref);
|
||||
|
||||
assert(hlsl_reg.allocated);
|
||||
reg->type = VKD3D_SM4_RT_TEMP;
|
||||
|
||||
Reference in New Issue
Block a user