mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-25 15:15:40 +00:00
GPU: Add some missing state reset
This commit is contained in:
parent
4422fb0545
commit
4d22bec8fd
|
@ -33,10 +33,14 @@ void GPU::Reset()
|
|||
void GPU::SoftReset()
|
||||
{
|
||||
m_GPUSTAT.bits = 0x14802000;
|
||||
m_drawing_area = {};
|
||||
m_drawing_offset = {};
|
||||
m_crtc_state = {};
|
||||
m_crtc_state.regs.display_address_start = 0;
|
||||
m_crtc_state.regs.horizontal_display_range = 0xC60260;
|
||||
m_crtc_state.regs.vertical_display_range = 0x3FC10;
|
||||
m_GP0_command.clear();
|
||||
m_GPUREAD_buffer.clear();
|
||||
m_render_state = {};
|
||||
m_render_state.texture_page_changed = true;
|
||||
m_render_state.texture_color_mode_changed = true;
|
||||
|
@ -48,7 +52,10 @@ void GPU::SoftReset()
|
|||
bool GPU::DoState(StateWrapper& sw)
|
||||
{
|
||||
if (sw.IsReading())
|
||||
FlushRender();
|
||||
{
|
||||
// perform a reset to discard all pending draws/fb state
|
||||
Reset();
|
||||
}
|
||||
|
||||
sw.Do(&m_GPUSTAT.bits);
|
||||
|
||||
|
|
|
@ -8,6 +8,13 @@ GPU_HW::GPU_HW() = default;
|
|||
|
||||
GPU_HW::~GPU_HW() = default;
|
||||
|
||||
void GPU_HW::Reset()
|
||||
{
|
||||
GPU::Reset();
|
||||
|
||||
m_batch = {};
|
||||
}
|
||||
|
||||
void GPU_HW::LoadVertices(RenderCommand rc, u32 num_vertices)
|
||||
{
|
||||
const u32 texpage =
|
||||
|
|
|
@ -11,6 +11,8 @@ public:
|
|||
GPU_HW();
|
||||
virtual ~GPU_HW();
|
||||
|
||||
virtual void Reset() override;
|
||||
|
||||
protected:
|
||||
struct HWVertex
|
||||
{
|
||||
|
|
|
@ -177,6 +177,7 @@ void GPU_HW_OpenGL::ClearFramebuffer()
|
|||
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
m_vram_read_texture_dirty = true;
|
||||
}
|
||||
|
||||
void GPU_HW_OpenGL::DestroyFramebuffer()
|
||||
|
|
Loading…
Reference in a new issue