diff options
| author | 2018-12-01 23:46:18 -0500 | |
|---|---|---|
| committer | 2018-12-01 23:46:18 -0500 | |
| commit | a6805e58ce4ace50a053b705df39d4eb26a76f84 (patch) | |
| tree | dc4534238ea89732e57121372a41bf6a604a2ad2 | |
| parent | Merge pull request #1823 from bunnei/fix-surface-copy (diff) | |
| parent | gl_rasterizer: Signal UNIMPLEMENTED when rt_separate_frag_data is not zero (diff) | |
| download | yuzu-a6805e58ce4ace50a053b705df39d4eb26a76f84.tar.gz yuzu-a6805e58ce4ace50a053b705df39d4eb26a76f84.tar.xz yuzu-a6805e58ce4ace50a053b705df39d4eb26a76f84.zip | |
Merge pull request #1795 from ReinUsesLisp/vc-cleanup
video_core: Minor style changes
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 15 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 17 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 3 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 2 |
5 files changed, 7 insertions, 32 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index a44bbfae8..70855fcfd 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -88,19 +88,6 @@ RasterizerOpenGL::RasterizerOpenGL(Core::Frontend::EmuWindow& window, ScreenInfo | |||
| 88 | state.texture_units[i].sampler = texture_samplers[i].sampler.handle; | 88 | state.texture_units[i].sampler = texture_samplers[i].sampler.handle; |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | GLint ext_num; | ||
| 92 | glGetIntegerv(GL_NUM_EXTENSIONS, &ext_num); | ||
| 93 | for (GLint i = 0; i < ext_num; i++) { | ||
| 94 | const std::string_view extension{ | ||
| 95 | reinterpret_cast<const char*>(glGetStringi(GL_EXTENSIONS, i))}; | ||
| 96 | |||
| 97 | if (extension == "GL_ARB_direct_state_access") { | ||
| 98 | has_ARB_direct_state_access = true; | ||
| 99 | } else if (extension == "GL_ARB_multi_bind") { | ||
| 100 | has_ARB_multi_bind = true; | ||
| 101 | } | ||
| 102 | } | ||
| 103 | |||
| 104 | OpenGLState::ApplyDefaultState(); | 91 | OpenGLState::ApplyDefaultState(); |
| 105 | 92 | ||
| 106 | // Create render framebuffer | 93 | // Create render framebuffer |
| @@ -443,7 +430,7 @@ void RasterizerOpenGL::ConfigureFramebuffers(OpenGLState& current_state, bool us | |||
| 443 | // TODO(bunnei): Figure out how the below register works. According to envytools, this should be | 430 | // TODO(bunnei): Figure out how the below register works. According to envytools, this should be |
| 444 | // used to enable multiple render targets. However, it is left unset on all games that I have | 431 | // used to enable multiple render targets. However, it is left unset on all games that I have |
| 445 | // tested. | 432 | // tested. |
| 446 | ASSERT_MSG(regs.rt_separate_frag_data == 0, "Unimplemented"); | 433 | UNIMPLEMENTED_IF(regs.rt_separate_frag_data != 0); |
| 447 | 434 | ||
| 448 | // Bind the framebuffer surfaces | 435 | // Bind the framebuffer surfaces |
| 449 | current_state.draw.draw_framebuffer = framebuffer.handle; | 436 | current_state.draw.draw_framebuffer = framebuffer.handle; |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 7ec9746b1..ed70d73ee 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h | |||
| @@ -60,20 +60,6 @@ public: | |||
| 60 | bool AccelerateDrawBatch(bool is_indexed) override; | 60 | bool AccelerateDrawBatch(bool is_indexed) override; |
| 61 | void UpdatePagesCachedCount(Tegra::GPUVAddr addr, u64 size, int delta) override; | 61 | void UpdatePagesCachedCount(Tegra::GPUVAddr addr, u64 size, int delta) override; |
| 62 | 62 | ||
| 63 | /// OpenGL shader generated for a given Maxwell register state | ||
| 64 | struct MaxwellShader { | ||
| 65 | /// OpenGL shader resource | ||
| 66 | OGLProgram shader; | ||
| 67 | }; | ||
| 68 | |||
| 69 | struct VertexShader { | ||
| 70 | OGLShader shader; | ||
| 71 | }; | ||
| 72 | |||
| 73 | struct FragmentShader { | ||
| 74 | OGLShader shader; | ||
| 75 | }; | ||
| 76 | |||
| 77 | /// Maximum supported size that a constbuffer can have in bytes. | 63 | /// Maximum supported size that a constbuffer can have in bytes. |
| 78 | static constexpr std::size_t MaxConstbufferSize = 0x10000; | 64 | static constexpr std::size_t MaxConstbufferSize = 0x10000; |
| 79 | static_assert(MaxConstbufferSize % sizeof(GLvec4) == 0, | 65 | static_assert(MaxConstbufferSize % sizeof(GLvec4) == 0, |
| @@ -193,9 +179,6 @@ private: | |||
| 193 | /// but are needed for correct emulation | 179 | /// but are needed for correct emulation |
| 194 | void CheckExtensions(); | 180 | void CheckExtensions(); |
| 195 | 181 | ||
| 196 | bool has_ARB_direct_state_access = false; | ||
| 197 | bool has_ARB_multi_bind = false; | ||
| 198 | |||
| 199 | OpenGLState state; | 182 | OpenGLState state; |
| 200 | 183 | ||
| 201 | RasterizerCacheOpenGL res_cache; | 184 | RasterizerCacheOpenGL res_cache; |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 2fbc753af..5f4cdd119 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -709,9 +709,10 @@ void CachedSurface::LoadGLBuffer() { | |||
| 709 | const auto texture_src_data_end{texture_src_data + params.size_in_bytes_gl}; | 709 | const auto texture_src_data_end{texture_src_data + params.size_in_bytes_gl}; |
| 710 | gl_buffer[0].assign(texture_src_data, texture_src_data_end); | 710 | gl_buffer[0].assign(texture_src_data, texture_src_data_end); |
| 711 | } | 711 | } |
| 712 | for (u32 i = 0; i < params.max_mip_level; i++) | 712 | for (u32 i = 0; i < params.max_mip_level; i++) { |
| 713 | ConvertFormatAsNeeded_LoadGLBuffer(gl_buffer[i], params.pixel_format, params.MipWidth(i), | 713 | ConvertFormatAsNeeded_LoadGLBuffer(gl_buffer[i], params.pixel_format, params.MipWidth(i), |
| 714 | params.MipHeight(i), params.MipDepth(i)); | 714 | params.MipHeight(i), params.MipDepth(i)); |
| 715 | } | ||
| 715 | } | 716 | } |
| 716 | 717 | ||
| 717 | MICROPROFILE_DEFINE(OpenGL_SurfaceFlush, "OpenGL", "Surface Flush", MP_RGB(128, 192, 64)); | 718 | MICROPROFILE_DEFINE(OpenGL_SurfaceFlush, "OpenGL", "Surface Flush", MP_RGB(128, 192, 64)); |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 93bf117c8..d4010001d 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -518,6 +518,8 @@ void GMainWindow::OnDisplayTitleBars(bool show) { | |||
| 518 | QStringList GMainWindow::GetUnsupportedGLExtensions() { | 518 | QStringList GMainWindow::GetUnsupportedGLExtensions() { |
| 519 | QStringList unsupported_ext; | 519 | QStringList unsupported_ext; |
| 520 | 520 | ||
| 521 | if (!GLAD_GL_ARB_direct_state_access) | ||
| 522 | unsupported_ext.append("ARB_direct_state_access"); | ||
| 521 | if (!GLAD_GL_ARB_vertex_type_10f_11f_11f_rev) | 523 | if (!GLAD_GL_ARB_vertex_type_10f_11f_11f_rev) |
| 522 | unsupported_ext.append("ARB_vertex_type_10f_11f_11f_rev"); | 524 | unsupported_ext.append("ARB_vertex_type_10f_11f_11f_rev"); |
| 523 | if (!GLAD_GL_ARB_texture_mirror_clamp_to_edge) | 525 | if (!GLAD_GL_ARB_texture_mirror_clamp_to_edge) |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index 2d6f8cced..a557f2884 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | |||
| @@ -111,6 +111,8 @@ void EmuWindow_SDL2::Fullscreen() { | |||
| 111 | bool EmuWindow_SDL2::SupportsRequiredGLExtensions() { | 111 | bool EmuWindow_SDL2::SupportsRequiredGLExtensions() { |
| 112 | std::vector<std::string> unsupported_ext; | 112 | std::vector<std::string> unsupported_ext; |
| 113 | 113 | ||
| 114 | if (!GLAD_GL_ARB_direct_state_access) | ||
| 115 | unsupported_ext.push_back("ARB_direct_state_access"); | ||
| 114 | if (!GLAD_GL_ARB_vertex_type_10f_11f_11f_rev) | 116 | if (!GLAD_GL_ARB_vertex_type_10f_11f_11f_rev) |
| 115 | unsupported_ext.push_back("ARB_vertex_type_10f_11f_11f_rev"); | 117 | unsupported_ext.push_back("ARB_vertex_type_10f_11f_11f_rev"); |
| 116 | if (!GLAD_GL_ARB_texture_mirror_clamp_to_edge) | 118 | if (!GLAD_GL_ARB_texture_mirror_clamp_to_edge) |