diff --git a/CMakeLists.txt b/CMakeLists.txt index 54acd778..621b2b5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/Modules/AmdCmakeHelper.cmake b/cmake/Modules/AmdCmakeHelper.cmake index 11348767..725f73b8 100644 --- a/cmake/Modules/AmdCmakeHelper.cmake +++ b/cmake/Modules/AmdCmakeHelper.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/Modules/FindAMDBoost.cmake b/cmake/Modules/FindAMDBoost.cmake index 32fa04b5..691ce5a8 100644 --- a/cmake/Modules/FindAMDBoost.cmake +++ b/cmake/Modules/FindAMDBoost.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/Modules/FindAMDNinja.cmake b/cmake/Modules/FindAMDNinja.cmake index 5419f7d4..a2eb30e3 100644 --- a/cmake/Modules/FindAMDNinja.cmake +++ b/cmake/Modules/FindAMDNinja.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/Modules/FindDRM.cmake b/cmake/Modules/FindDRM.cmake index 59f99a5f..4d0d9af9 100644 --- a/cmake/Modules/FindDRM.cmake +++ b/cmake/Modules/FindDRM.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/Modules/FindKernelHeaders.cmake b/cmake/Modules/FindKernelHeaders.cmake index 715db74a..008f4b92 100644 --- a/cmake/Modules/FindKernelHeaders.cmake +++ b/cmake/Modules/FindKernelHeaders.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/Modules/FindXCB.cmake b/cmake/Modules/FindXCB.cmake index 1e50f4a1..66ee4cd2 100644 --- a/cmake/Modules/FindXCB.cmake +++ b/cmake/Modules/FindXCB.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/Modules/XglSetupAmdGlobalRoots.cmake b/cmake/Modules/XglSetupAmdGlobalRoots.cmake index ab410bbc..e9e9056a 100644 --- a/cmake/Modules/XglSetupAmdGlobalRoots.cmake +++ b/cmake/Modules/XglSetupAmdGlobalRoots.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/XglCompileDefinitions.cmake b/cmake/XglCompileDefinitions.cmake index 29a23153..501f5c33 100644 --- a/cmake/XglCompileDefinitions.cmake +++ b/cmake/XglCompileDefinitions.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/XglCompilerOptions.cmake b/cmake/XglCompilerOptions.cmake index 658f6075..c1a28c59 100644 --- a/cmake/XglCompilerOptions.cmake +++ b/cmake/XglCompilerOptions.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/XglHelper.cmake b/cmake/XglHelper.cmake index aaf2b2f5..9151374b 100644 --- a/cmake/XglHelper.cmake +++ b/cmake/XglHelper.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/XglOptions.cmake b/cmake/XglOptions.cmake index 35e40072..fb0db8c3 100644 --- a/cmake/XglOptions.cmake +++ b/cmake/XglOptions.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/XglOverrides.cmake b/cmake/XglOverrides.cmake index 5f703c72..2b8e76a3 100644 --- a/cmake/XglOverrides.cmake +++ b/cmake/XglOverrides.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/cmake/XglPackaging.cmake b/cmake/XglPackaging.cmake index 618f71b2..307d6fbc 100644 --- a/cmake/XglPackaging.cmake +++ b/cmake/XglPackaging.cmake @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/CMakeLists.txt b/icd/CMakeLists.txt index 01f78773..e306a570 100644 --- a/icd/CMakeLists.txt +++ b/icd/CMakeLists.txt @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -87,6 +87,7 @@ target_sources(xgl PRIVATE api/app_resource_optimizer.cpp api/app_shader_optimizer.cpp api/barrier_policy.cpp + api/cmd_buffer_ring.cpp api/color_space_helper.cpp api/compiler_solution.cpp api/internal_mem_mgr.cpp diff --git a/icd/api/app_profile.cpp b/icd/api/app_profile.cpp index 4b55bc25..e95a2bec 100644 --- a/icd/api/app_profile.cpp +++ b/icd/api/app_profile.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/app_resource_optimizer.cpp b/icd/api/app_resource_optimizer.cpp index 2572f84b..d18b92c0 100644 --- a/icd/api/app_resource_optimizer.cpp +++ b/icd/api/app_resource_optimizer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/app_shader_optimizer.cpp b/icd/api/app_shader_optimizer.cpp index 185b9427..fc9e1f8a 100644 --- a/icd/api/app_shader_optimizer.cpp +++ b/icd/api/app_shader_optimizer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/appopt/barrier_filter_layer.cpp b/icd/api/appopt/barrier_filter_layer.cpp index 4c2947b3..40bbc25f 100644 --- a/icd/api/appopt/barrier_filter_layer.cpp +++ b/icd/api/appopt/barrier_filter_layer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/appopt/barrier_filter_layer.h b/icd/api/appopt/barrier_filter_layer.h index 7a8e3fde..13c0185f 100644 --- a/icd/api/appopt/barrier_filter_layer.h +++ b/icd/api/appopt/barrier_filter_layer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/appopt/gpu_decode_layer.cpp b/icd/api/appopt/gpu_decode_layer.cpp index 7aac2cbb..35176f6c 100644 --- a/icd/api/appopt/gpu_decode_layer.cpp +++ b/icd/api/appopt/gpu_decode_layer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -186,6 +186,23 @@ namespace GpuTexDecoder return result == VK_SUCCESS ? Pal::Result::Success : Pal::Result::ErrorUnknown; } + + void ClientDestroyInternalComputePipeline( + const DeviceInitInfo& initInfo, + Pal::IPipeline* pPipeline, + void* pMemory) + { + vk::Device* pDevice = reinterpret_cast(initInfo.pClientUserData); + + if (pMemory == nullptr) + { + pMemory = pPipeline; + } + + pPipeline->Destroy(); + pPipeline = nullptr; + pDevice->VkInstance()->FreeMem(pMemory); + } } namespace vk @@ -203,7 +220,7 @@ GpuDecoderLayer::~GpuDecoderLayer() { if(m_pGpuTexDecoder != nullptr) { - m_pDevice->VkInstance()->FreeMem(m_pGpuTexDecoder); + Util::Destructor(m_pGpuTexDecoder); m_pGpuTexDecoder = nullptr; } } diff --git a/icd/api/appopt/gpu_decode_layer.h b/icd/api/appopt/gpu_decode_layer.h index 71041ab4..d9aa15bb 100644 --- a/icd/api/appopt/gpu_decode_layer.h +++ b/icd/api/appopt/gpu_decode_layer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/appopt/opt_layer.h b/icd/api/appopt/opt_layer.h index db91a44c..e561c42d 100644 --- a/icd/api/appopt/opt_layer.h +++ b/icd/api/appopt/opt_layer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/appopt/strange_brigade_layer.cpp b/icd/api/appopt/strange_brigade_layer.cpp index 8b06deca..30213f93 100644 --- a/icd/api/appopt/strange_brigade_layer.cpp +++ b/icd/api/appopt/strange_brigade_layer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/appopt/strange_brigade_layer.h b/icd/api/appopt/strange_brigade_layer.h index 864571cc..0ee16aeb 100644 --- a/icd/api/appopt/strange_brigade_layer.h +++ b/icd/api/appopt/strange_brigade_layer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/barrier_policy.cpp b/icd/api/barrier_policy.cpp index 3e54c63e..0d89f3e7 100644 --- a/icd/api/barrier_policy.cpp +++ b/icd/api/barrier_policy.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -907,7 +907,6 @@ void ImageBarrierPolicy::InitImageLayoutUsagePolicy( } // We don't do anything special in case of transient attachment images - VK_IGNORE(VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT); } // ===================================================================================================================== @@ -1031,9 +1030,6 @@ void ImageBarrierPolicy::InitImageCachePolicy( supportedInputCacheMask |= Pal::CoherDepthStencilTarget | Pal::CoherClear; } - // We don't do anything special in case of transient attachment images - VK_IGNORE(VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT); - // Apply device specific supported cache masks to limit the scope. supportedOutputCacheMask &= pDevice->GetBarrierPolicy().GetSupportedOutputCacheMask(); supportedInputCacheMask &= pDevice->GetBarrierPolicy().GetSupportedInputCacheMask(); @@ -1328,8 +1324,7 @@ void BufferBarrierPolicy::InitBufferCachePolicy( supportedOutputCacheMask |= Pal::CoherStreamOut; } - // Nothing to do since Pal::CoherMemory is already set - VK_IGNORE(usage & VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT); + // Nothing to do for VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT since Pal::CoherMemory is already set // Apply device specific supported cache masks to limit the scope. supportedOutputCacheMask &= pDevice->GetBarrierPolicy().GetSupportedOutputCacheMask(); diff --git a/icd/api/binary_cache_serialization.cpp b/icd/api/binary_cache_serialization.cpp index 444e8189..3586a8d3 100644 --- a/icd/api/binary_cache_serialization.cpp +++ b/icd/api/binary_cache_serialization.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/cache_adapter.cpp b/icd/api/cache_adapter.cpp index 2bd0e1ae..6035cca6 100644 --- a/icd/api/cache_adapter.cpp +++ b/icd/api/cache_adapter.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/cmd_buffer_ring.cpp b/icd/api/cmd_buffer_ring.cpp new file mode 100644 index 00000000..25f19549 --- /dev/null +++ b/icd/api/cmd_buffer_ring.cpp @@ -0,0 +1,305 @@ +/* + *********************************************************************************************************************** + * + * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. + * + * 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 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. + * + **********************************************************************************************************************/ +/** + *********************************************************************************************************************** + * @file cmd_buffer_ring.cpp + * @brief Contains implementation of the CmdBufferRing + *********************************************************************************************************************** + */ + +#include "include/cmd_buffer_ring.h" +#include "include/vk_device.h" +#include "include/vk_queue.h" + +#include "palDequeImpl.h" + +namespace vk +{ + +// ===================================================================================================================== +CmdBufferRing::CmdBufferRing( + CmdBufferDequeue* pCmdBufferRings[], + Pal::EngineType engineType, + Pal::QueueType queueType) + : + m_engineType(engineType), + m_queueType(queueType) +{ + for (uint32 deviceIdx = 0; deviceIdx < MaxPalDevices; ++deviceIdx) + { + m_pCmdBufferRings[deviceIdx] = pCmdBufferRings[deviceIdx]; + } +} + +// ===================================================================================================================== +CmdBufferRing* CmdBufferRing::Create( + const Device* pDevice, + Pal::EngineType engineType, + Pal::QueueType queueType) +{ + void* pMemory = pDevice->VkInstance()->AllocMem((sizeof(CmdBufferRing) + + (sizeof(CmdBufferDequeue) * pDevice->NumPalDevices())), + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + + if (pMemory != nullptr) + { + CmdBufferDequeue* pCmdBufferDequeues[MaxPalDevices] = {}; + + for (uint32 deviceIdx = 0; deviceIdx < pDevice->NumPalDevices(); ++deviceIdx) + { + pCmdBufferDequeues[deviceIdx] = VK_PLACEMENT_NEW(Util::VoidPtrInc(pMemory, + (sizeof(CmdBufferRing) + + sizeof(CmdBufferDequeue) * deviceIdx))) + CmdBufferDequeue(pDevice->VkInstance()->Allocator()); + } + + VK_PLACEMENT_NEW(pMemory) CmdBufferRing(pCmdBufferDequeues, engineType, queueType); + } + + return static_cast(pMemory); +} + +// ===================================================================================================================== +// Destroys a ring buffer and frees any memory associated with it +void CmdBufferRing::Destroy( + const Device* pDevice) +{ + // Destroy the command buffer rings + for (uint32 deviceIdx = 0; deviceIdx < pDevice->NumPalDevices(); ++deviceIdx) + { + if (m_pCmdBufferRings[deviceIdx] != nullptr) + { + while (m_pCmdBufferRings[deviceIdx]->NumElements() > 0) + { + CmdBufState* pCmdBufState = nullptr; + m_pCmdBufferRings[deviceIdx]->PopFront(&pCmdBufState); + DestroyCmdBufState(pDevice, deviceIdx, pCmdBufState); + } + + Util::Destructor(m_pCmdBufferRings[deviceIdx]); + } + } + + this->~CmdBufferRing(); + pDevice->VkInstance()->FreeMem(this); +} + +// ===================================================================================================================== +// Initializes the command buffer state +CmdBufState* CmdBufferRing::CreateCmdBufState( + const Device* pDevice, + uint32 deviceIdx) +{ + CmdBufState* pCmdBufState = nullptr; + + Pal::IDevice* pPalDevice = pDevice->PalDevice(deviceIdx); + + Pal::CmdBufferCreateInfo cmdBufInfo = {}; + + cmdBufInfo.queueType = m_queueType; + cmdBufInfo.engineType = m_engineType; + cmdBufInfo.pCmdAllocator = pDevice->GetSharedCmdAllocator(deviceIdx); + + Pal::FenceCreateInfo fenceInfo = {}; + + size_t cmdBufSize = 0; + size_t fenceSize = 0; + + Pal::Result result; + + cmdBufSize = pPalDevice->GetCmdBufferSize(cmdBufInfo, &result); + + if (result == Pal::Result::Success) + { + fenceSize = pPalDevice->GetFenceSize(&result); + } + + size_t totalSize = sizeof(CmdBufState) + cmdBufSize + fenceSize; + + void* pStorage = nullptr; + + if (result == Pal::Result::Success) + { + pStorage = pDevice->VkInstance()->AllocMem(totalSize, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + } + + if (pStorage != nullptr) + { + pCmdBufState = static_cast(pStorage); + pStorage = Util::VoidPtrInc(pStorage, sizeof(CmdBufState)); + + void* pCmdBufStorage = pStorage; + pStorage = Util::VoidPtrInc(pStorage, cmdBufSize); + + void* pFenceStorage = pStorage; + pStorage = Util::VoidPtrInc(pStorage, fenceSize); + + if (result == Pal::Result::Success) + { + result = pPalDevice->CreateCmdBuffer(cmdBufInfo, pCmdBufStorage, &pCmdBufState->pCmdBuf); + } + + if (result == Pal::Result::Success) + { + result = pPalDevice->CreateFence(fenceInfo, pFenceStorage, &pCmdBufState->pFence); + } + + VK_ASSERT(Util::VoidPtrInc(pCmdBufState, totalSize) == pStorage); + + if (result != Pal::Result::Success) + { + DestroyCmdBufState(pDevice, deviceIdx, pCmdBufState); + pCmdBufState = nullptr; + } + } + + return pCmdBufState; +} + +// ===================================================================================================================== +// Destroys a command buffer state and frees any memory associated with it +void CmdBufferRing::DestroyCmdBufState( + const Device* pDevice, + uint32 deviceIdx, + CmdBufState* pCmdBufState) +{ + // Wait to finish in case still in flight + if (pCmdBufState->pFence->GetStatus() == Pal::Result::NotReady) + { + pDevice->PalDevice(deviceIdx)->WaitForFences(1, &pCmdBufState->pFence, true, ~0ULL); + } + + // Destroy Fence + if (pCmdBufState->pFence != nullptr) + { + pCmdBufState->pFence->Destroy(); + } + + // Destroy CmdBuf + if (pCmdBufState->pCmdBuf != nullptr) + { + pCmdBufState->pCmdBuf->Destroy(); + } + + // Free all system memory + pDevice->VkInstance()->FreeMem(pCmdBufState); +} + +// ===================================================================================================================== +// Gets a new command buffer from a ring buffer, the cmd of which can be redefined with new command data +CmdBufState* CmdBufferRing::AcquireCmdBuffer( + const Device* pDevice, + uint32 deviceIdx) +{ + CmdBufState* pCmdBufState = nullptr; + + if (m_pCmdBufferRings[deviceIdx] != nullptr) + { + // Create a new command buffer if the least recently used one is still busy. + if ((m_pCmdBufferRings[deviceIdx]->NumElements() == 0) || + (m_pCmdBufferRings[deviceIdx]->Front()->pFence->GetStatus() == Pal::Result::NotReady)) + { + pCmdBufState = CreateCmdBufState(pDevice, deviceIdx); + } + else + { + m_pCmdBufferRings[deviceIdx]->PopFront(&pCmdBufState); + } + + // Immediately push this command buffer onto the back of the deque to avoid leaking memory. + if (pCmdBufState != nullptr) + { + Pal::Result result = m_pCmdBufferRings[deviceIdx]->PushBack(pCmdBufState); + + if (result != Pal::Result::Success) + { + // We failed to push this command buffer onto the deque. To avoid leaking memory we must delete it. + DestroyCmdBufState(pDevice, deviceIdx, pCmdBufState); + pCmdBufState = nullptr; + } + else + { + Pal::CmdBufferBuildInfo buildInfo = {}; + + buildInfo.flags.optimizeOneTimeSubmit = 1; + + result = pCmdBufState->pCmdBuf->Reset(pDevice->GetSharedCmdAllocator(deviceIdx), true); + + if (result == Pal::Result::Success) + { + result = pCmdBufState->pCmdBuf->Begin(buildInfo); + } + + if (result != Pal::Result::Success) + { + pCmdBufState = nullptr; + } + } + } + } + + return pCmdBufState; +} + +// ===================================================================================================================== +// Submit commands to the provided queue +VkResult CmdBufferRing::SubmitCmdBuffer( + const Device* pDevice, + uint32 deviceIdx, + Pal::IQueue* pPalQueue, + const Pal::CmdBufInfo& cmdBufInfo, + CmdBufState* pCmdBufState) +{ + Pal::Result result = pCmdBufState->pCmdBuf->End(); + + if (result == Pal::Result::Success) + { + result = pDevice->PalDevice(deviceIdx)->ResetFences(1, &pCmdBufState->pFence); + + // Submit the command buffer + if (result == Pal::Result::Success) + { + Pal::PerSubQueueSubmitInfo perSubQueueInfo = {}; + perSubQueueInfo.cmdBufferCount = 1; + perSubQueueInfo.ppCmdBuffers = &pCmdBufState->pCmdBuf; + perSubQueueInfo.pCmdBufInfoList = &cmdBufInfo; + + Pal::SubmitInfo palSubmitInfo = {}; + + VK_ASSERT(cmdBufInfo.isValid == 1); + + palSubmitInfo.pPerSubQueueInfo = &perSubQueueInfo; + palSubmitInfo.perSubQueueInfoCount = 1; + palSubmitInfo.ppFences = &pCmdBufState->pFence; + palSubmitInfo.fenceCount = 1; + + result = pPalQueue->Submit(palSubmitInfo); + } + } + + return PalToVkResult(result); +} + +} //namespace vk diff --git a/icd/api/color_space_helper.cpp b/icd/api/color_space_helper.cpp index 4ce30afc..206d3839 100644 --- a/icd/api/color_space_helper.cpp +++ b/icd/api/color_space_helper.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/compiler_solution.cpp b/icd/api/compiler_solution.cpp index 59a18b1f..8a7f1bea 100644 --- a/icd/api/compiler_solution.cpp +++ b/icd/api/compiler_solution.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/compiler_solution_llpc.cpp b/icd/api/compiler_solution_llpc.cpp index ba6b99e1..3dd5d9e1 100644 --- a/icd/api/compiler_solution_llpc.cpp +++ b/icd/api/compiler_solution_llpc.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -107,8 +107,6 @@ VkResult CompilerSolutionLlpc::CreateShaderCache( void* pShaderCacheMem, ShaderCache* pShaderCache) { - VK_IGNORE(pShaderCacheMem); - return VK_ERROR_INITIALIZATION_FAILED; } @@ -122,8 +120,6 @@ VkResult CompilerSolutionLlpc::BuildShaderModule( ShaderModuleHandle* pShaderModule, const Util::MetroHash::Hash& hash) { - VK_IGNORE(pDevice); - VK_IGNORE(hash); VkResult result = VK_SUCCESS; auto pInstance = m_pPhysicalDevice->Manager()->VkInstance(); @@ -189,9 +185,6 @@ VkResult CompilerSolutionLlpc::CreateGraphicsPipelineBinary( Util::MetroHash::Hash* pCacheId, int64_t* pCompileTime) { - VK_IGNORE(pDevice); - VK_IGNORE(pipelineHash); - VK_IGNORE(pCacheId); const RuntimeSettings& settings = m_pPhysicalDevice->GetRuntimeSettings(); auto pInstance = m_pPhysicalDevice->Manager()->VkInstance(); @@ -314,10 +307,6 @@ VkResult CompilerSolutionLlpc::CreateComputePipelineBinary( Util::MetroHash::Hash* pCacheId, int64_t* pCompileTime) { - VK_IGNORE(pDevice); - VK_IGNORE(pipelineHash); - VK_IGNORE(pCacheId); - const RuntimeSettings& settings = m_pPhysicalDevice->GetRuntimeSettings(); auto pInstance = m_pPhysicalDevice->Manager()->VkInstance(); AppProfile appProfile = m_pPhysicalDevice->GetAppProfile(); @@ -431,7 +420,6 @@ void CompilerSolutionLlpc::FreeGraphicsPipelineBinary( const void* pPipelineBinary, size_t binarySize) { - VK_IGNORE(binarySize); m_pPhysicalDevice->Manager()->VkInstance()->FreeMem(const_cast(pPipelineBinary)); } @@ -440,7 +428,6 @@ void CompilerSolutionLlpc::FreeComputePipelineBinary( const void* pPipelineBinary, size_t binarySize) { - VK_IGNORE(binarySize); m_pPhysicalDevice->Manager()->VkInstance()->FreeMem(const_cast(pPipelineBinary)); } diff --git a/icd/api/devmode/devmode_mgr.cpp b/icd/api/devmode/devmode_mgr.cpp index 6c12c685..67d333f8 100644 --- a/icd/api/devmode/devmode_mgr.cpp +++ b/icd/api/devmode/devmode_mgr.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2016-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/devmode/devmode_mgr.h b/icd/api/devmode/devmode_mgr.h index 2b2b19f8..1b8ff76a 100644 --- a/icd/api/devmode/devmode_mgr.h +++ b/icd/api/devmode/devmode_mgr.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2016-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/graphics_pipeline_common.cpp b/icd/api/graphics_pipeline_common.cpp index b278f24b..2417e9c7 100644 --- a/icd/api/graphics_pipeline_common.cpp +++ b/icd/api/graphics_pipeline_common.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -558,7 +558,6 @@ static void BuildRasterizationState( VK_CONSERVATIVE_RASTERIZATION_MODE_BEGIN_RANGE_EXT); VK_ASSERT(pRsConservative->conservativeRasterizationMode <= VK_CONSERVATIVE_RASTERIZATION_MODE_END_RANGE_EXT); - VK_IGNORE(pRsConservative->extraPrimitiveOverestimationSize); switch (pRsConservative->conservativeRasterizationMode) { @@ -650,24 +649,6 @@ static void BuildRasterizationState( pNext = pHeader->pNext; } -#if PAL_CLIENT_INTERFACE_MAJOR_VERSION < 693 - // For optimal performance, depth clamping should be enabled by default. Only disable it if dealing - // with depth values outside of [0.0, 1.0] range. - // Note that this is the opposite of the default Vulkan setting which is depthClampEnable = false. - if ((pRs->depthClampEnable == VK_FALSE) && - (pDevice->IsExtensionEnabled(DeviceExtensions::EXT_DEPTH_RANGE_UNRESTRICTED) || - ((pInfo->pipeline.viewportInfo.depthClipNearEnable == false) && - (pInfo->pipeline.viewportInfo.depthClipFarEnable == false)))) - { - pInfo->pipeline.rsState.depthClampDisable = true; - } - else - { - // When depth clamping is enabled, depth clipping should be disabled, and vice versa. - // Clipping is updated in pipeline compiler. - pInfo->pipeline.rsState.depthClampDisable = false; - } -#else if (pRs->depthClampEnable == VK_FALSE) { // For optimal performance, depth clamping should be enabled by default, even if API says otherwise. @@ -690,7 +671,6 @@ static void BuildRasterizationState( // Clipping is updated in pipeline compiler. pInfo->pipeline.rsState.depthClampMode = Pal::DepthClampMode::Viewport; } -#endif pInfo->pipeline.rsState.pointCoordOrigin = Pal::PointOrigin::UpperLeft; pInfo->pipeline.rsState.shadeMode = Pal::ShadeMode::Flat; diff --git a/icd/api/icd_main.cpp b/icd/api/icd_main.cpp index 0e30aeb8..567280c3 100644 --- a/icd/api/icd_main.cpp +++ b/icd/api/icd_main.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/app_profile.h b/icd/api/include/app_profile.h index 1ba17c63..2454b72a 100644 --- a/icd/api/include/app_profile.h +++ b/icd/api/include/app_profile.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/app_resource_optimizer.h b/icd/api/include/app_resource_optimizer.h index 1611f70e..e444b5f8 100644 --- a/icd/api/include/app_resource_optimizer.h +++ b/icd/api/include/app_resource_optimizer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/app_shader_optimizer.h b/icd/api/include/app_shader_optimizer.h index bb4e5e5a..13eda566 100644 --- a/icd/api/include/app_shader_optimizer.h +++ b/icd/api/include/app_shader_optimizer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/barrier_policy.h b/icd/api/include/barrier_policy.h index 4d02d270..d153dd2e 100644 --- a/icd/api/include/barrier_policy.h +++ b/icd/api/include/barrier_policy.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/binary_cache_serialization.h b/icd/api/include/binary_cache_serialization.h index 3d46b40c..43e84131 100644 --- a/icd/api/include/binary_cache_serialization.h +++ b/icd/api/include/binary_cache_serialization.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/cache_adapter.h b/icd/api/include/cache_adapter.h index 5059b31a..27750bcf 100644 --- a/icd/api/include/cache_adapter.h +++ b/icd/api/include/cache_adapter.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/cmd_buffer_ring.h b/icd/api/include/cmd_buffer_ring.h new file mode 100644 index 00000000..2018e613 --- /dev/null +++ b/icd/api/include/cmd_buffer_ring.h @@ -0,0 +1,111 @@ +/* + *********************************************************************************************************************** + * + * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. + * + * 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 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. + * + **********************************************************************************************************************/ +/** + ************************************************************************************************** + * @file cmd_buffer_ring.h + * @brief Utility class for managing a ring of command buffers + ************************************************************************************************** + */ + +#ifndef __CMD_BUFFER_RING_H__ +#define __CMD_BUFFER_RING_H__ + +#include "include/khronos/vulkan.h" +#include "include/vk_alloccb.h" +#include "include/vk_utils.h" +#include "settings/settings.h" + +#include "palCmdBuffer.h" +#include "palDeque.h" + +#pragma once + +namespace vk +{ + +class Device; + +// ===================================================================================================================== +// State of a command buffer managed by the CmdBufferRing +struct CmdBufState +{ + Pal::ICmdBuffer* pCmdBuf; // Command buffer pointer + Pal::IFence* pFence; // Fence that will be signaled when this fence's submit completes +}; + +// ===================================================================================================================== +// Managed ring of command buffers to be acquired and submitted in FIFO order. +class CmdBufferRing +{ +public: + static CmdBufferRing* Create( + const Device* pDevice, + Pal::EngineType engineType, + Pal::QueueType queueType); + + void Destroy( + const Device* pDevice); + + CmdBufState* AcquireCmdBuffer( + const Device* pDevice, + uint32 deviceIdx); + + VkResult SubmitCmdBuffer( + const Device* pDevice, + uint32 deviceIdx, + Pal::IQueue* pPalQueue, + const Pal::CmdBufInfo& cmdBufInfo, + CmdBufState* pCmdBufState); + +protected: + CmdBufState* CreateCmdBufState( + const Device* pDevice, + uint32 deviceIdx); + + void DestroyCmdBufState( + const Device* pDevice, + uint32 deviceIdx, + CmdBufState* pCmdBufState); + + typedef Util::Deque CmdBufferDequeue; + + CmdBufferRing( + CmdBufferDequeue* pCmdBufferRings[], + Pal::EngineType engineType, + Pal::QueueType queueType); + + ~CmdBufferRing() {} + + CmdBufferDequeue* m_pCmdBufferRings[MaxPalDevices]; + Pal::EngineType m_engineType; + Pal::QueueType m_queueType; + +private: + PAL_DISALLOW_COPY_AND_ASSIGN(CmdBufferRing); +}; + +} //namespace vk + +#endif /* __CMD_BUFFER_RING_H__ */ diff --git a/icd/api/include/color_space_helper.h b/icd/api/include/color_space_helper.h index 57f050c0..72d0b0f5 100644 --- a/icd/api/include/color_space_helper.h +++ b/icd/api/include/color_space_helper.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/compiler_solution.h b/icd/api/include/compiler_solution.h index bda77b5f..23ca864e 100644 --- a/icd/api/include/compiler_solution.h +++ b/icd/api/include/compiler_solution.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -76,10 +76,7 @@ struct PipelineCreationFeedback // Represents pipeline metadata included in the pipeline ELF. struct PipelineMetadata { - bool reservedForFutureHw1; - bool reservedForFutureHw2; - uint16_t reservedForFutureHw3; - uint16_t reservedForFutureHw4; + bool pointSizeUsed; }; // ===================================================================================================================== @@ -97,6 +94,7 @@ struct GraphicsPipelineBinaryCreateInfo PipelineCreationFeedback pipelineFeedback; PipelineCreationFeedback stageFeedback[ShaderStage::ShaderStageGfxCount]; uint32_t rasterizationStream; + PipelineMetadata pipelineMetadata; }; // ===================================================================================================================== diff --git a/icd/api/include/compiler_solution_llpc.h b/icd/api/include/compiler_solution_llpc.h index 90f054bf..040e671e 100644 --- a/icd/api/include/compiler_solution_llpc.h +++ b/icd/api/include/compiler_solution_llpc.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/defer_compile_thread.h b/icd/api/include/defer_compile_thread.h index 95924d06..e6e64fd0 100644 --- a/icd/api/include/defer_compile_thread.h +++ b/icd/api/include/defer_compile_thread.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/graphics_pipeline_common.h b/icd/api/include/graphics_pipeline_common.h index 9f3fc11a..a9615b37 100644 --- a/icd/api/include/graphics_pipeline_common.h +++ b/icd/api/include/graphics_pipeline_common.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/internal_layer_hooks.h b/icd/api/include/internal_layer_hooks.h index 6d107ab1..2f671cda 100644 --- a/icd/api/include/internal_layer_hooks.h +++ b/icd/api/include/internal_layer_hooks.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/internal_mem_mgr.h b/icd/api/include/internal_mem_mgr.h index 4965d04d..7c35ec67 100644 --- a/icd/api/include/internal_mem_mgr.h +++ b/icd/api/include/internal_mem_mgr.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/devext/vk_amd_gpa_interface.h b/icd/api/include/khronos/devext/vk_amd_gpa_interface.h index d0c03632..b628602a 100644 --- a/icd/api/include/khronos/devext/vk_amd_gpa_interface.h +++ b/icd/api/include/khronos/devext/vk_amd_gpa_interface.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/devext/vk_internal_ext_helper.h b/icd/api/include/khronos/devext/vk_internal_ext_helper.h index 64b07c10..1b169b1e 100644 --- a/icd/api/include/khronos/devext/vk_internal_ext_helper.h +++ b/icd/api/include/khronos/devext/vk_internal_ext_helper.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_icd.h b/icd/api/include/khronos/vk_icd.h index 9b4519ea..fc0ae9e2 100644 --- a/icd/api/include/khronos/vk_icd.h +++ b/icd/api/include/khronos/vk_icd.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2016-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2016-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_layer.h b/icd/api/include/khronos/vk_layer.h index 75f1b678..e369f98b 100644 --- a/icd/api/include/khronos/vk_layer.h +++ b/icd/api/include/khronos/vk_layer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_platform.h b/icd/api/include/khronos/vk_platform.h index d704e5fa..263f74df 100644 --- a/icd/api/include/khronos/vk_platform.h +++ b/icd/api/include/khronos/vk_platform.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std.h b/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std.h index f2289993..ca953d7b 100644 --- a/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std.h +++ b/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std_decode.h b/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std_decode.h index 95bcedf8..5e780c49 100644 --- a/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std_decode.h +++ b/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std_decode.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std_encode.h b/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std_encode.h index c1c185ea..d72eab67 100644 --- a/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std_encode.h +++ b/icd/api/include/khronos/vk_video/vulkan_video_codec_h264std_encode.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std.h b/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std.h index e9b20eee..f9cd4944 100644 --- a/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std.h +++ b/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std_decode.h b/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std_decode.h index abbc5dc5..38b58a2d 100644 --- a/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std_decode.h +++ b/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std_decode.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std_encode.h b/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std_encode.h index 78a3c662..c4ff54c8 100644 --- a/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std_encode.h +++ b/icd/api/include/khronos/vk_video/vulkan_video_codec_h265std_encode.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vk_video/vulkan_video_codecs_common.h b/icd/api/include/khronos/vk_video/vulkan_video_codecs_common.h index b884c16f..107098a7 100644 --- a/icd/api/include/khronos/vk_video/vulkan_video_codecs_common.h +++ b/icd/api/include/khronos/vk_video/vulkan_video_codecs_common.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/khronos/vulkan.h b/icd/api/include/khronos/vulkan.h index 8d183afa..3cfdd175 100644 --- a/icd/api/include/khronos/vulkan.h +++ b/icd/api/include/khronos/vulkan.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/log.h b/icd/api/include/log.h index 04fd1812..9fe13387 100644 --- a/icd/api/include/log.h +++ b/icd/api/include/log.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/pipeline_binary_cache.h b/icd/api/include/pipeline_binary_cache.h index 30211ee6..dfd08c69 100644 --- a/icd/api/include/pipeline_binary_cache.h +++ b/icd/api/include/pipeline_binary_cache.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/pipeline_compiler.h b/icd/api/include/pipeline_compiler.h index 9707743e..5024bf52 100644 --- a/icd/api/include/pipeline_compiler.h +++ b/icd/api/include/pipeline_compiler.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/render_state_cache.h b/icd/api/include/render_state_cache.h index 0c313bc0..2c9535fb 100644 --- a/icd/api/include/render_state_cache.h +++ b/icd/api/include/render_state_cache.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/shader_cache.h b/icd/api/include/shader_cache.h index a387078b..3730d96b 100644 --- a/icd/api/include/shader_cache.h +++ b/icd/api/include/shader_cache.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/virtual_stack_mgr.h b/icd/api/include/virtual_stack_mgr.h index 9b032fba..a5a50b6f 100644 --- a/icd/api/include/virtual_stack_mgr.h +++ b/icd/api/include/virtual_stack_mgr.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_alloccb.h b/icd/api/include/vk_alloccb.h index 83a8259e..59c2b6f6 100644 --- a/icd/api/include/vk_alloccb.h +++ b/icd/api/include/vk_alloccb.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_buffer.h b/icd/api/include/vk_buffer.h index 8c730c3c..bdc46964 100644 --- a/icd/api/include/vk_buffer.h +++ b/icd/api/include/vk_buffer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_buffer_view.h b/icd/api/include/vk_buffer_view.h index aaff8fdf..13ed8be7 100644 --- a/icd/api/include/vk_buffer_view.h +++ b/icd/api/include/vk_buffer_view.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_cmd_pool.h b/icd/api/include/vk_cmd_pool.h index 489df175..d01c9255 100644 --- a/icd/api/include/vk_cmd_pool.h +++ b/icd/api/include/vk_cmd_pool.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_cmdbuffer.h b/icd/api/include/vk_cmdbuffer.h index 877c8fb6..6450796b 100644 --- a/icd/api/include/vk_cmdbuffer.h +++ b/icd/api/include/vk_cmdbuffer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -1242,6 +1242,13 @@ class CmdBuffer Pal::PipelineBindPoint* pPalBindPoint, PipelineBindPoint* pApiBind); + void PushConstantsIssueWrites( + const PipelineLayout* pLayout, + VkShaderStageFlags stageFlags, + uint32_t startInDwords, + uint32_t lengthInDwords, + const uint32_t* const pInputValues); + void WritePushConstants( PipelineBindPoint apiBindPoint, Pal::PipelineBindPoint palBindPoint, diff --git a/icd/api/include/vk_compute_pipeline.h b/icd/api/include/vk_compute_pipeline.h index 15427caa..0d7244f8 100644 --- a/icd/api/include/vk_compute_pipeline.h +++ b/icd/api/include/vk_compute_pipeline.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_conv.h b/icd/api/include/vk_conv.h index bc7cd741..51fef0f4 100644 --- a/icd/api/include/vk_conv.h +++ b/icd/api/include/vk_conv.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -2512,22 +2512,19 @@ inline VkCompositeAlphaFlagsKHR PalToVkSupportedCompositeAlphaMode(uint32 compos inline uint32_t VkToPalImageCreateFlags(VkImageCreateFlags imageCreateFlags, VkFormat format) { - Pal::ImageCreateInfo palImageCreateInfo; - palImageCreateInfo.flags.u32All = 0; + Pal::ImageCreateFlags flags = {}; + + flags.cubemap = (imageCreateFlags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) ? 1 : 0; + flags.prt = (imageCreateFlags & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) ? 1 : 0; + flags.invariant = (imageCreateFlags & VK_IMAGE_CREATE_ALIAS_BIT) ? 1 : 0; + flags.tmzProtected = (imageCreateFlags & VK_IMAGE_CREATE_PROTECTED_BIT) ? 1 : 0; - palImageCreateInfo.flags.cubemap = (imageCreateFlags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) ? 1 : 0; - palImageCreateInfo.flags.prt = (imageCreateFlags & VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT) ? 1 : 0; - palImageCreateInfo.flags.invariant = (imageCreateFlags & VK_IMAGE_CREATE_ALIAS_BIT) ? 1 : 0; -#if PAL_CLIENT_INTERFACE_MAJOR_VERSION >= 616 - palImageCreateInfo.flags.tmzProtected = (imageCreateFlags & VK_IMAGE_CREATE_PROTECTED_BIT) ? 1 : 0; -#endif // Always provide pQuadSamplePattern to PalCmdResolveImage for depth formats to allow optimizations - palImageCreateInfo.flags.sampleLocsAlwaysKnown = Formats::HasDepth(format) ? 1 : 0; + flags.sampleLocsAlwaysKnown = Formats::HasDepth(format) ? 1 : 0; - // Flag VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT is supported by default for all 3D images - VK_IGNORE(VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT); + // Ignore Flag VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT. It is supported by default for all 3D images - return palImageCreateInfo.flags.u32All; + return flags.u32All; } // ===================================================================================================================== @@ -2551,12 +2548,10 @@ inline VkImageCreateFlags PalToVkImageCreateFlags(Pal::ImageCreateFlags imageCre vkImageCreateFlags |= VK_IMAGE_CREATE_ALIAS_BIT; } -#if PAL_CLIENT_INTERFACE_MAJOR_VERSION >= 616 if (imageCreateFlags.tmzProtected == 1) { vkImageCreateFlags |= VK_IMAGE_CREATE_PROTECTED_BIT; } -#endif return vkImageCreateFlags; } diff --git a/icd/api/include/vk_debug_report.h b/icd/api/include/vk_debug_report.h index f8356f53..65a0db67 100644 --- a/icd/api/include/vk_debug_report.h +++ b/icd/api/include/vk_debug_report.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_debug_utils.h b/icd/api/include/vk_debug_utils.h index c58a1c3d..086f072f 100644 --- a/icd/api/include/vk_debug_utils.h +++ b/icd/api/include/vk_debug_utils.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_defines.h b/icd/api/include/vk_defines.h index e166b4d4..e4636d67 100644 --- a/icd/api/include/vk_defines.h +++ b/icd/api/include/vk_defines.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_descriptor_pool.h b/icd/api/include/vk_descriptor_pool.h index 5a386afa..88e79df7 100644 --- a/icd/api/include/vk_descriptor_pool.h +++ b/icd/api/include/vk_descriptor_pool.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_descriptor_set.h b/icd/api/include/vk_descriptor_set.h index 30b1b56d..a9bcade6 100644 --- a/icd/api/include/vk_descriptor_set.h +++ b/icd/api/include/vk_descriptor_set.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_descriptor_set_layout.h b/icd/api/include/vk_descriptor_set_layout.h index 2e8d2d27..890cbe58 100644 --- a/icd/api/include/vk_descriptor_set_layout.h +++ b/icd/api/include/vk_descriptor_set_layout.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_descriptor_update_template.h b/icd/api/include/vk_descriptor_update_template.h index aebbccd3..a9bd68c9 100644 --- a/icd/api/include/vk_descriptor_update_template.h +++ b/icd/api/include/vk_descriptor_update_template.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_device.h b/icd/api/include/vk_device.h index 1e7664bc..8c624a50 100644 --- a/icd/api/include/vk_device.h +++ b/icd/api/include/vk_device.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -744,9 +744,12 @@ class Device VkResult InitSwCompositing(uint32_t deviceIdx); - VkResult AllocBorderColorPalette(); + VkResult CreateSharedPalCmdAllocator( + ); + void DestroySharedPalCmdAllocator(); - void DestroyBorderColorPalette(); + VkResult AllocBorderColorPalette(); + void DestroyBorderColorPalette(); Instance* const m_pInstance; const RuntimeSettings& m_settings; @@ -826,7 +829,6 @@ class Device Pal::IQueueSemaphore* pSwCompositingSemaphore; // Internal semaphore (master and slave) Pal::ICmdBuffer* pSwCompositingCmdBuffer; // Internal dummy command buffer for flip metadata (master) Pal::IBorderColorPalette* pPalBorderColorPalette; // Pal border color palette for custom border color. - }; // Compute size required for the object. One copy of PerGpuInfo is included in the object and we need diff --git a/icd/api/include/vk_dispatch.h b/icd/api/include/vk_dispatch.h index 4e09b684..af77075d 100644 --- a/icd/api/include/vk_dispatch.h +++ b/icd/api/include/vk_dispatch.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_event.h b/icd/api/include/vk_event.h index e7cbd7e3..a10765c4 100644 --- a/icd/api/include/vk_event.h +++ b/icd/api/include/vk_event.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_extensions.h b/icd/api/include/vk_extensions.h index d047fd43..bece970c 100644 --- a/icd/api/include/vk_extensions.h +++ b/icd/api/include/vk_extensions.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_fence.h b/icd/api/include/vk_fence.h index 1ea40d3a..fe724054 100644 --- a/icd/api/include/vk_fence.h +++ b/icd/api/include/vk_fence.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_formats.h b/icd/api/include/vk_formats.h index ee2c26d2..0a641630 100644 --- a/icd/api/include/vk_formats.h +++ b/icd/api/include/vk_formats.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_framebuffer.h b/icd/api/include/vk_framebuffer.h index fec846bf..c34fb719 100644 --- a/icd/api/include/vk_framebuffer.h +++ b/icd/api/include/vk_framebuffer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_gpa_session.h b/icd/api/include/vk_gpa_session.h index c66f7fba..3c5a5d73 100644 --- a/icd/api/include/vk_gpa_session.h +++ b/icd/api/include/vk_gpa_session.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_graphics_pipeline.h b/icd/api/include/vk_graphics_pipeline.h index 048e629c..98cecab7 100644 --- a/icd/api/include/vk_graphics_pipeline.h +++ b/icd/api/include/vk_graphics_pipeline.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_image.h b/icd/api/include/vk_image.h index 89429359..bd8187b5 100644 --- a/icd/api/include/vk_image.h +++ b/icd/api/include/vk_image.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_image_view.h b/icd/api/include/vk_image_view.h index 33591607..3d2e4eed 100644 --- a/icd/api/include/vk_image_view.h +++ b/icd/api/include/vk_image_view.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_instance.h b/icd/api/include/vk_instance.h index 8503e326..1980682b 100644 --- a/icd/api/include/vk_instance.h +++ b/icd/api/include/vk_instance.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_memory.h b/icd/api/include/vk_memory.h index 6ebf5b3f..fb1f4295 100644 --- a/icd/api/include/vk_memory.h +++ b/icd/api/include/vk_memory.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_physical_device.h b/icd/api/include/vk_physical_device.h index 59371b8c..0fb83f0d 100644 --- a/icd/api/include/vk_physical_device.h +++ b/icd/api/include/vk_physical_device.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -118,7 +118,7 @@ class PhysicalDevice const VkAllocationCallbacks* pAllocator, VkDevice* pDevice); - VkResult GetDeviceProperties(VkPhysicalDeviceProperties* pProperties) const; + void GetDeviceProperties(VkPhysicalDeviceProperties* pProperties) const; void GetDeviceGpaProperties( VkPhysicalDeviceGpaPropertiesAMD* pGpaProperties) const; diff --git a/icd/api/include/vk_physical_device_manager.h b/icd/api/include/vk_physical_device_manager.h index 90193cd8..63259fa1 100644 --- a/icd/api/include/vk_physical_device_manager.h +++ b/icd/api/include/vk_physical_device_manager.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_pipeline.h b/icd/api/include/vk_pipeline.h index 19ee5d5c..54fa7217 100644 --- a/icd/api/include/vk_pipeline.h +++ b/icd/api/include/vk_pipeline.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_pipeline_cache.h b/icd/api/include/vk_pipeline_cache.h index c60cad05..e76f9dd5 100644 --- a/icd/api/include/vk_pipeline_cache.h +++ b/icd/api/include/vk_pipeline_cache.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_pipeline_layout.h b/icd/api/include/vk_pipeline_layout.h index f1f014f3..878117d4 100644 --- a/icd/api/include/vk_pipeline_layout.h +++ b/icd/api/include/vk_pipeline_layout.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_private_data_slot.h b/icd/api/include/vk_private_data_slot.h index bcfdbb23..ebe146b2 100644 --- a/icd/api/include/vk_private_data_slot.h +++ b/icd/api/include/vk_private_data_slot.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_query.h b/icd/api/include/vk_query.h index e10c9ff6..e4b19afe 100644 --- a/icd/api/include/vk_query.h +++ b/icd/api/include/vk_query.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_queue.h b/icd/api/include/vk_queue.h index c88a0721..0acb510a 100644 --- a/icd/api/include/vk_queue.h +++ b/icd/api/include/vk_queue.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -41,7 +41,6 @@ #include "include/vk_utils.h" #include "include/virtual_stack_mgr.h" -#include "palDeque.h" #include "palQueue.h" namespace Pal @@ -54,6 +53,8 @@ class IQueue; namespace vk { +struct CmdBufState; +class CmdBufferRing; class Device; class DevModeMgr; class DispatchableQueue; @@ -63,13 +64,6 @@ class FrtcFramePacer; class TurboSync; class SqttQueueState; -// State of a command buffer. -struct CmdBufState -{ - Pal::ICmdBuffer* pCmdBuf; // Command buffer pointer - Pal::IFence* pFence; // Fence that will be signaled when this fence's submit completes -}; - // ===================================================================================================================== // A Vulkan queue. class Queue @@ -85,7 +79,8 @@ class Queue Pal::IQueue** pPalQueues, Pal::IQueue** pPalTmzQueues, Pal::IQueueSemaphore** pPalTmzSemaphores, - VirtualStackAllocator* pStackAllocator); + VirtualStackAllocator* pStackAllocator, + CmdBufferRing* pCmdBufferRing); ~Queue(); @@ -237,22 +232,6 @@ class Queue VkResult CreateDummyCmdBuffer(); - void CreateCmdBufRing( - uint32_t deviceIdx); - - void DestroyCmdBufRing( - uint32_t deviceIdx); - - CmdBufState* CreateCmdBufState( - uint32_t deviceIdx); - - void DestroyCmdBufState( - uint32_t deviceIdx, - CmdBufState* pCmdBufState); - - CmdBufState* AcquireInternalCmdBuf( - uint32_t deviceIdx); - bool BuildPostProcessCommands( uint32_t deviceIdx, CmdBufState* pCmdBufState, @@ -295,8 +274,7 @@ class Queue Pal::PerSourceFrameMetadataControl m_palFrameMetadataControl; Pal::ICmdBuffer* m_pDummyCmdBuffer[MaxPalDevices]; SqttQueueState* m_pSqttState; // Per-queue state for handling SQ thread-tracing annotations - typedef Util::Deque CmdBufRing; - CmdBufRing* m_pCmdBufRing[MaxPalDevices]; + CmdBufferRing* m_pCmdBufferRing; private: PAL_DISALLOW_COPY_AND_ASSIGN(Queue); diff --git a/icd/api/include/vk_render_pass.h b/icd/api/include/vk_render_pass.h index 12e28da5..5219f437 100644 --- a/icd/api/include/vk_render_pass.h +++ b/icd/api/include/vk_render_pass.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_sampler.h b/icd/api/include/vk_sampler.h index ac3fd284..dd1653e3 100644 --- a/icd/api/include/vk_sampler.h +++ b/icd/api/include/vk_sampler.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_sampler_ycbcr_conversion.h b/icd/api/include/vk_sampler_ycbcr_conversion.h index 858a973f..9bb081b5 100644 --- a/icd/api/include/vk_sampler_ycbcr_conversion.h +++ b/icd/api/include/vk_sampler_ycbcr_conversion.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_semaphore.h b/icd/api/include/vk_semaphore.h index 622b9824..a2acefa9 100644 --- a/icd/api/include/vk_semaphore.h +++ b/icd/api/include/vk_semaphore.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_shader.h b/icd/api/include/vk_shader.h index b4daeda3..941a13ec 100644 --- a/icd/api/include/vk_shader.h +++ b/icd/api/include/vk_shader.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_shader_code.h b/icd/api/include/vk_shader_code.h index c44128d5..23656c86 100644 --- a/icd/api/include/vk_shader_code.h +++ b/icd/api/include/vk_shader_code.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_surface.h b/icd/api/include/vk_surface.h index 268e258f..5946c9c5 100644 --- a/icd/api/include/vk_surface.h +++ b/icd/api/include/vk_surface.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_swapchain.h b/icd/api/include/vk_swapchain.h index 24ebbbc2..77dad7dc 100644 --- a/icd/api/include/vk_swapchain.h +++ b/icd/api/include/vk_swapchain.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/include/vk_utils.h b/icd/api/include/vk_utils.h index 42108e6f..1dbd64ab 100644 --- a/icd/api/include/vk_utils.h +++ b/icd/api/include/vk_utils.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -88,9 +88,6 @@ // Wrap _malloca and _freea for compilers other than MSVS #define VK_ALLOC_A(_numBytes) alloca(_numBytes) -// Helper macro to mark some input ignored intentionally; eventually all such macro uses should disappear -#define VK_IGNORE(input) - // Default alignment for memory allocation #define VK_DEFAULT_MEM_ALIGN 16 diff --git a/icd/api/internal_mem_mgr.cpp b/icd/api/internal_mem_mgr.cpp index 3e767adc..b81d839e 100644 --- a/icd/api/internal_mem_mgr.cpp +++ b/icd/api/internal_mem_mgr.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/pipeline_binary_cache.cpp b/icd/api/pipeline_binary_cache.cpp index 6047166d..49cf26b2 100644 --- a/icd/api/pipeline_binary_cache.cpp +++ b/icd/api/pipeline_binary_cache.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/pipeline_compiler.cpp b/icd/api/pipeline_compiler.cpp index 24f3d528..71af9703 100644 --- a/icd/api/pipeline_compiler.cpp +++ b/icd/api/pipeline_compiler.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -47,6 +47,7 @@ #include "palElfReader.h" #include "palPipelineAbiReader.h" +#include "palPipelineAbiProcessorImpl.h" #include "llpc.h" @@ -1097,9 +1098,64 @@ VkResult PipelineCompiler::CreateGraphicsPipelineBinary( if (result == VK_SUCCESS) { + auto pInstance = m_pPhysicalDevice->Manager()->VkInstance(); + // Write PipelineMetadata to ELF section + Pal::Result palResult = Pal::Result::Success; + + Util::Abi::PipelineAbiProcessor abiProcessor(pDevice->VkInstance()->Allocator()); + palResult = abiProcessor.LoadFromBuffer(*ppPipelineBinary, *pPipelineBinarySize); + if (palResult == Pal::Result::Success) + { + palResult = abiProcessor.SetGenericSection(".pipelinemetadata", &pCreateInfo->pipelineMetadata, + sizeof(pCreateInfo->pipelineMetadata)); + if (palResult == Pal::Result::Success) + { + FreeGraphicsPipelineBinary(pCreateInfo, *ppPipelineBinary, *pPipelineBinarySize); + *ppPipelineBinary = nullptr; + + *pPipelineBinarySize = abiProcessor.GetRequiredBufferSizeBytes(); + void* pNewPipelineBinary = pInstance->AllocMem(*pPipelineBinarySize, VK_DEFAULT_MEM_ALIGN, + VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + + if (pNewPipelineBinary == nullptr) + { + palResult = Pal::Result::ErrorOutOfMemory; + } + else + { + abiProcessor.SaveToBuffer(pNewPipelineBinary); + *ppPipelineBinary = pNewPipelineBinary; + pCreateInfo->freeCompilerBinary = FreeWithInstanceAllocator; + } + } + } + + result = PalToVkResult(palResult); } } } + else + { + // Read PipelineMetadata from ELF section + Pal::Result palResult = Pal::Result::Success; + const void* pPipelineMetadataSection = nullptr; + size_t pipelineMetadataSectionLen = 0; + + Util::Abi::PipelineAbiProcessor abiProcessor(pDevice->VkInstance()->Allocator()); + palResult = abiProcessor.LoadFromBuffer(*ppPipelineBinary, *pPipelineBinarySize); + if (palResult == Pal::Result::Success) + { + abiProcessor.GetGenericSection(".pipelinemetadata", &pPipelineMetadataSection, &pipelineMetadataSectionLen); + + VK_ASSERT(pPipelineMetadataSection != nullptr); + VK_ASSERT(pipelineMetadataSectionLen == sizeof(pCreateInfo->pipelineMetadata)); + + // Copy metadata + memcpy(&pCreateInfo->pipelineMetadata, pPipelineMetadataSection, pipelineMetadataSectionLen); + } + + result = PalToVkResult(palResult); + } if (result == VK_SUCCESS) { @@ -1915,14 +1971,9 @@ static void BuildColorBlendState( // want to write to any attachment for that output (VK_ATTACHMENT_UNUSED). Under such cases, // disable shader writes through that target. There is one exception for alphaToCoverageEnable // and attachment zero, which can be set to VK_ATTACHMENT_UNUSED. - if ((cbFormat != VK_FORMAT_UNDEFINED) || (i == 0u)) + if (cbFormat != VK_FORMAT_UNDEFINED) { - VkFormat renderPassFormat = ((pRenderPass != nullptr) ? - pRenderPass->GetAttachmentDesc(i).format : - VK_FORMAT_UNDEFINED); - - pLlpcCbDst->format = (cbFormat != VK_FORMAT_UNDEFINED) ? - cbFormat : renderPassFormat; + pLlpcCbDst->format = cbFormat; pLlpcCbDst->blendEnable = (src.blendEnable == VK_TRUE); pLlpcCbDst->blendSrcAlphaToColor = @@ -1932,6 +1983,36 @@ static void BuildColorBlendState( GraphicsPipelineCommon::IsSrcAlphaUsedInBlend(src.dstColorBlendFactor); pLlpcCbDst->channelWriteMask = src.colorWriteMask; } + else if (i == 0) + { + // VK_FORMAT_UNDEFINED will cause the shader output to be dropped for alphaToCoverageEnable. + // Any supported format should be fine. + if ((pRenderPass != nullptr) && (pRenderPass->GetAttachmentCount() > 0)) + { + pLlpcCbDst->format = pRenderPass->GetAttachmentDesc(i).format; + } + else if (pRendering != nullptr) + { + if (pRendering->colorAttachmentCount > 0) + { + // Pick any VK_FORMAT that is not VK_FORMAT_UNDEFINED. + for (uint32_t j = 0; j < pRendering->colorAttachmentCount; ++j) + { + if (pRendering->pColorAttachmentFormats[j] != VK_FORMAT_UNDEFINED) + { + pLlpcCbDst->format = pRendering->pColorAttachmentFormats[j]; + break; + } + } + } + else + { + // If the color attachment is not available. + pLlpcCbDst->format = (pRendering->depthAttachmentFormat != VK_FORMAT_UNDEFINED) ? + pRendering->depthAttachmentFormat : pRendering->stencilAttachmentFormat; + } + } + } } dualSourceBlendEnabled = GraphicsPipelineCommon::GetDualSourceBlendEnableState(pDevice, pCb); @@ -2647,6 +2728,8 @@ void PipelineCompiler::GetGraphicsPipelineCacheId( hash.Update(pCreateInfo->dbFormat); hash.Update(pCreateInfo->pipelineInfo.dynamicVertexStride); + hash.Update(pCreateInfo->pipelineMetadata.pointSizeUsed); + hash.Finalize(pCacheId->bytes); } diff --git a/icd/api/render_state_cache.cpp b/icd/api/render_state_cache.cpp index 7b91fd5e..43705a73 100644 --- a/icd/api/render_state_cache.cpp +++ b/icd/api/render_state_cache.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/renderpass/renderpass_builder.cpp b/icd/api/renderpass/renderpass_builder.cpp index e8874be4..4d3406a4 100644 --- a/icd/api/renderpass/renderpass_builder.cpp +++ b/icd/api/renderpass/renderpass_builder.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/renderpass/renderpass_builder.h b/icd/api/renderpass/renderpass_builder.h index bae2942a..4e6a455b 100644 --- a/icd/api/renderpass/renderpass_builder.h +++ b/icd/api/renderpass/renderpass_builder.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/renderpass/renderpass_logger.cpp b/icd/api/renderpass/renderpass_logger.cpp index 732bbfd6..87c28e26 100644 --- a/icd/api/renderpass/renderpass_logger.cpp +++ b/icd/api/renderpass/renderpass_logger.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/renderpass/renderpass_logger.h b/icd/api/renderpass/renderpass_logger.h index 8b6ea36b..b0399915 100644 --- a/icd/api/renderpass/renderpass_logger.h +++ b/icd/api/renderpass/renderpass_logger.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/renderpass/renderpass_types.h b/icd/api/renderpass/renderpass_types.h index 66aae761..4f212206 100644 --- a/icd/api/renderpass/renderpass_types.h +++ b/icd/api/renderpass/renderpass_types.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/shader_cache.cpp b/icd/api/shader_cache.cpp index 24a82fa7..9aa3fef8 100644 --- a/icd/api/shader_cache.cpp +++ b/icd/api/shader_cache.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/shaders/copy_timestamp_query_pool.comp b/icd/api/shaders/copy_timestamp_query_pool.comp index 88c960e8..56fddf2e 100644 --- a/icd/api/shaders/copy_timestamp_query_pool.comp +++ b/icd/api/shaders/copy_timestamp_query_pool.comp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/shaders/copy_timestamp_query_pool_spv.h b/icd/api/shaders/copy_timestamp_query_pool_spv.h index dda0e1ee..8d8d64a8 100644 --- a/icd/api/shaders/copy_timestamp_query_pool_spv.h +++ b/icd/api/shaders/copy_timestamp_query_pool_spv.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/shaders/copy_timestamp_query_pool_strided_spv.h b/icd/api/shaders/copy_timestamp_query_pool_strided_spv.h index 51e2b56d..d51aada5 100644 --- a/icd/api/shaders/copy_timestamp_query_pool_strided_spv.h +++ b/icd/api/shaders/copy_timestamp_query_pool_strided_spv.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/shaders/make_llpc_shaders.py b/icd/api/shaders/make_llpc_shaders.py index b0ebee6d..13f4534a 100644 --- a/icd/api/shaders/make_llpc_shaders.py +++ b/icd/api/shaders/make_llpc_shaders.py @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/sqtt/sqtt_layer.cpp b/icd/api/sqtt/sqtt_layer.cpp index f0919614..9e1da21e 100644 --- a/icd/api/sqtt/sqtt_layer.cpp +++ b/icd/api/sqtt/sqtt_layer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/sqtt/sqtt_layer.h b/icd/api/sqtt/sqtt_layer.h index e6bb02bd..02b95601 100644 --- a/icd/api/sqtt/sqtt_layer.h +++ b/icd/api/sqtt/sqtt_layer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/sqtt/sqtt_mgr.cpp b/icd/api/sqtt/sqtt_mgr.cpp index 7879c9ae..0b201475 100644 --- a/icd/api/sqtt/sqtt_mgr.cpp +++ b/icd/api/sqtt/sqtt_mgr.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/sqtt/sqtt_mgr.h b/icd/api/sqtt/sqtt_mgr.h index a8fdcf7c..c2eb4f0b 100644 --- a/icd/api/sqtt/sqtt_mgr.h +++ b/icd/api/sqtt/sqtt_mgr.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/sqtt/sqtt_object_mgr.cpp b/icd/api/sqtt/sqtt_object_mgr.cpp index 519d5278..37004412 100644 --- a/icd/api/sqtt/sqtt_object_mgr.cpp +++ b/icd/api/sqtt/sqtt_object_mgr.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/sqtt/sqtt_object_mgr.h b/icd/api/sqtt/sqtt_object_mgr.h index 70153649..a102eceb 100644 --- a/icd/api/sqtt/sqtt_object_mgr.h +++ b/icd/api/sqtt/sqtt_object_mgr.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/sqtt/sqtt_rgp_annotations.h b/icd/api/sqtt/sqtt_rgp_annotations.h index 00df56ff..42a0b054 100644 --- a/icd/api/sqtt/sqtt_rgp_annotations.h +++ b/icd/api/sqtt/sqtt_rgp_annotations.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2015-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/strings/func_table_template.py b/icd/api/strings/func_table_template.py index 974d4d41..570a04af 100644 --- a/icd/api/strings/func_table_template.py +++ b/icd/api/strings/func_table_template.py @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/strings/generate_strings.py b/icd/api/strings/generate_strings.py index ca6839bb..52bf0c2c 100644 --- a/icd/api/strings/generate_strings.py +++ b/icd/api/strings/generate_strings.py @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/strings/strings.cpp b/icd/api/strings/strings.cpp index 027acd18..e2f0c168 100644 --- a/icd/api/strings/strings.cpp +++ b/icd/api/strings/strings.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/strings/strings.h b/icd/api/strings/strings.h index 972108f4..b9bb8d19 100644 --- a/icd/api/strings/strings.h +++ b/icd/api/strings/strings.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/utils/json_reader.cpp b/icd/api/utils/json_reader.cpp index 52c9d1b5..d9e0a590 100644 --- a/icd/api/utils/json_reader.cpp +++ b/icd/api/utils/json_reader.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/utils/json_reader.h b/icd/api/utils/json_reader.h index d2aaf7b0..58f8b56f 100644 --- a/icd/api/utils/json_reader.h +++ b/icd/api/utils/json_reader.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/utils/json_writer.cpp b/icd/api/utils/json_writer.cpp index f310162c..607d473d 100644 --- a/icd/api/utils/json_writer.cpp +++ b/icd/api/utils/json_writer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/utils/json_writer.h b/icd/api/utils/json_writer.h index 27c0230d..abf63452 100644 --- a/icd/api/utils/json_writer.h +++ b/icd/api/utils/json_writer.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/utils/temp_mem_arena.cpp b/icd/api/utils/temp_mem_arena.cpp index 05d20679..a097e77b 100644 --- a/icd/api/utils/temp_mem_arena.cpp +++ b/icd/api/utils/temp_mem_arena.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/utils/temp_mem_arena.h b/icd/api/utils/temp_mem_arena.h index 7d2469c3..dccc151a 100644 --- a/icd/api/utils/temp_mem_arena.h +++ b/icd/api/utils/temp_mem_arena.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/virtual_stack_mgr.cpp b/icd/api/virtual_stack_mgr.cpp index 53f0de48..027fd01e 100644 --- a/icd/api/virtual_stack_mgr.cpp +++ b/icd/api/virtual_stack_mgr.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_alloccb.cpp b/icd/api/vk_alloccb.cpp index e482d715..f0e75ba7 100644 --- a/icd/api/vk_alloccb.cpp +++ b/icd/api/vk_alloccb.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -61,7 +61,10 @@ static void* VKAPI_PTR alignment = Util::Pow2Align(alignment, sizeof(void*)); pMemory = aligned_alloc(alignment, Util::Pow2Align(size, alignment)); #elif _POSIX_VERSION >= 200112L - if (posix_memalign(&pMemory, Util::Pow2Align(alignment, sizeof(void*)), size)) pMemory = NULL; + if (posix_memalign(&pMemory, Util::Pow2Align(alignment, sizeof(void*)), size)) + { + pMemory = NULL; + } #else #error "Unsupported platform" #endif diff --git a/icd/api/vk_buffer.cpp b/icd/api/vk_buffer.cpp index 8c4dd222..b2d978a5 100644 --- a/icd/api/vk_buffer.cpp +++ b/icd/api/vk_buffer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_buffer_view.cpp b/icd/api/vk_buffer_view.cpp index bc4dd2f0..9e0f43ec 100644 --- a/icd/api/vk_buffer_view.cpp +++ b/icd/api/vk_buffer_view.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_cmd_pool.cpp b/icd/api/vk_cmd_pool.cpp index 64f8aca4..3c2682e4 100644 --- a/icd/api/vk_cmd_pool.cpp +++ b/icd/api/vk_cmd_pool.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -258,11 +258,6 @@ VkResult CmdPool::Reset(VkCommandPoolResetFlags flags) { VkResult result = VK_SUCCESS; - // There's currently no way to tell to the PAL CmdAllocator that it should release the actual allocations used - // by the pool, it always just marks the allocations unused, so we currently ignore the - // VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT flag if present. - VK_IGNORE(flags & VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT); - // We first have to reset all the command buffers that use this pool (PAL doesn't do this automatically). for (auto it = m_cmdBufferRegistry.Begin(); (it.Get() != nullptr) && (result == VK_SUCCESS); it.Next()) { diff --git a/icd/api/vk_cmdbuffer.cpp b/icd/api/vk_cmdbuffer.cpp index 352dc77d..b4e06176 100644 --- a/icd/api/vk_cmdbuffer.cpp +++ b/icd/api/vk_cmdbuffer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -4871,8 +4871,8 @@ void CmdBuffer::WaitEvents( Pal::BarrierInfo barrier = {}; // Tell PAL to wait at a specific point until the given set of GpuEvent objects is signaled. - // We intentionally ignore the source stage flags as they are irrelevant in the presence of event objects - VK_IGNORE(srcStageMask); + // We intentionally ignore the source stage flags (srcStagemask) as they are irrelevant in the + // presence of event objects barrier.flags.u32All = 0; barrier.reason = RgpBarrierExternalCmdWaitEvents; @@ -6277,8 +6277,6 @@ void CmdBuffer::BeginRenderPass( const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents) { - VK_IGNORE(contents); - DbgBarrierPreCmd(DbgBarrierBeginRenderPass); m_allGpuState.pRenderPass = RenderPass::ObjectFromHandle(pRenderPassBegin->renderPass); @@ -6561,8 +6559,6 @@ void CmdBuffer::BeginRenderPass( void CmdBuffer::NextSubPass( VkSubpassContents contents) { - VK_IGNORE(contents); - DbgBarrierPreCmd(DbgBarrierNextSubpass); if (m_renderPassInstance.subpass != VK_SUBPASS_EXTERNAL) @@ -7660,6 +7656,19 @@ void CmdBuffer::PushConstants( stageFlags &= m_validShaderStageFlags; + PushConstantsIssueWrites(pLayout, stageFlags, startInDwords, lengthInDwords, pInputValues); + + DbgBarrierPostCmd(DbgBarrierBindSetsPushConstants); +} + +// ===================================================================================================================== +void CmdBuffer::PushConstantsIssueWrites( + const PipelineLayout* pLayout, + VkShaderStageFlags stageFlags, + uint32_t startInDwords, + uint32_t lengthInDwords, + const uint32_t* const pInputValues) +{ if ((stageFlags & VK_SHADER_STAGE_COMPUTE_BIT) != 0) { WritePushConstants(PipelineBindCompute, @@ -7668,6 +7677,7 @@ void CmdBuffer::PushConstants( startInDwords, lengthInDwords, pInputValues); + } if ((stageFlags & VK_SHADER_STAGE_ALL_GRAPHICS) != 0) @@ -7679,8 +7689,6 @@ void CmdBuffer::PushConstants( lengthInDwords, pInputValues); } - - DbgBarrierPostCmd(DbgBarrierBindSetsPushConstants); } // ===================================================================================================================== @@ -9270,8 +9278,6 @@ VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier( uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) { - VK_IGNORE(dependencyFlags); - ApiCmdBuffer::ObjectFromHandle(cmdBuffer)->PipelineBarrier( srcStageMask, dstStageMask, diff --git a/icd/api/vk_compute_pipeline.cpp b/icd/api/vk_compute_pipeline.cpp index c3e70979..a73290f0 100644 --- a/icd/api/vk_compute_pipeline.cpp +++ b/icd/api/vk_compute_pipeline.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_conv.cpp b/icd/api/vk_conv.cpp index 66e28d11..f1e843d1 100644 --- a/icd/api/vk_conv.cpp +++ b/icd/api/vk_conv.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -729,11 +729,9 @@ const char* PalResultName( case Pal::Result::ErrorPermissionDenied: resultName = "ErrorPermissionDenied"; break; -#if PAL_CLIENT_INTERFACE_MAJOR_VERSION >= 645 case Pal::Result::ErrorInvalidExternalHandle: resultName = "ErrorInvalidExternalHandle"; break; -#endif default: VK_NOT_IMPLEMENTED; resultName = "??"; @@ -936,11 +934,9 @@ VkResult PalToVkError( case Pal::Result::ErrorNotMappable: vkResult = VK_ERROR_MEMORY_MAP_FAILED; break; -#if PAL_CLIENT_INTERFACE_MAJOR_VERSION >= 645 case Pal::Result::ErrorInvalidExternalHandle: vkResult = VK_ERROR_INVALID_EXTERNAL_HANDLE; break; -#endif case Pal::Result::ErrorUnknown: case Pal::Result::ErrorUnavailable: case Pal::Result::ErrorInvalidPointer: diff --git a/icd/api/vk_debug_report.cpp b/icd/api/vk_debug_report.cpp index 6cbe2bb1..5f8237de 100644 --- a/icd/api/vk_debug_report.cpp +++ b/icd/api/vk_debug_report.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_debug_utils.cpp b/icd/api/vk_debug_utils.cpp index 928c9f9b..7f801fac 100644 --- a/icd/api/vk_debug_utils.cpp +++ b/icd/api/vk_debug_utils.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_descriptor_pool.cpp b/icd/api/vk_descriptor_pool.cpp index bd8a8356..39208da7 100644 --- a/icd/api/vk_descriptor_pool.cpp +++ b/icd/api/vk_descriptor_pool.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_descriptor_set.cpp b/icd/api/vk_descriptor_set.cpp index 7a1808f3..f3394983 100644 --- a/icd/api/vk_descriptor_set.cpp +++ b/icd/api/vk_descriptor_set.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_descriptor_set_layout.cpp b/icd/api/vk_descriptor_set_layout.cpp index 994f4652..fefe41b3 100644 --- a/icd/api/vk_descriptor_set_layout.cpp +++ b/icd/api/vk_descriptor_set_layout.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -505,9 +505,8 @@ VkResult DescriptorSetLayout::ConvertCreateInfo( // Bindings numbers are allowed to come in out-of-order, as well as with gaps. // We compute offsets using the size we've seen so far as we iterate, so we need to handle - // the bindings in binding-number order, rather than array order. - - VK_IGNORE(pIn->flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT); + // the bindings in binding-number order, rather than array order. Hence we can ignore + // - VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT // First, copy the binding info into our output array in order. for (uint32 inIndex = 0; inIndex < pIn->bindingCount; ++inIndex) diff --git a/icd/api/vk_descriptor_update_template.cpp b/icd/api/vk_descriptor_update_template.cpp index d5832468..894e0c58 100644 --- a/icd/api/vk_descriptor_update_template.cpp +++ b/icd/api/vk_descriptor_update_template.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_device.cpp b/icd/api/vk_device.cpp index 3ad5f4de..7f298162 100644 --- a/icd/api/vk_device.cpp +++ b/icd/api/vk_device.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -64,6 +64,7 @@ #include "include/vk_swapchain.h" #include "include/vk_utils.h" #include "include/vk_conv.h" +#include "include/cmd_buffer_ring.h" #include "include/graphics_pipeline_common.h" #include "include/internal_layer_hooks.h" @@ -264,8 +265,8 @@ Device::Device( m_allocationSizeTracking(m_settings.memoryDeviceOverallocationAllowed ? false : true), m_useComputeAsTransferQueue(useComputeAsTransferQueue), m_useUniversalAsComputeQueue(pPhysicalDevices[DefaultDeviceIndex]->GetRuntimeSettings().useUniversalAsComputeQueue), - m_useGlobalGpuVa(false) - , m_pBorderColorUsedIndexes(nullptr) + m_useGlobalGpuVa(false), + m_pBorderColorUsedIndexes(nullptr) { memset(m_pBltMsaaState, 0, sizeof(m_pBltMsaaState)); @@ -285,7 +286,6 @@ Device::Device( m_perGpu[deviceIdx].pSwCompositingSemaphore = nullptr; m_perGpu[deviceIdx].pSwCompositingCmdBuffer = nullptr; m_perGpu[deviceIdx].pPalBorderColorPalette = nullptr; - } m_allocatedCount = 0; @@ -846,19 +846,6 @@ VkResult Device::Create( { switch (static_cast(pHeader->sType)) { - case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: - { - const auto* pMultiviewFeatures = reinterpret_cast(pHeader); - - // The implementation of multiview does not require special handling, - // therefore the multview features can be ignored. - VK_IGNORE(pMultiviewFeatures->multiview); - VK_IGNORE(pMultiviewFeatures->multiviewGeometryShader); - VK_IGNORE(pMultiviewFeatures->multiviewTessellationShader); - - break; - } - case VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT: { const auto* pPrivateDataInfo = reinterpret_cast(pHeader); @@ -867,6 +854,15 @@ VkResult Device::Create( break; } + case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES: + // The implementation of multiview does not require special handling, + // therefore the following multview features can be ignored. + // - pMultiviewFeatures->multiview + // - pMultiviewFeatures->multiviewGeometryShader + // - pMultiviewFeatures->multiviewTessellationShader + // + // Fall through to default. + default: // Skip any unknown extension structures break; @@ -1095,6 +1091,21 @@ VkResult Device::Create( palResult = pInstance->StackMgr()->AcquireAllocator(&pQueueStackAllocator); } + CmdBufferRing* pCmdBufferRing = nullptr; + + if (palResult == Pal::Result::Success) + { + Pal::EngineType engineType = (*pDispatchableDevice)->GetQueueFamilyPalEngineType(queueFamilyIndex); + Pal::QueueType queueType = (*pDispatchableDevice)->GetQueueFamilyPalQueueType(queueFamilyIndex); + + pCmdBufferRing = CmdBufferRing::Create(*pDispatchableDevice, engineType, queueType); + + if (pCmdBufferRing == nullptr) + { + palResult = Pal::Result::ErrorOutOfMemory; + } + } + if (palResult == Pal::Result::Success) { // Create the vk::Queue object @@ -1112,7 +1123,8 @@ VkResult Device::Create( pPalQueues, pPalTmzQueues, pPalTmzSemaphores, - pQueueStackAllocator)); + pQueueStackAllocator, + pCmdBufferRing)); pDispatchableQueues[queueFamilyIndex][queueIndex] = static_cast(pApiQueueMemory); @@ -1145,6 +1157,11 @@ VkResult Device::Create( pPalTmzSemaphores[deviceIdx]->Destroy(); } } + + if (pQueueStackAllocator != nullptr) + { + pInstance->StackMgr()->ReleaseAllocator(pQueueStackAllocator); + } } } } @@ -1219,75 +1236,16 @@ VkResult Device::Initialize( result = m_renderStateCache.Init(); } - if (result == VK_SUCCESS) - { - // Create a common CmdAllocator for internal use. For the driver setting, useSharedCmdAllocator, - // this CmdAllocator will be used by all command buffers created by this device. - // It must be thread safe because two threads could modify two command buffers at once - // which may cause those command buffers to access the allocator simultaneously. - Pal::CmdAllocatorCreateInfo createInfo = {}; - - createInfo.flags.threadSafe = 1; - createInfo.flags.autoMemoryReuse = 1; - createInfo.flags.disableBusyChunkTracking = 1; - - // Initialize command data chunk allocation size - createInfo.allocInfo[Pal::CommandDataAlloc].allocHeap = m_settings.cmdAllocatorDataHeap; - createInfo.allocInfo[Pal::CommandDataAlloc].allocSize = m_settings.cmdAllocatorDataAllocSize; - createInfo.allocInfo[Pal::CommandDataAlloc].suballocSize = m_settings.cmdAllocatorDataSubAllocSize; - - // Initialize embedded data chunk allocation size - createInfo.allocInfo[Pal::EmbeddedDataAlloc].allocHeap = m_settings.cmdAllocatorEmbeddedHeap; - createInfo.allocInfo[Pal::EmbeddedDataAlloc].allocSize = m_settings.cmdAllocatorEmbeddedAllocSize; - createInfo.allocInfo[Pal::EmbeddedDataAlloc].suballocSize = m_settings.cmdAllocatorEmbeddedSubAllocSize; - - // Initialize GPU scratch memory chunk allocation size - createInfo.allocInfo[Pal::GpuScratchMemAlloc].allocHeap = m_settings.cmdAllocatorScratchHeap; - createInfo.allocInfo[Pal::GpuScratchMemAlloc].allocSize = m_settings.cmdAllocatorScratchAllocSize; - createInfo.allocInfo[Pal::GpuScratchMemAlloc].suballocSize = m_settings.cmdAllocatorScratchSubAllocSize; - - Pal::Result palResult = Pal::Result::Success; - const size_t allocatorSize = PalDevice(DefaultDeviceIndex)->GetCmdAllocatorSize(createInfo, &palResult); - - if (palResult == Pal::Result::Success) - { - void* pAllocatorMem = m_pInstance->AllocMem( - allocatorSize * NumPalDevices(), VK_DEFAULT_MEM_ALIGN, VK_SYSTEM_ALLOCATION_SCOPE_DEVICE); - - if (pAllocatorMem != NULL) - { - for (uint32_t deviceIdx = 0; - (deviceIdx < NumPalDevices()) && (palResult == Pal::Result::Success); - deviceIdx++) - { - VK_ASSERT(allocatorSize == PalDevice(deviceIdx)->GetCmdAllocatorSize(createInfo, &palResult)); - - palResult = PalDevice(deviceIdx)->CreateCmdAllocator(createInfo, - Util::VoidPtrInc(pAllocatorMem, allocatorSize * deviceIdx), - &m_perGpu[deviceIdx].pSharedPalCmdAllocator); - } - result = PalToVkResult(palResult); - - if (result != VK_SUCCESS) - { - m_pInstance->FreeMem(pAllocatorMem); - } - } - else - { - result = VK_ERROR_OUT_OF_HOST_MEMORY; - } - } - else - { - result = PalToVkResult(palResult); - } - } - memcpy(&m_pQueues, pQueues, sizeof(m_pQueues)); Pal::DeviceProperties deviceProps = {}; result = PalToVkResult(PalDevice(DefaultDeviceIndex)->GetProperties(&deviceProps)); + if (result == VK_SUCCESS) + { + result = CreateSharedPalCmdAllocator( + ); + } + m_properties.virtualMemAllocGranularity = deviceProps.gpuMemoryProperties.virtualMemAllocGranularity; m_properties.virtualMemPageSize = deviceProps.gpuMemoryProperties.virtualMemPageSize; m_properties.descriptorSizes.bufferView = deviceProps.gfxipProperties.srdSizes.bufferView; @@ -1847,15 +1805,7 @@ VkResult Device::Destroy(const VkAllocationCallbacks* pAllocator) DestroyInternalPipelines(); - for (uint32_t deviceIdx = 0; deviceIdx < NumPalDevices(); deviceIdx++) - { - if (m_perGpu[deviceIdx].pSharedPalCmdAllocator != nullptr) - { - m_perGpu[deviceIdx].pSharedPalCmdAllocator->Destroy(); - } - } - - VkInstance()->FreeMem(m_perGpu[DefaultDeviceIndex].pSharedPalCmdAllocator); + DestroySharedPalCmdAllocator(); for (uint32_t deviceIdx = 0; deviceIdx < NumPalDevices(); deviceIdx++) { @@ -1878,7 +1828,6 @@ VkResult Device::Destroy(const VkAllocationCallbacks* pAllocator) VkInstance()->FreeMem(m_perGpu[deviceIdx].pSwCompositingMemory); } - } DestroyBorderColorPalette(); @@ -3252,6 +3201,94 @@ VkResult Device::InitSwCompositing( return result; } +// ===================================================================================================================== +// Create a common CmdAllocator for internal use. For the driver setting, useSharedCmdAllocator, this CmdAllocator will +// be used by all command buffers created by this device. It must be thread safe because two threads could modify two +// command buffers at once which may cause those command buffers to access the allocator simultaneously. +VkResult Device::CreateSharedPalCmdAllocator( + ) +{ + VkResult result = VK_SUCCESS; + + Pal::CmdAllocatorCreateInfo createInfo = {}; + + createInfo.flags.threadSafe = 1; + createInfo.flags.autoMemoryReuse = 1; + createInfo.flags.disableBusyChunkTracking = 1; + + // Initialize command data chunk allocation size + createInfo.allocInfo[Pal::CommandDataAlloc].allocHeap = m_settings.cmdAllocatorDataHeap; + createInfo.allocInfo[Pal::CommandDataAlloc].allocSize = m_settings.cmdAllocatorDataAllocSize; + createInfo.allocInfo[Pal::CommandDataAlloc].suballocSize = m_settings.cmdAllocatorDataSubAllocSize; + + // Initialize embedded data chunk allocation size + createInfo.allocInfo[Pal::EmbeddedDataAlloc].allocHeap = m_settings.cmdAllocatorEmbeddedHeap; + createInfo.allocInfo[Pal::EmbeddedDataAlloc].allocSize = m_settings.cmdAllocatorEmbeddedAllocSize; + createInfo.allocInfo[Pal::EmbeddedDataAlloc].suballocSize = m_settings.cmdAllocatorEmbeddedSubAllocSize; + + // Initialize GPU scratch memory chunk allocation size + createInfo.allocInfo[Pal::GpuScratchMemAlloc].allocHeap = m_settings.cmdAllocatorScratchHeap; + createInfo.allocInfo[Pal::GpuScratchMemAlloc].allocSize = m_settings.cmdAllocatorScratchAllocSize; + createInfo.allocInfo[Pal::GpuScratchMemAlloc].suballocSize = m_settings.cmdAllocatorScratchSubAllocSize; + + Pal::Result palResult; + const size_t allocatorSize = PalDevice(DefaultDeviceIndex)->GetCmdAllocatorSize(createInfo, &palResult); + VK_ASSERT(palResult == Pal::Result::Success); + + void* pAllocatorMem = m_pInstance->AllocMem( + allocatorSize * NumPalDevices(), + VK_DEFAULT_MEM_ALIGN, + VK_SYSTEM_ALLOCATION_SCOPE_DEVICE); + + if (pAllocatorMem != NULL) + { + for (uint32_t deviceIdx = 0; deviceIdx < NumPalDevices(); ++deviceIdx) + { + VK_ASSERT(allocatorSize == PalDevice(deviceIdx)->GetCmdAllocatorSize(createInfo, &palResult)); + + palResult = PalDevice(deviceIdx)->CreateCmdAllocator( + createInfo, + Util::VoidPtrInc(pAllocatorMem, allocatorSize * deviceIdx), + &m_perGpu[deviceIdx].pSharedPalCmdAllocator); + + if (palResult != Pal::Result::Success) + { + if (m_perGpu[DefaultDeviceIndex].pSharedPalCmdAllocator != nullptr) + { + DestroySharedPalCmdAllocator(); + } + else + { + m_pInstance->FreeMem(pAllocatorMem); + } + + result = PalToVkError(palResult); + break; + } + } + } + else + { + result = VK_ERROR_OUT_OF_HOST_MEMORY; + } + + return result; +} + +// ===================================================================================================================== +void Device::DestroySharedPalCmdAllocator() +{ + for (uint32_t deviceIdx = 0; deviceIdx < NumPalDevices(); deviceIdx++) + { + if (m_perGpu[deviceIdx].pSharedPalCmdAllocator != nullptr) + { + m_perGpu[deviceIdx].pSharedPalCmdAllocator->Destroy(); + } + } + + m_pInstance->FreeMem(m_perGpu[DefaultDeviceIndex].pSharedPalCmdAllocator); +} + // ===================================================================================================================== VkResult Device::AllocBorderColorPalette() { diff --git a/icd/api/vk_dispatch.cpp b/icd/api/vk_dispatch.cpp index 6b2c17e9..854b3a86 100644 --- a/icd/api/vk_dispatch.cpp +++ b/icd/api/vk_dispatch.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_event.cpp b/icd/api/vk_event.cpp index 6580fbc5..70ad538a 100644 --- a/icd/api/vk_event.cpp +++ b/icd/api/vk_event.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_fence.cpp b/icd/api/vk_fence.cpp index b7c759f7..f046dd00 100644 --- a/icd/api/vk_fence.cpp +++ b/icd/api/vk_fence.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_formats.cpp b/icd/api/vk_formats.cpp index 7ac3f5d6..c4807f68 100644 --- a/icd/api/vk_formats.cpp +++ b/icd/api/vk_formats.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_framebuffer.cpp b/icd/api/vk_framebuffer.cpp index fa7f1ee6..999d9d08 100644 --- a/icd/api/vk_framebuffer.cpp +++ b/icd/api/vk_framebuffer.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_gpa_session.cpp b/icd/api/vk_gpa_session.cpp index 143005c3..4b4f9fa4 100644 --- a/icd/api/vk_gpa_session.cpp +++ b/icd/api/vk_gpa_session.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_graphics_pipeline.cpp b/icd/api/vk_graphics_pipeline.cpp index 9cdb11dd..2e6809a2 100644 --- a/icd/api/vk_graphics_pipeline.cpp +++ b/icd/api/vk_graphics_pipeline.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -499,6 +499,7 @@ VkResult GraphicsPipeline::Create( objectCreateInfo.immedInfo.checkDeferCompilePipeline = pDevice->GetRuntimeSettings().deferCompileOptimizedPipeline && (binaryCreateInfo.pipelineInfo.enableEarlyCompile || binaryCreateInfo.pipelineInfo.enableUberFetchShader); + objectCreateInfo.flags.isPointSizeUsed = binaryCreateInfo.pipelineMetadata.pointSizeUsed; // 5. Create pipeline objects result = CreatePipelineObjects( pDevice, diff --git a/icd/api/vk_image.cpp b/icd/api/vk_image.cpp index 5621068a..0c1f29b2 100644 --- a/icd/api/vk_image.cpp +++ b/icd/api/vk_image.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_image_view.cpp b/icd/api/vk_image_view.cpp index d24ae73a..32cbb2d5 100644 --- a/icd/api/vk_image_view.cpp +++ b/icd/api/vk_image_view.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_instance.cpp b/icd/api/vk_instance.cpp index e6a73eb9..8bf710bf 100644 --- a/icd/api/vk_instance.cpp +++ b/icd/api/vk_instance.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2015-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_memory.cpp b/icd/api/vk_memory.cpp index f91bf10d..02df6c68 100644 --- a/icd/api/vk_memory.cpp +++ b/icd/api/vk_memory.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -116,6 +116,11 @@ VkResult Memory::Create( if (pDevice->ShouldAddRemoteBackupHeap(DefaultDeviceIndex, pAllocInfo->memoryTypeIndex, createInfo.heaps[0])) { createInfo.heaps[createInfo.heapCount++] = Pal::GpuHeapGartUswc; + + if (createInfo.heaps[0] != Pal::GpuHeapLocal) + { + createInfo.heaps[createInfo.heapCount++] = Pal::GpuHeapLocal; + } } if (pDevice->NumPalDevices() > 1) @@ -207,9 +212,7 @@ VkResult Memory::Create( )); #endif createInfo.flags.interprocess = 1; -#if PAL_CLIENT_INTERFACE_MAJOR_VERSION >= 657 createInfo.flags.explicitSync = 1; -#endif // Todo: we'd better to pass in the handleTypes to the Pal as well. // The supported handleType should also be provided by Pal as Device Capabilities. } @@ -753,9 +756,7 @@ VkResult Memory::OpenExternalSharedImage( Pal::ExternalImageOpenInfo palOpenInfo = {}; -#if PAL_CLIENT_INTERFACE_MAJOR_VERSION >= 645 palOpenInfo.extent = pBoundImage->PalImage(DefaultDeviceIndex)->GetImageCreateInfo().extent; -#endif palOpenInfo.swizzledFormat = VkToPalFormat(pBoundImage->GetFormat(), pDevice->GetRuntimeSettings()); palOpenInfo.usage = VkToPalImageUsageFlags(pBoundImage->GetImageUsage(), 1, diff --git a/icd/api/vk_physical_device.cpp b/icd/api/vk_physical_device.cpp index ff0cfcc1..0ae4b475 100644 --- a/icd/api/vk_physical_device.cpp +++ b/icd/api/vk_physical_device.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -706,6 +706,35 @@ VkResult PhysicalDevice::Initialize() if (result == Pal::Result::Success) { result = m_pPalDevice->GetGpuMemoryHeapProperties(heapProperties); + + if (settings.overrideLocalHeapSizeInGBs > 0) + { + constexpr Pal::gpusize BytesInOneGB = (1024 * 1024 * 1024); // bytes + + const Pal::gpusize forceMinLocalHeapSize = (settings.overrideLocalHeapSizeInGBs * BytesInOneGB); + + const Pal::gpusize totalLocalHeapSize = heapProperties[Pal::GpuHeapLocal].heapSize + + heapProperties[Pal::GpuHeapInvisible].heapSize; + + if (forceMinLocalHeapSize > totalLocalHeapSize) + { + // If there's no local invisible heap, override the heapsize for Local visible heap, + // else, keep local visible heap size to whatever is reported by PAL (256 MBs) and + // adjust the Local invisible heap size accordingly. + if (heapProperties[Pal::GpuHeapInvisible].heapSize == 0) + { + heapProperties[Pal::GpuHeapLocal].heapSize = forceMinLocalHeapSize; + heapProperties[Pal::GpuHeapLocal].physicalHeapSize = forceMinLocalHeapSize; + } + else + { + heapProperties[Pal::GpuHeapInvisible].heapSize = forceMinLocalHeapSize - + heapProperties[Pal::GpuHeapLocal].heapSize; + heapProperties[Pal::GpuHeapInvisible].physicalHeapSize = forceMinLocalHeapSize - + heapProperties[Pal::GpuHeapLocal].heapSize; + } + } + } } if (result == Pal::Result::Success) @@ -2144,7 +2173,7 @@ uint32_t PhysicalDevice::GetSupportedAPIVersion() const // ===================================================================================================================== // Retrieve device properties. Called in response to vkGetPhysicalDeviceProperties. -VkResult PhysicalDevice::GetDeviceProperties( +void PhysicalDevice::GetDeviceProperties( VkPhysicalDeviceProperties* pProperties) const { VK_ASSERT(pProperties != nullptr); @@ -2197,8 +2226,6 @@ VkResult PhysicalDevice::GetDeviceProperties( static_assert(sizeof(m_pipelineCacheUUID.raw) == VK_UUID_SIZE, "sizeof(Util::Uuid::Uuid) must be VK_UUID_SIZE"); memcpy(pProperties->pipelineCacheUUID, m_pipelineCacheUUID.raw, VK_UUID_SIZE); - - return VK_SUCCESS; } // ===================================================================================================================== @@ -2959,12 +2986,8 @@ VkResult PhysicalDevice::GetSurfaceCapabilities( pSurfaceCapabilities->maxImageCount = swapChainProperties.maxImageCount; -#if PAL_CLIENT_INTERFACE_MAJOR_VERSION >= 610 pSurfaceCapabilities->supportedCompositeAlpha = PalToVkSupportedCompositeAlphaMode(swapChainProperties.compositeAlphaMode); -#else - pSurfaceCapabilities->supportedCompositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; -#endif pSurfaceCapabilities->supportedTransforms = swapChainProperties.supportedTransforms; pSurfaceCapabilities->currentTransform = PalToVkSurfaceTransform(swapChainProperties.currentTransforms); @@ -7910,10 +7933,7 @@ VKAPI_ATTR void VKAPI_CALL vkGetPhysicalDeviceProperties( VkPhysicalDeviceProperties* pProperties) { VK_ASSERT(pProperties != nullptr); - - VkResult result = ApiPhysicalDevice::ObjectFromHandle(physicalDevice)->GetDeviceProperties(pProperties); - - VK_IGNORE(result); + ApiPhysicalDevice::ObjectFromHandle(physicalDevice)->GetDeviceProperties(pProperties); } // ===================================================================================================================== diff --git a/icd/api/vk_physical_device_manager.cpp b/icd/api/vk_physical_device_manager.cpp index d815da6d..d98a5379 100644 --- a/icd/api/vk_physical_device_manager.cpp +++ b/icd/api/vk_physical_device_manager.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_pipeline.cpp b/icd/api/vk_pipeline.cpp index b0e7f85d..70dece45 100644 --- a/icd/api/vk_pipeline.cpp +++ b/icd/api/vk_pipeline.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_pipeline_cache.cpp b/icd/api/vk_pipeline_cache.cpp index 806e31c3..e1b62b16 100644 --- a/icd/api/vk_pipeline_cache.cpp +++ b/icd/api/vk_pipeline_cache.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_pipeline_layout.cpp b/icd/api/vk_pipeline_layout.cpp index fad27a5f..5a9305a1 100644 --- a/icd/api/vk_pipeline_layout.cpp +++ b/icd/api/vk_pipeline_layout.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_private_data_slot.cpp b/icd/api/vk_private_data_slot.cpp index ef03199b..ba178a3d 100644 --- a/icd/api/vk_private_data_slot.cpp +++ b/icd/api/vk_private_data_slot.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_query.cpp b/icd/api/vk_query.cpp index faff6804..159ed1f5 100644 --- a/icd/api/vk_query.cpp +++ b/icd/api/vk_query.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_queue.cpp b/icd/api/vk_queue.cpp index e7585561..1c73bd56 100644 --- a/icd/api/vk_queue.cpp +++ b/icd/api/vk_queue.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -29,6 +29,7 @@ *********************************************************************************************************************** */ +#include "include/cmd_buffer_ring.h" #include "include/vk_buffer.h" #include "include/vk_cmdbuffer.h" #include "include/vk_conv.h" @@ -48,7 +49,6 @@ #include "sqtt/sqtt_layer.h" -#include "palDequeImpl.h" #include "palQueue.h" namespace vk @@ -63,7 +63,8 @@ Queue::Queue( Pal::IQueue** pPalQueues, Pal::IQueue** pPalTmzQueues, Pal::IQueueSemaphore** pPalTmzSemaphores, - VirtualStackAllocator* pStackAllocator) + VirtualStackAllocator* pStackAllocator, + CmdBufferRing* pCmdBufferRing) : m_lastSubmissionProtected(false), m_pDevice(pDevice), @@ -71,7 +72,8 @@ Queue::Queue( m_queueIndex(queueIndex), m_queueFlags(queueFlags), m_pDevModeMgr(pDevice->VkInstance()->GetDevModeMgr()), - m_pStackAllocator(pStackAllocator) + m_pStackAllocator(pStackAllocator), + m_pCmdBufferRing(pCmdBufferRing) { if (pPalQueues != nullptr) { @@ -98,7 +100,6 @@ Queue::Queue( for (uint32_t deviceIdx = 0; deviceIdx < MaxPalDevices; deviceIdx++) { m_pDummyCmdBuffer[deviceIdx] = nullptr; - m_pCmdBufRing[deviceIdx] = nullptr; } const Pal::DeviceProperties& deviceProps = m_pDevice->VkPhysicalDevice(DefaultDeviceIndex)->PalProperties(); @@ -116,8 +117,11 @@ Queue::~Queue() m_pDummyCmdBuffer[deviceIdx]->Destroy(); m_pDevice->VkInstance()->FreeMem(m_pDummyCmdBuffer[deviceIdx]); } + } - DestroyCmdBufRing(deviceIdx); + if (m_pCmdBufferRing != nullptr) + { + m_pCmdBufferRing->Destroy(m_pDevice); } if (m_pStackAllocator != nullptr) @@ -204,8 +208,11 @@ VkResult Queue::NotifyFlipMetadata( if ((flags.frameBeginFlag == 1) || (flags.frameEndFlag == 1) || (flags.primaryHandle == 1) || (pCmdBufState != nullptr) || forceSubmit) { + Pal::IQueue* pPalQueue = m_pPalQueues[deviceIdx]; Pal::CmdBufInfo cmdBufInfo = {}; + cmdBufInfo.isValid = 1; + if (flags.frameBeginFlag == 1) { cmdBufInfo.frameBegin = 1; @@ -221,7 +228,7 @@ VkResult Queue::NotifyFlipMetadata( } // Submit the flip metadata to the appropriate device and present queue for the software compositing path. - if ((pPresentQueue != nullptr) && (pPresentQueue != m_pPalQueues[deviceIdx])) + if ((pPresentQueue != nullptr) && (pPresentQueue != pPalQueue)) { result = m_pDevice->SwCompositingNotifyFlipMetadata(pPresentQueue, cmdBufInfo); } @@ -230,7 +237,7 @@ VkResult Queue::NotifyFlipMetadata( // If there's already a command buffer that needs to be submitted, use it instead of a dummy one. if (pCmdBufState != nullptr) { - result = SubmitInternalCmdBuf(deviceIdx, cmdBufInfo, pCmdBufState); + result = m_pCmdBufferRing->SubmitCmdBuffer(m_pDevice, deviceIdx, pPalQueue, cmdBufInfo, pCmdBufState); } else { @@ -250,7 +257,7 @@ VkResult Queue::NotifyFlipMetadata( submitInfo.pPerSubQueueInfo = &perSubQueueInfo; submitInfo.perSubQueueInfoCount = 1; - result = PalToVkResult(m_pPalQueues[deviceIdx]->Submit(submitInfo)); + result = PalToVkResult(pPalQueue->Submit(submitInfo)); } } } @@ -1061,7 +1068,7 @@ VkResult Queue::Present( &presentInfo, m_flipStatus.flipFlags); - CmdBufState* pCmdBufState = AcquireInternalCmdBuf(presentationDeviceIdx); + CmdBufState* pCmdBufState = m_pCmdBufferRing->AcquireCmdBuffer(m_pDevice, presentationDeviceIdx); // Ensure metadata is available before post processing. if (pSwapChain->GetFullscreenMgr() != nullptr) @@ -1654,202 +1661,6 @@ VkResult Queue::BindSparse( return result; } -// ===================================================================================================================== -// Initializes the command buffer ring -void Queue::CreateCmdBufRing( - uint32_t deviceIdx) -{ - void* pMemory = m_pDevice->VkInstance()->AllocMem(sizeof(CmdBufRing), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); - - if (pMemory != nullptr) - { - m_pCmdBufRing[deviceIdx] = VK_PLACEMENT_NEW(pMemory) CmdBufRing(m_pDevice->VkInstance()->Allocator()); - } - - VK_ASSERT(m_pCmdBufRing[deviceIdx] != nullptr); -} - -// ===================================================================================================================== -// Destroys a ring buffer and frees any memory associated with it -void Queue::DestroyCmdBufRing( - uint32_t deviceIdx) -{ - // Destroy the command buffer ring - if (m_pCmdBufRing[deviceIdx] != nullptr) - { - while (m_pCmdBufRing[deviceIdx]->NumElements() > 0) - { - CmdBufState* pCmdBufState = nullptr; - m_pCmdBufRing[deviceIdx]->PopFront(&pCmdBufState); - DestroyCmdBufState(deviceIdx, pCmdBufState); - } - - Util::Destructor(m_pCmdBufRing[deviceIdx]); - m_pDevice->VkInstance()->FreeMem(m_pCmdBufRing[deviceIdx]); - m_pCmdBufRing[deviceIdx] = nullptr; - } -} - -// ===================================================================================================================== -// Initializes the command buffer state -CmdBufState* Queue::CreateCmdBufState( - uint32_t deviceIdx) -{ - CmdBufState* pCmdBufState = nullptr; - - Pal::IDevice* pDevice = m_pDevice->PalDevice(deviceIdx); - - Pal::CmdBufferCreateInfo cmdBufInfo = {}; - - cmdBufInfo.queueType = m_pDevice->GetQueueFamilyPalQueueType(m_queueFamilyIndex); - cmdBufInfo.engineType = m_pDevice->GetQueueFamilyPalEngineType(m_queueFamilyIndex); - cmdBufInfo.pCmdAllocator = m_pDevice->GetSharedCmdAllocator(deviceIdx); - - Pal::FenceCreateInfo fenceInfo = {}; - - size_t cmdBufSize = 0; - size_t fenceSize = 0; - - Pal::Result result; - - cmdBufSize = pDevice->GetCmdBufferSize(cmdBufInfo, &result); - - if (result == Pal::Result::Success) - { - fenceSize = pDevice->GetFenceSize(&result); - } - - size_t totalSize = sizeof(CmdBufState) + cmdBufSize + fenceSize; - - void* pStorage = nullptr; - - if (result == Pal::Result::Success) - { - pStorage = m_pDevice->VkInstance()->AllocMem(totalSize, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); - } - - if (pStorage != nullptr) - { - pCmdBufState = static_cast(pStorage); - pStorage = Util::VoidPtrInc(pStorage, sizeof(CmdBufState)); - - void* pCmdBufStorage = pStorage; - pStorage = Util::VoidPtrInc(pStorage, cmdBufSize); - - void* pFenceStorage = pStorage; - pStorage = Util::VoidPtrInc(pStorage, fenceSize); - - if (result == Pal::Result::Success) - { - result = pDevice->CreateCmdBuffer(cmdBufInfo, pCmdBufStorage, &pCmdBufState->pCmdBuf); - } - - if (result == Pal::Result::Success) - { - result = pDevice->CreateFence(fenceInfo, pFenceStorage, &pCmdBufState->pFence); - } - - VK_ASSERT(Util::VoidPtrInc(pCmdBufState, totalSize) == pStorage); - - if (result != Pal::Result::Success) - { - DestroyCmdBufState(deviceIdx, pCmdBufState); - pCmdBufState = nullptr; - } - } - - return pCmdBufState; -} - -// ===================================================================================================================== -// Destroys a command buffer state and frees any memory associated with it -void Queue::DestroyCmdBufState( - uint32_t deviceIdx, - CmdBufState* pCmdBufState) -{ - // Wait to finish in case still in flight - if (pCmdBufState->pFence->GetStatus() == Pal::Result::NotReady) - { - m_pDevice->PalDevice(deviceIdx)->WaitForFences(1, &pCmdBufState->pFence, true, ~0ULL); - } - - // Destroy Fence - if (pCmdBufState->pFence != nullptr) - { - pCmdBufState->pFence->Destroy(); - } - - // Destroy CmdBuf - if (pCmdBufState->pCmdBuf != nullptr) - { - pCmdBufState->pCmdBuf->Destroy(); - } - - // Free all system memory - m_pDevice->VkInstance()->FreeMem(pCmdBufState); -} - -// ===================================================================================================================== -// Gets a new command buffer from a ring buffer, the cmd of which can be redefined with new command data -CmdBufState* Queue::AcquireInternalCmdBuf( - uint32_t deviceIdx) -{ - CmdBufState* pCmdBufState = nullptr; - - // Initialize on first use - if (m_pCmdBufRing[deviceIdx] == nullptr) - { - CreateCmdBufRing(deviceIdx); - } - - if (m_pCmdBufRing[deviceIdx] != nullptr) - { - // Create a new command buffer if the least recently used one is still busy. - if ((m_pCmdBufRing[deviceIdx]->NumElements() == 0) || - (m_pCmdBufRing[deviceIdx]->Front()->pFence->GetStatus() == Pal::Result::NotReady)) - { - pCmdBufState = CreateCmdBufState(deviceIdx); - } - else - { - m_pCmdBufRing[deviceIdx]->PopFront(&pCmdBufState); - } - - // Immediately push this command buffer onto the back of the deque to avoid leaking memory. - if (pCmdBufState != nullptr) - { - Pal::Result result = m_pCmdBufRing[deviceIdx]->PushBack(pCmdBufState); - - if (result != Pal::Result::Success) - { - // We failed to push this command buffer onto the deque. To avoid leaking memory we must delete it. - DestroyCmdBufState(deviceIdx, pCmdBufState); - pCmdBufState = nullptr; - } - else - { - Pal::CmdBufferBuildInfo buildInfo = {}; - - buildInfo.flags.optimizeOneTimeSubmit = 1; - - result = pCmdBufState->pCmdBuf->Reset(m_pDevice->GetSharedCmdAllocator(deviceIdx), true); - - if (result == Pal::Result::Success) - { - result = pCmdBufState->pCmdBuf->Begin(buildInfo); - } - - if (result != Pal::Result::Success) - { - pCmdBufState = nullptr; - } - } - } - } - - return pCmdBufState; -} - // ===================================================================================================================== // Build post processing commands bool Queue::BuildPostProcessCommands( @@ -1880,9 +1691,8 @@ bool Queue::BuildPostProcessCommands( frameInfo.presentMode = Pal::PresentMode::Unknown; } -#if PAL_CLIENT_INTERFACE_MAJOR_VERSION >= 625 frameInfo.fullScreenFrameMetadataControlFlags.u32All = m_palFrameMetadataControl.flags.u32All; -#endif + bool wasGpuWorkAdded = false; pCmdBuf->CmdPostProcessFrame(frameInfo, &wasGpuWorkAdded); @@ -1893,40 +1703,14 @@ bool Queue::BuildPostProcessCommands( } // ===================================================================================================================== -// Submit post processing commands +// Submits an internally managed command buffer to this queue VkResult Queue::SubmitInternalCmdBuf( uint32_t deviceIdx, const Pal::CmdBufInfo& cmdBufInfo, CmdBufState* pCmdBufState) { - Pal::Result result = pCmdBufState->pCmdBuf->End(); - - if (result == Pal::Result::Success) - { - result = m_pDevice->PalDevice(deviceIdx)->ResetFences(1, &pCmdBufState->pFence); - - // Submit the command buffer - if (result == Pal::Result::Success) - { - Pal::PerSubQueueSubmitInfo perSubQueueInfo = {}; - perSubQueueInfo.cmdBufferCount = 1; - perSubQueueInfo.ppCmdBuffers = &pCmdBufState->pCmdBuf; - perSubQueueInfo.pCmdBufInfoList = &cmdBufInfo; - - Pal::SubmitInfo palSubmitInfo = {}; - - VK_ASSERT(cmdBufInfo.isValid == 1); - - palSubmitInfo.pPerSubQueueInfo = &perSubQueueInfo; - palSubmitInfo.perSubQueueInfoCount = 1; - palSubmitInfo.ppFences = &pCmdBufState->pFence; - palSubmitInfo.fenceCount = 1; - - result = m_pPalQueues[deviceIdx]->Submit(palSubmitInfo); - } - } - - return PalToVkResult(result); + return m_pCmdBufferRing->SubmitCmdBuffer( + m_pDevice, deviceIdx, m_pPalQueues[deviceIdx], cmdBufInfo, pCmdBufState); } VkResult Queue::CreateSqttState( diff --git a/icd/api/vk_render_pass.cpp b/icd/api/vk_render_pass.cpp index bc15c2cc..c62ea3d1 100644 --- a/icd/api/vk_render_pass.cpp +++ b/icd/api/vk_render_pass.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_sampler.cpp b/icd/api/vk_sampler.cpp index 9f7f898e..17725d67 100644 --- a/icd/api/vk_sampler.cpp +++ b/icd/api/vk_sampler.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -143,7 +143,8 @@ VkResult Sampler::Create( samplerInfo.mipLodBias = pCreateInfo->mipLodBias; samplerInfo.maxAnisotropy = static_cast(pCreateInfo->maxAnisotropy); - samplerInfo.compareFunc = VkToPalCompareFunc(pCreateInfo->compareOp); + samplerInfo.compareFunc = (pCreateInfo->compareEnable == VK_FALSE) ? + Pal::CompareFunc::Never : VkToPalCompareFunc(pCreateInfo->compareOp); samplerInfo.minLod = pCreateInfo->minLod; samplerInfo.maxLod = pCreateInfo->maxLod; samplerInfo.borderColorType = VkToPalBorderColorType(pCreateInfo->borderColor); diff --git a/icd/api/vk_sampler_ycbcr_conversion.cpp b/icd/api/vk_sampler_ycbcr_conversion.cpp index e86b283e..f09e50e1 100644 --- a/icd/api/vk_sampler_ycbcr_conversion.cpp +++ b/icd/api/vk_sampler_ycbcr_conversion.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_semaphore.cpp b/icd/api/vk_semaphore.cpp index 2fcec011..451d8974 100644 --- a/icd/api/vk_semaphore.cpp +++ b/icd/api/vk_semaphore.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_shader.cpp b/icd/api/vk_shader.cpp index 4a226a8f..9fba449e 100644 --- a/icd/api/vk_shader.cpp +++ b/icd/api/vk_shader.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_surface.cpp b/icd/api/vk_surface.cpp index 5502ce85..3d2b7bca 100644 --- a/icd/api/vk_surface.cpp +++ b/icd/api/vk_surface.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/api/vk_swapchain.cpp b/icd/api/vk_swapchain.cpp index f3963721..28e5b321 100644 --- a/icd/api/vk_swapchain.cpp +++ b/icd/api/vk_swapchain.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -325,7 +325,7 @@ VkResult SwapChain::Create( pCreateInfo->queueFamilyIndexCount : 0u); bool isPreferWindowedModeOnly = false; -#if PAL_CLIENT_INTERFACE_MAJOR_VERSION >= 684 + Pal::SwapChainProperties swapChainProperties = {}; if (result == VK_SUCCESS) { @@ -343,7 +343,6 @@ VkResult SwapChain::Create( true : false; } } -#endif if (isPreferWindowedModeOnly || (pDevice->VkInstance()->GetProperties().supportExplicitPresentMode) || diff --git a/icd/imported/gputexdecoder/CMakeLists.txt b/icd/imported/gputexdecoder/CMakeLists.txt index 32969959..8b5c84a6 100644 --- a/icd/imported/gputexdecoder/CMakeLists.txt +++ b/icd/imported/gputexdecoder/CMakeLists.txt @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/imported/gputexdecoder/gpuTexDecoder.cpp b/icd/imported/gputexdecoder/gpuTexDecoder.cpp index f8d1350b..310283ef 100755 --- a/icd/imported/gputexdecoder/gpuTexDecoder.cpp +++ b/icd/imported/gputexdecoder/gpuTexDecoder.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -30,6 +30,9 @@ */ #include "gpuTexDecoder.h" #include "shaders.h" +#include "palMetroHash.h" +#include "palHashMapImpl.h" +#include "palMemTrackerImpl.h" namespace GpuTexDecoder { @@ -333,7 +336,8 @@ Device::Device() : m_info({}), m_pTableMemory(nullptr), - m_pPalCmdBuffer (nullptr) + m_pPalCmdBuffer (nullptr), + m_pipelineMap(64, &m_allocator) { } @@ -346,6 +350,11 @@ Device::~Device() m_pTableMemory->Destroy(); PAL_SAFE_FREE(m_pTableMemory, m_info.pPlatform); } + + for (InternalPipelineMap::Iterator itr = m_pipelineMap.Begin(); itr.Get(); itr.Next()) + { + ClientDestroyInternalComputePipeline(m_info, itr.Get()->value.pPipeline, itr.Get()->value.pMemory); + } } // ===================================================================================================================== @@ -362,6 +371,10 @@ void Device::Init( // 1 Image resource for output and 1 TexBuffer for Input m_srdDwords[static_cast(InternalTexConvertCsType::ConvertETC2ToRGBA8)] = 2 * m_imageViewSizeInDwords; + + Pal::Result result = m_pipelineMap.Init(); + + PAL_ASSERT(result == Pal::Result::Success); } // ===================================================================================================================== @@ -606,92 +619,123 @@ uint32* Device::CreateAndBindEmbeddedUserData( // ===================================================================================================================== Pal::IPipeline* Device::GetInternalPipeline( InternalTexConvertCsType type, - const CompileTimeConstants& constInfo) const + const CompileTimeConstants& constInfo) { Pal::IPipeline* pPipeline = nullptr; void* pMemory = nullptr; PipelineBuildInfo buildInfo = {}; GpuDecodeMappingNode resourceNodes[AstcInternalPipelineNodes]; + Util::RWLock* pPipelineLock = const_cast(&m_internalPipelineLock); - if (type == InternalTexConvertCsType::ConvertASTCToRGBA8) - { - uint32 offset = 0; - buildInfo.nodeCount = 1; + Util::MetroHash::Hash hash = {}; + Util::MetroHash64::Hash((uint8*)(constInfo.pConstants), sizeof(uint32) * constInfo.numConstants , &hash.bytes[0]); - // 1.Color UnQuantization Buffer View - resourceNodes[0].nodeType = NodeType::Buffer; - resourceNodes[0].sizeInDwords = m_bufferViewSizeInDwords; - resourceNodes[0].offsetInDwords = 0; - resourceNodes[0].binding = 0; - resourceNodes[0].set = 0; + InternalPipelineKey key = {}; + key.shaderType = type; + key.constInfoHash = Util::MetroHash::Compact32(&hash); - // 2.Trits Quints Buffer View - resourceNodes[1].nodeType = NodeType::Buffer; - resourceNodes[1].sizeInDwords = m_bufferViewSizeInDwords; - resourceNodes[1].offsetInDwords = 1 * m_bufferViewSizeInDwords; - resourceNodes[1].binding = 1; - resourceNodes[1].set = 0; + InternalPipelineMemoryPair* pPipelinePair = nullptr; - // 3.Quant and Transfer Buffer View - resourceNodes[2].nodeType = NodeType::Buffer; - resourceNodes[2].sizeInDwords = m_bufferViewSizeInDwords; - resourceNodes[2].offsetInDwords = 2 * m_bufferViewSizeInDwords; - resourceNodes[2].binding = 2; - resourceNodes[2].set = 0; - - // 4. TexBuffer View for Src Image Buffer - resourceNodes[3].nodeType = NodeType::TexBuffer; - resourceNodes[3].sizeInDwords = m_bufferViewSizeInDwords; - resourceNodes[3].offsetInDwords = 3 * m_bufferViewSizeInDwords; - resourceNodes[3].binding = 3; - resourceNodes[3].set = 0; - - // 5. Image View for Src Image - resourceNodes[4].nodeType = NodeType::Image; - resourceNodes[4].sizeInDwords = m_imageViewSizeInDwords; - resourceNodes[4].offsetInDwords = 4 * m_bufferViewSizeInDwords; - resourceNodes[4].binding = 4; - resourceNodes[4].set = 0; - - // 6. Image View for Dst Image - resourceNodes[5].nodeType = NodeType::Image; - resourceNodes[5].sizeInDwords = m_imageViewSizeInDwords; - resourceNodes[5].offsetInDwords = 4 * m_bufferViewSizeInDwords + m_imageViewSizeInDwords; - resourceNodes[5].binding = 5; - resourceNodes[5].set = 0; - - buildInfo.pUserDataNodes = resourceNodes; - buildInfo.shaderType = InternalTexConvertCsType::ConvertASTCToRGBA8; - GetSpvCode(buildInfo.shaderType, &(buildInfo.code.pSpvCode), &(buildInfo.code.spvSize)); - } - else { - PAL_ASSERT(type == InternalTexConvertCsType::ConvertETC2ToRGBA8); - uint32 offset = 0; - buildInfo.nodeCount = 1; - - // 1. output - resourceNodes[0].nodeType = NodeType::Image; - resourceNodes[0].sizeInDwords = m_imageViewSizeInDwords; - resourceNodes[0].offsetInDwords = 0; - resourceNodes[0].binding = 0; - resourceNodes[0].set = 0; - - //2. input - resourceNodes[1].nodeType = NodeType::Image; - resourceNodes[1].sizeInDwords = m_imageViewSizeInDwords; - resourceNodes[1].offsetInDwords = 1 * m_imageViewSizeInDwords; - resourceNodes[1].binding = 1; - resourceNodes[1].set = 0; - - buildInfo.pUserDataNodes = resourceNodes; - buildInfo.shaderType = InternalTexConvertCsType::ConvertETC2ToRGBA8; - GetSpvCode(buildInfo.shaderType, &(buildInfo.code.pSpvCode), &(buildInfo.code.spvSize)); + Util::RWLockAuto lock(pPipelineLock); + pPipelinePair = m_pipelineMap.FindKey(key); } - ClientCreateInternalComputePipeline(m_info, constInfo, buildInfo, &pPipeline, &pMemory); + if (pPipelinePair == nullptr) + { + Util::RWLockAuto lock(pPipelineLock); + + bool existed = false; + Pal::Result result = m_pipelineMap.FindAllocate(key, &existed, &pPipelinePair); + + if ((existed == false) && (result == Pal::Result::Success) && (pPipelinePair != nullptr)) + { + if (type == InternalTexConvertCsType::ConvertASTCToRGBA8) + { + buildInfo.nodeCount = 1; + + // 1.Color UnQuantization Buffer View + resourceNodes[0].nodeType = NodeType::Buffer; + resourceNodes[0].sizeInDwords = m_bufferViewSizeInDwords; + resourceNodes[0].offsetInDwords = 0; + resourceNodes[0].binding = 0; + resourceNodes[0].set = 0; + + // 2.Trits Quints Buffer View + resourceNodes[1].nodeType = NodeType::Buffer; + resourceNodes[1].sizeInDwords = m_bufferViewSizeInDwords; + resourceNodes[1].offsetInDwords = 1 * m_bufferViewSizeInDwords; + resourceNodes[1].binding = 1; + resourceNodes[1].set = 0; + + // 3.Quant and Transfer Buffer View + resourceNodes[2].nodeType = NodeType::Buffer; + resourceNodes[2].sizeInDwords = m_bufferViewSizeInDwords; + resourceNodes[2].offsetInDwords = 2 * m_bufferViewSizeInDwords; + resourceNodes[2].binding = 2; + resourceNodes[2].set = 0; + + // 4. TexBuffer View for Src Image Buffer + resourceNodes[3].nodeType = NodeType::TexBuffer; + resourceNodes[3].sizeInDwords = m_bufferViewSizeInDwords; + resourceNodes[3].offsetInDwords = 3 * m_bufferViewSizeInDwords; + resourceNodes[3].binding = 3; + resourceNodes[3].set = 0; + + // 5. Image View for Src Image + resourceNodes[4].nodeType = NodeType::Image; + resourceNodes[4].sizeInDwords = m_imageViewSizeInDwords; + resourceNodes[4].offsetInDwords = 4 * m_bufferViewSizeInDwords; + resourceNodes[4].binding = 4; + resourceNodes[4].set = 0; + + // 6. Image View for Dst Image + resourceNodes[5].nodeType = NodeType::Image; + resourceNodes[5].sizeInDwords = m_imageViewSizeInDwords; + resourceNodes[5].offsetInDwords = 4 * m_bufferViewSizeInDwords + m_imageViewSizeInDwords; + resourceNodes[5].binding = 5; + resourceNodes[5].set = 0; + + buildInfo.shaderType = InternalTexConvertCsType::ConvertASTCToRGBA8; + } + else + { + PAL_ASSERT(type == InternalTexConvertCsType::ConvertETC2ToRGBA8); + buildInfo.nodeCount = 1; + + // 1. output + resourceNodes[0].nodeType = NodeType::Image; + resourceNodes[0].sizeInDwords = m_imageViewSizeInDwords; + resourceNodes[0].offsetInDwords = 0; + resourceNodes[0].binding = 0; + resourceNodes[0].set = 0; + + //2. input + resourceNodes[1].nodeType = NodeType::Image; + resourceNodes[1].sizeInDwords = m_imageViewSizeInDwords; + resourceNodes[1].offsetInDwords = 1 * m_imageViewSizeInDwords; + resourceNodes[1].binding = 1; + resourceNodes[1].set = 0; + + buildInfo.shaderType = InternalTexConvertCsType::ConvertETC2ToRGBA8; + } + + buildInfo.pUserDataNodes = resourceNodes; + + GetSpvCode(buildInfo.shaderType, &(buildInfo.code.pSpvCode), &(buildInfo.code.spvSize)); + + result = ClientCreateInternalComputePipeline(m_info, + constInfo, + buildInfo, + &pPipelinePair->pPipeline, + &pPipelinePair->pMemory); + + PAL_ASSERT(result == Pal::Result::Success); + } + } - return pPipeline; + PAL_ASSERT(pPipelinePair->pPipeline); + return pPipelinePair->pPipeline; } // ===================================================================================================================== diff --git a/icd/imported/gputexdecoder/gpuTexDecoder.h b/icd/imported/gputexdecoder/gpuTexDecoder.h index 3d5bbde6..54e19111 100755 --- a/icd/imported/gputexdecoder/gpuTexDecoder.h +++ b/icd/imported/gputexdecoder/gpuTexDecoder.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -37,6 +37,8 @@ #include "palMutex.h" #include "palCmdBuffer.h" #include "palPlatform.h" +#include "palHashMap.h" +#include "palMutex.h" namespace Pal { @@ -113,6 +115,28 @@ struct PipelineBuildInfo InternalTexConvertCsType shaderType; }; +// Map key for map of internal pipelines +struct InternalPipelineKey +{ + InternalTexConvertCsType shaderType; + uint32 constInfoHash; +}; + +struct InternalPipelineMemoryPair +{ + Pal::IPipeline* pPipeline; + void* pMemory; +}; + +using InternalPipelineMap = Util::HashMap< + InternalPipelineKey, + InternalPipelineMemoryPair, + Util::GenericAllocatorTracked, + Util::JenkinsHashFunc, + Util::DefaultEqualFunc, + Util::HashAllocator, + sizeof(InternalPipelineMemoryPair) * 16>; + // Client-provided callback to build an internal compute pipeline. This is called by gpuTexDecoder during initialization // of a gpuTexDecoder device. // @@ -130,6 +154,18 @@ extern Pal::Result ClientCreateInternalComputePipeline( Pal::IPipeline** ppResultPipeline, // Result PAL pipeline object pointer void** ppResultMemory); // (Optional) Result PAL pipeline memory, if different from obj +// Client-provided callback to destroy an internal compute pipeline. This is called by gpuTexDecoder during device destroy. +// +// The client must implement this function to successfully initialize gpuTexDecoder. +// +// @param initInfo [in] Information about the host device +// @param pPipeline [in] Pipeline to be destroyed +// @param pMemory [in] Memory previously allocated to the pipeline (may be different based on client needs) +extern void ClientDestroyInternalComputePipeline( + const DeviceInitInfo& initInfo, + Pal::IPipeline* pPipeline, + void* pMemory); + // ===================================================================================================================== // GPUTEXDECODER device // @@ -211,13 +247,16 @@ class Device Pal::IPipeline* GetInternalPipeline( InternalTexConvertCsType type, - const CompileTimeConstants& constInfo) const; - - DeviceInitInfo m_info; - Pal::IGpuMemory* m_pTableMemory; - Pal::ICmdBuffer* m_pPalCmdBuffer; // The associated PAL cmdbuffer - uint32 m_bufferViewSizeInDwords{0}; - uint32 m_imageViewSizeInDwords{0}; - uint32 m_srdDwords[static_cast(InternalTexConvertCsType::Count)]; + const CompileTimeConstants& constInfo); + + DeviceInitInfo m_info; + Pal::IGpuMemory* m_pTableMemory; + Pal::ICmdBuffer* m_pPalCmdBuffer; // The associated PAL cmdbuffer + uint32 m_bufferViewSizeInDwords{0}; + uint32 m_imageViewSizeInDwords{0}; + uint32 m_srdDwords[static_cast(InternalTexConvertCsType::Count)]; + Util::GenericAllocatorTracked m_allocator; + Util::RWLock m_internalPipelineLock; + InternalPipelineMap m_pipelineMap; }; } diff --git a/icd/imported/gputexdecoder/shaders.h b/icd/imported/gputexdecoder/shaders.h index b031da0b..41aadceb 100644 --- a/icd/imported/gputexdecoder/shaders.h +++ b/icd/imported/gputexdecoder/shaders.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/imported/gputexdecoder/shaders/AstcDecode.comp b/icd/imported/gputexdecoder/shaders/AstcDecode.comp index 744b04ba..ee76253c 100644 --- a/icd/imported/gputexdecoder/shaders/AstcDecode.comp +++ b/icd/imported/gputexdecoder/shaders/AstcDecode.comp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/imported/gputexdecoder/shaders/AstcDecode.h b/icd/imported/gputexdecoder/shaders/AstcDecode.h index 2b1f41c7..7883b89f 100644 --- a/icd/imported/gputexdecoder/shaders/AstcDecode.h +++ b/icd/imported/gputexdecoder/shaders/AstcDecode.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2021-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/imported/gputexdecoder/shaders/Etc2Decode.h b/icd/imported/gputexdecoder/shaders/Etc2Decode.h index 3e2cf89e..b1a4b962 100644 --- a/icd/imported/gputexdecoder/shaders/Etc2Decode.h +++ b/icd/imported/gputexdecoder/shaders/Etc2Decode.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/layers/include/query_dlist.h b/icd/layers/include/query_dlist.h index 36349790..5e61f939 100644 --- a/icd/layers/include/query_dlist.h +++ b/icd/layers/include/query_dlist.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/layers/include/vk_layer_switchable_graphics.h b/icd/layers/include/vk_layer_switchable_graphics.h index 60b1a90b..9b8fcf0f 100644 --- a/icd/layers/include/vk_layer_switchable_graphics.h +++ b/icd/layers/include/vk_layer_switchable_graphics.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/layers/query_dlist.cpp b/icd/layers/query_dlist.cpp index e375e48e..925eb007 100644 --- a/icd/layers/query_dlist.cpp +++ b/icd/layers/query_dlist.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/layers/vk_layer_all_null_devices.cpp b/icd/layers/vk_layer_all_null_devices.cpp index 334ba868..efe35c02 100644 --- a/icd/layers/vk_layer_all_null_devices.cpp +++ b/icd/layers/vk_layer_all_null_devices.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2018-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2018-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/layers/vk_layer_switchable_graphics.cpp b/icd/layers/vk_layer_switchable_graphics.cpp index fef93bf3..7a61dae4 100644 --- a/icd/layers/vk_layer_switchable_graphics.cpp +++ b/icd/layers/vk_layer_switchable_graphics.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2015-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2015-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/make/amdicd.so.def b/icd/make/amdicd.so.def index f5036e9e..ca51582f 100644 --- a/icd/make/amdicd.so.def +++ b/icd/make/amdicd.so.def @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/make/importdefs b/icd/make/importdefs index 3a255d57..202883c3 100644 --- a/icd/make/importdefs +++ b/icd/make/importdefs @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -26,7 +26,7 @@ # This will become the value of PAL_CLIENT_INTERFACE_MAJOR_VERSION. It describes the version of the PAL interface # that the ICD supports. PAL uses this value to enable backwards-compatibility for older interface versions. It must # be updated on each PAL promotion after handling all of the interface changes described in palLib.h. -ICD_PAL_CLIENT_MAJOR_VERSION = 692 +ICD_PAL_CLIENT_MAJOR_VERSION = 696 ICD_PAL_CLIENT_MINOR_VERSION = 0 # This will become the value of GPUOPEN_CLIENT_INTERFACE_MAJOR_VERSION if ICD_GPUOPEN_DEVMODE_BUILD=1. It describes diff --git a/icd/res/ver.h b/icd/res/ver.h index 071b1ac8..5d2ca049 100644 --- a/icd/res/ver.h +++ b/icd/res/ver.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -36,7 +36,7 @@ #define VERSION_MAJOR_STR MAKE_VERSION_STRING(VULKAN_ICD_MAJOR_VERSION) "\0" // Bump up after each promotion to mainline -#define VULKAN_ICD_BUILD_VERSION 210 +#define VULKAN_ICD_BUILD_VERSION 212 // String version is needed with leading zeros and extra termination (unicode) #define VERSION_NUMBER_MINOR VULKAN_ICD_BUILD_VERSION @@ -45,7 +45,7 @@ // These values specify the driver ID and driver info string #define VULKAN_DRIVER_ID VK_DRIVER_ID_AMD_OPEN_SOURCE_KHR // "AMDOPEN" #define VULKAN_DRIVER_NAME_STR "AMD open-source driver" -#define VULKAN_DRIVER_INFO_STR "2021.Q4.3" +#define VULKAN_DRIVER_INFO_STR "2022.Q1.1" // These values tell which version of the conformance test the driver is compliant against #define CTS_VERSION_MAJOR 1 diff --git a/icd/settings/settings.cpp b/icd/settings/settings.cpp index 833b0445..4d36def9 100644 --- a/icd/settings/settings.cpp +++ b/icd/settings/settings.cpp @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -175,6 +175,9 @@ VkResult VulkanSettingsLoader::OverrideProfiledSettings( memset(pInfo, 0, sizeof(Pal::DeviceProperties)); m_pDevice->GetProperties(pInfo); + Pal::GpuMemoryHeapProperties heapProperties[Pal::GpuHeapCount] = {}; + Pal::Result gpuMemoryHeapPropertiesResult = m_pDevice->GetGpuMemoryHeapProperties(heapProperties); + // By allowing the enable/disable to be set by environment variable, any third party platform owners // can enable or disable the feature based on their internal feedback and not have to wait for a driver // update to catch issues @@ -213,10 +216,9 @@ VkResult VulkanSettingsLoader::OverrideProfiledSettings( } // Put command buffers in local for large/resizable BAR systems - Pal::GpuMemoryHeapProperties heapProperties[Pal::GpuHeapCount] = {}; - const gpusize minLocalSize = 256 * 1024 * 1024; + const gpusize minLocalSize = 256 * 1024 * 1024; - if ((m_pDevice->GetGpuMemoryHeapProperties(heapProperties) == Pal::Result::Success) && + if ((gpuMemoryHeapPropertiesResult == Pal::Result::Success) && (heapProperties[Pal::GpuHeapLocal].heapSize > minLocalSize)) { if ((appProfile != AppProfile::WorldWarZ) @@ -619,6 +621,19 @@ VkResult VulkanSettingsLoader::OverrideProfiledSettings( m_settings.nggEnableBackfaceCulling = false; m_settings.nggEnableSmallPrimFilter = false; + if (pInfo->revision == Pal::AsicRevision::Navi23) + { + m_settings.overrideLocalHeapSizeInGBs = 8; + + if ((gpuMemoryHeapPropertiesResult == Pal::Result::Success) && + ((m_settings.overrideLocalHeapSizeInGBs * 1024 * 1024 *1024) > + (heapProperties[Pal::GpuHeapLocal].heapSize + + heapProperties[Pal::GpuHeapInvisible].heapSize))) + { + m_settings.memoryRemoteBackupHeapMinHeapSize = 0x220000000; + m_settings.memoryDeviceOverallocationAllowed = true; + } + } } else if (pInfo->gfxLevel == Pal::GfxIpLevel::GfxIp9) { diff --git a/icd/settings/settings.h b/icd/settings/settings.h index 51265f8e..4dfee30c 100644 --- a/icd/settings/settings.h +++ b/icd/settings/settings.h @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2014-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2014-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/icd/settings/settings_xgl.json b/icd/settings/settings_xgl.json index df071b23..23a82d2d 100644 --- a/icd/settings/settings_xgl.json +++ b/icd/settings/settings_xgl.json @@ -3848,6 +3848,18 @@ "Type": "bool", "Name": "OverrideHeapGartCacheableToUswc" }, + { + "Description": "Forces local heap size to the value specified in GBs. The setting doesn't take affect unless the specified size is greater than actual heap size reported by PAL.", + "Tags": [ + "Memory" + ], + "Defaults": { + "Default": 0 + }, + "Scope": "Driver", + "Type": "uint32", + "Name": "OverrideLocalHeapSizeInGBs" + }, { "Description": "for APU, set local and local invisibl heap size to 0, Force to use system memory.", "Tags": [ diff --git a/icd/tools/generate/genSettingsCode.py b/icd/tools/generate/genSettingsCode.py index 95c8139d..94607b49 100644 --- a/icd/tools/generate/genSettingsCode.py +++ b/icd/tools/generate/genSettingsCode.py @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/tools/generate/genShaderProfile.py b/icd/tools/generate/genShaderProfile.py index 15fb0117..fd878fa5 100644 --- a/icd/tools/generate/genShaderProfile.py +++ b/icd/tools/generate/genShaderProfile.py @@ -2,7 +2,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2020-2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/tools/generate/shaderProfileTemplate.py b/icd/tools/generate/shaderProfileTemplate.py index 951afc7f..c176266b 100644 --- a/icd/tools/generate/shaderProfileTemplate.py +++ b/icd/tools/generate/shaderProfileTemplate.py @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2020-2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/tools/generate/vulkanSettingsCodeTemplates.py b/icd/tools/generate/vulkanSettingsCodeTemplates.py index d8980027..3d0a6b8e 100644 --- a/icd/tools/generate/vulkanSettingsCodeTemplates.py +++ b/icd/tools/generate/vulkanSettingsCodeTemplates.py @@ -1,7 +1,7 @@ ## ####################################################################################################################### # - # Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All Rights Reserved. + # Copyright (c) 2017-2022 Advanced Micro Devices, Inc. All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/icd/tools/xgl-copyright-template.txt b/icd/tools/xgl-copyright-template.txt index 647f20d2..21fca13d 100644 --- a/icd/tools/xgl-copyright-template.txt +++ b/icd/tools/xgl-copyright-template.txt @@ -1,7 +1,7 @@ /* *********************************************************************************************************************** * - * Copyright (c) 2020-2021 Advanced Micro Devices, Inc. All Rights Reserved. + * Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal