radeonsi: Use util_cpu_to_le32() instead of bswap32() on big-endian systems
authorTom Stellard <thomas.stellard@amd.com>
Thu, 20 Feb 2014 17:03:53 +0000 (09:03 -0800)
committerTom Stellard <thomas.stellard@amd.com>
Mon, 24 Feb 2014 20:56:27 +0000 (12:56 -0800)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_descriptors.c
src/gallium/drivers/radeonsi/si_shader.c

index d45bc8051292b787b17d68ea49aff903a8e75439..9b10d011b9ce2df14306debe6b0fe841ada685a9 100644 (file)
@@ -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,
index 54270cdb7334112b0fb0c11179cf869e15423095..9b04e6b5e5093a23a3b1255d59b287a48dac7f22 100644 (file)
@@ -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);