mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-12-15 08:03:30 -08:00
vkd3d-shader/hlsl: Use common hlsl_type_is_integer() and hlsl_base_type_is_integer() helpers.
This commit is contained in:
committed by
Henri Verbeet
parent
bd34ec1fb3
commit
3cf4a4e95e
Notes:
Henri Verbeet
2025-03-06 17:32:40 +01:00
Approved-by: Francisco Casas (@fcasas) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1387
@@ -298,12 +298,9 @@ bool hlsl_type_is_patch_array(const struct hlsl_type *type)
|
||||
|| type->e.array.array_type == HLSL_ARRAY_PATCH_OUTPUT);
|
||||
}
|
||||
|
||||
bool hlsl_type_is_integer(const struct hlsl_type *type)
|
||||
bool hlsl_base_type_is_integer(enum hlsl_base_type type)
|
||||
{
|
||||
if (!hlsl_is_numeric_type(type))
|
||||
return false;
|
||||
|
||||
switch (type->e.numeric.type)
|
||||
switch (type)
|
||||
{
|
||||
case HLSL_TYPE_BOOL:
|
||||
case HLSL_TYPE_INT:
|
||||
@@ -319,6 +316,12 @@ bool hlsl_type_is_integer(const struct hlsl_type *type)
|
||||
vkd3d_unreachable();
|
||||
}
|
||||
|
||||
bool hlsl_type_is_integer(const struct hlsl_type *type)
|
||||
{
|
||||
VKD3D_ASSERT(hlsl_is_numeric_type(type));
|
||||
return hlsl_base_type_is_integer(type->e.numeric.type);
|
||||
}
|
||||
|
||||
bool hlsl_type_is_floating_point(const struct hlsl_type *type)
|
||||
{
|
||||
if (!hlsl_is_numeric_type(type))
|
||||
|
||||
Reference in New Issue
Block a user