VERY experimental Nintendo Switch 2 emulator
C++
Merge pull request #2704 from FernandoS27/conditional
bunnei8ae3b5f4deb7
diff --cc src/video_core/engines/maxwell_3d.hindex ac300bf769,1e3e72bfd1..1ee982b76f--- a/src/video_core/engines/maxwell_3d.h+++ b/src/video_core/engines/maxwell_3d.h@@@ -1246,17 -1229,10 +1283,19 @@@ private/// Interpreter for the macro codes uploaded to the GPU.MacroInterpreter macro_interpreter;+ static constexpr u32 null_cb_data = 0xFFFFFFFF;+ struct {+ std::array<std::array<u32, 0x4000>, 16> buffer;+ u32 current{null_cb_data};+ u32 id{null_cb_data};+ u32 start_pos{};+ u32 counter{};+ } cb_data_state;+Upload::State upload_state;+ bool execute_on{true};+/// Retrieves information about a specific TIC entry from the TIC buffer.Texture::TICEntry GetTICEntry(u32 tic_index) const;diff --cc src/video_core/renderer_opengl/gl_rasterizer.cppindex c59e687b6e,6851a64fa8..c28ae795c1--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp@@@ -549,53 -519,14 +549,59 @@@ std::pair<bool, bool> RasterizerOpenGL:return current_depth_stencil_usage = {static_cast<bool>(depth_surface), fbkey.stencil_enable};}+void RasterizerOpenGL::ConfigureClearFramebuffer(OpenGLState& current_state, bool using_color_fb,+ bool using_depth_fb, bool using_stencil_fb) {+ auto& gpu = system.GPU().Maxwell3D();+ const auto& regs = gpu.regs;++ texture_cache.GuardRenderTargets(true);+ View color_surface{};+ if (using_color_fb) {+ color_surface = texture_cache.GetColorBufferSurface(regs.clear_buffers.RT, false);+ }+ View depth_surface{};+ if (using_depth_fb || using_stencil_fb) {+ depth_surface = texture_cache.GetDepthBufferSurface(false);+ }+ texture_cache.GuardRenderTargets(false);++ current_state.draw.draw_framebuffer = clear_framebuffer.handle;+ current_state.ApplyFramebufferState();++ if (color_surface) {+ color_surface->Attach(GL_COLOR_ATTACHMENT0, GL_DRAW_FRAMEBUFFER);+ } else {+ glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);+ }++ if (depth_surface) {+ const auto& params = depth_surface->GetSurfaceParams();+ switch (params.type) {+ case VideoCore::Surface::SurfaceType::Depth: {+ depth_surface->Attach(GL_DEPTH_ATTACHMENT, GL_DRAW_FRAMEBUFFER);+ glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0);+ break;+ }+ case VideoCore::Surface::SurfaceType::DepthStencil: {+ depth_surface->Attach(GL_DEPTH_ATTACHMENT, GL_DRAW_FRAMEBUFFER);+ break;+ }+ default: { UNIMPLEMENTED(); }+ }+ } else {+ glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0,+ 0);+ }+}+void RasterizerOpenGL::Clear() {- const auto& regs = system.GPU().Maxwell3D().regs;+ const auto& maxwell3d = system.GPU().Maxwell3D();++ if (!maxwell3d.ShouldExecute()) {+ return;+ }++ const auto& regs = maxwell3d.regs;bool use_color{};bool use_depth{};bool use_stencil{};