Skip to content

Commit

Permalink
Update pal from commit a33b9bbb
Browse files Browse the repository at this point in the history
Fix SDMA ODR warnings
MRT Use Minimum Resolution
Add 2 new TraceSources needed for pull UserMarker into RRA
Memory Leak in Execute Indirect Shader
Update submodule devdriver
Expose the flag 'enablePops' to PAL pipeline user
Fix the regression issue for the dynamicDualSourceBlend in fastlinklibrary mode
Minor fix for split barrier
Bresenham lines with adjacency failing
Cleanup gfx query pool code.
Don't read over PCIe when using SDMA predication
Implement workaround WaCwsrThreadgroupTrap
Update spill table register in rpm GenerateCmdDisptachTaskMesh on gfx10/11
Handle Directory Error in Command Buffer Dumping
Update submodule address-lib
Moves supportSplitReleaseAcquire from gfxipProperrties to queue queueProperties
Remove redundant Inits within ElfProcessor and PipelineProcessor
Fix PAL_CLIENT_INTERFACE_VERSION
Fix SaschaWillems perf regression due to OREO_MODE Workaround
Define Release PAL_ANALYSIS_ASSUME to void(0)
Update PM4 headers
Always log out layout transition info in interface logger (for barrier log)
Add alignment asserts for several gfx9 packets
Resolve address alignment
Set reg for PA_SU_POLY_OFFSET_DB_FMT_CNTL with no depth buffer bound.
Fix Vector Erase and define a new FastErase() function
Change definition of release token used for CmdRelease and CmdAcquire
Optimize split barrier: defer CpDma wait from Release to Acquire time
Implement Compute InheritStateFromCmdBuf
Add PERF_COUNTER_WINDOW Support
Convert enum opcodes for comparison
Fix spill threshold so that driver uses minimum spill threshold
Add SPM buffer wrap warning
Optimize split barrier to not acquire retired release token again
Change SubresRange member data types to save size
Fix VKD3D Execute Indirect Test Failures
Use double when converting float to fixed point number
Remove outdated ADDRLIB_VERSION checks
RenderOp trace controller
Allow mipmaps for T2T SDMA copies
Update ASIC Info chunk def
Use pairwise tree reduction in msaaFmaskResolve8x
Remove hard-coded NullGpuId and AsicRevision numbers
Add RGP instrumentation marker to amp/task ACE dispatch
Correct the matrixRowOrder in plane 2 of the P208 format
Relax blit operations
Place an upper limit on internalMemMgr pool size growth
Rename PipelineUploader to CodeObjectUploader and move it to its own files
Correct the sampleLocX of the packed format
Navi2 VRS data cannot be read from miptail
Changes to ExecuteIndirectV2 path on Gfx9
Controller config update and active controller
Disable use of PERF_COUNTER_WINDOW
Add treatSrcAsSrgb flag into ScaledCopyInfo
Adding L2 cache values for individual ASICs
RenderOp Controller updates
Customize Offset in Cmd Generator Creation
Fix interface log for ExternalImageOpenInfo to match tip definition
Update COVERAGE_TO_SHADER_SELECT bit when underestimation is enabled
Remove legacy settings
Add new enum for FsrOvr-ApArea
Fix nullptr deref in SPM Trace processing
  • Loading branch information
qiaojbao committed Aug 8, 2024
1 parent 695337a commit d3bfe50
Show file tree
Hide file tree
Showing 268 changed files with 67,642 additions and 71,413 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ PAL client drivers will have no HW-specific code; their responsibility is to tra
PAL client drivers should have little OS-specific code. PAL and its companion utility collection provide OS abstractions for almost everything a client might need, but there are some cases where this is unavoidable:

* Handling dynamic library infrastructure. I.e., the client has to implement DllMain() on Windows, etc.
* OS-specific APIs or extensions. DX may have Windows-specific functionality in the core API, and Vulkan/Mantle may export certain OS-specific features as extensions (like for presenting contents to the screen).
* OS-specific APIs or extensions. DX may have Windows-specific functionality in the core API, and Vulkan may export certain OS-specific features as extensions (like for presenting contents to the screen).
* Single OS clients (e.g., DX) may choose to make OS-specific calls directly simply out of convenience with no down side.

PAL is a source deliverable. Clients will periodically promote PAL's source into their own tree and build a static pal.lib as part of their build process.
Expand Down
21 changes: 11 additions & 10 deletions cmake/PalBuildParameters.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ pal_bp(PAL_BUILD_GPUUTIL ON)
pal_bp(PAL_DEVELOPER_BUILD OFF)
#endif

# Build PAL with Operating System support
pal_bp(PAL_BUILD_OSS ON)
if (PAL_CLIENT_INTERFACE_MAJOR_VERSION LESS 888)
# Build PAL with Operating System support
pal_bp(PAL_BUILD_OSS ON)
#if PAL_BUILD_OSS2_4
pal_bp(PAL_BUILD_OSS2_4 ON DEPENDS_ON PAL_BUILD_OSS)
pal_bp(PAL_BUILD_OSS2_4 ON DEPENDS_ON PAL_BUILD_OSS)
#endif
pal_bp(PAL_BUILD_OSS4 ON DEPENDS_ON PAL_BUILD_OSS)
endif()

# Clients must define this variable so pal know what API it's facilitating
pal_bp(PAL_CLIENT "-1" MODE "FATAL_ERROR")
Expand Down Expand Up @@ -115,12 +116,12 @@ if (PAL_BUILD_GFX9)
PAL_BUILD_GFX11
)
endif()

# We'll remove this soon...
pal_bp( PAL_BUILD_PHOENIX2 ON MODE "AUTHOR_WARNING"
ASIC_CONFIG
PAL_BUILD_GFX11
)
if (PAL_CLIENT_INTERFACE_MAJOR_VERSION LESS 888)
pal_bp( PAL_BUILD_PHOENIX2 ON MODE "AUTHOR_WARNING"
ASIC_CONFIG
PAL_BUILD_GFX11
)
endif()
#endif

endif() # PAL_BUILD_GFX9
Expand Down
139 changes: 1 addition & 138 deletions cmake/PalCodegen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,144 +58,6 @@ function(convert_pal_settings_name SETTINGS_FILE OUT_BASENAME_VAR FOR_FILE)
set(${OUT_BASENAME_VAR} ${OUT_BASENAME} PARENT_SCOPE)
endfunction()

function(target_pal_settings TARGET)
set(options NO_REGISTRY)
set(singleValArgs MAGIC_BUF CLASS_NAME CODE_TEMPLATE OUT_DIR OUT_BASENAME ROOT_BINARY_DIR)
set(multiValArgs SETTINGS ENSURE_DELETED ADDL_NAMESPACES)
cmake_parse_arguments(PARSE_ARGV 1 SETGEN "${options}" "${singleValArgs}" "${multiValArgs}")

# Asserts
if (NOT SETGEN_SETTINGS)
message(FATAL_ERROR "No settings inputs provided!")
endif()
if (SETGEN_OUT_BASENAME OR SETGEN_CLASS_NAME)
list(LENGTH SETGEN_SETTINGS SETGEN_SETTINGS_LEN)
if (${SETGEN_SETTINGS_LEN} GREATER 1)
message(FATAL_ERROR "With provided options, only one settings file can be set!")
endif()
endif()
if (SETGEN_ENSURE_DELETED)
foreach(DELETED_FILE ${SETGEN_ENSURE_DELETED})
get_filename_component(DELETED_FILE "${DELETED_FILE}" ABSOLUTE)
if(EXISTS ${DELETED_FILE})
message(FATAL_ERROR "Conflicts detected: ${DELETED_FILE} should be deleted!")
endif()
endforeach()
endif()

# Apply defaults
if (NOT SETGEN_OUT_DIR)
set(SETGEN_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_settings")
endif()
if (NOT SETGEN_CODE_TEMPLATE)
set(SETGEN_CODE_TEMPLATE "${PAL_GEN_DIR}/settingsCodeTemplates.py")
endif()
get_filename_component(SETGEN_CODE_TEMPLATE "${SETGEN_CODE_TEMPLATE}" ABSOLUTE)

# List dependencies which cause a rerun if modified (cmdline changes implicitly rerun).
set(ADDL_DEPS
"${PAL_GEN_DIR}/genSettingsCode.py"
"${SETGEN_CODE_TEMPLATE}"
)

# Build up common args based on the provided settings
set(ADDL_ARGS
"--codeTemplateFile" "${SETGEN_CODE_TEMPLATE}"
"--outDir" "${SETGEN_OUT_DIR}"
)
if (NOT SETGEN_NO_REGISTRY)
list(APPEND ADDL_ARGS "--genRegistryCode")
endif()
if (SETGEN_CLASS_NAME)
list(APPEND ADDL_ARGS "--classNameOverride" "${SETGEN_CLASS_NAME}")
endif()
if (SETGEN_ADDL_NAMESPACES)
list(APPEND ADDL_ARGS "--additionalNamespaces" "${SETGEN_ADDL_NAMESPACES}")
endif()

if (SETGEN_MAGIC_BUF)
get_filename_component(SETGEN_MAGIC_BUF "${SETGEN_MAGIC_BUF}" ABSOLUTE)
list(APPEND ADDL_DEPS "${SETGEN_MAGIC_BUF}")
list(APPEND ADDL_ARGS "--magicBuffer" "${SETGEN_MAGIC_BUF}")
endif()

# Create and include output dir
file(MAKE_DIRECTORY ${SETGEN_OUT_DIR})
target_include_directories(${TARGET} PRIVATE ${SETGEN_OUT_DIR})

foreach(SETTINGS_FILE ${SETGEN_SETTINGS})
if (SETGEN_OUT_BASENAME)
set(OUT_BASENAME ${SETGEN_OUT_BASENAME})
else()
convert_pal_settings_name(${SETTINGS_FILE} OUT_BASENAME TRUE)
endif()

get_filename_component(SETTINGS_FILE "${SETTINGS_FILE}" ABSOLUTE)
target_sources(${TARGET} PRIVATE
${SETGEN_OUT_DIR}/${OUT_BASENAME}.h
${SETGEN_OUT_DIR}/${OUT_BASENAME}.cpp
${SETTINGS_FILE}
)
set_source_files_properties(
${SETGEN_OUT_DIR}/${OUT_BASENAME}.h
${SETGEN_OUT_DIR}/${OUT_BASENAME}.cpp
TARGET_DIRECTORY ${TARGET}
PROPERTIES GENERATED ON
)

if ((NOT EXISTS ${SETGEN_OUT_DIR}/${OUT_BASENAME}.h) OR
(NOT EXISTS ${SETGEN_OUT_DIR}/${OUT_BASENAME}.cpp))
# Generate these during configuration so that they are guaranteed to exist.
execute_process(
COMMAND ${Python3_EXECUTABLE} ${PAL_GEN_DIR}/genSettingsCode.py
--settingsFile ${SETTINGS_FILE}
--outFilename ${OUT_BASENAME}
${ADDL_ARGS}
)
endif()

convert_pal_settings_name(${SETTINGS_FILE} SETTING_TGT FALSE)
add_custom_command(
OUTPUT ${SETGEN_OUT_DIR}/${OUT_BASENAME}.cpp
${SETGEN_OUT_DIR}/${OUT_BASENAME}.h
COMMAND ${Python3_EXECUTABLE} ${PAL_GEN_DIR}/genSettingsCode.py
--settingsFile ${SETTINGS_FILE}
--outFilename ${OUT_BASENAME}
${ADDL_ARGS}
COMMENT "Generating settings from ${SETTINGS_FILE}..."
DEPENDS ${SETTINGS_FILE}
${ADDL_DEPS}
)
add_custom_target(${SETTING_TGT}
DEPENDS ${SETGEN_OUT_DIR}/${OUT_BASENAME}.cpp
${SETGEN_OUT_DIR}/${OUT_BASENAME}.h
SOURCES ${SETGEN_OUT_DIR}/${OUT_BASENAME}.cpp
${SETGEN_OUT_DIR}/${OUT_BASENAME}.h
)

add_dependencies(${TARGET} ${SETTING_TGT})
set_target_properties(${SETTING_TGT}
PROPERTIES
FOLDER "${CMAKE_FOLDER}/Generate/Settings"
)

if (SETGEN_ROOT_BINARY_DIR)
source_group(
TREE ${PAL_BINARY_DIR}
FILES
${SETGEN_OUT_DIR}/${OUT_BASENAME}.h
${SETGEN_OUT_DIR}/${OUT_BASENAME}.cpp
)
else()
source_group("Generated/Settings"
FILES
${SETGEN_OUT_DIR}/${OUT_BASENAME}.h
${SETGEN_OUT_DIR}/${OUT_BASENAME}.cpp
)
endif()
endforeach()
endfunction()

function(pal_gen_settings)
# INPUT_JSON:
# Path to a JSON file describing all settings of a component.
Expand Down Expand Up @@ -294,6 +156,7 @@ function(pal_gen_settings)
${DEVDRIVER_PATH}/apis/settings/codegen/settings.cpp.jinja2
${DEVDRIVER_PATH}/apis/settings/codegen/settings.h.jinja2
)

add_custom_target(${SETTING_TGT}
DEPENDS ${SETTINGS_OUT_DIR}/${GENERATED_HEADER_FILENAME}
${SETTINGS_OUT_DIR}/${GENERATED_SOURCE_FILENAME}
Expand Down
18 changes: 8 additions & 10 deletions cmake/PalCompileDefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ function(pal_compile_definitions_gpu TARGET)
target_compile_definitions(${TARGET} INTERFACE PAL_BUILD_PHOENIX=$<BOOL:${PAL_BUILD_GFX9}>)
target_compile_definitions(${TARGET} INTERFACE PAL_BUILD_PHOENIX1=$<BOOL:${PAL_BUILD_GFX9}>)
endif()

# We'll remove this soon...
target_compile_definitions(${TARGET} INTERFACE PAL_BUILD_PHOENIX2=$<BOOL:${PAL_BUILD_GFX9}>)
if (PAL_CLIENT_INTERFACE_MAJOR_VERSION LESS 888)
target_compile_definitions(${TARGET} INTERFACE PAL_BUILD_PHOENIX2=$<BOOL:${PAL_BUILD_GFX9}>)
endif()

endif()
endfunction()
Expand Down Expand Up @@ -167,7 +167,7 @@ function(pal_compile_definitions TARGET)

target_compile_definitions(${TARGET} PRIVATE PAL_BUILD_CORE=$<BOOL:${PAL_BUILD_CORE}>)

if(PAL_AMDGPU_BUILD)
if (PAL_AMDGPU_BUILD)
message(STATUS "PAL build with amdgpu back-end enabled")

target_compile_definitions(${TARGET} PUBLIC PAL_AMDGPU_BUILD=1)
Expand All @@ -177,14 +177,12 @@ function(pal_compile_definitions TARGET)
target_compile_definitions(${TARGET} PRIVATE PAL_HAVE_WAYLAND_PLATFORM=$<BOOL:${PAL_BUILD_WAYLAND}>)
endif()

if (PAL_BUILD_OSS)
target_compile_definitions(${TARGET} PRIVATE PAL_BUILD_OSS=1)

if (PAL_CLIENT_INTERFACE_MAJOR_VERSION LESS 888)
if (PAL_BUILD_OSS)
#if PAL_BUILD_OSS2_4
target_compile_definitions(${TARGET} PUBLIC PAL_BUILD_OSS2_4=$<BOOL:${PAL_BUILD_OSS2_4}>)
target_compile_definitions(${TARGET} INTERFACE PAL_BUILD_OSS2_4=$<BOOL:${PAL_BUILD_OSS2_4}>)
#endif

target_compile_definitions(${TARGET} PRIVATE PAL_BUILD_OSS4=$<BOOL:${PAL_BUILD_OSS4}>)
endif()
endif()

#if PAL_BUILD_RPM_GFX_SHADERS
Expand Down
8 changes: 6 additions & 2 deletions inc/core/g_palPipelineAbiMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,9 @@ struct PipelineMetadata
uint8 psSampleMask : 1;
/// Indicates whether or not the pipeline uses continuations passing shaders (CPS).
uint8 usesCps : 1;
uint8 reserved : 3;
/// If using continuations passing shaders (CPS), stack is in global rather than scratch memory.
uint8 cpsGlobal : 1;
uint8 reserved : 2;
};
uint8 uAll;
} flags;
Expand Down Expand Up @@ -1952,10 +1954,11 @@ struct PipelineMetadata
uint32 psDummyExport : 1;
uint32 psSampleMask : 1;
uint32 usesCps : 1;
uint32 cpsGlobal : 1;
uint32 streamoutVertexStrides : 1;
uint32 graphicsRegister : 1;
uint32 computeRegister : 1;
uint32 reserved : 3;
uint32 reserved : 2;
};
uint32 uAll;
} hasEntry;
Expand Down Expand Up @@ -2017,6 +2020,7 @@ namespace PipelineMetadataKey
static constexpr char PsDummyExport[] = ".ps_dummy_export";
static constexpr char PsSampleMask[] = ".ps_sample_mask";
static constexpr char UsesCps[] = ".uses_cps";
static constexpr char CpsGlobal[] = ".cps_global";
static constexpr char StreamoutVertexStrides[] = ".streamout_vertex_strides";
static constexpr char GraphicsRegisters[] = ".graphics_registers";
static constexpr char ComputeRegisters[] = ".compute_registers";
Expand Down
15 changes: 15 additions & 0 deletions inc/core/g_palPipelineAbiMetadataImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5700,6 +5700,21 @@ inline Result DeserializePipelineMetadata(
break;
}

case HashLiteralString(PipelineMetadataKey::CpsGlobal):
{
PAL_ASSERT(pMetadata->hasEntry.cpsGlobal == 0);
bool value = false;
result = pReader->UnpackNext(&value);

if (result == Result::Success)
{
pMetadata->flags.cpsGlobal = value;
}

pMetadata->hasEntry.cpsGlobal = (result == Result::Success);
break;
}

case HashLiteralString(PipelineMetadataKey::StreamoutVertexStrides):
PAL_ASSERT(pMetadata->hasEntry.streamoutVertexStrides == 0);
result = pReader->UnpackNext(&pMetadata->streamoutVertexStrides);
Expand Down
4 changes: 2 additions & 2 deletions inc/core/pal.h
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ enum class TriState : uint8
* OS abstractions for almost everything a client might need, but there are some cases where this is unavoidable:
*
* + Handling dynamic library infrastructure. I.e., the client has to implement DllMain() on Windows, etc.
* + OS-specific APIs or extensions. DX may have Windows-specific functionality in the core API, and Vulkan/Mantle may
* + OS-specific APIs or extensions. DX may have Windows-specific functionality in the core API, and Vulkan may
* export certain OS-specific features as extensions (like for presenting contents to the screen).
* + Single OS clients (e.g., DX) may choose to make OS-specific calls directly simply out of convenience with no down
* side.
Expand Down Expand Up @@ -666,7 +666,7 @@ enum class TriState : uint8
*
* ### Introduction
* PAL's core interface is defined in the @ref Pal namespace, and defines an object-oriented model for interacting with
* the GPU and OS. The interface closely resembles the Mantle, Vulkan, and DX12 APIs. Some common features of these
* the GPU and OS. The interface closely resembles the Vulkan and DX12 APIs. Some common features of these
* APIs that are central to the PAL interface:
*
* - All shader stages, and some additional "shader adjacent" state, are glommed together into a monolithic pipeline
Expand Down
Loading

0 comments on commit d3bfe50

Please sign in to comment.