mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/d3dbc: Consider the class in sm1_base_type().
We want the base type to stop being a property of all types, and to stop using the same enumeration for objects and numeric types. The backend should do the work of translation; we want a more sensible and convenient representation for the compiler itself.
This commit is contained in:
parent
a882d60534
commit
285059ef11
Notes:
Alexandre Julliard
2024-04-11 17:04:58 -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/775
@ -1522,6 +1522,11 @@ D3DXPARAMETER_CLASS hlsl_sm1_class(const struct hlsl_type *type)
|
||||
|
||||
D3DXPARAMETER_TYPE hlsl_sm1_base_type(const struct hlsl_type *type)
|
||||
{
|
||||
switch (type->class)
|
||||
{
|
||||
case HLSL_CLASS_SCALAR:
|
||||
case HLSL_CLASS_VECTOR:
|
||||
case HLSL_CLASS_MATRIX:
|
||||
switch (type->base_type)
|
||||
{
|
||||
case HLSL_TYPE_BOOL:
|
||||
@ -1541,6 +1546,13 @@ D3DXPARAMETER_TYPE hlsl_sm1_base_type(const struct hlsl_type *type)
|
||||
case HLSL_TYPE_INT:
|
||||
case HLSL_TYPE_UINT:
|
||||
return D3DXPT_INT;
|
||||
default:
|
||||
vkd3d_unreachable();
|
||||
}
|
||||
|
||||
case HLSL_CLASS_OBJECT:
|
||||
switch (type->base_type)
|
||||
{
|
||||
case HLSL_TYPE_PIXELSHADER:
|
||||
return D3DXPT_PIXELSHADER;
|
||||
case HLSL_TYPE_SAMPLER:
|
||||
@ -1588,6 +1600,16 @@ D3DXPARAMETER_TYPE hlsl_sm1_base_type(const struct hlsl_type *type)
|
||||
default:
|
||||
vkd3d_unreachable();
|
||||
}
|
||||
vkd3d_unreachable();
|
||||
|
||||
case HLSL_CLASS_ARRAY:
|
||||
return hlsl_sm1_base_type(type->e.array.type);
|
||||
|
||||
case HLSL_CLASS_STRUCT:
|
||||
return D3DXPT_VOID;
|
||||
}
|
||||
|
||||
vkd3d_unreachable();
|
||||
}
|
||||
|
||||
static void write_sm1_type(struct vkd3d_bytecode_buffer *buffer, struct hlsl_type *type, unsigned int ctab_start)
|
||||
|
Loading…
x
Reference in New Issue
Block a user