Skip to content

Commit

Permalink
amd_ags_x64: Recognize version 6.2.0.
Browse files Browse the repository at this point in the history
CW-Bug-Id: #22976
  • Loading branch information
Paul Gofman committed Nov 9, 2023
1 parent 5b05890 commit 4b9b6a4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
14 changes: 8 additions & 6 deletions dlls/amd_ags_x64/amd_ags.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ typedef enum AGSReturnCode
AGS_NO_AMD_DRIVER_INSTALLED, ///< Returned if the AMD GPU driver does not appear to be installed
AGS_EXTENSION_NOT_SUPPORTED, ///< Returned if the driver does not support the requested driver extension
AGS_ADL_FAILURE, ///< Failure in ADL (the AMD Display Library)
AGS_DX_FAILURE ///< Failure from DirectX runtime
AGS_DX_FAILURE, ///< Failure from DirectX runtime
AGS_D3DDEVICE_NOT_CREATED, ///< Failure due to not creating the D3D device successfully via AGS.
} AGSReturnCode;

/// The DirectX11 extension support bits
Expand Down Expand Up @@ -268,7 +269,7 @@ typedef enum AGSDriverExtensionDX12
} AGSDriverExtensionDX12;

/// The space id for DirectX12 intrinsic support
const unsigned int AGS_DX12_SHADER_INSTRINSICS_SPACE_ID = 0x7FFF0ADE; // 2147420894
const unsigned int AGS_DX12_SHADER_INTRINSICS_SPACE_ID = 0x7FFF0ADE; // 2147420894

/// The display flags describing various properties of the display.
typedef enum AGSDisplayFlags
Expand Down Expand Up @@ -942,7 +943,8 @@ typedef struct AGSDX12ReturnedParams
unsigned int floatConversion : 1; ///< Supported in Radeon Software Version 20.5.1 onwards.
unsigned int readLaneAt : 1; ///< Supported in Radeon Software Version 20.11.2 onwards.
unsigned int rayHitToken : 1; ///< Supported in Radeon Software Version 20.11.2 onwards.
unsigned int padding : 20; ///< Reserved
unsigned int shaderClock : 1; ///< Supported in Radeon Software Version 23.1.1 onwards.
unsigned int padding : 19; ///< Reserved
} ExtensionsSupported;
ExtensionsSupported extensionsSupported; ///< List of supported extensions
*/
Expand All @@ -960,16 +962,16 @@ typedef struct AGSDX12ReturnedParams
/// * The intrinsic instructions require a 5.1 shader model.
/// * The Root Signature will need to reserve an extra UAV resource slot. This is not a real resource that requires allocating, it is just used to encode the intrinsic instructions.
///
/// The easiest way to set up the reserved UAV slot is to specify it at u0. The register space id will automatically be assumed to be \ref AGS_DX12_SHADER_INSTRINSICS_SPACE_ID.
/// The easiest way to set up the reserved UAV slot is to specify it at u0. The register space id will automatically be assumed to be \ref AGS_DX12_SHADER_INTRINSICS_SPACE_ID.
/// The HLSL expects this as default and the set up code would look similar to this:
/// \code{.cpp}
/// CD3DX12_DESCRIPTOR_RANGE range[];
/// ...
/// range[ 0 ].Init( D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 1, 0, AGS_DX12_SHADER_INSTRINSICS_SPACE_ID ); // u0 at driver-reserved space id
/// range[ 0 ].Init( D3D12_DESCRIPTOR_RANGE_TYPE_UAV, 1, 0, AGS_DX12_SHADER_INTRINSICS_SPACE_ID ); // u0 at driver-reserved space id
/// \endcode
///
/// Newer drivers also support a user-specified slot in which case the register space id is assumed to be 0. It is important that the \ref AGSDX12ReturnedParams::ExtensionsSupported::UAVBindSlot bit is set.
/// to ensure the driver can support this. If not, then u0 and \ref AGS_DX12_SHADER_INSTRINSICS_SPACE_ID must be used.
/// to ensure the driver can support this. If not, then u0 and \ref AGS_DX12_SHADER_INTRINSICS_SPACE_ID must be used.
/// If the driver does support this feature and a non zero slot is required, then the HLSL must also define AMD_EXT_SHADER_INTRINSIC_UAV_OVERRIDE as the matching slot value.
///
/// \param [in] context Pointer to a context. This is generated by \ref agsInitialize
Expand Down
12 changes: 7 additions & 5 deletions dlls/amd_ags_x64/amd_ags_x64_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ enum amd_ags_version
AMD_AGS_VERSION_6_0_0,
AMD_AGS_VERSION_6_0_1,
AMD_AGS_VERSION_6_1_0,
AMD_AGS_VERSION_6_2_0,

AMD_AGS_VERSION_COUNT
};
Expand All @@ -64,27 +65,28 @@ amd_ags_info[AMD_AGS_VERSION_COUNT] =
{6, 0, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)},
{6, 0, 1, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)},
{6, 1, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)},
{6, 2, 0, sizeof(AGSDeviceInfo_600), sizeof(AGSDX11ReturnedParams_600)},
};

#define DEF_FIELD(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \
offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \
offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name), \
offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}}
offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}}
#define DEF_FIELD_520_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \
offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), -1, \
-1, -1, -1, -1, -1}}
-1, -1, -1, -1, -1, -1}}
#define DEF_FIELD_540_UP(name) {DEVICE_FIELD_##name, {-1, -1, -1, \
-1, -1, offsetof(AGSDeviceInfo_540, name), \
offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), offsetof(AGSDeviceInfo_600, name), \
offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}}
offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name), offsetof(AGSDeviceInfo_600, name)}}
#define DEF_FIELD_540_600(name) {DEVICE_FIELD_##name, {-1, -1, -1, \
-1, -1, offsetof(AGSDeviceInfo_540, name), \
offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), \
-1, -1, -1}}
-1, -1, -1, -1}}
#define DEF_FIELD_600_BELOW(name) {DEVICE_FIELD_##name, {offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_511, name), offsetof(AGSDeviceInfo_520, name), \
offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_520, name), offsetof(AGSDeviceInfo_540, name), \
offsetof(AGSDeviceInfo_541, name), offsetof(AGSDeviceInfo_542, name), -1, \
-1, -1}}
-1, -1, -1}}

#define DEVICE_FIELD_adapterString 0
#define DEVICE_FIELD_architectureVersion 1
Expand Down

0 comments on commit 4b9b6a4

Please sign in to comment.