Skip to content

Commit

Permalink
Update xgl from commit daeb5249
Browse files Browse the repository at this point in the history
* Update PAL Version in XGL 841
* Update Khronos Vulkan Headers to 1.3.271
* Update to new DevDriver Settings
* Bump Gpurt Version to 41
* Bump LLPC version to 69
* Generate debug file amdvlk64.so.debug to debug with release driver
* Power Optimization for ML workloads
* Alert, not assert, when ML power opt fails
* Add ImageType PAL DMA constraint in XGL
* Add setting for debug printf buffer creation
* Rename OverrideNumVGPRsAvailable to camelCase
* Simplify VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT
* Bypass MALL when device_coherent_memory extension is used
* Export "NV_COMPUTE_SHADER_DERIVATIVES" for vkd3d engine to run DX12 games on steam
* Cleanup VKI_BUILD_NAVI31 and VKI_BUILD_GFX11
* Cleanup VariableName field in settings_xgl.json
* Remove ICD_BUILD_{LLPC,SPV}ONLY
* Remove the option 'enableRobustUberFetchShader'
* Use core names for dynamic rendering instead of KHR names
* Pass option cpsFlag to LLPC
* Force PwsMode::NoLateAcquirePoint for GfxIp11 and BG3
* Improve CPU performance in QueuePresent
* Move ac01WaNotNeeded to UpdatePalSettings
* CS2 - App detect for waDisableAc01 on NV3x
* CS2 optimizations
* Fix incorrect attachment clears for dynamic rendering
* Fix pipeline creation failures for mesh shader pipelines during renderdoc replay
* Fix graphics pipeline library
* Fix RenderPassClearUpfront OOM handling
* Fix memory leak and delay BIL conversion again
* Fix crash when image is blit via gpu_decode_layer
* Fix warning about ignored 'const' qualifier
* Fix compilation failure due to designated initializers
* Fix RT Apps fail with Wave32
  • Loading branch information
chuang13 committed Dec 21, 2023
1 parent 565dce2 commit efc2d75
Show file tree
Hide file tree
Showing 44 changed files with 732 additions and 623 deletions.
9 changes: 0 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,6 @@ endif()
# for intellisense used by VScode, YouCompleteMe, etc
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

# Strip the symbols for release build
if(UNIX)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
string(APPEND CMAKE_SHARED_LINKER_FLAGS_RELEASE " -s")
endif()
endif()

### Set Compiler ######################################################################################################
xgl_set_compiler()

Expand Down Expand Up @@ -309,9 +302,7 @@ else()
endif()

# icd
if(NOT ICD_BUILD_LLPCONLY)
add_subdirectory(icd)
endif()

# VKGC compiler
add_subdirectory(${XGL_VKGC_PATH} ${CMAKE_BINARY_DIR}/compiler)
Expand Down
1 change: 0 additions & 1 deletion cmake/XglOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ macro(xgl_options)
#endif

option(ICD_BUILD_LLPC "Build LLPC?" ON)
option(ICD_BUILD_LLPCONLY "Build LLPC Only?" OFF)

option(XGL_LLVM_UPSTREAM "Build with upstreamed LLVM?" OFF)

Expand Down
5 changes: 0 additions & 5 deletions cmake/XglOverrides.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,6 @@ macro(xgl_overrides)
set(XGL_BUILD_TOOLS ON CACHE BOOL "XGL_BUILD_TOOLS override by XGL_BUILD_TESTS." FORCE)
endif()

if(ICD_BUILD_LLPCONLY)
set(ICD_BUILD_LLPC ON CACHE BOOL "ICD_BUILD_LLPC override." FORCE)
set(XGL_BUILD_TOOLS ON CACHE BOOL "XGL_BUILD_TOOLS override by ICD_BUILD_LLPCONLY." FORCE)
endif()

if(NOT ICD_BUILD_LLPC)
set(XGL_LLVM_UPSTREAM OFF CACHE BOOL "XGL_LLVM_UPSTREAM is overrided to false." FORCE)
endif()
Expand Down
6 changes: 3 additions & 3 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 "834")
set(ICD_PAL_CLIENT_MAJOR_VERSION "841")

# 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,9 +37,9 @@ 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 "40")
set(ICD_GPURT_CLIENT_MAJOR_VERSION "41")
#endif

# This will become the value of LLPC_CLIENT_INTERFACE_MAJOR_VERSION if ICD_BUILD_LLPC=1.
# It describes the version of the interface version of LLPC that the ICD supports.
set(ICD_LLPC_CLIENT_MAJOR_VERSION "68")
set(ICD_LLPC_CLIENT_MAJOR_VERSION "69")
31 changes: 25 additions & 6 deletions icd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -261,19 +261,26 @@ target_sources(xgl PRIVATE api/strings/strings.cpp)

### ICD Auto-generated Settings Files #########################################
# ICD settings code generation main script
set(ICD_GEN_SETTINGS ${ICD_GENDIR}/genSettingsCode.py)

set(ICD_GEN_SETTINGS_FILES ${ICD_GEN_SETTINGS} ${ICD_GENDIR}/vulkanSettingsCodeTemplates.py)
set(XGL_DEVDRIVER_PATH ${XGL_PAL_PATH}/shared/devdriver)
set(ICD_DD_GENDIR ${XGL_DEVDRIVER_PATH}/apis/settings/codegen)

set(ICD_SETTINGS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/settings)
set(ICD_GEN_SETTINGS ${ICD_DD_GENDIR}/settings_codegen.py)

set(PAL_GENDIR ${XGL_PAL_PATH}/tools/generate)
set(ICD_GEN_SETTINGS_FILES ${ICD_GEN_SETTINGS})

set(COMPONENT_NAME vulkan)
set(ICD_SETTINGS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/settings)

add_custom_command(
OUTPUT ${ICD_SETTINGS_DIR}/g_settings.cpp ${ICD_SETTINGS_DIR}/g_settings.h
COMMAND ${PYTHON_CMD} ${ICD_GEN_SETTINGS} ${XGL_PAL_PATH} ${COMPONENT_NAME}
COMMAND ${PYTHON_CMD} ${ICD_GEN_SETTINGS}
-i ${ICD_SETTINGS_DIR}/settings_xgl.json
-o ${ICD_SETTINGS_DIR}
-g settings
-s settings/settings.h
--namespaces vk
--settings-struct-name RuntimeSettings
--include-headers pal.h palImage.h
DEPENDS ${ICD_GEN_SETTINGS_FILES} ${ICD_SETTINGS_DIR}/settings_xgl.json
COMMENT "Generating Vulkan settings code from settings_xgl.json"
)
Expand Down Expand Up @@ -381,6 +388,18 @@ target_link_libraries(xgl_cache_support INTERFACE pal)

target_link_libraries(xgl PRIVATE xgl_cache_support)

# Strip the symbols for release build, generate debug file
if(UNIX)
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
add_custom_command(
TARGET xgl POST_BUILD
COMMAND objcopy --only-keep-debug ${CMAKE_CURRENT_BINARY_DIR}/${ICD_TARGET}.so ${CMAKE_CURRENT_BINARY_DIR}/${ICD_TARGET}.so.debug
COMMAND strip ${CMAKE_CURRENT_BINARY_DIR}/${ICD_TARGET}.so
COMMAND objcopy --add-gnu-debuglink=${CMAKE_CURRENT_BINARY_DIR}/${ICD_TARGET}.so.debug ${CMAKE_CURRENT_BINARY_DIR}/${ICD_TARGET}.so
)
endif()
endif()

### ICD loader configuration ###########################################################################################
if(UNIX)
include(GNUInstallDirs)
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.269"
"api_version": "1.3.271"
},
"layer": {
"name": "VK_LAYER_AMD_switchable_graphics_@ISABITS@",
"type": "GLOBAL",
"library_path": "@AMDVLK_INSTALL_PATH@/amdvlk@[email protected]",
"api_version": "1.3.269",
"api_version": "1.3.271",
"implementation_version": "1",
"description": "AMD switchable graphics layer",
"functions": {
Expand Down
17 changes: 10 additions & 7 deletions icd/api/app_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,18 +406,13 @@ constexpr AppProfilePatternEntry AppNameSpidermanRemastered =
"spider-man.exe"
};

#if VKI_RAY_TRACING
constexpr AppProfilePatternEntry AppEngineVKD3D =
{
PatternEngineNameLower,
Util::MetroHash::Hash{{{
0x32778d0a,
0x05b56a84,
0x8f0c25bc,
0x1d75f3eb
}}}
"vkd3d"
};

#if VKI_RAY_TRACING
constexpr AppProfilePatternEntry AppNameControlDX12 =
{
PatternAppNameLower,
Expand Down Expand Up @@ -1435,6 +1430,14 @@ AppProfilePattern AppPatternTable[] =
AppNameEnscape,
PatternEnd
}
},

{
AppProfile::Vkd3dEngine,
{
AppEngineVKD3D,
PatternEnd
}
}
};

Expand Down
13 changes: 2 additions & 11 deletions icd/api/app_shader_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -903,10 +903,10 @@ void ShaderOptimizer::BuildTuningProfile()
pPattern->codeHash.lower = m_settings.overrideShaderHashLower;
pPattern->codeHash.upper = m_settings.overrideShaderHashUpper;

if (m_settings.overrideNumVGPRsAvailable != 0)
if (m_settings.overrideNumVgprsAvailable != 0)
{
pAction->shaderCreate.apply.vgprLimit = true;
pAction->shaderCreate.tuningOptions.vgprLimit = m_settings.overrideNumVGPRsAvailable;
pAction->shaderCreate.tuningOptions.vgprLimit = m_settings.overrideNumVgprsAvailable;
}

if (m_settings.overrideMaxLdsSpillDwords != 0)
Expand Down Expand Up @@ -1180,15 +1180,6 @@ void ShaderOptimizer::BuildAppProfileLlpc()
pEntry->action.shaders[ShaderStage::ShaderStageVertex].shaderCreate.tuningOptions.disableFastMathFlags = 8u | 32u;
}

if (appProfile == AppProfile::CSGO)
{
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)
{
i = m_appProfile.entryCount++;
Expand Down
16 changes: 8 additions & 8 deletions icd/api/appopt/gpu_decode_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ static VkResult gpuBlitImage(
uint32_t maxObj = pCmdBuffer->EstimateMaxObjectsOnVirtualStack(sizeof(Pal::ImageCopyRegion));
VkFormat dstFormat = pDstImage->GetFormat();

if(settings.enableBC3Encoder)
if(settings.enableBc3Encoder)
{
if (type == GpuTexDecoder::InternalTexConvertCsType::ConvertRGBA8ToBc3)
{
Expand Down Expand Up @@ -661,7 +661,7 @@ static VkResult gpuBlitBuffer(
GpuTexDecoder::CompileTimeConstants constInfo = {};
Pal::SwizzledFormat sourceViewFormat = {};

if(settings.enableBC3Encoder)
if(settings.enableBc3Encoder)
{
if (type != GpuTexDecoder::InternalTexConvertCsType::ConvertETC2ToBc3)
{
Expand Down Expand Up @@ -722,8 +722,8 @@ static VkResult gpuBlitBuffer(
pPalRegions[i] = VkToPalMemoryImageCopyRegion(
pRegions[regionIdx + i],
dstSwzFormat.format,
pDstImage->GetArraySize(),
plane,
pDstImage->GetArraySize(),
pSrcBuffer->MemOffset());
}

Expand Down Expand Up @@ -765,7 +765,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdCopyImage(

if (Formats::IsASTCFormat(pDstImage->GetFormat()))
{
if (settings.enableBC3Encoder != 0)
if (settings.enableBc3Encoder != 0)
{
// ASTC one step convert to BC3 haven't implemented, so force two steps if Bc3 encoder is enabled
twoStepsOp = true;
Expand All @@ -774,7 +774,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdCopyImage(
}
else if (Formats::IsEtc2Format(pDstImage->GetFormat()))
{
switch (settings.enableBC3Encoder)
switch (settings.enableBc3Encoder)
{
case 0:
convType = GpuTexDecoder::InternalTexConvertCsType::ConvertETC2ToRGBA8;
Expand Down Expand Up @@ -896,7 +896,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage(

if (Formats::IsASTCFormat(pDstImage->GetFormat()))
{
if (settings.enableBC3Encoder != 0)
if (settings.enableBc3Encoder != 0)
{
// ASTC one step convert to BC3 haven't implemented, so force two steps if Bc3 encoder is enabled
twoStepsOp = true;
Expand All @@ -905,7 +905,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage(
}
else if (Formats::IsEtc2Format(pDstImage->GetFormat()))
{
switch (settings.enableBC3Encoder)
switch (settings.enableBc3Encoder)
{
case 0:
convType = GpuTexDecoder::InternalTexConvertCsType::ConvertETC2ToRGBA8;
Expand Down Expand Up @@ -1101,7 +1101,7 @@ VKAPI_ATTR void VKAPI_CALL vkDestroyImage(
GpuDecoderLayer* pDecodeWrapper = pDevice->GetGpuDecoderLayer();
const RuntimeSettings& settings = pDevice->GetRuntimeSettings();

if (settings.enableBC3Encoder)
if (settings.enableBc3Encoder)
{
pDevice->GetGpuDecoderLayer()->ClearStagingResources(image);
}
Expand Down
1 change: 1 addition & 0 deletions icd/api/compiler_solution_llpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ void CompilerSolutionLlpc::FreeShaderModule(ShaderModuleHandle* pShaderModule)
auto pInstance = m_pPhysicalDevice->Manager()->VkInstance();

pInstance->FreeMem(pShaderModule->pLlpcShaderModule);
pShaderModule->pLlpcShaderModule = nullptr;
}

// =====================================================================================================================
Expand Down
5 changes: 4 additions & 1 deletion icd/api/debug_printf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ void DebugPrintf::BindPipeline(
allocInfo.pal.size = Util::Pow2Align(settings.debugPrintfBufferSize, PAL_PAGE_BYTES);
allocInfo.pal.alignment = PAL_PAGE_BYTES;
allocInfo.pal.priority = Pal::GpuMemPriority::Normal;
pDevice->MemMgr()->GetCommonPool(InternalPoolCpuCacheableGpuUncached, &allocInfo);
InternalSubAllocPool bufferType = settings.enableHangOutput ?
InternalPoolCpuCacheableGpuUncached : InternalPoolDebugCpuRead;

pDevice->MemMgr()->GetCommonPool(bufferType, &allocInfo);
VkResult result = pDevice->MemMgr()->AllocGpuMem(allocInfo,
&m_printfMemory,
pDevice->GetPalDeviceMask(),
Expand Down
4 changes: 2 additions & 2 deletions icd/api/entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1219,8 +1219,8 @@ VKAPI_ATTR void VKAPI_CALL vkCmdWriteBufferMarker2AMD(

// =====================================================================================================================
VKAPI_ATTR void VKAPI_CALL vkCmdBeginRendering(
VkCommandBuffer commandBuffer,
const VkRenderingInfoKHR* pRenderingInfo)
VkCommandBuffer commandBuffer,
const VkRenderingInfo* pRenderingInfo)
{
ApiCmdBuffer::ObjectFromHandle(commandBuffer)->BeginRendering(pRenderingInfo);
}
Expand Down
Loading

0 comments on commit efc2d75

Please sign in to comment.