mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Make single-component swizzles retrieve a scalar.
This commit is contained in:
committed by
Alexandre Julliard
parent
edf86b2248
commit
f33ca836d7
Notes:
Alexandre Julliard
2023-01-26 23:11:28 +01:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/70
@@ -1164,11 +1164,15 @@ struct hlsl_ir_swizzle *hlsl_new_swizzle(struct hlsl_ctx *ctx, DWORD s, unsigned
|
||||
struct hlsl_ir_node *val, const struct vkd3d_shader_location *loc)
|
||||
{
|
||||
struct hlsl_ir_swizzle *swizzle;
|
||||
struct hlsl_type *type;
|
||||
|
||||
if (!(swizzle = hlsl_alloc(ctx, sizeof(*swizzle))))
|
||||
return NULL;
|
||||
init_node(&swizzle->node, HLSL_IR_SWIZZLE,
|
||||
hlsl_get_vector_type(ctx, val->data_type->base_type, components), loc);
|
||||
if (components == 1)
|
||||
type = hlsl_get_scalar_type(ctx, val->data_type->base_type);
|
||||
else
|
||||
type = hlsl_get_vector_type(ctx, val->data_type->base_type, components);
|
||||
init_node(&swizzle->node, HLSL_IR_SWIZZLE, type, loc);
|
||||
hlsl_src_from_node(&swizzle->val, val);
|
||||
swizzle->swizzle = s;
|
||||
return swizzle;
|
||||
|
Reference in New Issue
Block a user