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"
|
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-05-10 01:05:00 +02:00
|
|
|
#ifdef WIN32
|
|
|
|
|
#include "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();
|
|
|
|
|
|
2012-11-15 00:39:56 +01:00
|
|
|
switch(Ini.GSRenderMode.GetValue())
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
case 0: m_render = new NullGSRender(); break;
|
|
|
|
|
case 1: m_render = new GLGSRender(); break;
|
2015-05-10 19:41:08 +02:00
|
|
|
#if defined(DX12_SUPPORT)
|
2015-05-10 01:05:00 +02:00
|
|
|
case 2: m_render = new D3D12GSRender(); break;
|
|
|
|
|
#endif
|
2012-11-15 00:39:56 +01:00
|
|
|
}
|
|
|
|
|
//m_render->Init(GetInfo().outresolution.width, GetInfo().outresolution.height);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GSManager::Close()
|
|
|
|
|
{
|
|
|
|
|
if(m_render)
|
|
|
|
|
{
|
|
|
|
|
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
|
|
|
}
|