byteswap.h and bswap_32 aren't portable, replace them with calls to

gallium's util_bswap32 as suggested by kettenis.

already merged upstream
ok kettenis@
This commit is contained in:
jsg 2013-06-17 23:21:23 +00:00
parent 537fe7febb
commit 54ad3dfaaa
3 changed files with 5 additions and 7 deletions

View File

@ -22,9 +22,9 @@
*/
#include <stdio.h>
#include <errno.h>
#include <byteswap.h>
#include "util/u_format.h"
#include "util/u_memory.h"
#include "util/u_math.h"
#include "pipe/p_shader_tokens.h"
#include "r600_pipe.h"
#include "r600_sq.h"
@ -2288,7 +2288,7 @@ int r600_vertex_elements_build_fetch_shader(struct r600_pipe_context *rctx, stru
if (R600_BIG_ENDIAN) {
for (i = 0; i < ve->fs_size / 4; ++i) {
bytecode[i] = bswap_32(bc.bytecode[i]);
bytecode[i] = util_bswap32(bc.bytecode[i]);
}
} else {
memcpy(bytecode, bc.bytecode, ve->fs_size);

View File

@ -24,8 +24,6 @@
* Jerome Glisse
* Corbin Simpson <MostAwesomeDude@gmail.com>
*/
#include <byteswap.h>
#include <pipe/p_screen.h>
#include <util/u_format.h>
#include <util/u_math.h>
@ -274,7 +272,7 @@ void r600_upload_const_buffer(struct r600_pipe_context *rctx, struct r600_resour
}
for (i = 0; i < size / 4; ++i) {
tmpPtr[i] = bswap_32(((uint32_t *)ptr)[i]);
tmpPtr[i] = util_bswap32(((uint32_t *)ptr)[i]);
}
u_upload_data(rctx->vbuf_mgr->uploader, 0, size, tmpPtr, const_offset,

View File

@ -26,6 +26,7 @@
#include "tgsi/tgsi_scan.h"
#include "tgsi/tgsi_dump.h"
#include "util/u_format.h"
#include "util/u_math.h"
#include "r600_pipe.h"
#include "r600_asm.h"
#include "r600_sq.h"
@ -34,7 +35,6 @@
#include "r600d.h"
#include <stdio.h>
#include <errno.h>
#include <byteswap.h>
/* CAYMAN notes
Why CAYMAN got loops for lots of instructions is explained here.
@ -89,7 +89,7 @@ static int r600_pipe_shader(struct pipe_context *ctx, struct r600_pipe_shader *s
ptr = (uint32_t*)r600_bo_map(rctx->radeon, shader->bo, 0, NULL);
if (R600_BIG_ENDIAN) {
for (i = 0; i < rshader->bc.ndw; ++i) {
ptr[i] = bswap_32(rshader->bc.bytecode[i]);
ptr[i] = util_bswap32(rshader->bc.bytecode[i]);
}
} else {
memcpy(ptr, rshader->bc.bytecode, rshader->bc.ndw * sizeof(*ptr));