aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-04-27 19:19:53 +0200
committerMarek Olšák <[email protected]>2017-05-05 00:23:44 +0200
commit4c0e68dfe5a0bb69f07466ca39e8a243b00d06b8 (patch)
tree6595748b4be35ef371e59b7650ba72f457652b26 /src/gallium/drivers/radeonsi
parent7660c9ee4ec97b5c74b73667acf91a8206208b23 (diff)
radeonsi: don't use util_memcpy_cpu_to_le32 for shader uploads
at least I think this is correct. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index c4d102e0202..f9b94052597 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -6575,27 +6575,28 @@ int si_shader_binary_upload(struct si_screen *sscreen, struct si_shader *shader)
PIPE_TRANSFER_READ_WRITE |
PIPE_TRANSFER_UNSYNCHRONIZED);
+ /* Don't use util_memcpy_cpu_to_le32. LLVM binaries are
+ * endian-independent. */
if (prolog) {
- util_memcpy_cpu_to_le32(ptr, prolog->code, prolog->code_size);
+ memcpy(ptr, prolog->code, prolog->code_size);
ptr += prolog->code_size;
}
if (previous_stage) {
- util_memcpy_cpu_to_le32(ptr, previous_stage->code,
- previous_stage->code_size);
+ memcpy(ptr, previous_stage->code, previous_stage->code_size);
ptr += previous_stage->code_size;
}
if (prolog2) {
- util_memcpy_cpu_to_le32(ptr, prolog2->code, prolog2->code_size);
+ memcpy(ptr, prolog2->code, prolog2->code_size);
ptr += prolog2->code_size;
}
- util_memcpy_cpu_to_le32(ptr, mainb->code, mainb->code_size);
+ memcpy(ptr, mainb->code, mainb->code_size);
ptr += mainb->code_size;
if (epilog)
- util_memcpy_cpu_to_le32(ptr, epilog->code, epilog->code_size);
+ memcpy(ptr, epilog->code, epilog->code_size);
else if (mainb->rodata_size > 0)
- util_memcpy_cpu_to_le32(ptr, mainb->rodata, mainb->rodata_size);
+ memcpy(ptr, mainb->rodata, mainb->rodata_size);
sscreen->b.ws->buffer_unmap(shader->bo->buf);
return 0;