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