mirror of https://github.com/PCSX2/pcsx2.git
gsdx ogl: flush vbo range instead of barrier
For testing purpose. I don't know which one is better. It seems flushing have less fps fluctuation than barrier.
This commit is contained in:
parent
ce98276322
commit
19eb1f00d1
|
@ -415,9 +415,11 @@ void GSDeviceOGL::BeforeDraw()
|
|||
#ifdef _DEBUG
|
||||
ASSERT(gl_CheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE);
|
||||
#endif
|
||||
#if 0
|
||||
// Ensure VBOs are uploaded
|
||||
if (GLLoader::found_GL_ARB_buffer_storage)
|
||||
Barrier(GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT);
|
||||
#endif
|
||||
|
||||
//#ifdef ENABLE_OGL_STENCIL_DEBUG
|
||||
// if (m_date.t)
|
||||
|
|
|
@ -66,7 +66,7 @@ class GSBufferOGL {
|
|||
const GLbitfield map_flags = GL_MAP_WRITE_BIT
|
||||
| GL_MAP_PERSISTENT_BIT
|
||||
// | GL_MAP_COHERENT_BIT (see barrier in GSDeviceOGL::BeforeDraw)
|
||||
| GL_MAP_INVALIDATE_RANGE_BIT
|
||||
| GL_MAP_FLUSH_EXPLICIT_BIT
|
||||
;
|
||||
const GLbitfield create_flags = map_flags
|
||||
// | GL_CLIENT_STORAGE_BIT
|
||||
|
@ -130,6 +130,8 @@ class GSBufferOGL {
|
|||
void* dst;
|
||||
|
||||
m_count = count;
|
||||
size_t offset = m_start*m_stride;
|
||||
size_t length = m_count*m_stride;
|
||||
|
||||
// Get the pointer of the buffer
|
||||
{
|
||||
|
@ -141,21 +143,25 @@ class GSBufferOGL {
|
|||
//fprintf(stderr, "Wrap buffer (%x)\n", m_target);
|
||||
// Wrap at startup
|
||||
m_start = 0;
|
||||
offset = 0;
|
||||
}
|
||||
|
||||
dst = m_buffer_ptr + m_start*m_stride;
|
||||
dst = m_buffer_ptr + offset;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// FIXME which one to use. Note dst doesn't have any aligment guarantee
|
||||
// because it depends of the offset
|
||||
if (m_target == GL_ARRAY_BUFFER) {
|
||||
GSVector4i::storent(dst, src, m_count * m_stride);
|
||||
GSVector4i::storent(dst, src, length);
|
||||
} else {
|
||||
memcpy(dst, src, m_stride*m_count);
|
||||
memcpy(dst, src, length);
|
||||
}
|
||||
#else
|
||||
memcpy(dst, src, m_stride*m_count);
|
||||
memcpy(dst, src, length);
|
||||
#endif
|
||||
#if 1
|
||||
gl_FlushMappedBufferRange(m_target, offset, length);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue