mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
vkd3d-shader/hlsl: Calculate the bind count from the vector width.
Scalars have a reg_size of 4 on sm1. In the case of a deref of a vector or matrix resulting in a scalar, however, this yields a required_bind_count that is one higher than it should be. reg_size is the wrong thing to be using here, since it describes the size of a type in isolation, but this is conceptually an embedded type that doesn't include any padding. Since we're only dealing with scalars and vectors here, just use their width.
This commit is contained in:
committed by
Henri Verbeet
parent
8a0e578f64
commit
73c8529e6e
Notes:
Henri Verbeet
2025-11-25 20:41:38 +01:00
Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1843
@@ -6439,8 +6439,9 @@ static void register_deref_usage(struct hlsl_ctx *ctx, const struct hlsl_deref *
|
||||
else if (regset == HLSL_REGSET_NUMERIC)
|
||||
{
|
||||
type = hlsl_deref_get_type(ctx, deref);
|
||||
VKD3D_ASSERT(type->class <= HLSL_CLASS_VECTOR);
|
||||
|
||||
required_bind_count = align(index + type->reg_size[regset], 4) / 4;
|
||||
required_bind_count = align(index + type->e.numeric.dimx, 4) / 4;
|
||||
var->bind_count[regset] = max(var->bind_count[regset], required_bind_count);
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user