Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaojbao committed Feb 23, 2024
2 parents 44902e7 + ccc121a commit a68e7f2
Show file tree
Hide file tree
Showing 76 changed files with 3,366 additions and 1,530 deletions.
36 changes: 3 additions & 33 deletions cmake/XglOverrides.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -106,39 +106,9 @@ macro(xgl_overrides_pal)

set(PAL_BUILD_GPUOPEN ${ICD_GPUOPEN_DEVMODE_BUILD} CACHE BOOL "${PROJECT_NAME} override." FORCE)

set(PAL_BUILD_NAVI12 ${XGL_BUILD_NAVI12} CACHE BOOL "${PROJECT_NAME} override." FORCE)

set(PAL_BUILD_NAVI14 ON CACHE BOOL "${PROJECT_NAME} override." FORCE)

set(PAL_BUILD_GFX103 ${XGL_BUILD_GFX103} CACHE BOOL "${PROJECT_NAME} override." FORCE)

set(PAL_BUILD_NAVI21 ON CACHE BOOL "${PROJECT_NAME} override." FORCE)

set(PAL_BUILD_NAVI22 ON CACHE BOOL "${PROJECT_NAME} override." FORCE)

set(PAL_BUILD_NAVI23 ON CACHE BOOL "${PROJECT_NAME} override." FORCE)

set(PAL_BUILD_NAVI24 ON CACHE BOOL "${PROJECT_NAME} override." FORCE)

set(PAL_BUILD_REMBRANDT ${XGL_BUILD_REMBRANDT} CACHE BOOL "${PROJECT_NAME} override." FORCE)

set(PAL_BUILD_RAPHAEL ${XGL_BUILD_RAPHAEL} CACHE BOOL "${PROJECT_NAME} override." FORCE)

set(PAL_BUILD_MENDOCINO ${XGL_BUILD_MENDOCINO} CACHE BOOL "${PROJECT_NAME} override." FORCE)

#if VKI_BUILD_NAVI31
set(PAL_BUILD_NAVI31 ${XGL_BUILD_NAVI31} CACHE BOOL "${PROJECT_NAME} override." FORCE)
#endif

#if VKI_BUILD_NAVI32
set(PAL_BUILD_NAVI32 ${XGL_BUILD_NAVI32} CACHE BOOL "${PROJECT_NAME} override." FORCE)
#endif

#if VKI_BUILD_NAVI33
set(PAL_BUILD_NAVI33 ${XGL_BUILD_NAVI33} CACHE BOOL "${PROJECT_NAME} override." FORCE)
#endif

set(PAL_BUILD_PHOENIX1 ${XGL_BUILD_PHOENIX1} CACHE BOOL "${PROJECT_NAME} override." FORCE)
if(XGL_BUILD_NAVI31 OR XGL_BUILD_NAVI32 OR XGL_BUILD_NAVI33 OR XGL_BUILD_PHOENIX1)
set(PAL_BUILD_GFX11 1 CACHE BOOL "${PROJECT_NAME} override." FORCE)
endif()

# Wayland
set(PAL_BUILD_WAYLAND ${BUILD_WAYLAND_SUPPORT} CACHE BOOL "Build PAL with Wayland support" FORCE)
Expand Down
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 "844")
set(ICD_PAL_CLIENT_MAJOR_VERSION "846")

# 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 "41")
set(ICD_GPURT_CLIENT_MAJOR_VERSION "43")
#endif

# This will become the value of LLPC_CLIENT_INTERFACE_MAJOR_VERSION if ICD_BUILD_LLPC=1.
Expand Down
4 changes: 4 additions & 0 deletions icd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ endif()
# PAL
add_subdirectory(${XGL_PAL_PATH} ${PROJECT_BINARY_DIR}/pal)

# Add LLPC version before gpurt
include("${XGL_VKGC_PATH}/cmake/llpc_version.cmake")
add_llpc_version_projects()

#if VKI_RAY_TRACING
# GPURT
if (VKI_RAY_TRACING)
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.273"
"api_version": "1.3.277"
},
"layer": {
"name": "VK_LAYER_AMD_switchable_graphics_@ISABITS@",
"type": "GLOBAL",
"library_path": "@AMDVLK_INSTALL_PATH@/amdvlk@[email protected]",
"api_version": "1.3.273",
"api_version": "1.3.277",
"implementation_version": "1",
"description": "AMD switchable graphics layer",
"functions": {
Expand Down
31 changes: 30 additions & 1 deletion icd/api/app_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,12 +725,24 @@ constexpr AppProfilePatternEntry AppNameDetroit =
"detroitbecomehuman"
};

constexpr AppProfilePatternEntry AppEngineQuanticDream =
constexpr AppProfilePatternEntry AppEngineQuanticDream
{
PatternEngineNameLower,
"quantic dream engine"
};

constexpr AppProfilePatternEntry AppNameEnshrouded =
{
PatternAppNameLower,
"enshrouded"
};

constexpr AppProfilePatternEntry AppEngineHolistic =
{
PatternEngineNameLower,
"holistic"
};

constexpr AppProfilePatternEntry PatternEnd = {};

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

{
AppProfile::Enshrouded,
{
AppNameEnshrouded,
AppEngineHolistic,
PatternEnd
}
},

{
AppProfile::HolisticEngine,
{
AppEngineHolistic,
PatternEnd
}
},

{
AppProfile::Zink,
{
Expand Down
1 change: 1 addition & 0 deletions icd/api/barrier_policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class LayoutUsageHelper

InitEntry(VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT,
Pal::LayoutShaderRead | Pal::LayoutShaderWrite);

}

// Return layout usage index corresponding to the specified layout.
Expand Down
27 changes: 3 additions & 24 deletions icd/api/compiler_solution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,9 @@ void CompilerSolution::SetRayTracingFunctionName(
// =====================================================================================================================
// Parse and update RayTracingFunctionName of all funcTypes
void CompilerSolution::UpdateRayTracingFunctionNames(
const Device* pDevice,
Vkgc::RtState* pRtState)
const Device* pDevice,
Pal::RayTracingIpLevel rayTracingIp,
Vkgc::RtState* pRtState)
{
VkResult result = VK_ERROR_UNKNOWN;
GpuRt::IDevice* pGpurtDevice = pDevice->RayTrace()->GpuRt(DefaultDeviceIndex);
Expand All @@ -298,28 +299,6 @@ void CompilerSolution::UpdateRayTracingFunctionNames(
const RuntimeSettings& settings = pDevice->VkPhysicalDevice(DefaultDeviceIndex)->GetRuntimeSettings();
auto pTable = &pRtState->gpurtFuncTable;

Pal::RayTracingIpLevel rayTracingIp =
pDevice->VkPhysicalDevice(DefaultDeviceIndex)->PalProperties().gfxipProperties.rayTracingIp;

// Optionally, override RTIP level based on software emulation setting
switch (settings.emulatedRtIpLevel)
{
case EmulatedRtIpLevelNone:
break;
case HardwareRtIpLevel1_1:
case EmulatedRtIpLevel1_1:
rayTracingIp = Pal::RayTracingIpLevel::RtIp1_1;
break;
#if VKI_BUILD_GFX11
case EmulatedRtIpLevel2_0:
rayTracingIp = Pal::RayTracingIpLevel::RtIp2_0;
break;
#endif
default:
VK_ASSERT(false);
break;
}

GpuRt::EntryFunctionTable entryFuncTable = {};
result = PalToVkResult(pGpurtDevice->QueryRayTracingEntryFunctionTable(rayTracingIp, &entryFuncTable));

Expand Down
51 changes: 35 additions & 16 deletions icd/api/compiler_solution_llpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ VkResult CompilerSolutionLlpc::BuildShaderModule(
VkShaderModuleCreateFlags flags,
VkShaderModuleCreateFlags internalShaderFlags,
const Vkgc::BinaryData& shaderBinary,
const bool adaptForFastLink,
bool isInternal,
ShaderModuleHandle* pShaderModule,
const PipelineOptimizerKey& profileKey)
{
Expand Down Expand Up @@ -409,6 +407,7 @@ VkResult CompilerSolutionLlpc::CreateColorExportBinary(
auto pPipelineBuildInfo = &pCreateInfo->pipelineInfo;
pPipelineBuildInfo->pInstance = pInstance;
pPipelineBuildInfo->pfnOutputAlloc = AllocateShaderOutput;
pPipelineBuildInfo->pipelineApiHash = pCreateInfo->libraryHash[GraphicsLibraryColorExport];

VK_ASSERT(pCreateInfo->pBinaryMetadata->pFsOutputMetaData != nullptr);
Vkgc::Result llpcResult = m_pLlpc->BuildColorExportShader(pPipelineBuildInfo,
Expand Down Expand Up @@ -439,15 +438,14 @@ VkResult CompilerSolutionLlpc::CreateColorExportBinary(
VkResult CompilerSolutionLlpc::CreateGraphicsShaderBinary(
const Device* pDevice,
PipelineCache* pPipelineCache,
const ShaderStage stage,
GraphicsLibraryType gplType,
GraphicsPipelineBinaryCreateInfo* pCreateInfo,
void* pPipelineDumpHandle,
ShaderModuleHandle* pShaderModule)
GplModuleState* pModuleState)
{
VkResult result = VK_SUCCESS;
Util::MetroHash::Hash cacheId = {};
Vkgc::BinaryData shaderLibraryBinary = {};
GraphicsLibraryType gplType = GetGraphicsLibraryType(stage);

bool hitCache = false;
bool hitAppCache = false;
Expand Down Expand Up @@ -484,7 +482,7 @@ VkResult CompilerSolutionLlpc::CreateGraphicsShaderBinary(
if (pPipelineCache != nullptr)
{
// Update the shader feedback
PipelineCreationFeedback* pStageFeedBack = &pCreateInfo->stageFeedback[stage];
PipelineCreationFeedback* pStageFeedBack = &pCreateInfo->stageFeedback[pModuleState->stage];
pStageFeedBack->feedbackValid = true;
pStageFeedBack->hitApplicationCache = hitAppCache;
}
Expand All @@ -497,11 +495,11 @@ VkResult CompilerSolutionLlpc::CreateGraphicsShaderBinary(
Vkgc::UnlinkedShaderStage unlinkedStage = UnlinkedStageCount;

// Belong to vertexProcess stage before fragment
if (stage < ShaderStage::ShaderStageFragment)
if (gplType == GraphicsLibraryPreRaster)
{
unlinkedStage = UnlinkedShaderStage::UnlinkedStageVertexProcess;
}
else if (stage == ShaderStage::ShaderStageFragment)
else if (gplType == GraphicsLibraryFragment)
{
unlinkedStage = UnlinkedShaderStage::UnlinkedStageFragment;
}
Expand Down Expand Up @@ -548,21 +546,41 @@ VkResult CompilerSolutionLlpc::CreateGraphicsShaderBinary(
&shaderLibraryBinary);
}

pShaderModule->elfPackage = shaderLibraryBinary;
pCreateInfo->earlyElfPackage[gplType] = pShaderModule->elfPackage;
pModuleState->elfPackage = shaderLibraryBinary;
pModuleState->pFsOutputMetaData = nullptr;
pCreateInfo->earlyElfPackage[gplType] = pModuleState->elfPackage;
pCreateInfo->earlyElfPackageHash[gplType] = cacheId;

if (stage == ShaderStage::ShaderStageFragment)
if (gplType == GraphicsLibraryFragment)
{
if (shaderLibraryBinary.pCode != nullptr)
{
const auto* pShaderLibraryHeader =
reinterpret_cast<const ShaderLibraryBlobHeader*>(shaderLibraryBinary.pCode);

pCreateInfo->pBinaryMetadata->fsOutputMetaDataSize = pShaderLibraryHeader->fragMetaLength;
pCreateInfo->pBinaryMetadata->pFsOutputMetaData = (pShaderLibraryHeader->fragMetaLength > 0) ?
const_cast<void*>(VoidPtrInc(pShaderLibraryHeader + 1, pShaderLibraryHeader->binaryLength)) :
nullptr;
pCreateInfo->pBinaryMetadata->fsOutputMetaDataSize = 0;
pCreateInfo->pBinaryMetadata->pFsOutputMetaData = nullptr;
if (pShaderLibraryHeader->fragMetaLength > 0)
{
void* pFsOutputMetaData = m_pPhysicalDevice->Manager()->VkInstance()->AllocMem(
pShaderLibraryHeader->fragMetaLength,
VK_DEFAULT_MEM_ALIGN,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);

if (pFsOutputMetaData != nullptr)
{
memcpy(pFsOutputMetaData,
VoidPtrInc(pShaderLibraryHeader + 1, pShaderLibraryHeader->binaryLength),
pShaderLibraryHeader->fragMetaLength);
pCreateInfo->pBinaryMetadata->fsOutputMetaDataSize = pShaderLibraryHeader->fragMetaLength;
pCreateInfo->pBinaryMetadata->pFsOutputMetaData = pFsOutputMetaData;
pModuleState->pFsOutputMetaData = pFsOutputMetaData;
}
else
{
result = VK_ERROR_OUT_OF_HOST_MEMORY;
}
}
}
}

Expand Down Expand Up @@ -1164,7 +1182,8 @@ void CompilerSolutionLlpc::UpdateStageCreationFeedback(
bool CompilerSolutionLlpc::IsGplFastLinkCompatible(
const Device* pDevice,
uint32_t deviceIdx,
const GraphicsPipelineBinaryCreateInfo* pCreateInfo)
const GraphicsPipelineBinaryCreateInfo* pCreateInfo,
const GraphicsPipelineLibraryInfo& libInfo)
{
return (pCreateInfo->pipelineInfo.iaState.enableMultiView == false) &&
((pCreateInfo->flags & VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR) == 0);
Expand Down
5 changes: 5 additions & 0 deletions icd/api/devmode/devmode_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,11 @@ Pal::Result DevModeMgr::TraceEndingToIdleStep(TraceState* pState)

if (settings.devModeEnableRgpTraceDump)
{
// The min length of both win and linux is 260, so we use this number.
char pathBuffer[260];
Util::SplitFilePath(settings.devModeRgpTraceDumpFile, pathBuffer, 260, nullptr, 0);
Util::MkDirRecursively(pathBuffer);

Util::File dumpFile;
if (dumpFile.Open(settings.devModeRgpTraceDumpFile, Util::FileAccessMode::FileAccessWrite | Util::FileAccessMode::FileAccessBinary) == Util::Result::Success)
{
Expand Down
55 changes: 55 additions & 0 deletions icd/api/entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,61 @@ VKAPI_ATTR void VKAPI_CALL vkCmdBindIndexBuffer2KHR(
indexType);
}

// =====================================================================================================================
VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorSets2KHR(
VkCommandBuffer commandBuffer,
const VkBindDescriptorSetsInfoKHR* pBindDescriptorSetsInfo)
{
ApiCmdBuffer::ObjectFromHandle(commandBuffer)->VkDevice()->GetEntryPoints().vkCmdBindDescriptorSets2KHR(
commandBuffer,
pBindDescriptorSetsInfo);
}

// =====================================================================================================================
VKAPI_ATTR void VKAPI_CALL vkCmdPushConstants2KHR(
VkCommandBuffer commandBuffer,
const VkPushConstantsInfoKHR* pPushConstantsInfo)
{
ApiCmdBuffer::ObjectFromHandle(commandBuffer)->PushConstants2KHR(pPushConstantsInfo);
}

// =====================================================================================================================
VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSet2KHR(
VkCommandBuffer commandBuffer,
const VkPushDescriptorSetInfoKHR* pPushDescriptorSetInfo)
{
ApiCmdBuffer::ObjectFromHandle(commandBuffer)->VkDevice()->GetEntryPoints().vkCmdPushDescriptorSet2KHR(
commandBuffer,
pPushDescriptorSetInfo);
}

// =====================================================================================================================
VKAPI_ATTR void VKAPI_CALL vkCmdPushDescriptorSetWithTemplate2KHR(
VkCommandBuffer commandBuffer,
const VkPushDescriptorSetWithTemplateInfoKHR* pPushDescriptorSetWithTemplateInfo)
{
ApiCmdBuffer::ObjectFromHandle(commandBuffer)->VkDevice()->GetEntryPoints().vkCmdPushDescriptorSetWithTemplate2KHR(
commandBuffer,
pPushDescriptorSetWithTemplateInfo);
}

// =====================================================================================================================
VKAPI_ATTR void VKAPI_CALL vkCmdSetDescriptorBufferOffsets2EXT(
VkCommandBuffer commandBuffer,
const VkSetDescriptorBufferOffsetsInfoEXT* pSetDescriptorBufferOffsetsInfo)
{
ApiCmdBuffer::ObjectFromHandle(commandBuffer)->SetDescriptorBufferOffsets2EXT(pSetDescriptorBufferOffsetsInfo);
}

// =====================================================================================================================
VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorBufferEmbeddedSamplers2EXT(
VkCommandBuffer commandBuffer,
const VkBindDescriptorBufferEmbeddedSamplersInfoEXT* pBindDescriptorBufferEmbeddedSamplersInfo)
{
ApiCmdBuffer::ObjectFromHandle(commandBuffer)->BindDescriptorBufferEmbeddedSamplers2EXT(
pBindDescriptorBufferEmbeddedSamplersInfo);
}

// =====================================================================================================================
VKAPI_ATTR void VKAPI_CALL vkCmdBindVertexBuffers(
VkCommandBuffer cmdBuffer,
Expand Down
Loading

0 comments on commit a68e7f2

Please sign in to comment.