Merge branch 'master' into primitive_restart

Conflicts:
	Source/Core/VideoCommon/Src/VideoConfig.h
	Source/Plugins/Plugin_VideoDX9/Src/main.cpp
	Source/Plugins/Plugin_VideoOGL/Src/Render.cpp
This commit is contained in:
degasus
2013-04-08 15:57:51 +02:00
334 changed files with 21473 additions and 18765 deletions

View File

@ -57,7 +57,7 @@
#include "ConfigManager.h"
#include "VideoBackend.h"
#include "PerfQueryBase.h"
#include "PerfQuery.h"
namespace DX9
{
@ -95,27 +95,17 @@ std::string VideoBackend::GetDisplayName()
void InitBackendInfo()
{
DX9::D3D::Init();
const int shaderModel = ((DX9::D3D::GetCaps().PixelShaderVersion >> 8) & 0xFF);
D3DCAPS9 device_caps = DX9::D3D::GetCaps();
const int shaderModel = ((device_caps.PixelShaderVersion >> 8) & 0xFF);
const int maxConstants = (shaderModel < 3) ? 32 : ((shaderModel < 4) ? 224 : 65536);
g_Config.backend_info.APIType = shaderModel < 3 ? API_D3D9_SM20 : API_D3D9_SM30;
g_Config.backend_info.bUseRGBATextures = false;
g_Config.backend_info.bUseMinimalMipCount = true;
g_Config.backend_info.bSupports3DVision = true;
g_Config.backend_info.bSupportsPrimitiveRestart = false; // TODO: figure out if it does
OSVERSIONINFO info;
ZeroMemory(&info, sizeof(OSVERSIONINFO));
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (GetVersionEx(&info))
{
// dual source blending is only supported in windows 7 o newer. sorry xp users
// we cannot test for device caps because most drivers just declare the minimun caps
// and don't expose their support for some functionalities
g_Config.backend_info.bSupportsDualSourceBlend = info.dwPlatformId == VER_PLATFORM_WIN32_NT && info.dwMajorVersion > 5;
}
else
{
g_Config.backend_info.bSupportsDualSourceBlend = false;
}
g_Config.backend_info.bSupportsSeparateAlphaFunction = device_caps.PrimitiveMiscCaps & D3DPMISCCAPS_SEPARATEALPHABLEND;
// Dual source blend disabled by default until a proper method to test for support is found
g_Config.backend_info.bSupportsDualSourceBlend = false;
g_Config.backend_info.bSupportsFormatReinterpretation = true;
g_Config.backend_info.bSupportsPixelLighting = C_PLIGHTS + 40 <= maxConstants && C_PMATERIALS + 4 <= maxConstants;
@ -188,9 +178,9 @@ void VideoBackend::Video_Prepare()
// internal interfaces
g_vertex_manager = new VertexManager;
g_perf_query = new PerfQuery;
g_renderer = new Renderer;
g_texture_cache = new TextureCache;
g_perf_query = new PerfQueryBase;
g_texture_cache = new TextureCache;
// VideoCommon
BPInit();
Fifo_Init();
@ -200,8 +190,7 @@ void VideoBackend::Video_Prepare()
PixelShaderManager::Init();
CommandProcessor::Init();
PixelEngine::Init();
DLCache::Init();
DLCache::Init();
// Notify the core that the video backend is ready
Host_Message(WM_USER_CREATE);
}
@ -229,9 +218,9 @@ void VideoBackend::Shutdown()
// internal interfaces
PixelShaderCache::Shutdown();
VertexShaderCache::Shutdown();
delete g_perf_query;
delete g_texture_cache;
delete g_renderer;
delete g_perf_query;
delete g_vertex_manager;
g_renderer = NULL;
g_texture_cache = NULL;