Skip to content

Commit

Permalink
renderer: add actual GPU name into github issue template
Browse files Browse the repository at this point in the history
IDK why, but github clang-format go crazy on brackets around (version_raw)
  • Loading branch information
bookmist committed Mar 18, 2024
1 parent 1fda880 commit d20d859
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
5 changes: 3 additions & 2 deletions vita3k/gui/src/app_context_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <include/cpu.h>
#include <include/environment.h>
#include <io/state.h>
#include <renderer/state.h>

#include <util/log.h>
#include <util/safe_time.h>
Expand Down Expand Up @@ -413,8 +414,8 @@ void draw_app_context_menu(GuiState &gui, EmuEnvState &emuenv, const std::string

// Test environment summary
const auto test_env_summary = fmt::format(
"%23 Test environment summary%0A- Tested by: {} <!-- Change your username if is needed -->%0A- OS: {}%0A- CPU: {}%0A- GPU: AMD/NVIDIA/Intel?%0A- RAM: {} GB",
user ? user : "?", CppCommon::Environment::OSVersion(), CppCommon::CPU::Architecture(), SDL_GetSystemRAM() / 1000);
"%23 Test environment summary%0A- Tested by: {} <!-- Change your username if is needed -->%0A- OS: {}%0A- CPU: {}%0A- GPU: {}%0A- RAM: {} GB",
user ? user : "?", CppCommon::Environment::OSVersion(), CppCommon::CPU::Architecture(), emuenv.renderer->get_gpu_name(), SDL_GetSystemRAM() / 1000);

const auto rest_of_body = "%23 Issues%0A<!-- Summary of problems -->%0A%0A%23 Screenshots%0A![image](https://?)%0A%0A%23 Log%0A%0A%23 Recommended labels%0A<!-- See https://github.com/Vita3K/compatibility/labels -->%0A- A?%0A- B?%0A- C?";

Expand Down
2 changes: 2 additions & 0 deletions vita3k/renderer/include/renderer/gl/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ struct GLState : public renderer::State {
int get_max_anisotropic_filtering() override;
void set_anisotropic_filtering(int anisotropic_filtering) override;

std::string_view get_gpu_name() override;

void precompile_shader(const ShadersHash &hash) override;
void preclose_action() override;
};
Expand Down
2 changes: 2 additions & 0 deletions vita3k/renderer/include/renderer/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ struct State {
return { "Automatic" };
}

virtual std::string_view get_gpu_name() = 0;

virtual void precompile_shader(const ShadersHash &hash) = 0;
virtual void preclose_action() = 0;

Expand Down
1 change: 1 addition & 0 deletions vita3k/renderer/include/renderer/vulkan/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ struct VKState : public renderer::State {
// return the GPU buffer device address matching this one
uint64_t get_matching_device_address(const Address address);
std::vector<std::string> get_gpu_list() override;
std::string_view get_gpu_name() override;

void precompile_shader(const ShadersHash &hash) override;
void preclose_action() override;
Expand Down
4 changes: 4 additions & 0 deletions vita3k/renderer/src/gl/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,10 @@ void GLState::set_anisotropic_filtering(int anisotropic_filtering) {
texture_cache.anisotropic_filtering = anisotropic_filtering;
}

std::string_view GLState::get_gpu_name() {
return reinterpret_cast<const GLchar *>(glGetString(GL_RENDERER));
}

void GLState::precompile_shader(const ShadersHash &hash) {
pre_compile_program(*this, hash);
}
Expand Down
4 changes: 4 additions & 0 deletions vita3k/renderer/src/vulkan/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,10 @@ std::vector<std::string> VKState::get_gpu_list() {
return gpu_list;
}

std::string_view VKState::get_gpu_name() {
return physical_device_properties.deviceName.data();
}

void VKState::precompile_shader(const ShadersHash &hash) {
Sha256Hash empty_hash{};
if (hash.vert != empty_hash) {
Expand Down

0 comments on commit d20d859

Please sign in to comment.