From 195ee1067323d593a602681e435f64e2af454099 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 20 Feb 2014 09:03:53 -0800 Subject: [PATCH] radeonsi: Use util_cpu_to_le32() instead of bswap32() on big-endian systems MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Michel Dänzer --- src/gallium/drivers/radeonsi/si_descriptors.c | 2 +- src/gallium/drivers/radeonsi/si_shader.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c index d45bc805129..9b10d011b9c 100644 --- a/src/gallium/drivers/radeonsi/si_descriptors.c +++ b/src/gallium/drivers/radeonsi/si_descriptors.c @@ -432,7 +432,7 @@ void si_upload_const_buffer(struct si_context *sctx, struct r600_resource **rbuf } for (i = 0; i < size / 4; ++i) { - tmpPtr[i] = util_bswap32(((uint32_t *)ptr)[i]); + tmpPtr[i] = util_cpu_to_le32(((uint32_t *)ptr)[i]); } u_upload_data(sctx->b.uploader, 0, size, tmpPtr, const_offset, diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 54270cdb733..9b04e6b5e50 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -2335,7 +2335,7 @@ int si_compile_llvm(struct si_context *sctx, struct si_pipe_shader *shader, ptr = (uint32_t*)sctx->b.ws->buffer_map(shader->bo->cs_buf, sctx->b.rings.gfx.cs, PIPE_TRANSFER_WRITE); if (0 /*SI_BIG_ENDIAN*/) { for (i = 0; i < binary.code_size / 4; ++i) { - ptr[i] = util_bswap32(*(uint32_t*)(binary.code + i*4)); + ptr[i] = util_cpu_to_le32((*(uint32_t*)(binary.code + i*4))); } } else { memcpy(ptr, binary.code, binary.code_size); -- 2.30.2