diff options
author | joukj <joukj@tarantella.(none)> | 2007-11-30 11:12:41 +0100 |
---|---|---|
committer | joukj <joukj@tarantella.(none)> | 2007-11-30 11:12:41 +0100 |
commit | 86f3135fbd9db9ca08a6c0bfc620345c8a8e3f04 (patch) | |
tree | 586dca229d09fb523554dd07ad39c9bf422ab927 /src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c | |
parent | d1414da8f9dbf3c27cf05509be51e8c70ed1185d (diff) | |
parent | d2540e6d4bdcfcda195f6dcf43f75b810001c227 (diff) |
Merge branch 'master' of git+ssh://joukj@git.freedesktop.org/git/mesa/mesa
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c index be6455a01e..25c7b8206a 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c @@ -224,7 +224,7 @@ nouveau_bo_init_storage(GLcontext *ctx, GLuint valid_gpu_access, GLsizeiptrARB size, const GLvoid *data, GLenum usage, - struct gl_buffer_object *bo) + struct gl_buffer_object *bo, int flags) { nouveau_buffer_object *nbo = (nouveau_buffer_object *)bo; @@ -257,7 +257,18 @@ nouveau_bo_init_storage(GLcontext *ctx, GLuint valid_gpu_access, if (data) { GLvoid *map = nouveau_bo_map(ctx, GL_WRITE_ONLY_ARB, bo); - _mesa_memcpy(map, data, size); +#ifdef MESA_BIG_ENDIAN + int i; + if (flags) { + for (i = 0; i < size; i+=4) { + uint32_t _data = *(unsigned int *)(data+i); + _data = ((_data >> 16) | ((_data & 0xffff) << 16)); + *(unsigned int *)(map+i) = _data; + } + } else +#endif + _mesa_memcpy(map, data, size); + (void)flags; /* get rid of warning */ nouveau_bo_dirty_all(ctx, GL_FALSE, bo); nouveau_bo_unmap(ctx, bo); } @@ -514,7 +525,7 @@ nouveauBufferData(GLcontext *ctx, GLenum target, GLsizeiptrARB size, gpu_flags = NOUVEAU_BO_VRAM_OK | NOUVEAU_BO_GART_OK; break; } - nouveau_bo_init_storage(ctx, gpu_flags, size, data, usage, obj); + nouveau_bo_init_storage(ctx, gpu_flags, size, data, usage, obj, 0); } static void |