From 52aafd6331a3b8efb29529c63146f01aee263497 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 28 Aug 2018 15:45:08 +0100 Subject: [PATCH] Update to RGA 2.0.1 backend, support gfx900/gfx902 * This requires an updated set of plugins for the RGA binary files. --- renderdoc/driver/ihv/amd/amd_isa.cpp | 9 +++- renderdoc/driver/ihv/amd/amd_isa_devices.cpp | 53 ++++++++++++-------- renderdoc/driver/ihv/amd/amd_isa_devices.h | 3 +- 3 files changed, 40 insertions(+), 25 deletions(-) diff --git a/renderdoc/driver/ihv/amd/amd_isa.cpp b/renderdoc/driver/ihv/amd/amd_isa.cpp index fd3bb43ed..bfbecd757 100644 --- a/renderdoc/driver/ihv/amd/amd_isa.cpp +++ b/renderdoc/driver/ihv/amd/amd_isa.cpp @@ -114,8 +114,13 @@ void GetTargets(GraphicsAPI api, std::vector &targets) if(api != GraphicsAPI::OpenGL) targets.push_back("AMDIL"); + int apiBitmask = 1 << (int)api; + for(int i = 0; i < asicCount; i++) - targets.push_back(asicInfo[i].name); + { + if(asicInfo[i].apiBitmask & apiBitmask) + targets.push_back(asicInfo[i].name); + } } else { @@ -137,7 +142,7 @@ std::string DisassembleSPIRV(ShaderStage stage, const bytebuf &shaderBytes, cons ; https://github.com/baldurk/renderdoc/wiki/GCN-ISA)"; } - std::string cmdLine = "-set spirvDasmLegacyFormat=1 -Dall -l"; + std::string cmdLine = "-Dall -l"; bool found = false; diff --git a/renderdoc/driver/ihv/amd/amd_isa_devices.cpp b/renderdoc/driver/ihv/amd/amd_isa_devices.cpp index 93542c8d4..98f627acb 100644 --- a/renderdoc/driver/ihv/amd/amd_isa_devices.cpp +++ b/renderdoc/driver/ihv/amd/amd_isa_devices.cpp @@ -26,32 +26,41 @@ #include "common/common.h" #include "official/RGA/Common/asic_reg/devices.h" +static constexpr int allAPIs = (1 << (int)GraphicsAPI::D3D11) | (1 << (int)GraphicsAPI::D3D12) | + (1 << (int)GraphicsAPI::Vulkan) | (1 << (int)GraphicsAPI::OpenGL); + +// gfx900 isn't currently supported on GL +static constexpr int notOpenGL = (1 << (int)GraphicsAPI::D3D11) | (1 << (int)GraphicsAPI::D3D12) | + (1 << (int)GraphicsAPI::Vulkan); + const GCNISA::asic GCNISA::asicInfo[] = { // Southern Islands - {"GCN (Tahiti)", "6", FAMILY_SI, SI_TAHITI_P_B1}, - {"GCN (Pitcairn)", "6", FAMILY_SI, SI_PITCAIRN_PM_A1}, - {"GCN (Capeverde)", "6", FAMILY_SI, SI_CAPEVERDE_M_A1}, - {"GCN (Oland)", "6", FAMILY_SI, SI_OLAND_M_A0}, - {"GCN (Hainan)", "6", FAMILY_SI, SI_HAINAN_V_A0}, + {"GCN (Tahiti)", "6", FAMILY_SI, SI_TAHITI_P_B1, allAPIs}, + {"GCN (Pitcairn)", "6", FAMILY_SI, SI_PITCAIRN_PM_A1, allAPIs}, + {"GCN (Capeverde)", "6", FAMILY_SI, SI_CAPEVERDE_M_A1, allAPIs}, + {"GCN (Oland)", "6", FAMILY_SI, SI_OLAND_M_A0, allAPIs}, + {"GCN (Hainan)", "6", FAMILY_SI, SI_HAINAN_V_A0, allAPIs}, // Sea Islands - {"GCN (Bonaire)", "7", FAMILY_CI, CI_BONAIRE_M_A0}, - {"GCN (Hawaii)", "7", FAMILY_CI, CI_HAWAII_P_A0}, - {"GCN (Spectre)", "7", FAMILY_CI, KV_SPECTRE_A0}, - {"GCN (Spooky)", "7", FAMILY_CI, KV_SPOOKY_A0}, - {"GCN (Kalindi)", "7.x", FAMILY_CI, CI_BONAIRE_M_A0}, - {"GCN (Mullins)", "7", FAMILY_CI, CI_BONAIRE_M_A0}, + {"GCN (Bonaire)", "7", FAMILY_CI, CI_BONAIRE_M_A0, allAPIs}, + {"GCN (Hawaii)", "7", FAMILY_CI, CI_HAWAII_P_A0, allAPIs}, + {"GCN (Spectre)", "7", FAMILY_CI, KV_SPECTRE_A0, allAPIs}, + {"GCN (Spooky)", "7", FAMILY_CI, KV_SPOOKY_A0, allAPIs}, + {"GCN (Kalindi)", "7.x", FAMILY_CI, CI_BONAIRE_M_A0, allAPIs}, + {"GCN (Mullins)", "7", FAMILY_CI, CI_BONAIRE_M_A0, allAPIs}, // Volcanic Islands - {"GCN (Iceland)", "8", FAMILY_VI, VI_ICELAND_M_A0}, - {"GCN (Tonga)", "8", FAMILY_VI, VI_TONGA_P_A0}, - {"GCN (Carrizo)", "8", FAMILY_VI, CARRIZO_A0}, - {"GCN (Bristol Ridge)", "8", FAMILY_VI, CARRIZO_A0}, - {"GCN (Carrizo)", "8", FAMILY_VI, CARRIZO_A0}, - {"GCN (Fiji)", "8", FAMILY_VI, VI_FIJI_P_A0}, - {"GCN (Stoney)", "8.1", FAMILY_VI, STONEY_A0}, - {"GCN (Ellesmere)", "8", FAMILY_VI, VI_ELLESMERE_P_A0}, - {"GCN (Baffin)", "8", FAMILY_VI, VI_BAFFIN_M_A0}, - {"GCN (gfx804)", "8", FAMILY_VI, VI_LEXA_V_A0}, - // GDT_HW_GENERATION_GFX9 goes here, when it's supported by amdspv. + {"GCN (Iceland)", "8", FAMILY_VI, VI_ICELAND_M_A0, allAPIs}, + {"GCN (Tonga)", "8", FAMILY_VI, VI_TONGA_P_A0, allAPIs}, + {"GCN (Carrizo)", "8", FAMILY_VI, CARRIZO_A0, allAPIs}, + {"GCN (Bristol Ridge)", "8", FAMILY_VI, CARRIZO_A0, allAPIs}, + {"GCN (Carrizo)", "8", FAMILY_VI, CARRIZO_A0, allAPIs}, + {"GCN (Fiji)", "8", FAMILY_VI, VI_FIJI_P_A0, allAPIs}, + {"GCN (Stoney)", "8.1", FAMILY_VI, STONEY_A0, allAPIs}, + {"GCN (Ellesmere)", "8", FAMILY_VI, VI_ELLESMERE_P_A0, allAPIs}, + {"GCN (Baffin)", "8", FAMILY_VI, VI_BAFFIN_M_A0, allAPIs}, + {"GCN (gfx804)", "8", FAMILY_VI, VI_LEXA_V_A0, allAPIs}, + // Arctic Islands + {"GCN (gfx900)", "900", FAMILY_AI, AI_GD_P0, notOpenGL}, + {"GCN (gfx902)", "902", FAMILY_AI, AI_GD_P0, notOpenGL}, }; RDCCOMPILE_ASSERT(ARRAY_COUNT(GCNISA::asicInfo) == GCNISA::asicCount, "Mismatched array count"); \ No newline at end of file diff --git a/renderdoc/driver/ihv/amd/amd_isa_devices.h b/renderdoc/driver/ihv/amd/amd_isa_devices.h index b278715ae..d3ddc6b80 100644 --- a/renderdoc/driver/ihv/amd/amd_isa_devices.h +++ b/renderdoc/driver/ihv/amd/amd_isa_devices.h @@ -32,9 +32,10 @@ struct asic const char *gfxIpString; int chipFamily; int chipRevision; + int apiBitmask; }; -const int asicCount = 21; +const int asicCount = 23; extern const asic asicInfo[]; }; // namespace GCNISA