2012-11-15 01:39:56 +02:00
|
|
|
#include "stdafx.h"
|
2015-07-02 13:54:28 +03:00
|
|
|
#include "Utilities/Log.h"
|
2014-09-11 23:18:19 +04:00
|
|
|
#include "Emu/Memory/Memory.h"
|
2015-08-01 19:14:49 +03:00
|
|
|
#include "Emu/SysCalls/Modules/cellVideoOut.h"
|
2015-10-25 18:44:49 +04:00
|
|
|
#include "Emu/state.h"
|
2014-08-23 04:16:54 +04:00
|
|
|
|
2012-11-15 01:39:56 +02:00
|
|
|
#include "GSManager.h"
|
|
|
|
|
#include "Null/NullGSRender.h"
|
|
|
|
|
#include "GL/GLGSRender.h"
|
2015-11-16 18:04:49 +03:00
|
|
|
#ifdef _MSC_VER
|
2015-10-21 10:24:02 +03:00
|
|
|
#include "Emu/RSX/D3D12/D3D12GSRender.h"
|
|
|
|
|
#endif
|
2012-11-15 01:39:56 +02:00
|
|
|
|
2014-08-23 04:16:54 +04:00
|
|
|
void GSInfo::Init()
|
|
|
|
|
{
|
2015-10-27 01:09:31 +04:00
|
|
|
mode.resolutionId = (u8)rpcs3::state.config.rsx.resolution.value();
|
2014-08-23 04:16:54 +04:00
|
|
|
mode.scanMode = CELL_VIDEO_OUT_SCAN_MODE_INTERLACE;
|
|
|
|
|
mode.conversion = CELL_VIDEO_OUT_DISPLAY_CONVERSION_NONE;
|
2015-10-27 01:09:31 +04:00
|
|
|
mode.aspect = (u8)rpcs3::state.config.rsx.aspect_ratio.value();
|
2014-08-23 04:16:54 +04:00
|
|
|
mode.refreshRates = CELL_VIDEO_OUT_REFRESH_RATE_50HZ;
|
|
|
|
|
mode.format = CELL_VIDEO_OUT_BUFFER_COLOR_FORMAT_X8R8G8B8;
|
|
|
|
|
mode.pitch = 4;
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-26 17:18:59 +03:00
|
|
|
GSManager::GSManager() : m_render(nullptr)
|
2012-11-15 01:39:56 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GSManager::Init()
|
|
|
|
|
{
|
|
|
|
|
if(m_render) return;
|
2013-06-30 11:46:29 +03:00
|
|
|
|
|
|
|
|
m_info.Init();
|
|
|
|
|
|
2015-10-25 18:44:49 +04:00
|
|
|
switch (rpcs3::state.config.rsx.renderer.value())
|
2015-10-21 10:24:02 +03:00
|
|
|
{
|
|
|
|
|
default:
|
2015-10-25 18:44:49 +04:00
|
|
|
case rsx_renderer_type::Null : m_render = new NullGSRender(); break;
|
|
|
|
|
case rsx_renderer_type::OpenGL: m_render = new GLGSRender(); break;
|
2015-11-16 18:04:49 +03:00
|
|
|
#ifdef _MSC_VER
|
2015-10-25 18:44:49 +04:00
|
|
|
case rsx_renderer_type::DX12: m_render = new D3D12GSRender(); break;
|
2015-10-21 10:24:02 +03:00
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-15 01:39:56 +02:00
|
|
|
//m_render->Init(GetInfo().outresolution.width, GetInfo().outresolution.height);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GSManager::Close()
|
|
|
|
|
{
|
|
|
|
|
if(m_render)
|
|
|
|
|
{
|
2015-10-04 01:45:26 +03:00
|
|
|
m_render->close();
|
2013-11-09 23:29:49 +02:00
|
|
|
delete m_render;
|
2013-06-30 11:46:29 +03:00
|
|
|
m_render = nullptr;
|
2012-11-15 01:39:56 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u8 GSManager::GetState()
|
|
|
|
|
{
|
|
|
|
|
return CELL_VIDEO_OUT_OUTPUT_STATE_ENABLED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u8 GSManager::GetColorSpace()
|
|
|
|
|
{
|
|
|
|
|
return CELL_VIDEO_OUT_COLOR_SPACE_RGB;
|
2014-02-23 17:52:52 +01:00
|
|
|
}
|