anv: rename layers entrypoints

Prefix everything with anv_ so it doesn't clash with other drivers if
loaded in the same process.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26843>
This commit is contained in:
Lionel Landwerlin
2023-12-29 11:05:48 +02:00
committed by Marge Bot
parent cb0af056bc
commit 82c08c4141
5 changed files with 43 additions and 34 deletions

View File

@@ -3083,17 +3083,23 @@ VkResult anv_CreateDevice(
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);
vk_device_dispatch_table_from_entrypoints(&dispatch_table,
&anv_hitman3_device_entrypoints,
true);
override_initial_entrypoints = false;
}
if (physical_device->info.ver < 12 &&
physical_device->instance->vk.app_info.app_name &&
!strcmp(physical_device->instance->vk.app_info.app_name, "DOOM 64")) {
vk_device_dispatch_table_from_entrypoints(&dispatch_table, &doom64_device_entrypoints, true);
vk_device_dispatch_table_from_entrypoints(&dispatch_table,
&anv_doom64_device_entrypoints,
true);
override_initial_entrypoints = false;
}
#ifdef ANDROID
vk_device_dispatch_table_from_entrypoints(&dispatch_table, &android_device_entrypoints, true);
vk_device_dispatch_table_from_entrypoints(&dispatch_table,
&anv_android_device_entrypoints,
true);
override_initial_entrypoints = false;
#endif
vk_device_dispatch_table_from_entrypoints(&dispatch_table,

View File

@@ -23,11 +23,11 @@
#include "anv_private.h"
VKAPI_ATTR VkResult VKAPI_CALL
android_CreateImageView(VkDevice _device,
const VkImageViewCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkImageView *pView)
VkResult anv_android_CreateImageView(
VkDevice _device,
const VkImageViewCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkImageView* pView)
{
ANV_FROM_HANDLE(anv_device, device, _device);
const struct util_format_description *fmt =

View File

@@ -49,17 +49,17 @@
* so it preserves all compressed information, and this WA is not needed.
*/
VKAPI_ATTR void VKAPI_CALL
doom64_CmdPipelineBarrier(VkCommandBuffer commandBuffer,
VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask,
VkDependencyFlags dependencyFlags,
uint32_t memoryBarrierCount,
const VkMemoryBarrier* pMemoryBarriers,
uint32_t bufferMemoryBarrierCount,
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
uint32_t imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers)
void anv_doom64_CmdPipelineBarrier(
VkCommandBuffer commandBuffer,
VkPipelineStageFlags srcStageMask,
VkPipelineStageFlags dstStageMask,
VkDependencyFlags dependencyFlags,
uint32_t memoryBarrierCount,
const VkMemoryBarrier* pMemoryBarriers,
uint32_t bufferMemoryBarrierCount,
const VkBufferMemoryBarrier* pBufferMemoryBarriers,
uint32_t imageMemoryBarrierCount,
const VkImageMemoryBarrier* pImageMemoryBarriers)
{
ANV_FROM_HANDLE(anv_cmd_buffer, command_buffer, commandBuffer);
assert(command_buffer && command_buffer->device);
@@ -93,9 +93,11 @@ doom64_CmdPipelineBarrier(VkCommandBuffer commandBuffer,
pImageMemoryBarriers);
}
VKAPI_ATTR VkResult VKAPI_CALL
doom64_CreateImage(VkDevice _device, const VkImageCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, VkImage* pImage)
VkResult anv_doom64_CreateImage(
VkDevice _device,
const VkImageCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkImage* pImage)
{
ANV_FROM_HANDLE(anv_device, device, _device);
assert(device);
@@ -111,9 +113,10 @@ doom64_CreateImage(VkDevice _device, const VkImageCreateInfo* pCreateInfo,
return anv_CreateImage(_device, pCreateInfo, pAllocator, pImage);
}
VKAPI_ATTR void VKAPI_CALL
doom64_DestroyImage(VkDevice _device, VkImage _image,
const VkAllocationCallbacks *pAllocator)
void anv_doom64_DestroyImage(
VkDevice _device,
VkImage _image,
const VkAllocationCallbacks* pAllocator)
{
ANV_FROM_HANDLE(anv_device, device, _device);
ANV_FROM_HANDLE(anv_image, image, _image);

View File

@@ -23,11 +23,11 @@
#include "anv_private.h"
VkResult
hitman3_CreateBufferView(VkDevice _device,
const VkBufferViewCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkBufferView *pView)
VkResult anv_hitman3_CreateBufferView(
VkDevice _device,
const VkBufferViewCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkBufferView* pView)
{
ANV_FROM_HANDLE(anv_buffer, buffer, pCreateInfo->buffer);
if (pCreateInfo->format == VK_FORMAT_R32G32B32_SFLOAT &&

View File

@@ -42,9 +42,9 @@ anv_entrypoints = custom_target(
'--device-prefix', 'gfx12',
'--device-prefix', 'gfx125',
'--device-prefix', 'gfx20',
'--device-prefix', 'doom64',
'--device-prefix', 'hitman3',
'--device-prefix', 'android'
'--device-prefix', 'anv_doom64',
'--device-prefix', 'anv_hitman3',
'--device-prefix', 'anv_android',
],
depend_files : vk_entrypoints_gen_depend_files,
)
@@ -145,9 +145,9 @@ libanv_files = files(
'i915/anv_kmd_backend.c',
'i915/anv_queue.c',
'i915/anv_queue.h',
'layers/anv_android_layer.c',
'layers/anv_doom64.c',
'layers/anv_hitman3.c',
'layers/anv_android_layer.c',
'xe/anv_batch_chain.c',
'xe/anv_batch_chain.h',
'xe/anv_kmd_backend.c',