vkd3d-shader: Deduplicate profile version comparison functions.

This commit is contained in:
Giovanni Mascellani
2023-10-30 17:14:26 +01:00
committed by Alexandre Julliard
parent dd96fe50e2
commit 2ba8c5771c
Notes: Alexandre Julliard 2023-11-02 22:49:42 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/432
3 changed files with 20 additions and 25 deletions

View File

@@ -1082,6 +1082,16 @@ struct vkd3d_shader_instruction
} declaration;
};
static inline bool vkd3d_shader_ver_ge(const struct vkd3d_shader_version *v, unsigned int major, unsigned int minor)
{
return v->major > major || (v->major == major && v->minor >= minor);
}
static inline bool vkd3d_shader_ver_le(const struct vkd3d_shader_version *v, unsigned int major, unsigned int minor)
{
return v->major < major || (v->major == major && v->minor <= minor);
}
void vsir_instruction_init(struct vkd3d_shader_instruction *ins, const struct vkd3d_shader_location *location,
enum vkd3d_shader_opcode handler_idx);