Skip to content

Commit

Permalink
Update PAL from commit: 7306f9b
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobHeAMD committed Jan 22, 2018
1 parent 92f481f commit 91e30f1
Show file tree
Hide file tree
Showing 61 changed files with 167 additions and 3,937 deletions.
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ cmake_dependent_option(PAL_BUILD_OSS2 "Build PAL with OSS2?" ON "PAL_BUILD_O
cmake_dependent_option(PAL_BUILD_OSS2_4 "Build PAL with OSS2_4?" ON "PAL_BUILD_OSS" OFF)
cmake_dependent_option(PAL_BUILD_OSS4 "Build PAL with OSS4?" ON "PAL_BUILD_OSS" OFF)

option(PAL_BUILD_DTIF "Build PAL with Driver-to-TCore2 InterFace support?" OFF)

# PAL Client Options ###############################################################################
# Use Vulkan as the default client.
set(PAL_CLIENT "VULKAN" CACHE STRING "Client interfacing with PAL.")
Expand Down
103 changes: 1 addition & 102 deletions inc/core/palDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ class IPrivateScreen;
class IQueryPool;
class IQueue;
class IQueueSemaphore;
class IShader;
class IShaderCache;
class ISwapChain;
struct BorderColorPaletteCreateInfo;
struct CmdAllocatorCreateInfo;
Expand Down Expand Up @@ -98,8 +96,6 @@ struct QueryPoolCreateInfo;
struct QueueCreateInfo;
struct QueueSemaphoreCreateInfo;
struct QueueSemaphoreOpenInfo;
struct ShaderCreateInfo;
struct ShaderCacheCreateInfo;
struct SwapChainCreateInfo;
struct SwapChainProperties;
struct SvmGpuMemoryCreateInfo;
Expand Down Expand Up @@ -3545,64 +3541,6 @@ class IDevice
void* pPlacementAddr,
IBorderColorPalette** ppPalette) const = 0;

/// Determines the amount of system memory required for a shader object. An allocation of this amount of memory
/// must be provided in the pPlacementAddr parameter of CreateShader().
///
/// @param [in] createInfo Shader creation properties.
/// @param [out] pResult The validation result if pResult is non-null. This argument can be null to avoid the
/// additional validation.
///
/// @returns Size, in bytes, of system memory required for an IShader object with the specified properties. A
/// return value of 0 indicates the createInfo was invalid.
virtual size_t GetShaderSize(
const ShaderCreateInfo& createInfo,
Result* pResult) const = 0;

/// Creates an @ref IShader object with the requested properties.
///
/// @param [in] createInfo AMD IL code of the shader to create.
/// @param [in] pPlacementAddr Pointer to the location where PAL should construct this object. There must be as
/// much size available here as reported by calling GetShaderSize() with the same
/// createInfo param.
/// @param [out] ppShader Constructed shader object. When successful, the returned address will be the same
/// as specified in pPlacementAddr.
///
/// @returns Success if the shader was successfully created. Otherwise, one of the following errors may be
/// returned:
/// + ErrorInvalidPointer if pPlacementAddr, ppShader, or the code pointer is null.
/// + ErrorInvalidValue if the specified code size is 0.
/// + ErrorUnsupportedShaderIlVersion if the shader IL version is not supported.
/// + ErrorBadShaderCode if an unknown shader type or inconsistent shader code is detected.
/// + ErrorThreadGroupTooBig if the number of threads per group in a CS exceeds the limit reported in
/// DeviceProperties.
/// + ErrorInvalidFlags if allowReZ is set for a non pixel shader.
virtual Result CreateShader(
const ShaderCreateInfo& createInfo,
void* pPlacementAddr,
IShader** ppShader) const = 0;

/// Determines the amount of system memory required for a shader cache object. An allocation of this amount of memory
/// must be provided in the pPlacementAddr parameter of CreateShaderCache().
///
/// @returns Size, in bytes, of system memory required for an IShaderCache object.
virtual size_t GetShaderCacheSize() const = 0;

/// Creates an @ref IShaderCache object with the requested properties.
///
/// @param [in] createInfo Create info of the shader cache.
/// @param [in] pPlacementAddr Pointer to the location where PAL should construct this object. There must be as
/// much size available here as reported by calling GetShaderCacheSize().
/// @param [out] ppShaderCache Constructed shader cache object. When successful, the returned address will be the same
/// as specified in pPlacementAddr.
///
/// @returns Success if the shader cache was successfully created. Otherwise, one of the following errors may be
/// returned:
/// + ErrorOutOfMemory if system memory allocation fails for the shader cache storage.
virtual Result CreateShaderCache(
const ShaderCacheCreateInfo& createInfo,
void* pPlacementAddr,
IShaderCache** ppShaderCache) const = 0;

/// Determines the amount of system memory required for a compute pipeline object. An allocation of this amount of
/// memory must be provided in the pPlacementAddr parameter of CreateComputePipeline().
///
Expand Down Expand Up @@ -3683,46 +3621,6 @@ class IDevice
void* pPlacementAddr,
IPipeline** ppPipeline) = 0;

/// Determines the amount of system memory required for a pipeline object when loaded from serialized data. An
/// allocation of this amount of memory must be provided in the pPlacementAddr parameter of LoadPipeline().
///
/// @param [in] pData Serialized pipeline data created with a previous call to IPipeline::Store().
/// @param [in] dataSize Size of the serialized pipeline data in bytes.
/// @param [out] pResult The validation result if pResult is non-null. This argument can be null to avoid the
/// additional validation.
///
/// @returns Size, in bytes, of system memory required for an IPipeline object opened from the specified data.
virtual size_t GetLoadedPipelineSize(
const void* pData,
size_t dataSize,
Result* pResult) const = 0;

/// Creates a (compute or graphics) @ref IPipeline object by opening serialized data from a previous call to
/// IPipeline::Store().
///
/// @param [in] pData Serialized pipeline data created with a previous call to IPipeline::Store().
/// @param [in] dataSize Size of the serialized pipeline data in bytes.
/// @param [in] pPlacementAddr Pointer to the location where PAL should construct this object. There must be as
/// much size available here as reported by calling GetLoadedPipelineSize() with the
/// same createInfo param.
/// @param [out] ppPipeline Constructed pipeline object. When successful, the returned address will be the same
/// as specified in pPlacementAddr.
///
/// @returns Success if the pipeline was successfully created. Otherwise, one of the following errors may be
/// returned:
/// + ErrorInvalidPointer if pData, pPlacementAddr, or ppPipeline is null.
/// + ErrorInvalidMemorySize if dataSize does not match the expected pipeline data size.
/// + ErrorIncompatibleDevice if the device is incompatible with the device the serialized data was
/// created on.
/// + ErrorIncompatibleLibrary if the PAL version is incompatible with the one used to serialize the
/// pipeline.
/// + ErrorBadPipelineData if the serialized data is otherwise invalid or corrupt.
virtual Result LoadPipeline(
const void* pData,
size_t dataSize,
void* pPlacementAddr,
IPipeline** ppPipeline) = 0;

/// Determines the amount of system memory required for a MSAA state object. An allocation of this amount of memory
/// must be provided in the pPlacementAddr parameter of CreateMsaaState().
///
Expand Down Expand Up @@ -4473,6 +4371,7 @@ class IDevice
/// @returns True if hardware accelerated stereo rendering can be enabled, False otherwise.
virtual bool DetermineHwStereoRenderingSupported(
const GraphicPipelineViewInstancingInfo& viewInstancingInfo) const = 0;

/// Returns the value of the associated arbitrary client data pointer.
/// Can be used to associate arbitrary data with a particular PAL object.
///
Expand Down
37 changes: 27 additions & 10 deletions inc/core/palLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
/// compatible, it is not assumed that the client will initialize all input structs to 0.
///
/// @ingroup LibInit
#define PAL_INTERFACE_MAJOR_VERSION 373
#define PAL_INTERFACE_MAJOR_VERSION 377

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

/// Minimum major interface version. This is the minimum interface version PAL supports in order to support backward
/// compatibility. When it is equal to PAL_INTERFACE_MAJOR_VERSION, only the latest interface version is supported.
Expand Down Expand Up @@ -147,15 +147,18 @@ struct NullGpuInfo
/// Specifies properties for @ref IPlatform creation. Input structure to Pal::CreatePlatform().
struct PlatformCreateInfo
{
const Util::AllocCallbacks* pAllocCb; ///< Optional client-provided callbacks. If non-null, PAL will call the
const Util::AllocCallbacks* pAllocCb; ///< Optional client-provided callbacks. If non-null, PAL will call the
/// specified callbacks to allocate and free all internal system
/// memory. If null, PAL will manage memory on its own through the C
/// runtime library.
#if PAL_CLIENT_INTERFACE_MAJOR_VERSION >= 368
Util::LogCallbackFunc pfnLogCb; ///< Optional client-provided callback. If non-null, Pal will call the
#if PAL_CLIENT_INTERFACE_MAJOR_VERSION >= 377
const Util::LogCallbackInfo* pLogInfo; ///< Optional client-provided callback info. If non-null, Pal will
/// call the callback to pass debug prints to the client.
#elif PAL_CLIENT_INTERFACE_MAJOR_VERSION >= 368
Util::LogCallbackFunc pfnLogCb; ///< Optional client-provided callback. If non-null, Pal will call the
/// specified callback to pass debug prints to the client.
#endif
const char* pSettingsPath; ///< A null-terminated string describing the path to where settings are
const char* pSettingsPath; ///< A null-terminated string describing the path to where settings are
/// located on the system. For example, on Windows, this will refer to
/// which UMD subkey to look in under a device's key. For Linux, this
/// is the path to the settings file.
Expand Down Expand Up @@ -187,13 +190,13 @@ struct PlatformCreateInfo
uint32 u32All; ///< Flags packed as 32-bit uint.
} flags; ///< Platform-wide creation flags.

NullGpuId nullGpuId; ///< ID for the null device. Ignored unless the above
NullGpuId nullGpuId; ///< ID for the null device. Ignored unless the above
/// flags.createNullDevice bit is set.
uint16 apiMajorVer; ///< Major API version number to be used by RGP. Should be
uint16 apiMajorVer; ///< Major API version number to be used by RGP. Should be
/// set by client based on their contract with RGP.
uint16 apiMinorVer; ///< Minor API version number to be used by RGP. Should be
uint16 apiMinorVer; ///< Minor API version number to be used by RGP. Should be
/// set by client based on their contract with RGP.
gpusize maxSvmSize; /// Maximum amount of virtual address space that will be
gpusize maxSvmSize; /// Maximum amount of virtual address space that will be
/// reserved for SVM
};

Expand Down Expand Up @@ -344,6 +347,20 @@ Result PAL_STDCALL EnumerateNullDevices(
*
* include $(ICD_DEPTH)/make/icdrules
*
* ### Internal Pipeline Compiler Component
*
* PAL is delivered alongside a module which can compile pipeline binaries in ELF format. This module, named SCPC, is
* based on the AMD proprietary shader compiler (SC). The following build options in PAL are used to control how SCPC
* is included in the PAL build.
*
* __PAL_BUILD_SCPC__: Defaults to 1. Controls whether or not the SCPC component is built as part of the PAL
* build. Clients should only change this to zero if they are using something besides SCPC for compiling their
* pipeline binaries.
*
* __PAL_ENABLE_INTERNAL_SCPC__: Defaults to 1. Controls whether or not a PAL IDevice object will manage an
* internal instance of an SCPC ICompiler object for compiling pipelines. If this is 1, then @ref PAL_BUILD_SCPC
* is overridden to be 1 as well.
*
* ### External Shader Compiler
* PAL must be linked with an SC library built by the client. The client must specify the location of the SC interface
* header files with this build parameter:
Expand Down
Loading

0 comments on commit 91e30f1

Please sign in to comment.