mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
DevScreens: In shader viewer tabs, show the number of each shader type.
This commit is contained in:
parent
04e313ecba
commit
0f10014219
2 changed files with 7 additions and 4 deletions
|
@ -899,14 +899,17 @@ UI::EventReturn JitCompareScreen::OnCurrentBlock(UI::EventParams &e) {
|
||||||
return UI::EVENT_DONE;
|
return UI::EVENT_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShaderListScreen::ListShaders(DebugShaderType shaderType, UI::LinearLayout *view) {
|
int ShaderListScreen::ListShaders(DebugShaderType shaderType, UI::LinearLayout *view) {
|
||||||
using namespace UI;
|
using namespace UI;
|
||||||
std::vector<std::string> shaderIds_ = gpu->DebugGetShaderIDs(shaderType);
|
std::vector<std::string> shaderIds_ = gpu->DebugGetShaderIDs(shaderType);
|
||||||
|
int count = 0;
|
||||||
for (auto id : shaderIds_) {
|
for (auto id : shaderIds_) {
|
||||||
Choice *choice = view->Add(new Choice(gpu->DebugGetShaderString(id, shaderType, SHADER_STRING_SHORT_DESC)));
|
Choice *choice = view->Add(new Choice(gpu->DebugGetShaderString(id, shaderType, SHADER_STRING_SHORT_DESC)));
|
||||||
choice->SetTag(id);
|
choice->SetTag(id);
|
||||||
choice->OnClick.Handle(this, &ShaderListScreen::OnShaderClick);
|
choice->OnClick.Handle(this, &ShaderListScreen::OnShaderClick);
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct { DebugShaderType type; const char *name; } shaderTypes[] = {
|
struct { DebugShaderType type; const char *name; } shaderTypes[] = {
|
||||||
|
@ -933,9 +936,9 @@ void ShaderListScreen::CreateViews() {
|
||||||
for (size_t i = 0; i < ARRAY_SIZE(shaderTypes); i++) {
|
for (size_t i = 0; i < ARRAY_SIZE(shaderTypes); i++) {
|
||||||
ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(1.0));
|
ScrollView *scroll = new ScrollView(ORIENT_VERTICAL, new LinearLayoutParams(1.0));
|
||||||
LinearLayout *shaderList = new LinearLayout(ORIENT_VERTICAL, new LayoutParams(FILL_PARENT, WRAP_CONTENT));
|
LinearLayout *shaderList = new LinearLayout(ORIENT_VERTICAL, new LayoutParams(FILL_PARENT, WRAP_CONTENT));
|
||||||
ListShaders(shaderTypes[i].type, shaderList);
|
int count = ListShaders(shaderTypes[i].type, shaderList);
|
||||||
scroll->Add(shaderList);
|
scroll->Add(shaderList);
|
||||||
tabs_->AddTab(shaderTypes[i].name, scroll);
|
tabs_->AddTab(StringFromFormat("%s (%d)", shaderTypes[i].name, count), scroll);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ public:
|
||||||
void CreateViews() override;
|
void CreateViews() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ListShaders(DebugShaderType shaderType, UI::LinearLayout *view);
|
int ListShaders(DebugShaderType shaderType, UI::LinearLayout *view);
|
||||||
|
|
||||||
UI::EventReturn OnShaderClick(UI::EventParams &e);
|
UI::EventReturn OnShaderClick(UI::EventParams &e);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue