diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index ad48f2a46bb..4e8f9981265 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -3248,8 +3248,16 @@ VkResult anv_CreateDevice( return vk_error(physical_device, VK_ERROR_OUT_OF_HOST_MEMORY); struct vk_device_dispatch_table dispatch_table; + + bool override_initial_entrypoints = true; + if (physical_device->instance->vk.app_info.app_name && + !strcmp(physical_device->instance->vk.app_info.app_name, "HITMAN3.exe")) { + vk_device_dispatch_table_from_entrypoints(&dispatch_table, &hitman3_device_entrypoints, true); + override_initial_entrypoints = false; + } vk_device_dispatch_table_from_entrypoints(&dispatch_table, - anv_genX(&physical_device->info, device_entrypoints), true); + anv_genX(&physical_device->info, device_entrypoints), + override_initial_entrypoints); vk_device_dispatch_table_from_entrypoints(&dispatch_table, &anv_device_entrypoints, false); vk_device_dispatch_table_from_entrypoints(&dispatch_table, diff --git a/src/intel/vulkan/layers/anv_hitman3.c b/src/intel/vulkan/layers/anv_hitman3.c new file mode 100644 index 00000000000..7089752c71e --- /dev/null +++ b/src/intel/vulkan/layers/anv_hitman3.c @@ -0,0 +1,33 @@ +/* + * Copyright © 2022 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "anv_private.h" + +VkResult +hitman3_CreateBufferView(VkDevice _device, + const VkBufferViewCreateInfo *pCreateInfo, + const VkAllocationCallbacks *pAllocator, + VkBufferView *pView) +{ + return anv_CreateBufferView(_device, pCreateInfo, pAllocator, pView); +} diff --git a/src/intel/vulkan/meson.build b/src/intel/vulkan/meson.build index c57e88d1bdb..ec640eaced9 100644 --- a/src/intel/vulkan/meson.build +++ b/src/intel/vulkan/meson.build @@ -38,6 +38,7 @@ anv_entrypoints = custom_target( '--device-prefix', 'gfx11', '--device-prefix', 'gfx12', '--device-prefix', 'gfx125', + '--device-prefix', 'hitman3' ], depend_files : vk_entrypoints_gen_depend_files, ) @@ -127,6 +128,7 @@ foreach g : [['90', ['gfx8_cmd_buffer.c']], endforeach libanv_files = files( + 'layers/anv_hitman3.c', 'anv_acceleration_structure.c', 'anv_allocator.c', 'anv_android.h',