vkd3d: Pass down shader quirks for Necromunda.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
This commit is contained in:
parent
cb61a4c83a
commit
28c8a595fa
|
@ -406,7 +406,8 @@ static void vkd3d_init_debug_messenger_callback(struct vkd3d_instance *instance)
|
|||
instance->vk_debug_callback = callback;
|
||||
}
|
||||
|
||||
uint64_t vkd3d_config_flags = 0;
|
||||
uint64_t vkd3d_config_flags;
|
||||
const struct vkd3d_shader_quirk_info *vkd3d_shader_quirk_info;
|
||||
|
||||
struct vkd3d_instance_application_meta
|
||||
{
|
||||
|
@ -421,6 +422,25 @@ static const struct vkd3d_instance_application_meta application_override[] = {
|
|||
{ NULL, 0, 0 }
|
||||
};
|
||||
|
||||
struct vkd3d_shader_quirk_meta
|
||||
{
|
||||
const char *name;
|
||||
const struct vkd3d_shader_quirk_info *info;
|
||||
};
|
||||
|
||||
static const struct vkd3d_shader_quirk_hash necromunda_hashes[] = {
|
||||
{ 0x75dcbd76ee898815ull, VKD3D_SHADER_QUIRK_FORCE_EXPLICIT_LOD_IN_CONTROL_FLOW },
|
||||
};
|
||||
|
||||
static const struct vkd3d_shader_quirk_info necromunda_quirks = {
|
||||
necromunda_hashes, ARRAY_SIZE(necromunda_hashes), 0,
|
||||
};
|
||||
|
||||
static const struct vkd3d_shader_quirk_meta application_shader_quirks[] = {
|
||||
/* Necromunda: Hired Gun (1222370) */
|
||||
{ "Necromunda-Win64-Shipping.exe", &necromunda_quirks },
|
||||
};
|
||||
|
||||
static void vkd3d_instance_apply_application_workarounds(void)
|
||||
{
|
||||
char app[VKD3D_PATH_MAX];
|
||||
|
@ -439,6 +459,16 @@ static void vkd3d_instance_apply_application_workarounds(void)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(application_shader_quirks); i++)
|
||||
{
|
||||
if (application_shader_quirks[i].name && !strcmp(app, application_shader_quirks[i].name))
|
||||
{
|
||||
vkd3d_shader_quirk_info = application_shader_quirks[i].info;
|
||||
INFO("Detected game %s, adding shader quirks for specific shaders.\n", app);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const struct vkd3d_debug_option vkd3d_config_options[] =
|
||||
|
|
|
@ -868,6 +868,7 @@ static HRESULT d3d12_state_object_compile_pipeline(struct d3d12_state_object *ob
|
|||
compile_args.target_extension_count = object->device->vk_info.shader_extension_count;
|
||||
compile_args.target = VKD3D_SHADER_TARGET_SPIRV_VULKAN_1_0;
|
||||
compile_args.config_flags = vkd3d_config_flags;
|
||||
compile_args.quirks = vkd3d_shader_quirk_info;
|
||||
|
||||
/* TODO: Allow different root signatures per module. */
|
||||
memset(&shader_interface_info, 0, sizeof(shader_interface_info));
|
||||
|
|
|
@ -2113,6 +2113,7 @@ static HRESULT vkd3d_create_compute_pipeline(struct d3d12_device *device,
|
|||
compile_args.target_extension_count = device->vk_info.shader_extension_count;
|
||||
compile_args.target = VKD3D_SHADER_TARGET_SPIRV_VULKAN_1_0;
|
||||
compile_args.config_flags = vkd3d_config_flags;
|
||||
compile_args.quirks = vkd3d_shader_quirk_info;
|
||||
|
||||
pipeline_info.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO;
|
||||
pipeline_info.pNext = NULL;
|
||||
|
@ -2975,6 +2976,7 @@ static HRESULT d3d12_pipeline_state_init_graphics(struct d3d12_pipeline_state *s
|
|||
compile_args.target_extension_count = vk_info->shader_extension_count;
|
||||
compile_args.target_extensions = vk_info->shader_extensions;
|
||||
compile_args.config_flags = vkd3d_config_flags;
|
||||
compile_args.quirks = vkd3d_shader_quirk_info;
|
||||
|
||||
/* Options which are exclusive to PS. Especially output swizzles must only be used in PS. */
|
||||
ps_compile_args = compile_args;
|
||||
|
|
|
@ -185,6 +185,7 @@ struct vkd3d_instance
|
|||
};
|
||||
|
||||
extern uint64_t vkd3d_config_flags;
|
||||
extern const struct vkd3d_shader_quirk_info *vkd3d_shader_quirk_info;
|
||||
|
||||
union vkd3d_thread_handle
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue