summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/common/settings.h6
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp8
-rw-r--r--src/video_core/renderer_vulkan/vk_blit_screen.cpp5
-rw-r--r--src/yuzu/configuration/configure_graphics.cpp18
-rw-r--r--src/yuzu_cmd/default_ini.h2
5 files changed, 20 insertions, 19 deletions
diff --git a/src/common/settings.h b/src/common/settings.h
index 5305f1ed8..898798212 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -333,9 +333,9 @@ struct Values {
333 Setting<bool> use_fast_gpu_time{true, "use_fast_gpu_time"}; 333 Setting<bool> use_fast_gpu_time{true, "use_fast_gpu_time"};
334 Setting<bool> use_caches_gc{false, "use_caches_gc"}; 334 Setting<bool> use_caches_gc{false, "use_caches_gc"};
335 335
336 Setting<float> bg_red{0.0f, "bg_red"}; 336 Setting<u8> bg_red{0, "bg_red"};
337 Setting<float> bg_green{0.0f, "bg_green"}; 337 Setting<u8> bg_green{0, "bg_green"};
338 Setting<float> bg_blue{0.0f, "bg_blue"}; 338 Setting<u8> bg_blue{0, "bg_blue"};
339 339
340 // System 340 // System
341 Setting<std::optional<u32>> rng_seed{std::optional<u32>(), "rng_seed"}; 341 Setting<std::optional<u32>> rng_seed{std::optional<u32>(), "rng_seed"};
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index a718bff7a..c12929de6 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -229,9 +229,6 @@ void RendererOpenGL::LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color
229} 229}
230 230
231void RendererOpenGL::InitOpenGLObjects() { 231void RendererOpenGL::InitOpenGLObjects() {
232 glClearColor(Settings::values.bg_red.GetValue(), Settings::values.bg_green.GetValue(),
233 Settings::values.bg_blue.GetValue(), 0.0f);
234
235 // Create shader programs 232 // Create shader programs
236 OGLShader vertex_shader; 233 OGLShader vertex_shader;
237 vertex_shader.Create(HostShaders::OPENGL_PRESENT_VERT, GL_VERTEX_SHADER); 234 vertex_shader.Create(HostShaders::OPENGL_PRESENT_VERT, GL_VERTEX_SHADER);
@@ -337,8 +334,9 @@ void RendererOpenGL::ConfigureFramebufferTexture(TextureInfo& texture,
337void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) { 334void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) {
338 if (renderer_settings.set_background_color) { 335 if (renderer_settings.set_background_color) {
339 // Update background color before drawing 336 // Update background color before drawing
340 glClearColor(Settings::values.bg_red.GetValue(), Settings::values.bg_green.GetValue(), 337 glClearColor(Settings::values.bg_red.GetValue() / 255.0f,
341 Settings::values.bg_blue.GetValue(), 0.0f); 338 Settings::values.bg_green.GetValue() / 255.0f,
339 Settings::values.bg_blue.GetValue() / 255.0f, 1.0f);
342 } 340 }
343 341
344 // Set projection matrix 342 // Set projection matrix
diff --git a/src/video_core/renderer_vulkan/vk_blit_screen.cpp b/src/video_core/renderer_vulkan/vk_blit_screen.cpp
index a1a32aabe..363134129 100644
--- a/src/video_core/renderer_vulkan/vk_blit_screen.cpp
+++ b/src/video_core/renderer_vulkan/vk_blit_screen.cpp
@@ -225,8 +225,11 @@ VkSemaphore VKBlitScreen::Draw(const Tegra::FramebufferConfig& framebuffer, bool
225 descriptor_set = descriptor_sets[image_index], buffer = *buffer, 225 descriptor_set = descriptor_sets[image_index], buffer = *buffer,
226 size = swapchain.GetSize(), pipeline = *pipeline, 226 size = swapchain.GetSize(), pipeline = *pipeline,
227 layout = *pipeline_layout](vk::CommandBuffer cmdbuf) { 227 layout = *pipeline_layout](vk::CommandBuffer cmdbuf) {
228 const f32 bg_red = Settings::values.bg_red.GetValue() / 255.0f;
229 const f32 bg_green = Settings::values.bg_green.GetValue() / 255.0f;
230 const f32 bg_blue = Settings::values.bg_blue.GetValue() / 255.0f;
228 const VkClearValue clear_color{ 231 const VkClearValue clear_color{
229 .color = {.float32 = {0.0f, 0.0f, 0.0f, 0.0f}}, 232 .color = {.float32 = {bg_red, bg_green, bg_blue, 1.0f}},
230 }; 233 };
231 const VkRenderPassBeginInfo renderpass_bi{ 234 const VkRenderPassBeginInfo renderpass_bi{
232 .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO, 235 .sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO,
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp
index 41a69d9b8..4d5b4c0e6 100644
--- a/src/yuzu/configuration/configure_graphics.cpp
+++ b/src/yuzu/configuration/configure_graphics.cpp
@@ -101,9 +101,9 @@ void ConfigureGraphics::SetConfiguration() {
101 ConfigurationShared::SetHighlight(ui->bg_layout, !Settings::values.bg_red.UsingGlobal()); 101 ConfigurationShared::SetHighlight(ui->bg_layout, !Settings::values.bg_red.UsingGlobal());
102 } 102 }
103 103
104 UpdateBackgroundColorButton(QColor::fromRgbF(Settings::values.bg_red.GetValue(), 104 UpdateBackgroundColorButton(QColor::fromRgb(Settings::values.bg_red.GetValue(),
105 Settings::values.bg_green.GetValue(), 105 Settings::values.bg_green.GetValue(),
106 Settings::values.bg_blue.GetValue())); 106 Settings::values.bg_blue.GetValue()));
107 UpdateDeviceComboBox(); 107 UpdateDeviceComboBox();
108} 108}
109 109
@@ -132,9 +132,9 @@ void ConfigureGraphics::ApplyConfiguration() {
132 Settings::values.vulkan_device.SetValue(vulkan_device); 132 Settings::values.vulkan_device.SetValue(vulkan_device);
133 } 133 }
134 if (Settings::values.bg_red.UsingGlobal()) { 134 if (Settings::values.bg_red.UsingGlobal()) {
135 Settings::values.bg_red.SetValue(static_cast<float>(bg_color.redF())); 135 Settings::values.bg_red.SetValue(static_cast<u8>(bg_color.red()));
136 Settings::values.bg_green.SetValue(static_cast<float>(bg_color.greenF())); 136 Settings::values.bg_green.SetValue(static_cast<u8>(bg_color.green()));
137 Settings::values.bg_blue.SetValue(static_cast<float>(bg_color.blueF())); 137 Settings::values.bg_blue.SetValue(static_cast<u8>(bg_color.blue()));
138 } 138 }
139 } else { 139 } else {
140 if (ui->api->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) { 140 if (ui->api->currentIndex() == ConfigurationShared::USE_GLOBAL_INDEX) {
@@ -159,9 +159,9 @@ void ConfigureGraphics::ApplyConfiguration() {
159 Settings::values.bg_red.SetGlobal(false); 159 Settings::values.bg_red.SetGlobal(false);
160 Settings::values.bg_green.SetGlobal(false); 160 Settings::values.bg_green.SetGlobal(false);
161 Settings::values.bg_blue.SetGlobal(false); 161 Settings::values.bg_blue.SetGlobal(false);
162 Settings::values.bg_red.SetValue(static_cast<float>(bg_color.redF())); 162 Settings::values.bg_red.SetValue(static_cast<u8>(bg_color.red()));
163 Settings::values.bg_green.SetValue(static_cast<float>(bg_color.greenF())); 163 Settings::values.bg_green.SetValue(static_cast<u8>(bg_color.green()));
164 Settings::values.bg_blue.SetValue(static_cast<float>(bg_color.blueF())); 164 Settings::values.bg_blue.SetValue(static_cast<u8>(bg_color.blue()));
165 } 165 }
166 } 166 }
167} 167}
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h
index d2a7cd024..7d6bcccc7 100644
--- a/src/yuzu_cmd/default_ini.h
+++ b/src/yuzu_cmd/default_ini.h
@@ -232,7 +232,7 @@ use_vsync =
232use_caches_gc = 232use_caches_gc =
233 233
234# The clear color for the renderer. What shows up on the sides of the bottom screen. 234# The clear color for the renderer. What shows up on the sides of the bottom screen.
235# Must be in range of 0.0-1.0. Defaults to 1.0 for all. 235# Must be in range of 0-255. Defaults to 0 for all.
236bg_red = 236bg_red =
237bg_blue = 237bg_blue =
238bg_green = 238bg_green =