mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/hlsl: Avoid using HLSL_CLASS_OBJECT without checking the base type.
As the diffstat shows, HLSL_CLASS_OBJECT does not really have much in common. Resource types (TEXTURE, SAMPLER, UAV) sometimes behave similarly to each other, but do not generally behave similarly to effect-specific types (string, shader, state, view). Most consumers of HLSL_CLASS_OBJECT subsequently check the base type anyway. Hence we want to replace HLSL_TYPE_* with individual classes for object types. As a first step, change the last few places that only check HLSL_CLASS_OBJECT.
This commit is contained in:
committed by
Alexandre Julliard
parent
269cdad7b9
commit
0e3377a1be
Notes:
Alexandre Julliard
2024-04-09 15:45:34 -05:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/757
@@ -1565,7 +1565,7 @@ static bool copy_propagation_replace_with_single_instr(struct hlsl_ctx *ctx,
|
||||
var->name, start, start + count, debug_hlsl_swizzle(swizzle, instr_component_count),
|
||||
new_instr, debug_hlsl_swizzle(ret_swizzle, instr_component_count));
|
||||
|
||||
if (instr->data_type->class != HLSL_CLASS_OBJECT)
|
||||
if (new_instr->data_type->class == HLSL_CLASS_SCALAR || new_instr->data_type->class == HLSL_CLASS_VECTOR)
|
||||
{
|
||||
struct hlsl_ir_node *swizzle_node;
|
||||
|
||||
@@ -1742,7 +1742,7 @@ static void copy_propagation_record_store(struct hlsl_ctx *ctx, struct hlsl_ir_s
|
||||
{
|
||||
unsigned int writemask = store->writemask;
|
||||
|
||||
if (store->rhs.node->data_type->class == HLSL_CLASS_OBJECT)
|
||||
if (!hlsl_is_numeric_type(store->rhs.node->data_type))
|
||||
writemask = VKD3DSP_WRITEMASK_0;
|
||||
copy_propagation_set_value(ctx, var_def, start, writemask, store->rhs.node, store->node.index);
|
||||
}
|
||||
|
Reference in New Issue
Block a user