Skip to content

Commit

Permalink
Update xgl from commit 2aeb0b25
Browse files Browse the repository at this point in the history
* Hook up resources for ray history traces via PAL trace
* Initial changes for VK_EXT_device_address_binding_report
* Update PAL Version in XGL 796
* Update Khronos Vulkan Headers to 1.3.250
* Refine pipeline cache in GPL
* Fix push descriptor spilled to spill table
* The api hash dump name should be set false as default
* Support new dynamic state vertexBufferCount
* Refine Pipeline dump
* Check whether the image view of the color/depth/stencil attachment is a null handle
* Fix GPL fast link fail on nv2x
* Link enableImplicitInvariantExports to driver-level disableImplicitInvariantExports
* [DebugPrintf]Fixed the case to read entryHeader
* [DebugPrintf]Fixed the pPtr header
* Support BinaryInfo in ShaderEarlyCompileInfo for GPL caching
* Enable PalDeveloperCb immediately after the Pal Platform is created
* Fix ColorspaceHelper's lookup table so it only reports formats that are legal
* Bump Gpurt Version to 33
* Add astc hdr support
* [CTS_Next] dEQP-VK.pipeline.*.extended_dynamic_state.*.large_static_rasterization_samples_* - tests crash
* [CTS_Next] dEQP-VK.pipeline.*.extended_dynamic_state.*color_blend_dual* - tests fail
* Update supported CTS to 1.3.3.1
* Expose VK_EXT_mutable_descriptor_type
* Add EnableFusedInstanceNode
* Navi3x tuning for Rage2
* Add appProfile for SOTTR
* Fix Noisy Asserts & Alerts
* Correlation information does not come for some binds
* Mutable descriptor type, fix array element pointer calculation bug
* Remove descriptor buffer memory type for Images
* Potential crash when calculating pipeline cache id
* Force initialization of disableImplicitInvariantExports in LLPC builds
* Expose disableImplicitInvariantExports to LLPC
* Switch to Parallel Build Path
* Add sleep to help wait for debugger to attach
* Corruption Observed in Unigine Heaven/Unigine Valley Using Zink
* SE 5 Radeon Relive TDR
* HDR is not supported on Doom Eternal
* Config emulatedRtIp in raytracing device init
* Fix issues in the DebugPrintf
* [Navi31][TotalWar:Rome Remastered]Random corruption in gameplay
* Yuzu - Metroid Prime Remastered: Corruption & Crash on game load
  • Loading branch information
WenqingLiAMD committed May 18, 2023
1 parent 5301cf5 commit 02e867e
Show file tree
Hide file tree
Showing 64 changed files with 2,178 additions and 1,233 deletions.
4 changes: 2 additions & 2 deletions cmake/XglVersions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ include_guard()
# 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.
set(ICD_PAL_CLIENT_MAJOR_VERSION "792")
set(ICD_PAL_CLIENT_MAJOR_VERSION "796")

# This will become the value of GPUOPEN_CLIENT_INTERFACE_MAJOR_VERSION if ICD_GPUOPEN_DEVMODE_BUILD=1.
# It describes the interface version of the gpuopen shared module (part of PAL) that the ICD supports.
Expand All @@ -37,7 +37,7 @@ set(ICD_GPUOPEN_CLIENT_MAJOR_VERSION "42")
#if VKI_RAY_TRACING
# This will become the value of GPURT_CLIENT_INTERFACE_MAJOR_VERSION if VKI_RAY_TRACING=1.
# It describes the interface version of the GpuRT shared module that the ICD supports.
set(ICD_GPURT_CLIENT_MAJOR_VERSION "32")
set(ICD_GPURT_CLIENT_MAJOR_VERSION "33")
#endif

# This will become the value of LLPC_CLIENT_INTERFACE_MAJOR_VERSION if ICD_BUILD_LLPC=1.
Expand Down
4 changes: 2 additions & 2 deletions icd/Loader/LunarG/Lnx/amd-icd.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"file_format_version": "1.0.0",
"ICD": {
"library_path": "@AMDVLK_INSTALL_PATH@/amdvlk@[email protected]",
"api_version": "1.3.246"
"api_version": "1.3.250"
},
"layer": {
"name": "VK_LAYER_AMD_switchable_graphics_@ISABITS@",
"type": "GLOBAL",
"library_path": "@AMDVLK_INSTALL_PATH@/amdvlk@[email protected]",
"api_version": "1.3.246",
"api_version": "1.3.250",
"implementation_version": "1",
"description": "AMD switchable graphics layer",
"functions": {
Expand Down
31 changes: 31 additions & 0 deletions icd/api/app_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ constexpr AppProfilePatternEntry AppNameSeriousSam4Win =
"serious sam 4 - 64bit"
};

constexpr AppProfilePatternEntry AppNameRomeRemasteredLinux =
{
PatternAppNameLower,
"rome"
};

constexpr AppProfilePatternEntry AppEngineSedp =
{
PatternEngineNameLower,
Expand Down Expand Up @@ -375,6 +381,13 @@ constexpr AppProfilePatternEntry AppEngineSaschaWillemsExamples =
"vulkanexample"
};

//steam version of shadow of tomb raider
constexpr AppProfilePatternEntry AppNameSOTTR =
{
PatternAppNameLower,
"sottr.exe"
};

#if VKI_RAY_TRACING
constexpr AppProfilePatternEntry AppEngineVKD3D =
{
Expand Down Expand Up @@ -902,6 +915,15 @@ AppProfilePattern AppPatternTable[] =
}
},

{
AppProfile::RomeRemastered,
{
AppNameRomeRemasteredLinux,
AppEngineFeral3D,
PatternEnd
}
},

{
AppProfile::ThreeKingdoms,
{
Expand Down Expand Up @@ -1161,6 +1183,15 @@ AppProfilePattern AppPatternTable[] =
}
},

{
AppProfile::SOTTR,
{
AppNameSOTTR,
AppEngineDXVK,
PatternEnd
}
},

#if VKI_RAY_TRACING
{
AppProfile::ControlDX12,
Expand Down
3 changes: 2 additions & 1 deletion icd/api/app_shader_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ void ShaderOptimizer::CalculateMatchingProfileEntriesHash(
pHasher->Update(shaderAction.pipelineShader);
pHasher->Update(shaderAction.shaderCreate);

if (shaderAction.shaderReplace.pCode != nullptr)
if (shaderAction.shaderCreate.apply.shaderReplaceEnabled &&
(shaderAction.shaderReplace.pCode != nullptr))
{
pHasher->Update(
static_cast<const uint8_t*>(shaderAction.shaderReplace.pCode),
Expand Down
6 changes: 3 additions & 3 deletions icd/api/color_space_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ struct LookupDefines

const LookupDefines colorspaceLookup[] =
{
{ Pal::ScreenColorSpace::CsSrgb, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, FmtSupport::Fmt_All },
{ Pal::ScreenColorSpace::CsSrgb, VK_COLOR_SPACE_SRGB_NONLINEAR_KHR, FmtSupport::Fmt_8bpc },
{ Pal::ScreenColorSpace::CsBt709, VK_COLOR_SPACE_BT709_NONLINEAR_EXT, FmtSupport::Fmt_All },
{ Pal::ScreenColorSpace::TfHlg, VK_COLOR_SPACE_HDR10_HLG_EXT, FmtSupport::Fmt_KnownHDR },
{ Pal::ScreenColorSpace::TfPq2084, VK_COLOR_SPACE_HDR10_ST2084_EXT, FmtSupport::Fmt_KnownHDR },
{ Pal::ScreenColorSpace::TfPq2084, VK_COLOR_SPACE_HDR10_ST2084_EXT, FmtSupport::Fmt_10bpc },
{ Pal::ScreenColorSpace::TfDolbyVision, VK_COLOR_SPACE_DOLBYVISION_EXT, FmtSupport::Fmt_8bpc_unorm },
{ Pal::ScreenColorSpace::CsBt2020, VK_COLOR_SPACE_BT2020_LINEAR_EXT, FmtSupport::Fmt_KnownHDR },
{ Pal::ScreenColorSpace::CsBt2020, VK_COLOR_SPACE_BT2020_LINEAR_EXT, FmtSupport::Fmt_10bpc },
{ Pal::ScreenColorSpace::CsAdobe, VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT, FmtSupport::Fmt_All },
{ Pal::ScreenColorSpace::CsDciP3, VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT, FmtSupport::Fmt_All },
{ Pal::ScreenColorSpace::CsScrgb, VK_COLOR_SPACE_EXTENDED_SRGB_LINEAR_EXT, FmtSupport::Fmt_16bpc_sfloat },
Expand Down
6 changes: 3 additions & 3 deletions icd/api/compiler_solution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ CompilerSolution::~CompilerSolution()
// =====================================================================================================================
// Initialize CompilerSolution class
VkResult CompilerSolution::Initialize(
Vkgc::GfxIpVersion gfxIp,
Pal::GfxIpLevel gfxIpLevel,
Vkgc::ICache* pCache)
Vkgc::GfxIpVersion gfxIp,
Pal::GfxIpLevel gfxIpLevel,
PipelineBinaryCache* pCache)
{
m_gfxIp = gfxIp;
m_gfxIpLevel = gfxIpLevel;
Expand Down
110 changes: 62 additions & 48 deletions icd/api/compiler_solution_llpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,21 @@ CompilerSolutionLlpc::~CompilerSolutionLlpc()
// =====================================================================================================================
// Initialize CompilerSolutionLlpc class
VkResult CompilerSolutionLlpc::Initialize(
Vkgc::GfxIpVersion gfxIp,
Pal::GfxIpLevel gfxIpLevel,
Vkgc::ICache* pCache)
Vkgc::GfxIpVersion gfxIp,
Pal::GfxIpLevel gfxIpLevel,
PipelineBinaryCache* pCache)
{
const RuntimeSettings& settings = m_pPhysicalDevice->GetRuntimeSettings();
Vkgc::ICache* pInternalCache = pCache;
if (settings.shaderCacheMode == ShaderCacheDisable)
Vkgc::ICache* pInternalCache = nullptr;
if (pCache != nullptr)
{
pInternalCache = nullptr;
if (settings.shaderCacheMode != ShaderCacheDisable)
{
pInternalCache = pCache->GetCacheAdapter();
}
}

VkResult result = CompilerSolution::Initialize(gfxIp, gfxIpLevel, pInternalCache);
VkResult result = CompilerSolution::Initialize(gfxIp, gfxIpLevel, pCache);

if (result == VK_SUCCESS)
{
Expand All @@ -91,32 +94,12 @@ void CompilerSolutionLlpc::Destroy()
}
}

// =====================================================================================================================
// Get size of shader cache object
size_t CompilerSolutionLlpc::GetShaderCacheSize(
PipelineCompilerType cacheType)
{
VK_NEVER_CALLED();
return 0;
}

// =====================================================================================================================
// Creates shader cache object.
VkResult CompilerSolutionLlpc::CreateShaderCache(
const void* pInitialData,
size_t initialDataSize,
void* pShaderCacheMem,
uint32_t expectedEntries,
ShaderCache* pShaderCache)
{
return VK_ERROR_INITIALIZATION_FAILED;
}

// =====================================================================================================================
// Builds shader module from SPIR-V binary code.
VkResult CompilerSolutionLlpc::BuildShaderModule(
const Device* pDevice,
VkShaderModuleCreateFlags flags,
VkShaderModuleCreateFlags internalShaderFlags,
size_t codeSize,
const void* pCode,
const bool adaptForFastLink,
Expand All @@ -142,7 +125,7 @@ VkResult CompilerSolutionLlpc::BuildShaderModule(
pPipelineCompiler->ApplyPipelineOptions(pDevice, 0, &moduleInfo.options.pipelineOptions);

#if VKI_RAY_TRACING
if ((flags & VK_SHADER_MODULE_RAY_TRACING_INTERNAL_SHADER_BIT) != 0)
if ((internalShaderFlags & VK_INTERNAL_SHADER_FLAGS_RAY_TRACING_INTERNAL_SHADER_BIT) != 0)
{
#if LLPC_CLIENT_INTERFACE_MAJOR_VERSION >= 55
moduleInfo.options.pipelineOptions.internalRtShaders = true;
Expand Down Expand Up @@ -183,11 +166,6 @@ void CompilerSolutionLlpc::FreeShaderModule(ShaderModuleHandle* pShaderModule)
auto pInstance = m_pPhysicalDevice->Manager()->VkInstance();

pInstance->FreeMem(pShaderModule->pLlpcShaderModule);

if (pShaderModule->elfPackage.codeSize > 0)
{
pInstance->FreeMem(const_cast<void*>(pShaderModule->elfPackage.pCode));
}
}

// =====================================================================================================================
Expand Down Expand Up @@ -377,36 +355,72 @@ VkResult CompilerSolutionLlpc::CreateGraphicsPipelineBinary(
// Build ElfPackage for a specific shader module based on pipeine information
VkResult CompilerSolutionLlpc::CreateGraphicsShaderBinary(
const Device* pDevice,
PipelineCache* pPipelineCache,
const ShaderStage stage,
GraphicsPipelineBinaryCreateInfo* pCreateInfo,
void* pPipelineDumpHandle,
ShaderModuleHandle* pShaderModule)
{
VkResult result = VK_SUCCESS;
Util::MetroHash::Hash cacheId = {};

// Build the LLPC pipeline
Llpc::GraphicsPipelineBuildOut pipelineOut = {};

Vkgc::UnlinkedShaderStage unlinkedStage = UnlinkedStageCount;

// Belong to vertexProcess stage before fragment
if (stage < ShaderStage::ShaderStageFragment)
bool hitCache = false;
if ((pPipelineCache != nullptr) && (pPipelineCache->GetPipelineCache() != nullptr))
{
unlinkedStage = UnlinkedShaderStage::UnlinkedStageVertexProcess;
Vkgc::BinaryData elfPackage = {};
Util::MetroHash128 hasher;
hasher.Update(pCreateInfo->libraryHash[stage]);
hasher.Update(m_pPhysicalDevice->GetSettingsLoader()->GetSettingsHash());
hasher.Finalize(cacheId.bytes);
auto pAppCache = pPipelineCache->GetPipelineCache();
hitCache = (pAppCache->LoadPipelineBinary(&cacheId, &elfPackage.codeSize, &elfPackage.pCode)
== Util::Result::Success);
pShaderModule->elfPackage = elfPackage;
}
else if (stage == ShaderStage::ShaderStageFragment)

if (hitCache == false)
{
unlinkedStage = UnlinkedShaderStage::UnlinkedStageFragment;
}
// Build the LLPC pipeline
Llpc::GraphicsPipelineBuildOut pipelineOut = {};
Vkgc::UnlinkedShaderStage unlinkedStage = UnlinkedStageCount;

auto llpcResult = m_pLlpc->buildGraphicsShaderStage(
// Belong to vertexProcess stage before fragment
if (stage < ShaderStage::ShaderStageFragment)
{
unlinkedStage = UnlinkedShaderStage::UnlinkedStageVertexProcess;
}
else if (stage == ShaderStage::ShaderStageFragment)
{
unlinkedStage = UnlinkedShaderStage::UnlinkedStageFragment;
}

auto llpcResult = m_pLlpc->buildGraphicsShaderStage(
&pCreateInfo->pipelineInfo,
&pipelineOut,
unlinkedStage,
pPipelineDumpHandle);
if (llpcResult == Vkgc::Result::Success)
if (llpcResult == Vkgc::Result::Success)
{
pShaderModule->elfPackage = pipelineOut.pipelineBin;
if ((pPipelineCache != nullptr) && (pPipelineCache->GetPipelineCache() != nullptr))
{
pPipelineCache->GetPipelineCache()->StorePipelineBinary(
&cacheId, pipelineOut.pipelineBin.codeSize, pipelineOut.pipelineBin.pCode);
}
}
else
{

result = (llpcResult == Vkgc::Result::ErrorOutOfMemory) ?
VK_ERROR_OUT_OF_HOST_MEMORY : VK_ERROR_INITIALIZATION_FAILED;

}
}

if (result == VK_SUCCESS)
{
pShaderModule->elfPackage = pipelineOut.pipelineBin;
pCreateInfo->earlyElfPackage[stage] = pShaderModule->elfPackage;
pCreateInfo->earlyElfPackageHash[stage] = cacheId;
}

return result;
Expand Down
Loading

0 comments on commit 02e867e

Please sign in to comment.