Skip to content

Commit

Permalink
Update xgl from commit 644d9910
Browse files Browse the repository at this point in the history
* Drop support for gfx8-9 ASICs
* Turn on OptimizeTessFactor
* Remove state needSampleInfo
* Graphics pipeline library fast link support
* Add setting to move clears to beginning of renderpass
* Fix Pipeline Destroy
* Update PAL Version in XGL 827
* Split transfer functions out of vk_cmdbuffer.cpp
* [Ray Tracing] Use new PAL interface for querying the correct stack size in continuations mode
* Fix multiSample for graphics pipeline library
* Move fast link to the begin of GraphicsPipeline::Create
* Defer format string creation
* Update Khronos Vulkan Headers to 1.3.267
* Support graphics pipeline library ELF binary replacement
* Fix CreateGpuMemory return error.
* Use Resource ID for VKImage string logging
* Add appProfile for Enscape.
* [Ray Tracing] Add Panel Setting ForceRebuildForUpdate
* Add LLPC shader tuning for Counter-Strike 2
* VK_EXT_frame_boundary - Driver Implementation
* Fix Missing Vulkan Debug Names
* Remove AppProfile from PipelineCacheUUID
* Move BaldursGate3 app profile out, fix AppProfile changes and restore LLPC tuning for BG3
* Enable NoContract propagation
* Fix warnings that clang 16 complained about
* Bump CMake minimum version to 3.21
* EnableEarlyCompile setting fixes
* Fix crash on vkCmdEndRenderPass
* Fix illegal clear boxes when calling to PAL.
* Create PipelineDumps with Appname
* Refine compiler function parameters
* Add panel setting for d32/d24 to d16
* Setup sort Agnostic barycentric
* Refine pipeline compiler solution
  • Loading branch information
chuang13 committed Oct 18, 2023
1 parent 5f4c7d9 commit c9f6c1c
Show file tree
Hide file tree
Showing 71 changed files with 3,716 additions and 2,786 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
#
#######################################################################################################################

cmake_minimum_required(VERSION 3.13.4)
cmake_minimum_required(VERSION 3.21)
cmake_policy(SET CMP0091 NEW)

# This part set before "project(XGL VERSION 1 LANGUAGES C CXX)".
# In a system has both gcc and clang compiler.
Expand Down
2 changes: 1 addition & 1 deletion 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 "819")
set(ICD_PAL_CLIENT_MAJOR_VERSION "827")

# 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 Down
1 change: 1 addition & 0 deletions icd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ target_sources(xgl PRIVATE
api/vk_buffer.cpp
api/vk_buffer_view.cpp
api/vk_cmdbuffer.cpp
api/vk_cmdbuffer_transfer.cpp
api/vk_cmd_pool.cpp
api/vk_compute_pipeline.cpp
api/vk_conv.cpp
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@ISABITS@.so",
"api_version": "1.3.264"
"api_version": "1.3.267"
},
"layer": {
"name": "VK_LAYER_AMD_switchable_graphics_@ISABITS@",
"type": "GLOBAL",
"library_path": "@AMDVLK_INSTALL_PATH@/amdvlk@ISABITS@.so",
"api_version": "1.3.264",
"api_version": "1.3.267",
"implementation_version": "1",
"description": "AMD switchable graphics layer",
"functions": {
Expand Down
56 changes: 35 additions & 21 deletions icd/api/app_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,12 @@ constexpr AppProfilePatternEntry AppNameRomeRemasteredLinux =
"rome"
};

constexpr AppProfilePatternEntry AppNameEnscape =
{
PatternAppNameLower,
"enscape"
};

constexpr AppProfilePatternEntry AppEngineSedp =
{
PatternEngineNameLower,
Expand Down Expand Up @@ -400,18 +406,6 @@ constexpr AppProfilePatternEntry AppNameSpidermanRemastered =
"spider-man.exe"
};

constexpr AppProfilePatternEntry AppNameYuzu =
{
PatternAppNameLower,
"yuzu emulator"
};

constexpr AppProfilePatternEntry AppEngineYuzu =
{
PatternEngineNameLower,
"yuzu emulator"
};

#if VKI_RAY_TRACING
constexpr AppProfilePatternEntry AppEngineVKD3D =
{
Expand Down Expand Up @@ -706,6 +700,18 @@ constexpr AppProfilePatternEntry AppNameTheSurge2 =
"fledge"
};

constexpr AppProfilePatternEntry AppNameBaldursGate3 =
{
PatternAppNameLower,
"baldur's gate 3"
};

constexpr AppProfilePatternEntry AppEngineDivinity =
{
PatternEngineNameLower,
"the divinity engine"
};

constexpr AppProfilePatternEntry PatternEnd = {};

// This is a table of patterns. The first matching pattern in this table will be returned.
Expand Down Expand Up @@ -1229,6 +1235,15 @@ AppProfilePattern AppPatternTable[] =
}
},

{
AppProfile::BaldursGate3,
{
AppNameBaldursGate3,
AppEngineDivinity,
PatternEnd
}
},

{
AppProfile::SOTTR,
{
Expand All @@ -1254,15 +1269,6 @@ AppProfilePattern AppPatternTable[] =
}
},

{
AppProfile::Yuzu,
{
AppNameYuzu,
AppEngineYuzu,
PatternEnd
}
},

#if VKI_RAY_TRACING
{
AppProfile::ControlDX12,
Expand Down Expand Up @@ -1421,6 +1427,14 @@ AppProfilePattern AppPatternTable[] =
AppEngineZink,
PatternEnd
}
},

{
AppProfile::Enscape,
{
AppNameEnscape,
PatternEnd
}
}
};

Expand Down
62 changes: 18 additions & 44 deletions icd/api/app_resource_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,27 +244,7 @@ void ResourceOptimizer::BuildAppProfile()

// TODO: These need to be auto-generated from source JSON but for now we write profile programmatically

if (appProfile == AppProfile::Doom)
{
if (gfxIpLevel == Pal::GfxIpLevel::GfxIp9)
{
// Disable DCC for resource causing corruption on clear because of the change to reset FCE counts in
// the command buffer when an implicit reset is triggered.
i = m_appProfile.entryCount++;
m_appProfile.entries[i].pattern.match.apiHash = true;
m_appProfile.entries[i].pattern.targetKey.apiHash = 0x0bb76acc72ad6492;
m_appProfile.entries[i].action.resourceCreate.apply.dccMode = 1;
m_appProfile.entries[i].action.resourceCreate.dccMode = DccMode::DccDisableMode;

// Same issue as above but for image when viewed via Renderdoc which adds the Transfer_Dst usage
i = m_appProfile.entryCount++;
m_appProfile.entries[i].pattern.match.apiHash = true;
m_appProfile.entries[i].pattern.targetKey.apiHash = 0x1237495e0bf5594b;
m_appProfile.entries[i].action.resourceCreate.apply.dccMode = 1;
m_appProfile.entries[i].action.resourceCreate.dccMode = DccMode::DccDisableMode;
}
}
else if (appProfile == AppProfile::DoomEternal)
if (appProfile == AppProfile::DoomEternal)
{
if (gfxIpLevel > Pal::GfxIpLevel::GfxIp10_1)
{
Expand Down Expand Up @@ -292,36 +272,30 @@ void ResourceOptimizer::BuildAppProfile()
}
else if (appProfile == AppProfile::SkyGold)
{
if (gfxIpLevel >= Pal::GfxIpLevel::GfxIp10_1)
{
i = m_appProfile.entryCount++;
m_appProfile.entries[i].pattern.match.apiHash = true;
m_appProfile.entries[i].pattern.targetKey.apiHash = 0xdd5e41b92c928478;
m_appProfile.entries[i].action.resourceCreate.apply.dccMode = 1;
m_appProfile.entries[i].action.resourceCreate.dccMode = DccMode::DccDisableMode;
}
i = m_appProfile.entryCount++;
m_appProfile.entries[i].pattern.match.apiHash = true;
m_appProfile.entries[i].pattern.targetKey.apiHash = 0xdd5e41b92c928478;
m_appProfile.entries[i].action.resourceCreate.apply.dccMode = 1;
m_appProfile.entries[i].action.resourceCreate.dccMode = DccMode::DccDisableMode;
}
else if (appProfile == AppProfile::WolfensteinII)
{
// The resource profile created by disabling DCC for usage containing:
// VK_IMAGE_USAGE_STORAGE_BIT & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
// except for format:
// VK_FORMAT_R8G8B8A8_UNORM
if (gfxIpLevel >= Pal::GfxIpLevel::GfxIp10_1)
{
i = m_appProfile.entryCount++;
m_appProfile.entries[i].pattern.match.apiHash = true;
m_appProfile.entries[i].pattern.targetKey.apiHash = 0xf07d02f4cd182cfc;
m_appProfile.entries[i].action.resourceCreate.apply.dccMode = true;
m_appProfile.entries[i].action.resourceCreate.dccMode = DccMode::DccEnableMode;

// This resource is just for RenderDoc
i = m_appProfile.entryCount++;
m_appProfile.entries[i].pattern.match.apiHash = true;
m_appProfile.entries[i].pattern.targetKey.apiHash = 0xa93766a8cca3df9d;
m_appProfile.entries[i].action.resourceCreate.apply.dccMode = true;
m_appProfile.entries[i].action.resourceCreate.dccMode = DccMode::DccEnableMode;
}
i = m_appProfile.entryCount++;
m_appProfile.entries[i].pattern.match.apiHash = true;
m_appProfile.entries[i].pattern.targetKey.apiHash = 0xf07d02f4cd182cfc;
m_appProfile.entries[i].action.resourceCreate.apply.dccMode = true;
m_appProfile.entries[i].action.resourceCreate.dccMode = DccMode::DccEnableMode;

// This resource is just for RenderDoc
i = m_appProfile.entryCount++;
m_appProfile.entries[i].pattern.match.apiHash = true;
m_appProfile.entries[i].pattern.targetKey.apiHash = 0xa93766a8cca3df9d;
m_appProfile.entries[i].action.resourceCreate.apply.dccMode = true;
m_appProfile.entries[i].action.resourceCreate.dccMode = DccMode::DccEnableMode;
}
else if (appProfile == AppProfile::WolfensteinYoungblood)
{
Expand Down
98 changes: 28 additions & 70 deletions icd/api/app_shader_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,16 @@ void ShaderOptimizer::ApplyProfileToShaderCreateInfo(
{
options.pOptions->scalarizeWaterfallLoads = shaderCreate.tuningOptions.scalarizeWaterfallLoads;
}
if (shaderCreate.apply.backwardPropagateNoContract)
{
options.pOptions->backwardPropagateNoContract =
shaderCreate.tuningOptions.backwardPropagateNoContract;
}
if (shaderCreate.apply.forwardPropagateNoContract)
{
options.pOptions->forwardPropagateNoContract =
shaderCreate.tuningOptions.forwardPropagateNoContract;
}
if (shaderCreate.apply.waveSize)
{
options.pOptions->waveSize = shaderCreate.tuningOptions.waveSize;
Expand Down Expand Up @@ -1031,6 +1041,18 @@ void ShaderOptimizer::BuildTuningProfile()
pAction->shaderCreate.tuningOptions.scalarizeWaterfallLoads =
m_settings.overrideScalarizeWaterfallLoads;
}
if (m_settings.overrideBackwardPropagateNoContract)
{
pAction->shaderCreate.apply.backwardPropagateNoContract = true;
pAction->shaderCreate.tuningOptions.backwardPropagateNoContract =
m_settings.overrideBackwardPropagateNoContract;
}
if (m_settings.disableForwardPropagateNoContract)
{
pAction->shaderCreate.apply.forwardPropagateNoContract = true;
pAction->shaderCreate.tuningOptions.backwardPropagateNoContract =
!m_settings.disableForwardPropagateNoContract;
}

switch (m_settings.overrideWaveSize)
{
Expand Down Expand Up @@ -1135,68 +1157,6 @@ void ShaderOptimizer::BuildAppProfileLlpc()

m_appShaderProfile.BuildAppProfileLlpc(appProfile, gfxIpLevel, asicRevision, &m_appProfile);

if (appProfile == AppProfile::Dota2)
{
if ((asicRevision >= Pal::AsicRevision::Polaris10) && (asicRevision <= Pal::AsicRevision::Polaris12))
{
i = m_appProfile.entryCount++;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].match.stageActive = true;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].match.codeHash = true;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].codeHash.lower = 0xdd6c573c46e6adf8;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].codeHash.upper = 0x751207727c904749;
m_appProfile.pEntries[i].action.shaders[ShaderStage::ShaderStageFragment].shaderCreate.apply.allowReZ = true;

i = m_appProfile.entryCount++;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].match.stageActive = true;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].match.codeHash = true;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].codeHash.lower = 0x71093bf7c6e98da8;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].codeHash.upper = 0xfbc956d87a6d6631;
m_appProfile.pEntries[i].action.shaders[ShaderStage::ShaderStageFragment].shaderCreate.apply.allowReZ = true;

i = m_appProfile.entryCount++;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].match.stageActive = true;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].match.codeHash = true;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].codeHash.lower = 0xedd89880de2091f9;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].codeHash.upper = 0x506d0ac3995d2f1b;
m_appProfile.pEntries[i].action.shaders[ShaderStage::ShaderStageFragment].shaderCreate.apply.allowReZ = true;

i = m_appProfile.entryCount++;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].match.stageActive = true;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].match.codeHash = true;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].codeHash.lower = 0xbc583b30527e9f1d;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].codeHash.upper = 0x1ef8276d42a14220;
m_appProfile.pEntries[i].action.shaders[ShaderStage::ShaderStageFragment].shaderCreate.apply.allowReZ = true;

i = m_appProfile.entryCount++;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].match.stageActive = true;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].match.codeHash = true;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].codeHash.lower = 0x012ddab000f80610;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].codeHash.upper = 0x3a65a6325756203d;
m_appProfile.pEntries[i].action.shaders[ShaderStage::ShaderStageFragment].shaderCreate.apply.allowReZ = true;

i = m_appProfile.entryCount++;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].match.stageActive = true;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].match.codeHash = true;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].codeHash.lower = 0x78095b5acf62f4d5;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].codeHash.upper = 0x2c1afc1c6f669e33;
m_appProfile.pEntries[i].action.shaders[ShaderStage::ShaderStageFragment].shaderCreate.apply.allowReZ = true;

i = m_appProfile.entryCount++;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].match.stageActive = true;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].match.codeHash = true;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].codeHash.lower = 0x22803b077988ec36;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].codeHash.upper = 0x7ba50586c34e1662;
m_appProfile.pEntries[i].action.shaders[ShaderStage::ShaderStageFragment].shaderCreate.apply.allowReZ = true;

i = m_appProfile.entryCount++;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].match.stageActive = true;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].match.codeHash = true;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].codeHash.lower = 0x313dab8ff9408da0;
m_appProfile.pEntries[i].pattern.shaders[ShaderStage::ShaderStageFragment].codeHash.upper = 0xbb11905194a55485;
m_appProfile.pEntries[i].action.shaders[ShaderStage::ShaderStageFragment].shaderCreate.apply.allowReZ = true;
}
}

if (appProfile == AppProfile::ShadowOfTheTombRaider)
{
i = m_appProfile.entryCount++;
Expand All @@ -1221,14 +1181,11 @@ void ShaderOptimizer::BuildAppProfileLlpc()

if (appProfile == AppProfile::CSGO)
{
if (gfxIpLevel >= Pal::GfxIpLevel::GfxIp10_1)
{
i = m_appProfile.entryCount++;
PipelineProfileEntry *pEntry = &m_appProfile.pEntries[i];
pEntry->pattern.match.always = true;
pEntry->action.shaders[ShaderStage::ShaderStageFragment].shaderCreate.apply.disableFastMathFlags = true;
pEntry->action.shaders[ShaderStage::ShaderStageFragment].shaderCreate.tuningOptions.disableFastMathFlags = 32u;
}
i = m_appProfile.entryCount++;
PipelineProfileEntry *pEntry = &m_appProfile.pEntries[i];
pEntry->pattern.match.always = true;
pEntry->action.shaders[ShaderStage::ShaderStageFragment].shaderCreate.apply.disableFastMathFlags = true;
pEntry->action.shaders[ShaderStage::ShaderStageFragment].shaderCreate.tuningOptions.disableFastMathFlags = 32u;
}

if (appProfile == AppProfile::WarHammerIII)
Expand All @@ -1250,6 +1207,7 @@ void ShaderOptimizer::BuildAppProfileLlpc()
pEntry->pattern.match.always = true;
pEntry->action.shaders[ShaderStage::ShaderStageCompute].shaderCreate.apply.workaroundStorageImageFormats = true;
}

}

#if PAL_ENABLE_PRINTS_ASSERTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
{
"pattern": {
"ps": {
"stageActive": true,
"codeHash": "0xfd59b52b7db5ef6b f9b17451c9c6cf06"
"codeHash": "0x840F5E31E0457DC8 84AEDCE5D263265A"
}
},
"action": {
"ps": {
"allowReZ": 1
"favorLatencyHiding": true
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"entries": []
}
Loading

0 comments on commit c9f6c1c

Please sign in to comment.