mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-28 16:10:23 +01:00
st/mesa: always allocate pack/unpack buffers as staging
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
This commit is contained in:
parent
3f840e5ccd
commit
7f6b9baee2
1 changed files with 6 additions and 8 deletions
|
|
@ -245,6 +245,11 @@ buffer_usage(GLenum target, GLboolean immutable,
|
|||
}
|
||||
}
|
||||
else {
|
||||
/* These are often read by the CPU, so enable CPU caches. */
|
||||
if (target == GL_PIXEL_PACK_BUFFER ||
|
||||
target == GL_PIXEL_UNPACK_BUFFER)
|
||||
return PIPE_USAGE_STAGING;
|
||||
|
||||
/* BufferData */
|
||||
switch (usage) {
|
||||
case GL_DYNAMIC_DRAW:
|
||||
|
|
@ -252,14 +257,7 @@ buffer_usage(GLenum target, GLboolean immutable,
|
|||
return PIPE_USAGE_DYNAMIC;
|
||||
case GL_STREAM_DRAW:
|
||||
case GL_STREAM_COPY:
|
||||
/* XXX: Remove this test and fall-through when we have PBO unpacking
|
||||
* acceleration. Right now, PBO unpacking is done by the CPU, so we
|
||||
* have to make sure CPU reads are fast.
|
||||
*/
|
||||
if (target != GL_PIXEL_UNPACK_BUFFER_ARB) {
|
||||
return PIPE_USAGE_STREAM;
|
||||
}
|
||||
/* fall through */
|
||||
return PIPE_USAGE_STREAM;
|
||||
case GL_STATIC_READ:
|
||||
case GL_DYNAMIC_READ:
|
||||
case GL_STREAM_READ:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue