Skip to content

Commit

Permalink
Merge branch 'internal_master_prm' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
JaxLinAMD committed Aug 6, 2021
2 parents 5cb0bf5 + b135615 commit 7f30e7d
Show file tree
Hide file tree
Showing 62 changed files with 8,079 additions and 2,001 deletions.
1 change: 0 additions & 1 deletion .github/workflows/rebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ jobs:
name: Rebase
if: github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase') &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR')
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 6 additions & 0 deletions cmake/XglCompileDefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ macro(xgl_set_compile_definitions)
endif()
#endif

#if VKI_GPU_DECOMPRESS
if(VKI_GPU_DECOMPRESS)
target_compile_definitions(xgl PRIVATE VKI_GPU_DECOMPRESS)
endif()
#endif

#if VKI_EXPOSE_EXT_CONDITIONAL_RENDERING
if(VKI_EXPOSE_EXT_CONDITIONAL_RENDERING)
target_compile_definitions(xgl PRIVATE VKI_EXPOSE_EXT_CONDITIONAL_RENDERING)
Expand Down
37 changes: 0 additions & 37 deletions cmake/XglHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,43 +24,6 @@
#######################################################################################################################
include_guard()

### Helper Macros #####################################################################################################
macro(target_find_headers _target)
get_target_property(${_target}_INCLUDES_DIRS ${_target} INCLUDE_DIRECTORIES)

if(${_target}_INCLUDES_DIRS)
foreach(_include_dir IN ITEMS ${${_target}_INCLUDES_DIRS})
file(GLOB_RECURSE _include_files
LIST_DIRECTORIES false
"${_include_dir}/*.h"
"${_include_dir}/*.hpp"
)

list(APPEND ${_target}_INCLUDES ${_include_files})
endforeach()

target_sources(${_target} PRIVATE ${${_target}_INCLUDES})
endif()
endmacro()

# Source Groups Helper #############################################################################
# This helper creates source groups for generators that support them. This is primarily MSVC and
# XCode, but there are other generators that support IDE project files.
#
# Note: this only adds files that have been added to the target's SOURCES property. To add headers
# to this list, be sure that you call target_find_headers before you call target_source_groups.
macro(target_source_groups _target)
get_target_property(${_target}_SOURCES ${_target} SOURCES)
foreach(_source IN ITEMS ${${_target}_SOURCES})
set(_source ${_source})
get_filename_component(_source_path "${_source}" ABSOLUTE)
file(RELATIVE_PATH _source_path_rel "${PROJECT_SOURCE_DIR}" "${_source_path}")
get_filename_component(_source_path_rel "${_source_path_rel}" DIRECTORY)
string(REPLACE "/" "\\" _group_path "${_source_path_rel}")
source_group("${_group_path}" FILES "${_source}")
endforeach()
endmacro()

macro(xgl_append_common_sanitizer_flags)
if(NOT MSVC)
# Append -fno-omit-frame-pointer and turn on debug info to get better stack traces.
Expand Down
8 changes: 2 additions & 6 deletions cmake/XglOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,8 @@ macro(xgl_options)
option(VKI_KHR_SHADER_SUBGROUP_EXTENDED_TYPES "Build vulkan with KHR_SHADER_SUBGROUP_EXTENDED_TYPES" OFF)
#endif

#if VKI_EXPOSE_SW_DECOMPRESS
option(VKI_EXPOSE_SW_DECOMPRESS "Expose SW_DECOMPRESS" OFF)
#endif

#if VKI_3RD_PARTY_IP_PROPERTY_ID
option(VKI_3RD_PARTY_IP_PROPERTY_ID "Build vulkan with 3RD_PARTY_IP_PROPERTY_ID" OFF)
#if VKI_GPU_DECOMPRESS
option(VKI_GPU_DECOMPRESS "Build vulkan with GPU_DECOMPRESS" OFF)
#endif

#if VKI_EXT_EXTENDED_DYNAMIC_STATE
Expand Down
10 changes: 6 additions & 4 deletions cmake/XglOverrides.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ macro(xgl_get_path)
set(XGL_PAL_PATH ${PROJECT_SOURCE_DIR}/../pal CACHE PATH "Specify the path to the PAL project.")
endif()

#if VKI_GPU_DECOMPRESS
if(VKI_GPU_DECOMPRESS)
set(XGL_GPUTEXDECODER_PATH ${PROJECT_SOURCE_DIR}/icd/imported/gputexdecoder CACHE PATH "Specify the path to the gpu texture decoe project.")
endif()
#endif

# VKGC path
if (EXISTS ${PROJECT_SOURCE_DIR}/../llpc/CMakeLists.txt)
# On github, the default repo name is llpc instead of compiler
Expand Down Expand Up @@ -162,10 +168,6 @@ macro(xgl_overrides_pal)
# Dri3
set(PAL_BUILD_DRI3 ${BUILD_DRI3_SUPPORT} CACHE BOOL "PAL build with Dri3 enabled" FORCE)

#if VKI_3RD_PARTY_IP_PROPERTY_ID
set(PAL_3RD_PARTY_IP_PROPERTY_ID ${VKI_3RD_PARTY_IP_PROPERTY_ID})
#endif

if(EXISTS ${XGL_METROHASH_PATH})
set(PAL_METROHASH_PATH ${XGL_METROHASH_PATH} CACHE PATH "${PROJECT_NAME} override." FORCE)
endif()
Expand Down
35 changes: 27 additions & 8 deletions icd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ if (BUILD_WAYLAND_SUPPORT)
target_include_directories(xgl PUBLIC ${WAYLAND_INCLUDE_DIRS})
endif()

#if VKI_GPU_DECOMPRESS
if (VKI_GPU_DECOMPRESS)
target_include_directories(xgl PRIVATE ${XGL_GPUTEXDECODER_PATH})
endif()
#endif

target_include_directories(xgl PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
api
Expand All @@ -56,6 +62,13 @@ target_include_directories(xgl PRIVATE
# PAL
add_subdirectory(${XGL_PAL_PATH} ${PROJECT_BINARY_DIR}/pal)

#if VKI_GPU_DECOMPRESS
# GPU Texture Decode
if (VKI_GPU_DECOMPRESS)
add_subdirectory(${XGL_GPUTEXDECODER_PATH} ${PROJECT_BINARY_DIR}/gputexdecoder)
endif()
#endif

# XGL cache creator tool
if(XGL_BUILD_CACHE_CREATOR)
if(NOT ICD_BUILD_LLPC)
Expand Down Expand Up @@ -136,6 +149,14 @@ target_sources(xgl PRIVATE
api/icd_main.cpp
)

#if VKI_GPU_DECOMPRESS
if(VKI_GPU_DECOMPRESS)
target_sources(xgl PRIVATE
api/appopt/gpu_decode_layer.cpp
)
endif()
#endif

if(ICD_BUILD_LLPC)
target_sources(xgl PRIVATE
api/compiler_solution_llpc.cpp
Expand Down Expand Up @@ -273,8 +294,6 @@ target_sources(xgl PRIVATE
layers/vk_layer_switchable_graphics.cpp
)

### ICD Android interface ######################################################

### Link Libraries #####################################################################################################
if (UNIX)
target_link_libraries(xgl PRIVATE dl c stdc++ ${CMAKE_DL_LIBS} pthread)
Expand Down Expand Up @@ -318,6 +337,12 @@ target_link_libraries(xgl PRIVATE vkgc)
target_link_libraries(xgl PRIVATE pal)
target_link_libraries(xgl PRIVATE khronos_vulkan_interface)

#if VKI_GPU_DECOMPRESS
if(VKI_GPU_DECOMPRESS)
target_link_libraries(xgl PRIVATE gputexdecoder)
endif()
#endif

### XGL cache_support ####
add_library(xgl_cache_support INTERFACE)

Expand All @@ -332,12 +357,6 @@ target_link_libraries(xgl_cache_support INTERFACE pal)

target_link_libraries(xgl PRIVATE xgl_cache_support)

### Visual Studio Filters ##############################################################################################
target_find_headers(xgl)
if(MSVC)
target_source_groups(xgl)
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.2.182"
"api_version": "1.2.185"
},
"layer": {
"name": "VK_LAYER_AMD_switchable_graphics_@ISABITS@",
"type": "GLOBAL",
"library_path": "@AMDVLK_INSTALL_PATH@/amdvlk@[email protected]",
"api_version": "1.2.182",
"api_version": "1.2.185",
"implementation_version": "1",
"description": "AMD switchable graphics layer",
"functions": {
Expand Down
19 changes: 19 additions & 0 deletions icd/api/app_resource_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,25 @@ void ResourceOptimizer::BuildAppProfile()
m_appProfile.entries[i].action.resourceCreate.dccMode = DccMode::DccEnableMode;
}
}
else if (appProfile == AppProfile::Rage2)
{
// Disable DCC for resource causing corruption
if (gfxIpLevel == Pal::GfxIpLevel::GfxIp10_3)
{
i = m_appProfile.entryCount++;
m_appProfile.entries[i].pattern.match.apiHash = true;
m_appProfile.entries[i].pattern.targetKey.apiHash = 0xb92ea6fe16e91aba;
m_appProfile.entries[i].action.resourceCreate.apply.dccMode = true;
m_appProfile.entries[i].action.resourceCreate.dccMode = DccMode::DccDisableMode;

// 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 = 0x111fa3cb932fb5fa;
m_appProfile.entries[i].action.resourceCreate.apply.dccMode = true;
m_appProfile.entries[i].action.resourceCreate.dccMode = DccMode::DccDisableMode;
}
}
}

#if ICD_RUNTIME_APP_PROFILE
Expand Down
22 changes: 11 additions & 11 deletions icd/api/app_shader_optimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void ShaderOptimizer::ApplyProfileToShaderCreateInfo(
const PipelineProfile& profile,
const PipelineOptimizerKey& pipelineKey,
ShaderStage shaderStage,
PipelineShaderOptionsPtr options)
PipelineShaderOptionsPtr options) const
{
for (uint32_t entry = 0; entry < profile.entryCount; ++entry)
{
Expand Down Expand Up @@ -220,7 +220,7 @@ void ShaderOptimizer::ApplyProfileToShaderCreateInfo(
void ShaderOptimizer::OverrideShaderCreateInfo(
const PipelineOptimizerKey& pipelineKey,
ShaderStage shaderStage,
PipelineShaderOptionsPtr options)
PipelineShaderOptionsPtr options) const
{

ApplyProfileToShaderCreateInfo(m_appProfile, pipelineKey, shaderStage, options);
Expand All @@ -237,7 +237,7 @@ void ShaderOptimizer::OverrideGraphicsPipelineCreateInfo(
const PipelineOptimizerKey& pipelineKey,
VkShaderStageFlagBits shaderStages,
Pal::GraphicsPipelineCreateInfo* pPalCreateInfo,
Pal::DynamicGraphicsShaderInfos* pGraphicsShaderInfos)
Pal::DynamicGraphicsShaderInfos* pGraphicsShaderInfos) const
{
ApplyProfileToGraphicsPipelineCreateInfo(
m_appProfile, pipelineKey, shaderStages, pPalCreateInfo, pGraphicsShaderInfos);
Expand All @@ -254,7 +254,7 @@ void ShaderOptimizer::OverrideGraphicsPipelineCreateInfo(
// =====================================================================================================================
void ShaderOptimizer::OverrideComputePipelineCreateInfo(
const PipelineOptimizerKey& pipelineKey,
Pal::DynamicComputeShaderInfo* pDynamicCompueShaderInfo)
Pal::DynamicComputeShaderInfo* pDynamicCompueShaderInfo) const
{
ApplyProfileToComputePipelineCreateInfo(m_appProfile, pipelineKey, pDynamicCompueShaderInfo);

Expand Down Expand Up @@ -289,14 +289,14 @@ ShaderOptimizer::~ShaderOptimizer()
// =====================================================================================================================
void ShaderOptimizer::ApplyProfileToDynamicComputeShaderInfo(
const ShaderProfileAction& action,
Pal::DynamicComputeShaderInfo* pComputeShaderInfo)
Pal::DynamicComputeShaderInfo* pComputeShaderInfo) const
{
}

// =====================================================================================================================
void ShaderOptimizer::ApplyProfileToDynamicGraphicsShaderInfo(
const ShaderProfileAction& action,
Pal::DynamicGraphicsShaderInfo* pGraphicsShaderInfo)
Pal::DynamicGraphicsShaderInfo* pGraphicsShaderInfo) const
{

if (action.dynamicShaderInfo.apply.cuEnableMask)
Expand All @@ -311,7 +311,7 @@ void ShaderOptimizer::ApplyProfileToGraphicsPipelineCreateInfo(
const PipelineOptimizerKey& pipelineKey,
VkShaderStageFlagBits shaderStages,
Pal::GraphicsPipelineCreateInfo* pPalCreateInfo,
Pal::DynamicGraphicsShaderInfos* pGraphicsShaderInfos)
Pal::DynamicGraphicsShaderInfos* pGraphicsShaderInfos) const
{
for (uint32_t entry = 0; entry < profile.entryCount; ++entry)
{
Expand Down Expand Up @@ -375,7 +375,7 @@ void ShaderOptimizer::ApplyProfileToGraphicsPipelineCreateInfo(
void ShaderOptimizer::ApplyProfileToComputePipelineCreateInfo(
const PipelineProfile& profile,
const PipelineOptimizerKey& pipelineKey,
Pal::DynamicComputeShaderInfo* pDynamicComputeShaderInfo)
Pal::DynamicComputeShaderInfo* pDynamicComputeShaderInfo) const
{
for (uint32_t entry = 0; entry < profile.entryCount; ++entry)
{
Expand All @@ -400,7 +400,7 @@ void ShaderOptimizer::ApplyProfileToComputePipelineCreateInfo(
// =====================================================================================================================
Pal::ShaderHash ShaderOptimizer::GetFirstMatchingShaderHash(
const PipelineProfilePattern& pattern,
const PipelineOptimizerKey& pipelineKey)
const PipelineOptimizerKey& pipelineKey) const
{
for (uint32_t stage = 0; stage < ShaderStageCount; ++stage)
{
Expand All @@ -427,7 +427,7 @@ Pal::ShaderHash ShaderOptimizer::GetFirstMatchingShaderHash(
// =====================================================================================================================
bool ShaderOptimizer::ProfilePatternMatchesPipeline(
const PipelineProfilePattern& pattern,
const PipelineOptimizerKey& pipelineKey)
const PipelineOptimizerKey& pipelineKey) const
{
if (pattern.match.always)
{
Expand Down Expand Up @@ -733,7 +733,7 @@ void ShaderOptimizer::BuildAppProfileLlpc()
void ShaderOptimizer::PrintProfileEntryMatch(
const PipelineProfile& profile,
uint32_t index,
const PipelineOptimizerKey& key)
const PipelineOptimizerKey& key) const
{
Util::MutexAuto lock(&m_printMutex);

Expand Down
Loading

0 comments on commit 7f30e7d

Please sign in to comment.