mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08: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
@@ -5707,18 +5707,12 @@ static void write_sm4_block(const struct tpf_writer *tpf, const struct hlsl_bloc
|
||||
{
|
||||
if (instr->data_type)
|
||||
{
|
||||
if (instr->data_type->class == HLSL_CLASS_MATRIX)
|
||||
if (instr->data_type->class != HLSL_CLASS_SCALAR && instr->data_type->class != HLSL_CLASS_VECTOR)
|
||||
{
|
||||
hlsl_fixme(tpf->ctx, &instr->loc, "Matrix operations need to be lowered.");
|
||||
hlsl_fixme(tpf->ctx, &instr->loc, "Class %#x should have been lowered or removed.",
|
||||
instr->data_type->class);
|
||||
break;
|
||||
}
|
||||
else if (instr->data_type->class == HLSL_CLASS_OBJECT)
|
||||
{
|
||||
hlsl_fixme(tpf->ctx, &instr->loc, "Object copy.");
|
||||
break;
|
||||
}
|
||||
|
||||
assert(instr->data_type->class == HLSL_CLASS_SCALAR || instr->data_type->class == HLSL_CLASS_VECTOR);
|
||||
|
||||
if (!instr->reg.allocated)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user