Skip to content

Commit b6da370

Browse files
committed
Update pal from commit 53117dfb
Implement GPU work submission for Trace Session 'Preparation' state Add Absolute and Relative Capture Modes to Trace Controllers Fix task shader user data missing in Execute Indirect Shader Fix issue with gang-submit and compute scratch ring Validate AceRingSet only for ACE Add supportInt4 to gfxipProperties Implement cancel trace for UberTrace-based tools Bind Instrumentation changes for RGP Handle CancelTrace for TDR and RenderOp controllers Update address-lib submodule Fix "Unknown()" events appearing in RGP captures Clean up virtual functions in RsrcProcMgr [CodingStandards] Add allowance for const function value-type parameters HSA ABI permit HiddenHostcallBuffer MultiElfCacheLayer fixes Set DrawIndex to Zero for Execute Indirect Add support for Wayland explicit sync during presents Parse dimension info from Mesa metadata Clean up image clone copy path codes Gpu Profiler SPM Draw Markers: Add updates of the RLCUSER0 and RLCUSER1 "counters" to indicate the TimedCallId (Draw, Dispatch, Copy, Barrier, etc) and CommandBufferID, respectively Allow acquiring an unique id for StringTableTraceSource Update SwWarDetection submodule Optimize the HwlImageToImageMissingPixelCopy() path in CmdCopyImage() Zero init embedded data in Execute Indirect Drop using PWS late acquire point PrePs Re-enable zwp dmabuf protocol Remove non-primary GartCacheable alert Evaluate and override GpuProfilerMode in PlatformSettings validation to ensure downstream choices for GpuProfilerMode are consisten Archive pipeline loader: Avoid indiscriminately propagating reg/stack usage Add IDevice::GetDefaultSamplePattern GpuProfiler - Add flush to WaitForFences Update DevDriver submodule Pre-increment instead of post-increment for String table Id Recompile rpm Remove a pre-RDNA check [codegen] Generate formats at build time. Enable the support for int4 type on gfx11 [AddrMgr2] Fix failure with InitSubresourcesForImage on user specified dma_buf_modifier Fix failure in VK.dgc.ext.compute* compute queue cases when running in batch Fix an underflow in BoxesCoverWholeExtent Fix gpuDebugQueue with ReBAR/SAM enabled Fix YUV regression with format generation Disable DevDriverOverlay in preparation state munmap format table in zwp_linux_dmabuf_feedback_v1::done Fix build error with the latest clang: missing header for sscanf calls
1 parent 0a622c9 commit b6da370

File tree

270 files changed

+21286
-38428
lines changed

Some content is hidden

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

270 files changed

+21286
-38428
lines changed

cmake/PalCodegen.cmake

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ function(pal_setup_generated_code)
214214
INCLUDE_HEADERS core/hw/gfxip/gfxDevice.h)
215215
endif()
216216

217+
pal_gen_formats()
217218
endfunction()
218219

219220
function(nongen_source_groups DIR)
@@ -246,3 +247,68 @@ function(nongen_source_groups DIR)
246247
endforeach()
247248
endfunction()
248249

250+
function(pal_gen_formats)
251+
set(FORMAT_GEN_DIR ${PAL_GEN_DIR}/formats)
252+
set(FORMAT_OUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
253+
254+
set(NEEDS_CONFIG_GEN_STEP FALSE)
255+
256+
set(FORMAT_INDEPENDENT_HDR "${FORMAT_OUT_DIR}/src/core/g_mergedFormatInfo.h")
257+
258+
if (NOT EXISTS ${FORMAT_INDEPENDENT_HDR})
259+
set(NEEDS_CONFIG_GEN_STEP TRUE)
260+
endif()
261+
262+
set(FORMAT_GFX9_HDR "${FORMAT_OUT_DIR}/src/core/hw/gfxip/gfx9/g_gfx9MergedDataFormats.h")
263+
if (NOT EXISTS ${FORMAT_GFX9_HDR})
264+
set(NEEDS_CONFIG_GEN_STEP TRUE)
265+
endif()
266+
267+
if (NEEDS_CONFIG_GEN_STEP)
268+
# Generate these during configuration so that they are guaranteed to exist.
269+
execute_process(
270+
COMMAND ${Python3_EXECUTABLE} ${FORMAT_GEN_DIR}/main.py
271+
${FORMAT_OUT_DIR}
272+
COMMAND_ECHO STDOUT
273+
WORKING_DIRECTORY ${FORMAT_GEN_DIR}
274+
)
275+
endif()
276+
277+
add_custom_command(
278+
OUTPUT ${FORMAT_INDEPENDENT_HDR}
279+
${FORMAT_GFX9_HDR}
280+
COMMAND ${Python3_EXECUTABLE} ${FORMAT_GEN_DIR}/main.py
281+
${FORMAT_OUT_DIR}
282+
COMMENT "Generating formats from ${FORMAT_GEN_DIR}/..."
283+
DEPENDS ${FORMAT_GEN_DIR}/main.py
284+
${FORMAT_GEN_DIR}/data/pal.yaml
285+
${FORMAT_GEN_DIR}/data/gfx10.yaml
286+
${FORMAT_GEN_DIR}/data/gfx10_3.yaml
287+
${FORMAT_GEN_DIR}/data/gfx11.yaml
288+
${FORMAT_GEN_DIR}/shared/structs.py
289+
${FORMAT_GEN_DIR}/shared/template_hwl.h.j2
290+
${FORMAT_GEN_DIR}/shared/template_independent.h.j2
291+
${FORMAT_GEN_DIR}/shared/utils.py
292+
WORKING_DIRECTORY ${FORMAT_GEN_DIR}
293+
)
294+
295+
add_custom_target(pal_generate_formats
296+
DEPENDS ${FORMAT_INDEPENDENT_HDR}
297+
${FORMAT_GFX9_HDR}
298+
SOURCES ${FORMAT_INDEPENDENT_HDR}
299+
${FORMAT_GFX9_HDR}
300+
)
301+
target_include_directories(pal PRIVATE ${FORMAT_OUT_DIR}/src)
302+
add_dependencies(pal pal_generate_formats)
303+
set_target_properties(pal_generate_formats
304+
PROPERTIES
305+
FOLDER "${CMAKE_FOLDER}/Generate/Formats"
306+
)
307+
308+
source_group(
309+
TREE ${PAL_BINARY_DIR}
310+
FILES
311+
${FORMAT_INDEPENDENT_HDR}
312+
${FORMAT_GFX9_HDR}
313+
)
314+
endfunction()

cmake/PalCompilerOptions.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,15 @@ function(pal_compiler_options TARGET)
4040

4141
set(isGNU FALSE)
4242
set(isClang FALSE)
43+
set(isMSVC FALSE)
4344

44-
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
45+
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC"
46+
OR "${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC")
47+
# Either Microsoft's cl or LLVM's clang-cl. Note this check
48+
# is done before the Clang check below because clang-cl uses
49+
# "Clang" for COMPILER_ID too.
50+
set(isMSVC TRUE)
51+
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
4552
set(isGNU TRUE)
4653
# Output with color if in terminal: https://github.com/ninja-build/ninja/wiki/FAQ
4754
target_compile_options(${TARGET} PRIVATE -fdiagnostics-color=always)

doc/process/palCodingStandards.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,6 +1186,10 @@ Const Usage
11861186

11871187
- Use the const specifier ***whenever possible***.
11881188

1189+
- Use of const for value-type function parameters ***should*** be used when
1190+
the function author wants the value to be guaranteed constant for the
1191+
life of the function.
1192+
11891193
- Floating point constants ***must*** be suffixed with an "f" to
11901194
prevent an implicit conversion from double to float. Constants of
11911195
other types ***should*** limit conversions using the "ul", "ull",

inc/core/palCmdBuffer.h

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,6 +1496,17 @@ struct GpuVirtAddrAndStride
14961496
};
14971497
};
14981498

1499+
/// Flags to describe a dispatch
1500+
union DispatchInfoFlags
1501+
{
1502+
struct
1503+
{
1504+
uint32 devDriverOverlay : 1; ///< Flag indicates this dispatch draws the DevDriver overlay
1505+
uint32 reserved : 31; ///< Reserved for future use.
1506+
};
1507+
uint32 u32All; ///< Flags packed as 32-bit uint.
1508+
};
1509+
14991510
/// Specifies the different stages at which a combiner can choose between different shading rates.
15001511
enum class VrsCombinerStage : uint32
15011512
{
@@ -1663,8 +1674,9 @@ typedef void (PAL_STDCALL *CmdDrawIndexedIndirectMultiFunc)(
16631674
///
16641675
/// @see ICmdBuffer::CmdDispatch().
16651676
typedef void (PAL_STDCALL *CmdDispatchFunc)(
1666-
ICmdBuffer* pCmdBuffer,
1667-
DispatchDims size);
1677+
ICmdBuffer* pCmdBuffer,
1678+
DispatchDims size,
1679+
DispatchInfoFlags infoFlags);
16681680

16691681
/// @internal Function pointer type definition for issuing indirect dispatches.
16701682
///
@@ -3137,17 +3149,34 @@ class ICmdBuffer : public IDestroyable
31373149
}
31383150
#endif
31393151

3152+
#if PAL_CLIENT_INTERFACE_MAJOR_VERSION < 909
31403153
/// Dispatches a compute workload of the given dimensions using the command buffer's currently bound compute state.
31413154
///
31423155
/// The thread group size is defined in the compute shader.
31433156
///
31443157
/// Supports PAL ABI and HSA ABI pipelines.
31453158
///
31463159
/// @param [in] size Thread groups to dispatch. If any components are zero the dispatch will be discarded.
3147-
void CmdDispatch(
3160+
inline void CmdDispatch(
31483161
DispatchDims size)
31493162
{
3150-
m_funcTable.pfnCmdDispatch(this, size);
3163+
m_funcTable.pfnCmdDispatch(this, size, {});
3164+
}
3165+
#endif
3166+
3167+
/// Dispatches a compute workload of the given dimensions using the command buffer's currently bound compute state.
3168+
///
3169+
/// The thread group size is defined in the compute shader.
3170+
///
3171+
/// Supports PAL ABI and HSA ABI pipelines.
3172+
///
3173+
/// @param [in] size Thread groups to dispatch. If any components are zero the dispatch will be discarded.
3174+
/// @param [in] infoFlags Additional information about the dispatch.
3175+
void CmdDispatch(
3176+
DispatchDims size,
3177+
DispatchInfoFlags infoFlags)
3178+
{
3179+
m_funcTable.pfnCmdDispatch(this, size, infoFlags);
31513180
}
31523181

31533182
/// Dispatches a compute workload using the command buffer's currently bound compute state. The dimensions of the

inc/core/palDeveloperHooks.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ enum class CallbackType : uint32
6969
BindGpuMemory, ///< This callback is to inform of a new binding to GPU memory.
7070
SubAllocGpuMemory, ///< This callback is to inform of suballocation from base GPU memory allocation.
7171
SubFreeGpuMemory, ///< This callback is to inform that GPU memory suballocation has been freed.
72-
7372
#if PAL_DEVELOPER_BUILD
7473
RpmBlt, ///< This callback is to describe the internal RPM blt calls.
7574
#endif
@@ -497,6 +496,9 @@ struct DrawDispatchDispatchArgs
497496
DispatchDims groupStart; ///< Thread/workgroup start offsets in X/Y/Z dimensions. Only valid for CmdDispatchOffset.
498497
DispatchDims groupDims; ///< Thread/workgroup counts in X/Y/Z dimensions. Only valid for CmdDispatch[Offset].
499498
DispatchDims logicalSize; ///< Thread/workgroup counts as seen by the shader. Only valid for CmdDispatchOffset.
499+
/// Optional flags to help the client driver understand the dispatch.
500+
/// For example, if the dispatch originated in PAL rather than the client driver.
501+
DispatchInfoFlags infoFlags;
500502
};
501503

502504
/// Information for DrawDispatch callbacks

inc/core/palDevice.h

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,11 @@ union RsFeatureInfo
452452
/// Global Boost settings.
453453
struct
454454
{
455-
bool enabled; ///< Specifies whether Boost is enabled globally.
456-
uint32 hotkey; ///< If nonzero, specifies the virtual key code assigned to Boost.
457-
uint32 hotkeyInd;///< If nonzero, specifies the virtual key code assigned to Boost's indicator.
458-
uint32 minRes; ///< Specifies the global Boost minimum resolution.
455+
bool enabled; ///< Specifies whether Boost is enabled globally.
456+
uint32 hotkey; ///< If nonzero, specifies the virtual key code assigned to Boost.
457+
uint32 hotkeyInd; ///< If nonzero, specifies the virtual key code assigned to Boost's indicator.
458+
uint32 minRes; ///< Specifies the global Boost minimum resolution.
459+
bool adaptiveVrsEnabled; ///< Specifies whether BoostAdaptiveVrs is enabled globally.
459460
} boost;
460461

461462
/// Global ProVsr settings.
@@ -1432,7 +1433,8 @@ struct DeviceProperties
14321433
#endif
14331434
uint64 supportBFloat16 : 1; ///< HW supports bf16 instructions.
14341435
uint64 supportFloat8 : 1; ///< HW supports float 8-bit instructions.
1435-
uint64 reserved : 63; ///< Reserved for future use.
1436+
uint64 supportInt4 : 1; ///< HW supports integer 4-bit instructions.
1437+
uint64 reserved : 62; ///< Reserved for future use.
14361438
};
14371439
uint64 u64All[2]; ///< Flags packed as 32-bit uint.
14381440
} flags; ///< Device IP property flags.
@@ -2993,7 +2995,7 @@ class IDevice
29932995
/// modifying settings, the client must call CommitSettingsAndInit() before creating finalizing the device.
29942996
///
29952997
/// @warning The returned value points to an internal PAL structure. Modifying data using this pointer after
2996-
/// calling FinalizeSettings() will result in undefined behavior.
2998+
/// calling CommitSettingsAndInit() will result in undefined behavior.
29972999
///
29983000
/// @returns Pointer to this devices public settings for examination and/or modification by the client.
29993001
virtual PalPublicSettings* GetPublicSettings() = 0;
@@ -3144,6 +3146,20 @@ class IDevice
31443146
virtual Result GetPerfExperimentProperties(
31453147
PerfExperimentProperties* pProperties) const = 0;
31463148

3149+
/// Fills out the default MSAA quad sample pattern for the given sample count.
3150+
///
3151+
/// @param [in] samples The number of valid samples in the sample pattern. Must be a power of two.
3152+
/// @param [out] pQuadSamplePattern Fill this with the default pattern.
3153+
///
3154+
/// @returns Success if @ref pQuadSamplePattern was filled with the default sample pattern.
3155+
/// Otherwise, one of the following errors may be returned:
3156+
/// + ErrorInvalidPointer if @ref pQuadSamplePattern is null.
3157+
/// + ErrorInvalidValue if @ref samples is not a supported power of two.
3158+
/// + ErrorUnavailable if this device lacks GfxIp support.
3159+
virtual Result GetDefaultSamplePattern(
3160+
uint32 samples,
3161+
MsaaQuadSamplePattern* pQuadSamplePattern) const = 0;
3162+
31473163
/// Adds a list of per-device memory object references that persist across command buffer submissions. It is the
31483164
/// responsibility of the client to make sure that all required memory references have been added before submitting
31493165
/// the command buffer that uses on them. References can be added at the device, queue or specified at submit time.

inc/core/palLib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
#endif
4848
///
4949
/// @ingroup LibInit
50-
#define PAL_INTERFACE_MAJOR_VERSION 907
50+
#define PAL_INTERFACE_MAJOR_VERSION 909
5151

5252
#if PAL_CLIENT_INTERFACE_MAJOR_VERSION < 831
5353
/// Minor interface version. Note that the interface version is distinct from the PAL version itself, which is returned

0 commit comments

Comments
 (0)