OGL: Move copy_image variable into backend.

This commit is contained in:
degasus 2015-07-25 12:10:52 +02:00
parent 767ed88f3d
commit e2f42f8fd0
5 changed files with 11 additions and 10 deletions

View File

@ -84,7 +84,6 @@ void InitBackendInfo()
g_Config.backend_info.bSupportsPostProcessing = false; g_Config.backend_info.bSupportsPostProcessing = false;
g_Config.backend_info.bSupportsPaletteConversion = true; g_Config.backend_info.bSupportsPaletteConversion = true;
g_Config.backend_info.bSupportsClipControl = true; g_Config.backend_info.bSupportsClipControl = true;
g_Config.backend_info.bSupportsCopySubImage = true;
IDXGIFactory* factory; IDXGIFactory* factory;
IDXGIAdapter* ad; IDXGIAdapter* ad;

View File

@ -469,7 +469,7 @@ Renderer::Renderer()
g_Config.backend_info.bSupportsGeometryShaders = GLExtensions::Version() >= 320; g_Config.backend_info.bSupportsGeometryShaders = GLExtensions::Version() >= 320;
g_Config.backend_info.bSupportsPaletteConversion = GLExtensions::Supports("GL_ARB_texture_buffer_object"); g_Config.backend_info.bSupportsPaletteConversion = GLExtensions::Supports("GL_ARB_texture_buffer_object");
g_Config.backend_info.bSupportsClipControl = GLExtensions::Supports("GL_ARB_clip_control"); g_Config.backend_info.bSupportsClipControl = GLExtensions::Supports("GL_ARB_clip_control");
g_Config.backend_info.bSupportsCopySubImage = GLExtensions::Supports("GL_ARB_copy_image") || g_ogl_config.bSupportsCopySubImage = GLExtensions::Supports("GL_ARB_copy_image") ||
GLExtensions::Supports("GL_NV_copy_image") || GLExtensions::Supports("GL_NV_copy_image") ||
GLExtensions::Supports("GL_EXT_copy_image") || GLExtensions::Supports("GL_EXT_copy_image") ||
GLExtensions::Supports("GL_OES_copy_image"); GLExtensions::Supports("GL_OES_copy_image");
@ -603,7 +603,7 @@ Renderer::Renderer()
g_ogl_config.bSupportSampleShading ? "" : "SSAA ", g_ogl_config.bSupportSampleShading ? "" : "SSAA ",
g_ActiveConfig.backend_info.bSupportsGSInstancing ? "" : "GSInstancing ", g_ActiveConfig.backend_info.bSupportsGSInstancing ? "" : "GSInstancing ",
g_ActiveConfig.backend_info.bSupportsClipControl ? "" : "ClipControl ", g_ActiveConfig.backend_info.bSupportsClipControl ? "" : "ClipControl ",
g_ActiveConfig.backend_info.bSupportsCopySubImage ? "" : "CopyImageSubData " g_ogl_config.bSupportsCopySubImage ? "" : "CopyImageSubData "
); );
s_last_multisample_mode = g_ActiveConfig.iMultisampleMode; s_last_multisample_mode = g_ActiveConfig.iMultisampleMode;

View File

@ -36,6 +36,7 @@ struct VideoConfig
bool bSupportViewportFloat; bool bSupportViewportFloat;
bool bSupportsAEP; bool bSupportsAEP;
bool bSupportsDebug; bool bSupportsDebug;
bool bSupportsCopySubImage;
const char* gl_vendor; const char* gl_vendor;
const char* gl_renderer; const char* gl_renderer;

View File

@ -147,7 +147,7 @@ void TextureCache::TCacheEntry::CopyRectangleFromTexture(
TCacheEntry* srcentry = (TCacheEntry*)source; TCacheEntry* srcentry = (TCacheEntry*)source;
if (srcrect.GetWidth() == dstrect.GetWidth() if (srcrect.GetWidth() == dstrect.GetWidth()
&& srcrect.GetHeight() == dstrect.GetHeight() && srcrect.GetHeight() == dstrect.GetHeight()
&& g_ActiveConfig.backend_info.bSupportsCopySubImage) && g_ogl_config.bSupportsCopySubImage)
{ {
glCopyImageSubData( glCopyImageSubData(
srcentry->texture, srcentry->texture,
@ -167,9 +167,11 @@ void TextureCache::TCacheEntry::CopyRectangleFromTexture(
1); 1);
return; return;
} }
else if (!config.rendertarget) else if (!framebuffer)
{ {
return; glGenFramebuffers(1, &framebuffer);
FramebufferManager::SetFramebuffer(framebuffer);
FramebufferManager::FramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_ARRAY, texture, 0);
} }
g_renderer->ResetAPIState(); g_renderer->ResetAPIState();
FramebufferManager::SetFramebuffer(framebuffer); FramebufferManager::SetFramebuffer(framebuffer);

View File

@ -160,7 +160,6 @@ struct VideoConfig final
bool bSupportsPostProcessing; bool bSupportsPostProcessing;
bool bSupportsPaletteConversion; bool bSupportsPaletteConversion;
bool bSupportsClipControl; // Needed by VertexShaderGen, so must stay in VideoCommon bool bSupportsClipControl; // Needed by VertexShaderGen, so must stay in VideoCommon
bool bSupportsCopySubImage; // Needed for partial texture updates
} backend_info; } backend_info;
// Utility // Utility