mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
vkd3d-shader/tpf: Convert some of the semantic names to system values names when in compatibility mode.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
committed by
Alexandre Julliard
parent
a4ed06bc5b
commit
e242b46922
Notes:
Alexandre Julliard
2023-10-19 23:22:28 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Zebediah Figura (@zfigura) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/381
@@ -2762,20 +2762,21 @@ bool hlsl_sm4_usage_from_semantic(struct hlsl_ctx *ctx, const struct hlsl_semant
|
||||
{"position", true, VKD3D_SHADER_TYPE_VERTEX, D3D_NAME_POSITION},
|
||||
{"sv_position", true, VKD3D_SHADER_TYPE_VERTEX, D3D_NAME_POSITION},
|
||||
};
|
||||
bool needs_compat_mapping = ascii_strncasecmp(semantic->name, "sv_", 3);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(semantics); ++i)
|
||||
{
|
||||
if (!ascii_strcasecmp(semantic->name, semantics[i].name)
|
||||
&& output == semantics[i].output
|
||||
&& ctx->profile->type == semantics[i].shader_type
|
||||
&& !ascii_strncasecmp(semantic->name, "sv_", 3))
|
||||
&& (ctx->semantic_compat_mapping == needs_compat_mapping || !needs_compat_mapping)
|
||||
&& ctx->profile->type == semantics[i].shader_type)
|
||||
{
|
||||
*usage = semantics[i].usage;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ascii_strncasecmp(semantic->name, "sv_", 3))
|
||||
if (!needs_compat_mapping)
|
||||
return false;
|
||||
|
||||
*usage = D3D_NAME_UNDEFINED;
|
||||
|
Reference in New Issue
Block a user