diff --git a/rpcs3/Emu/RSX/GL/GLGSRender.cpp b/rpcs3/Emu/RSX/GL/GLGSRender.cpp index fa848b43c9..e9184a0beb 100644 --- a/rpcs3/Emu/RSX/GL/GLGSRender.cpp +++ b/rpcs3/Emu/RSX/GL/GLGSRender.cpp @@ -220,7 +220,7 @@ void GLGSRender::begin() blend_factor(rsx::method_registers.blend_func_sfactor_a()), blend_factor(rsx::method_registers.blend_func_dfactor_a())); - if (m_surface.color_format == rsx::surface_color_format::w16z16y16x16) //TODO: check another color formats + if (rsx::method_registers.surface_color() == rsx::surface_color_format::w16z16y16x16) //TODO: check another color formats { u16 blend_color_r = rsx::method_registers.blend_color_16b_r(); u16 blend_color_g = rsx::method_registers.blend_color_16b_g(); diff --git a/rpcs3/Emu/RSX/GL/GLGSRender.h b/rpcs3/Emu/RSX/GL/GLGSRender.h index 41f9a528ae..0ece01e1c4 100644 --- a/rpcs3/Emu/RSX/GL/GLGSRender.h +++ b/rpcs3/Emu/RSX/GL/GLGSRender.h @@ -20,7 +20,6 @@ private: gl::glsl::program *m_program; - rsx::surface_info m_surface; gl_render_targets m_rtts; gl::gl_texture_cache m_gl_texture_cache; diff --git a/rpcs3/Emu/RSX/GL/gl_render_targets.cpp b/rpcs3/Emu/RSX/GL/gl_render_targets.cpp index d3a145f208..c3c3ee447b 100644 --- a/rpcs3/Emu/RSX/GL/gl_render_targets.cpp +++ b/rpcs3/Emu/RSX/GL/gl_render_targets.cpp @@ -204,7 +204,7 @@ void GLGSRender::read_buffers() if (g_cfg_rsx_read_color_buffers) { - auto color_format = rsx::internals::surface_color_format_to_gl(m_surface.color_format); + auto color_format = rsx::internals::surface_color_format_to_gl(rsx::method_registers.surface_color()); auto read_color_buffers = [&](int index, int count) { @@ -293,16 +293,16 @@ void GLGSRender::read_buffers() //Read failed. Fall back to slow s/w path... - auto depth_format = rsx::internals::surface_depth_format_to_gl(m_surface.depth_format); - int pixel_size = rsx::internals::get_pixel_size(m_surface.depth_format); + auto depth_format = rsx::internals::surface_depth_format_to_gl(rsx::method_registers.surface_depth_fmt()); + int pixel_size = rsx::internals::get_pixel_size(rsx::method_registers.surface_depth_fmt()); gl::buffer pbo_depth; - __glcheck pbo_depth.create(m_surface.width * m_surface.height * pixel_size); + __glcheck pbo_depth.create(rsx::method_registers.surface_clip_width() * rsx::method_registers.surface_clip_height() * pixel_size); __glcheck pbo_depth.map([&](GLubyte* pixels) { u32 depth_address = rsx::get_address(rsx::method_registers.surface_z_offset(), rsx::method_registers.surface_z_dma()); - if (m_surface.depth_format == rsx::surface_depth_format::z16) + if (rsx::method_registers.surface_depth_fmt() == rsx::surface_depth_format::z16) { u16 *dst = (u16*)pixels; const be_t* src = vm::ps3::_ptr(depth_address); @@ -336,7 +336,7 @@ void GLGSRender::write_buffers() if (g_cfg_rsx_write_color_buffers) { - auto color_format = rsx::internals::surface_color_format_to_gl(m_surface.color_format); + auto color_format = rsx::internals::surface_color_format_to_gl(rsx::method_registers.surface_color()); auto write_color_buffers = [&](int index, int count) { @@ -404,11 +404,11 @@ void GLGSRender::write_buffers() if (pitch <= 64) return; - auto depth_format = rsx::internals::surface_depth_format_to_gl(m_surface.depth_format); + auto depth_format = rsx::internals::surface_depth_format_to_gl(rsx::method_registers.surface_depth_fmt()); u32 depth_address = rsx::get_address(rsx::method_registers.surface_z_offset(), rsx::method_registers.surface_z_dma()); u32 range = std::get<1>(m_rtts.m_bound_depth_stencil)->width() * std::get<1>(m_rtts.m_bound_depth_stencil)->height() * 2; - if (m_surface.depth_format != rsx::surface_depth_format::z16) range *= 2; + if (rsx::method_registers.surface_depth_fmt() != rsx::surface_depth_format::z16) range *= 2; m_gl_texture_cache.save_render_target(depth_address, range, (*std::get<1>(m_rtts.m_bound_depth_stencil))); } diff --git a/rpcs3/Emu/RSX/RSXThread.cpp b/rpcs3/Emu/RSX/RSXThread.cpp index 42cefd5dc2..a99075f835 100644 --- a/rpcs3/Emu/RSX/RSXThread.cpp +++ b/rpcs3/Emu/RSX/RSXThread.cpp @@ -327,7 +327,6 @@ namespace rsx void thread::begin() { - draw_inline_vertex_array = false; inline_vertex_array.clear(); } diff --git a/rpcs3/Emu/RSX/RSXThread.h b/rpcs3/Emu/RSX/RSXThread.h index 16890d1e0b..5f17179164 100644 --- a/rpcs3/Emu/RSX/RSXThread.h +++ b/rpcs3/Emu/RSX/RSXThread.h @@ -117,33 +117,6 @@ namespace rsx void read(void *dst, u32 width, u32 height, u32 pitch); }; - struct surface_info - { - u8 log2height; - u8 log2width; - surface_antialiasing antialias; - surface_depth_format depth_format; - surface_color_format color_format; - - u32 width; - u32 height; - u32 format; - - void unpack(u32 surface_format) - { - format = surface_format; - - log2height = surface_format >> 24; - log2width = (surface_format >> 16) & 0xff; - antialias = to_surface_antialiasing((surface_format >> 12) & 0xf); - depth_format = to_surface_depth_format((surface_format >> 5) & 0x7); - color_format = to_surface_color_format(surface_format & 0x1f); - - width = 1 << (u32(log2width) + 1); - height = 1 << (u32(log2width) + 1); - } - }; - struct vertex_array_buffer { rsx::vertex_base_type type; @@ -210,7 +183,6 @@ namespace rsx u32 local_mem_addr, main_mem_addr; bool strict_ordering[0x1000]; - bool draw_inline_vertex_array; std::vector inline_vertex_array; bool m_rtts_dirty; @@ -222,8 +194,6 @@ namespace rsx RSXVertexProgram get_current_vertex_program() const; RSXFragmentProgram get_current_fragment_program() const; public: - u32 draw_array_count; - u32 draw_array_first; double fps_limit = 59.94; public: diff --git a/rpcs3/Emu/RSX/rsx_methods.cpp b/rpcs3/Emu/RSX/rsx_methods.cpp index ed5f449684..ea9f01ff53 100644 --- a/rpcs3/Emu/RSX/rsx_methods.cpp +++ b/rpcs3/Emu/RSX/rsx_methods.cpp @@ -219,7 +219,6 @@ namespace rsx void draw_inline_array(thread* rsx, u32 _reg, u32 arg) { rsx::method_registers.current_draw_clause.command = rsx::draw_command::inlined_array; - rsx->draw_inline_vertex_array = true; rsx->inline_vertex_array.push_back(arg); }