mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d-shader/tpf: Improve readability of compat mapping in sm4_sysval_semantic_from_semantic_name().
This commit is contained in:
Notes:
Henri Verbeet
2025-02-03 16:40:17 +01:00
Approved-by: Henri Verbeet (@hverbeet) Approved-by: Elizabeth Figura (@zfigura) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1362
@@ -3131,7 +3131,7 @@ bool sm4_sysval_semantic_from_semantic_name(enum vkd3d_shader_sysval_semantic *s
|
||||
{"sv_rendertargetarrayindex", true, VKD3D_SHADER_TYPE_VERTEX, VKD3D_SHADER_SV_RENDER_TARGET_ARRAY_INDEX},
|
||||
{"sv_viewportarrayindex", true, VKD3D_SHADER_TYPE_VERTEX, VKD3D_SHADER_SV_VIEWPORT_ARRAY_INDEX},
|
||||
};
|
||||
bool needs_compat_mapping = ascii_strncasecmp(semantic_name, "sv_", 3);
|
||||
bool has_sv_prefix = !ascii_strncasecmp(semantic_name, "sv_", 3);
|
||||
|
||||
if (is_patch_constant_func)
|
||||
{
|
||||
@@ -3173,7 +3173,7 @@ bool sm4_sysval_semantic_from_semantic_name(enum vkd3d_shader_sysval_semantic *s
|
||||
{
|
||||
if (!ascii_strcasecmp(semantic_name, semantics[i].name)
|
||||
&& output == semantics[i].output
|
||||
&& (semantic_compat_mapping == needs_compat_mapping || !needs_compat_mapping)
|
||||
&& (semantic_compat_mapping || has_sv_prefix)
|
||||
&& version->type == semantics[i].shader_type)
|
||||
{
|
||||
*sysval_semantic = semantics[i].semantic;
|
||||
@@ -3181,7 +3181,7 @@ bool sm4_sysval_semantic_from_semantic_name(enum vkd3d_shader_sysval_semantic *s
|
||||
}
|
||||
}
|
||||
|
||||
if (!needs_compat_mapping)
|
||||
if (has_sv_prefix)
|
||||
return false;
|
||||
|
||||
*sysval_semantic = VKD3D_SHADER_SV_NONE;
|
||||
|
Reference in New Issue
Block a user