Skip to content

Commit efbae91

Browse files
committed
Remove duplicated GCN (Capeverde) entry in device list
1 parent 4a1cd89 commit efbae91

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

renderdoc/driver/ihv/amd/amd_isa.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,16 @@ static bool IsSupported(GraphicsAPI api)
144144

145145
void GetTargets(GraphicsAPI api, std::vector<std::string> &targets)
146146
{
147-
targets.reserve(ARRAY_COUNT(asicInfo) + 1);
147+
targets.reserve(asicCount + 1);
148148

149149
if(IsSupported(api))
150150
{
151151
// OpenGL doesn't support AMDIL
152152
if(api != GraphicsAPI::OpenGL)
153153
targets.push_back("AMDIL");
154154

155-
for(const asic &a : asicInfo)
156-
targets.push_back(a.name);
155+
for(int i = 0; i < asicCount; i++)
156+
targets.push_back(asicInfo[i].name);
157157
}
158158
else
159159
{
@@ -179,8 +179,9 @@ std::string Disassemble(const SPVModule *spv, const std::string &entry, const st
179179

180180
bool found = false;
181181

182-
for(const asic &a : asicInfo)
182+
for(int i = 0; i < asicCount; i++)
183183
{
184+
const asic &a = asicInfo[i];
184185
if(target == a.name)
185186
{
186187
cmdLine += " -gfxip ";
@@ -357,8 +358,9 @@ std::string Disassemble(ShaderStage stage, const std::vector<std::string> &glsl,
357358
}
358359

359360
bool found = false;
360-
for(const asic &a : asicInfo)
361+
for(int i = 0; i < asicCount; i++)
361362
{
363+
const asic &a = asicInfo[i];
362364
if(target == a.name)
363365
{
364366
cmdLine += StringFormat::Fmt("%d;%d;", a.chipFamily, a.chipRevision);

renderdoc/driver/ihv/amd/amd_isa_devices.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
******************************************************************************/
2424

2525
#include "amd_isa_devices.h"
26+
#include "common/common.h"
2627
#include "official/RGA/Common/asic_reg/devices.h"
2728

28-
GCNISA::asic GCNISA::asicInfo[22] = {
29+
const GCNISA::asic GCNISA::asicInfo[] = {
2930
// Southern Islands
3031
{"GCN (Tahiti)", "6", FAMILY_SI, SI_TAHITI_P_B1},
3132
{"GCN (Pitcairn)", "6", FAMILY_SI, SI_PITCAIRN_PM_A1},
3233
{"GCN (Capeverde)", "6", FAMILY_SI, SI_CAPEVERDE_M_A1},
33-
{"GCN (Capeverde)", "6", FAMILY_SI, SI_CAPEVERDE_M_A1},
3434
{"GCN (Oland)", "6", FAMILY_SI, SI_OLAND_M_A0},
3535
{"GCN (Hainan)", "6", FAMILY_SI, SI_HAINAN_V_A0},
3636
// Sea Islands
@@ -52,4 +52,6 @@ GCNISA::asic GCNISA::asicInfo[22] = {
5252
{"GCN (Baffin)", "8", FAMILY_VI, VI_BAFFIN_M_A0},
5353
{"GCN (gfx804)", "8", FAMILY_VI, VI_LEXA_V_A0},
5454
// GDT_HW_GENERATION_GFX9 goes here, when it's supported by amdspv.
55-
};
55+
};
56+
57+
RDCCOMPILE_ASSERT(ARRAY_COUNT(GCNISA::asicInfo) == GCNISA::asicCount, "Mismatched array count");

renderdoc/driver/ihv/amd/amd_isa_devices.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ struct asic
3434
int chipRevision;
3535
};
3636

37-
extern asic asicInfo[22];
37+
const int asicCount = 21;
38+
extern const asic asicInfo[];
3839

3940
}; // namespace GCNISA

renderdoc/driver/ihv/amd/amd_isa_win32.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ std::string GCNISA::Disassemble(const DXBC::DXBCFile *dxbc, const std::string &t
9191
in.numCompileOptions = 0;
9292
in.pCompileOptions = opts;
9393

94-
for(const asic &a : asicInfo)
94+
for(int i = 0; i < asicCount; i++)
9595
{
96+
const asic &a = asicInfo[i];
9697
if(target == a.name)
9798
{
9899
in.chipFamily = a.chipFamily;

0 commit comments

Comments
 (0)