From: Tom Stellard <thomas.stell...@amd.com> --- src/gallium/drivers/radeonsi/radeonsi_shader.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/radeonsi_shader.c b/src/gallium/drivers/radeonsi/radeonsi_shader.c index 218997f..0aeecc2 100644 --- a/src/gallium/drivers/radeonsi/radeonsi_shader.c +++ b/src/gallium/drivers/radeonsi/radeonsi_shader.c @@ -1175,9 +1175,9 @@ int si_pipe_shader_create( } } - shader->num_sgprs = util_le32_to_cpu(*(uint32_t*)binary.code); - shader->num_vgprs = util_le32_to_cpu(*(uint32_t*)(binary.code + 4)); - shader->spi_ps_input_ena = util_le32_to_cpu(*(uint32_t*)(binary.code + 8)); + shader->num_sgprs = util_le32_to_cpu(*(uint32_t*)binary.config); + shader->num_vgprs = util_le32_to_cpu(*(uint32_t*)(binary.config + 4)); + shader->spi_ps_input_ena = util_le32_to_cpu(*(uint32_t*)(binary.config + 8)); radeon_llvm_dispose(&si_shader_ctx.radeon_bld); tgsi_parse_free(&si_shader_ctx.parse); @@ -1185,7 +1185,7 @@ int si_pipe_shader_create( /* copy new shader */ si_resource_reference(&shader->bo, NULL); shader->bo = si_resource_create_custom(ctx->screen, PIPE_USAGE_IMMUTABLE, - binary.code_size - 12); + binary.code_size); if (shader->bo == NULL) { FREE(si_shader_ctx.constants); FREE(si_shader_ctx.resources); @@ -1195,11 +1195,11 @@ int si_pipe_shader_create( ptr = (uint32_t*)rctx->ws->buffer_map(shader->bo->cs_buf, rctx->cs, PIPE_TRANSFER_WRITE); if (0 /*R600_BIG_ENDIAN*/) { - for (i = 0; i < (binary.code_size-12)/4; ++i) { - ptr[i] = util_bswap32(*(uint32_t*)(binary.code+12 + i*4)); + for (i = 0; i < binary.code_size / 4; ++i) { + ptr[i] = util_bswap32(*(uint32_t*)(binary.code + i*4)); } } else { - memcpy(ptr, binary.code + 12, binary.code_size - 12); + memcpy(ptr, binary.code, binary.code_size); } rctx->ws->buffer_unmap(shader->bo->cs_buf); -- 1.8.1.5 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev