Skip to content

Commit 9d64433

Browse files
committed
GL*: properly translate HBU setting
1 parent 5e2f7cf commit 9d64433

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

RenderSystems/GL/src/OgreGLHardwareBufferManager.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,8 @@ namespace Ogre {
108108
//---------------------------------------------------------------------
109109
GLenum GLHardwareBufferManager::getGLUsage(unsigned int usage)
110110
{
111-
return (usage & HardwareBuffer::HBU_DETAIL_DISCARDABLE) ? GL_STREAM_DRAW_ARB :
112-
(usage & HardwareBuffer::HBU_STATIC) ? GL_STATIC_DRAW_ARB :
113-
GL_DYNAMIC_DRAW_ARB;
111+
return (usage == HBU_GPU_TO_CPU) ? GL_STATIC_READ
112+
: (usage == HBU_GPU_ONLY) ? GL_STATIC_DRAW : GL_DYNAMIC_DRAW;
114113
}
115114
//---------------------------------------------------------------------
116115
GLenum GLHardwareBufferManager::getGLType(unsigned int type)

RenderSystems/GL3Plus/src/OgreGL3PlusHardwareBuffer.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,7 @@ namespace Ogre {
165165

166166
GLenum GL3PlusHardwareBuffer::getGLUsage(uint32 usage)
167167
{
168-
return (usage & HardwareBuffer::HBU_DETAIL_DISCARDABLE) ? GL_STREAM_DRAW :
169-
(usage & HardwareBuffer::HBU_STATIC) ? GL_STATIC_DRAW :
170-
GL_DYNAMIC_DRAW;
168+
return (usage == HBU_GPU_TO_CPU) ? GL_STATIC_READ
169+
: (usage == HBU_GPU_ONLY) ? GL_STATIC_DRAW : GL_DYNAMIC_DRAW;
171170
}
172171
}

RenderSystems/GL3Plus/src/OgreGL3PlusTextureBuffer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ namespace Ogre {
286286
"GL3PlusTextureBuffer::download");
287287

288288
// Download data to PBO
289-
GL3PlusHardwareBuffer buffer(GL_PIXEL_PACK_BUFFER, data.getConsecutiveSize(), HBU_DETAIL_DISCARDABLE);
289+
GL3PlusHardwareBuffer buffer(GL_PIXEL_PACK_BUFFER, data.getConsecutiveSize(), HBU_GPU_TO_CPU);
290290

291291
// std::stringstream str;
292292
// str << "GL3PlusHardwarePixelBuffer::download: " << mTextureID

RenderSystems/GLES2/src/OgreGLES2HardwareBuffer.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ namespace Ogre {
200200

201201
GLenum GLES2HardwareBuffer::getGLUsage(unsigned int usage)
202202
{
203-
return (usage & HardwareBuffer::HBU_DETAIL_DISCARDABLE) ? GL_STREAM_DRAW :
204-
(usage & HardwareBuffer::HBU_STATIC) ? GL_STATIC_DRAW :
205-
GL_DYNAMIC_DRAW;
203+
return (usage == HBU_GPU_TO_CPU) ? GL_STATIC_READ
204+
: (usage == HBU_GPU_ONLY) ? GL_STATIC_DRAW : GL_DYNAMIC_DRAW;
206205
}
207206
}

0 commit comments

Comments
 (0)