mirror of https://github.com/PCSX2/pcsx2.git
gsdx-ogl: disable slow and buggy code until I found a better solution
ogl_texture_storage 1 creates texture corruption. Advance date is too slow, code need to be updated (properly) to uses 2 passes only not 3 Maybe one could be enough (sometimes)
This commit is contained in:
parent
b32f808fd4
commit
f6652e9a50
|
@ -290,7 +290,8 @@ namespace GLLoader {
|
||||||
if (ext.compare("GL_ARB_shading_language_420pack") == 0) found_GL_ARB_shading_language_420pack = true;
|
if (ext.compare("GL_ARB_shading_language_420pack") == 0) found_GL_ARB_shading_language_420pack = true;
|
||||||
if (ext.compare("GL_ARB_texture_storage") == 0) found_GL_ARB_texture_storage = true;
|
if (ext.compare("GL_ARB_texture_storage") == 0) found_GL_ARB_texture_storage = true;
|
||||||
// Only enable this extension on nvidia
|
// Only enable this extension on nvidia
|
||||||
if (nvidia_buggy_driver && ext.compare("GL_ARB_shader_image_load_store") == 0) found_GL_ARB_shader_image_load_store = true;
|
// It is too costly on perf (big upscaling), code need to updated to reduce the number of draw stage
|
||||||
|
//if (nvidia_buggy_driver && ext.compare("GL_ARB_shader_image_load_store") == 0) found_GL_ARB_shader_image_load_store = true;
|
||||||
// GL4.3
|
// GL4.3
|
||||||
if (ext.compare("GL_ARB_copy_image") == 0) found_GL_ARB_copy_image = true;
|
if (ext.compare("GL_ARB_copy_image") == 0) found_GL_ARB_copy_image = true;
|
||||||
if (ext.compare("GL_ARB_explicit_uniform_location") == 0) found_GL_ARB_explicit_uniform_location = true;
|
if (ext.compare("GL_ARB_explicit_uniform_location") == 0) found_GL_ARB_explicit_uniform_location = true;
|
||||||
|
|
|
@ -36,6 +36,7 @@ namespace PboPool {
|
||||||
char* m_map[PBO_POOL_SIZE];
|
char* m_map[PBO_POOL_SIZE];
|
||||||
uint32 m_current_pbo = 0;
|
uint32 m_current_pbo = 0;
|
||||||
uint32 m_size;
|
uint32 m_size;
|
||||||
|
bool m_texture_storage;
|
||||||
const uint32 m_pbo_size = 4*1024*1024;
|
const uint32 m_pbo_size = 4*1024*1024;
|
||||||
|
|
||||||
#ifndef ENABLE_GLES
|
#ifndef ENABLE_GLES
|
||||||
|
@ -51,11 +52,12 @@ namespace PboPool {
|
||||||
|
|
||||||
void Init() {
|
void Init() {
|
||||||
gl_GenBuffers(countof(m_pool), m_pool);
|
gl_GenBuffers(countof(m_pool), m_pool);
|
||||||
|
m_texture_storage = ((theApp.GetConfig("ogl_texture_storage", 0) == 1) && GLLoader::found_GL_ARB_buffer_storage);
|
||||||
|
|
||||||
for (size_t i = 0; i < countof(m_pool); i++) {
|
for (size_t i = 0; i < countof(m_pool); i++) {
|
||||||
BindPbo();
|
BindPbo();
|
||||||
|
|
||||||
if (GLLoader::found_GL_ARB_buffer_storage) {
|
if (m_texture_storage) {
|
||||||
#ifndef ENABLE_GLES
|
#ifndef ENABLE_GLES
|
||||||
gl_BufferStorage(GL_PIXEL_UNPACK_BUFFER, m_pbo_size, NULL, create_flags);
|
gl_BufferStorage(GL_PIXEL_UNPACK_BUFFER, m_pbo_size, NULL, create_flags);
|
||||||
m_map[m_current_pbo] = (char*)gl_MapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, m_pbo_size, map_flags);
|
m_map[m_current_pbo] = (char*)gl_MapBufferRange(GL_PIXEL_UNPACK_BUFFER, 0, m_pbo_size, map_flags);
|
||||||
|
@ -78,7 +80,7 @@ namespace PboPool {
|
||||||
fprintf(stderr, "BUG: PBO too small %d but need %d\n", m_pbo_size, m_size);
|
fprintf(stderr, "BUG: PBO too small %d but need %d\n", m_pbo_size, m_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GLLoader::found_GL_ARB_buffer_storage) {
|
if (m_texture_storage) {
|
||||||
if (m_offset[m_current_pbo] + m_size >= m_pbo_size) {
|
if (m_offset[m_current_pbo] + m_size >= m_pbo_size) {
|
||||||
NextPbo();
|
NextPbo();
|
||||||
}
|
}
|
||||||
|
@ -118,7 +120,7 @@ namespace PboPool {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unmap() {
|
void Unmap() {
|
||||||
if (GLLoader::found_GL_ARB_buffer_storage) {
|
if (m_texture_storage) {
|
||||||
// As far as I understand glTexSubImage2D is a client-server transfer so no need to make
|
// As far as I understand glTexSubImage2D is a client-server transfer so no need to make
|
||||||
// the value visible to the server
|
// the value visible to the server
|
||||||
//gl_MemoryBarrier(GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT);
|
//gl_MemoryBarrier(GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT);
|
||||||
|
@ -132,7 +134,7 @@ namespace PboPool {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Destroy() {
|
void Destroy() {
|
||||||
if (GLLoader::found_GL_ARB_buffer_storage)
|
if (m_texture_storage)
|
||||||
UnmapAll();
|
UnmapAll();
|
||||||
gl_DeleteBuffers(countof(m_pool), m_pool);
|
gl_DeleteBuffers(countof(m_pool), m_pool);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue