Skip to content

Commit bcec463

Browse files
committed
Update pal from commit: 59416f33
* Add ReadSetting cross-platform wrapper * Correct RereadSetting name * dEQP-VK.dynamic_rendering.*cmdbuffer* - failing on Linux * Incorrect CPU logical cores shown in the RGP Device Configuration * WriteBufferImmediate CP copydata top: ME->PFP and Cleanup * Implementation of device info trace source * Add option to open shared memory with globalGpuVa * [Streaming SDK 1.5] Pass frame index from the app to KMD * Debug logging support in PAL * Fixup Linux ArchiveFile implementation * Adjust default tessFactorBufferSizePerSe * Tweak Shader Cache Hash Map settings to reduce memory usage * StringView class implementation * Hook up memory budget value in PAL to SW addrlib * Add ICmdBuffer::CmdCopyMemoryByGpuVa * Fix settings script * PAL_NOT_IMPLEMENTED Assert triggers with MGPU * Fix for SPM regr * Remove pointless cache layer alerts * Null device dummy values for swizzling * Add utility function to read a file into memory * Use old SPM layout until RGP is ready * Ubuntu21.04+Wayland Vulkan perf ~40% lower compared U20.04 * Add sample info to ShaderEarlyCompileInfo * Fix InitBusAddressableGpuMemory decorator * Updated waForce1kHtileMin size in Gfx9 * RDF lib update * Clean up NullDevice tables
1 parent 44abc48 commit bcec463

File tree

205 files changed

+14251
-7480
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+14251
-7480
lines changed

CMakeLists.txt

+1-13
Original file line numberDiff line numberDiff line change
@@ -27,36 +27,24 @@ cmake_minimum_required(VERSION 3.13...3.21)
2727
include(cmake/PalVersionHelper.cmake)
2828
project(PAL LANGUAGES CXX)
2929

30-
### Build Parameters ###################################################################################################
3130
include(PalBuildParameters)
32-
33-
### Project Options ####################################################################################################
3431
include(PalOptions)
35-
36-
### Option Overrides ###################################################################################################
3732
include(PalOverrides)
3833

39-
### Create PAL Library #################################################################################################
4034
set(CMAKE_FOLDER "${CMAKE_FOLDER}/PAL Libs")
4135
add_library(pal STATIC)
4236
add_library(AMD::PAL ALIAS pal)
4337

44-
### Add Subdirectories #################################################################################################
4538
add_subdirectory(cmake)
4639
add_subdirectory(inc)
4740
add_subdirectory(res)
4841
add_subdirectory(shared)
4942
add_subdirectory(src)
43+
add_subdirectory(tools)
5044

51-
### Build Definitions ##################################################################################################
5245
pal_compile_definitions(pal)
53-
54-
### Compiler Options ###################################################################################################
5546
pal_compiler_options(pal)
5647

57-
### Custom Commands ####################################################################################################
58-
59-
### IDE support ########################################################################################################
6048
get_target_property(pal_sources pal SOURCES)
6149
source_group(TREE ${PAL_SOURCE_DIR}/
6250
FILES ${pal_sources}

cmake/CMakeLists.txt

+12-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@
2323
#
2424
#######################################################################################################################
2525

26-
if (MSVC_IDE)
27-
file(GLOB_RECURSE PAL_CMAKE_SOURCES CONFIGURE_DEPENDS *.cmake)
28-
target_sources(pal PRIVATE ${PAL_CMAKE_SOURCES} CMakeLists.txt)
29-
endif()
26+
add_subdirectory(Modules)
27+
28+
target_sources(pal PRIVATE
29+
CMakeLists.txt
30+
PalBuildParameters.cmake
31+
PalCompileDefinitions.cmake
32+
PalCompilerOptions.cmake
33+
PalCompilerWarnings.cmake
34+
PalOptions.cmake
35+
PalOverrides.cmake
36+
PalVersionHelper.cmake
37+
)

cmake/Modules/CMakeLists.txt

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
##
2+
#######################################################################################################################
3+
#
4+
# Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved.
5+
#
6+
# Permission is hereby granted, free of charge, to any person obtaining a copy
7+
# of this software and associated documentation files (the "Software"), to deal
8+
# in the Software without restriction, including without limitation the rights
9+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
# copies of the Software, and to permit persons to whom the Software is
11+
# furnished to do so, subject to the following conditions:
12+
#
13+
# The above copyright notice and this permission notice shall be included in all
14+
# copies or substantial portions of the Software.
15+
#
16+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
# SOFTWARE.
23+
#
24+
#######################################################################################################################
25+
26+
target_sources(pal PRIVATE
27+
CMakeLists.txt
28+
FindDRM.cmake
29+
FindWayland.cmake
30+
FindXCB.cmake
31+
)

cmake/PalCompileDefinitions.cmake

+6
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ function(pal_compile_definitions TARGET)
140140
)
141141
endif()
142142

143+
if(PAL_ENABLE_LOGGING)
144+
target_compile_definitions(${TARGET} PUBLIC
145+
$<$<CONFIG:Debug>:PAL_ENABLE_LOGGING=1>
146+
)
147+
endif()
148+
143149
target_compile_definitions(${TARGET} PUBLIC
144150
# Turn on memory tracking in Debug builds or when the user asks for it
145151
$<$<OR:$<CONFIG:Debug>,$<BOOL:${PAL_MEMTRACK}>>:

cmake/PalOptions.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,7 @@ include_guard()
3232
option(PAL_ENABLE_PRINTS_ASSERTS "Enable print assertions?")
3333
option(PAL_ENABLE_PRINTS_ASSERTS_DEBUG "Enable print assertions on debug builds?" ON)
3434

35+
option(PAL_ENABLE_LOGGING "Enable debug logging?" OFF)
36+
3537
option(PAL_MEMTRACK "Enable PAL memory tracker?")
3638

doc/process/palCodingStandards.md

+3
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ General Language Restrictions
152152
- In cases where the type is specified in the right-hand
153153
initialization expression.
154154

155+
- **Avoid** overloading function names for class hierarchies. This can
156+
lead to tedious casting of the class that defines the function.
157+
155158
Preprocessor
156159
------------
157160

inc/CMakeLists.txt

+10-9
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@
2323
#
2424
#######################################################################################################################
2525

26-
if (MSVC_IDE)
27-
file(GLOB_RECURSE PAL_HEADER_SOURCES CONFIGURE_DEPENDS *.h *.hpp)
28-
target_sources(pal PRIVATE ${PAL_HEADER_SOURCES} CMakeLists.txt)
26+
target_include_directories(pal PUBLIC .)
27+
28+
if (PAL_BUILD_CORE)
29+
add_subdirectory(core)
30+
endif()
31+
32+
if (PAL_BUILD_GPUUTIL)
33+
add_subdirectory(gpuUtil)
2934
endif()
3035

31-
target_include_directories(pal PUBLIC
32-
.
33-
core
34-
gpuUtil
35-
util
36-
)
36+
add_subdirectory(util)
3737

38+
target_sources(pal PRIVATE CMakeLists.txt)

inc/core/CMakeLists.txt

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
##
2+
#######################################################################################################################
3+
#
4+
# Copyright (c) 2021 Advanced Micro Devices, Inc. All Rights Reserved.
5+
#
6+
# Permission is hereby granted, free of charge, to any person obtaining a copy
7+
# of this software and associated documentation files (the "Software"), to deal
8+
# in the Software without restriction, including without limitation the rights
9+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
# copies of the Software, and to permit persons to whom the Software is
11+
# furnished to do so, subject to the following conditions:
12+
#
13+
# The above copyright notice and this permission notice shall be included in all
14+
# copies or substantial portions of the Software.
15+
#
16+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
# SOFTWARE.
23+
#
24+
#######################################################################################################################
25+
26+
target_include_directories(pal PUBLIC .)
27+
28+
target_sources(pal PRIVATE
29+
CMakeLists.txt
30+
g_palPipelineAbiMetadata.h
31+
g_palPipelineAbiMetadataImpl.h
32+
pal.h
33+
palBorderColorPalette.h
34+
palCmdAllocator.h
35+
palCmdBuffer.h
36+
palColorBlendState.h
37+
palColorTargetView.h
38+
palDepthStencilState.h
39+
palDepthStencilView.h
40+
palDestroyable.h
41+
palDeveloperHooks.h
42+
palDevice.h
43+
palEventDefs.h
44+
palFence.h
45+
palFormat.h
46+
palFormatInfo.h
47+
palGpuEvent.h
48+
palGpuMemory.h
49+
palGpuMemoryBindable.h
50+
palHsaAbiMetadata.h
51+
palImage.h
52+
palIndirectCmdGenerator.h
53+
palLib.h
54+
palMotionEstimator.h
55+
palMsaaState.h
56+
palOglPresent.h
57+
palPerfExperiment.h
58+
palPipeline.h
59+
palPipelineAbi.h
60+
palPipelineAbiProcessor.h
61+
palPipelineAbiProcessorImpl.h
62+
palPipelineAbiReader.h
63+
palPipelineAbiUtils.h
64+
palPlatform.h
65+
palPrivateScreen.h
66+
palQueryPool.h
67+
palQueue.h
68+
palQueueSemaphore.h
69+
palScreen.h
70+
palSettingsLoader.h
71+
palShaderLibrary.h
72+
palSwapChain.h
73+
)

inc/core/pal.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,12 @@ struct ExternalResourceOpenInfo
431431
/// instead of fd.
432432
uint32 isDopp : 1; ///< This is a Dopp texture, doppDesktopInfo is in use.
433433
uint32 isDirectCapture : 1; ///< This is a Direct Capture resource, directCaptureInfo is in use.
434-
uint32 reserved : 28; ///< Reserved for future use.
434+
#if PAL_CLIENT_INTERFACE_MAJOR_VERSION >= 696
435+
uint32 globalGpuVa : 1; ///< The GPU virtual address must be visible to all devices.
436+
#else
437+
uint32 placeholder695 : 1;
438+
#endif
439+
uint32 reserved : 27; ///< Reserved for future use.
435440
};
436441
uint32 u32All; ///< Flags packed as 32-bit uint.
437442
} flags; ///< External resource open flags.

inc/core/palCmdBuffer.h

+35-9
Original file line numberDiff line numberDiff line change
@@ -1777,6 +1777,10 @@ struct CmdBufInfo
17771777
const IGpuMemory* pPrivFlipMemory; ///< The gpu memory object of the private flip primary surface for the
17781778
/// DirectCapture feature.
17791779
#endif
1780+
#if PAL_CLIENT_INTERFACE_MAJOR_VERSION >= 695
1781+
uint64 frameIndex; ///< The frame index of this command buffer. It is only required for the
1782+
/// DirectCapture feature
1783+
#endif
17801784
};
17811785

17821786
/// Specifies rotation angle between two images. Used as input to ICmdBuffer::CmdScaledCopyImage.
@@ -2741,6 +2745,29 @@ class ICmdBuffer : public IDestroyable
27412745
uint32 regionCount,
27422746
const MemoryCopyRegion* pRegions) = 0;
27432747

2748+
/// Copies multiple regions from one GPU memory virtual address to another.
2749+
///
2750+
/// @note The CmdCopyMemory() path should be preferred because it contains more optimizations due to more
2751+
/// knowledge about the memory itself that is lost when only virtual addresses are passed in.
2752+
///
2753+
///
2754+
/// None of the destination regions are allowed to overlap each other, nor are destination and source regions
2755+
/// allowed to overlap when the source and destination GPU memory virtual address are the same. Any illegal
2756+
/// overlapping will cause undefined results.
2757+
///
2758+
/// For best performance, addresses, offsets, and copy sizes should be 4-byte aligned.
2759+
///
2760+
/// @param [in] srcGpuVirtAddr GPU memory vitrual address where the source regions are located.
2761+
/// @param [in] dstGpuVirtAddr GPU memory virtual address where the destination regions are located.
2762+
/// @param [in] regionCount Number of regions to copy; size of the pRegions array.
2763+
/// @param [in] pRegions Array of copy regions, each entry specifynig a source offset, destination offset,
2764+
/// and copy size.
2765+
virtual void CmdCopyMemoryByGpuVa(
2766+
gpusize srcGpuVirtAddr,
2767+
gpusize dstGpuVirtAddr,
2768+
uint32 regionCount,
2769+
const MemoryCopyRegion* pRegions) = 0;
2770+
27442771
/// Copies multiple regions from one image to another.
27452772
///
27462773
/// The source and destination subresource of a particular region are not allowed to be the same, and will produce
@@ -3385,16 +3412,17 @@ class ICmdBuffer : public IDestroyable
33853412
uint32 startQuery,
33863413
uint32 queryCount) = 0;
33873414

3388-
/// Writes a top-of-pipe or bottom-of-pipe timestamp to the specified memory location.
3415+
/// Writes a HwPipePostIndexFetch or HwPipeBottom timestamp to the specified memory location.
33893416
///
33903417
/// The timestamp data is a 64-bit value that increments once per clock. timestampFrequency in DeviceProperties
33913418
/// reports the frequency the timestamps are clocked at.
33923419
///
33933420
/// Timestamps are only supported by engines that report supportsTimestamps in DeviceProperties.
33943421
///
3395-
/// @param [in] pipePoint Specifies where in the pipeline the timestamp should be sampled and written. The only
3396-
/// valid choices are HwPipeTop and HwPipeBottom. Top-of-pipe timestamps are not supported
3397-
/// on the SDMA engine, so all timestamps will be executed as bottom-of-pipe.
3422+
/// @param [in] pipePoint Specifies where in the pipeline the timestamp should be sampled and written. The only
3423+
/// valid choices are HwPipePostIndexFetch and HwPipeBottom. HwPipePostIndexFetch timestamps
3424+
/// are not supported on the SDMA engine, so all timestamps will be executed as
3425+
/// bottom-of-pipe.
33983426
/// @param [in] dstGpuMemory GPU memory object where timestamp should be written.
33993427
/// @param [in] dstOffset Offset into pDstGpuMemory where the timestamp should be written. Must be aligned to
34003428
/// minTimestampAlignment in DeviceProperties.
@@ -3405,12 +3433,10 @@ class ICmdBuffer : public IDestroyable
34053433

34063434
/// Writes a top-of-pipe or bottom-of-pipe immediate value to the specified memory location.
34073435
///
3408-
/// Timestamps are only supported by engines that report supportsTimestamps in DeviceProperties.
3409-
///
34103436
/// @param [in] pipePoint Specifies where in the pipeline the timestamp should be sampled and written.
3411-
/// The only valid choices are HwPipeTop and HwPipeBottom. Top-of-pipe timestamps
3412-
/// are not supported on the SDMA engine, so all timestamps will be executed as
3413-
/// bottom-of-pipe.
3437+
/// The only valid choices are HwPipeTop, HwPipePostIndexFetch and HwPipeBottom.
3438+
/// Top-of-pipe timestamps are not supported on the SDMA engine, so all timestamps
3439+
/// will be executed as bottom-of-pipe.
34143440
/// @param [in] data Value to be written to gpu address.
34153441
/// @param [in] ImmediateDataWidth Size of the data to be written out.
34163442
/// @param [in] address GPU address where immediate value should be written.

inc/core/palDevice.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -2109,8 +2109,8 @@ struct CustomPowerProfile
21092109
/// directed by the application or hard-code them to a single value. Driver-internal memory references should be marked
21102110
/// as CantTrim unless the client explicitly handles trim support.
21112111
///
2112-
/// Note that the CantTrim and MustSucceed flags are based on the same WDDM2 flags; it is expected that PAL will ignore
2113-
/// them on non-WDDM2 platforms.
2112+
/// Note that the CantTrim and MustSucceed flags are based on the same WDDM flags; it is expected that PAL will ignore
2113+
/// them on non-WDDM platforms.
21142114
enum GpuMemoryRefFlags : uint32
21152115
{
21162116
GpuMemoryRefCantTrim = 0x1, ///< The caller can't or won't free this allocation on OS request.

inc/core/palImage.h

+14
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,16 @@ struct ImageCreateInfo
291291
MetadataTcCompatMode metadataTcCompatMode; ///< TC compat mode for this image.
292292
uint32 maxBaseAlign; ///< Maximum address alignment for this image or zero for an unbounded
293293
/// alignment.
294+
#if PAL_CLIENT_INTERFACE_MAJOR_VERSION >= 694
295+
float imageMemoryBudget; ///< The memoryBudget value used in SW addrlib to determine the minSizeBlk for
296+
/// textures. It must be >= 0.0.
297+
/// When in [0.0, 1.0), addrlib uses legacy logic to decide minSizeBlk.
298+
/// When == 1.0, addrlib uses minimizeAlign.
299+
/// When > 1.0, addrlib applies memory budget algorithm.
300+
/// Despite 1.5 in tests show significant texture allocation size reduction,
301+
/// default value 0.0 (legacy behavior) is recommended if not specified by
302+
/// client.
303+
#endif
294304

295305
struct
296306
{
@@ -497,6 +507,10 @@ struct SubresLayout
497507
///
498508
/// This value is only valid if supportSplitReleaseAcquire is set in @ref DeviceProperties.
499509
ImageLayout defaultGfxLayout;
510+
511+
SwizzledFormat planeFormat; ///< Swizzled format for plane. Planar resource like D32-S8
512+
/// will have different swizzled format per plane.
513+
500514
};
501515

502516
/// Selects a specific subresource of an image resource.

inc/core/palLib.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
/// compatible, it is not assumed that the client will initialize all input structs to 0.
4444
///
4545
/// @ingroup LibInit
46-
#define PAL_INTERFACE_MAJOR_VERSION 691
46+
#define PAL_INTERFACE_MAJOR_VERSION 697
4747

4848
/// Minor interface version. Note that the interface version is distinct from the PAL version itself, which is returned
4949
/// in @ref Pal::PlatformProperties.
@@ -53,7 +53,7 @@
5353
/// of the existing enum values will change. This number will be reset to 0 when the major version is incremented.
5454
///
5555
/// @ingroup LibInit
56-
#define PAL_INTERFACE_MINOR_VERSION 2
56+
#define PAL_INTERFACE_MINOR_VERSION 0
5757

5858
/// Minimum major interface version. This is the minimum interface version PAL supports in order to support backward
5959
/// compatibility. When it is equal to PAL_INTERFACE_MAJOR_VERSION, only the latest interface version is supported.

0 commit comments

Comments
 (0)