r600g: Use util_cpu_to_le32() instead of bswap32() on big-endian systems
authorTom Stellard <thomas.stellard@amd.com>
Thu, 20 Feb 2014 15:51:24 +0000 (07:51 -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/r600/r600_asm.c
src/gallium/drivers/r600/r600_shader.c
src/gallium/drivers/r600/r600_state_common.c

index 3afe7b2c019f5bddfbc87da18c2ed75b3b0c914f..67df2f2acd30fcf90caba0804748128bacc9099a 100644 (file)
@@ -2431,7 +2431,7 @@ void *r600_create_vertex_fetch_shader(struct pipe_context *ctx,
 
        if (R600_BIG_ENDIAN) {
                for (i = 0; i < fs_size / 4; ++i) {
-                       bytecode[i] = util_bswap32(bc.bytecode[i]);
+                       bytecode[i] = util_cpu_to_le32(bc.bytecode[i]);
                }
        } else {
                memcpy(bytecode, bc.bytecode, fs_size);
index baeef57b22dd8e2eb3b926e514a28bf20a62b715..38c68e48aafe54f0ddd4223f869a29132e1d0c56 100644 (file)
@@ -119,7 +119,7 @@ static int store_shader(struct pipe_context *ctx,
                ptr = r600_buffer_map_sync_with_rings(&rctx->b, shader->bo, PIPE_TRANSFER_WRITE);
                if (R600_BIG_ENDIAN) {
                        for (i = 0; i < shader->shader.bc.ndw; ++i) {
-                               ptr[i] = util_bswap32(shader->shader.bc.bytecode[i]);
+                               ptr[i] = util_cpu_to_le32(shader->shader.bc.bytecode[i]);
                        }
                } else {
                        memcpy(ptr, shader->shader.bc.bytecode, shader->shader.bc.ndw * sizeof(*ptr));
index da4578a378130c9facbd187ff71ca582af855c2f..5f9e8b7af9869d579cbb43c528b160a9bb1f0069 100644 (file)
@@ -936,7 +936,7 @@ static void r600_set_constant_buffer(struct pipe_context *ctx, uint shader, uint
                        }
 
                        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(rctx->b.uploader, 0, size, tmpPtr, &cb->buffer_offset, &cb->buffer);