diff options
author | Ilia Mirkin <[email protected]> | 2016-06-08 11:32:54 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2016-06-09 21:01:53 -0400 |
commit | f48f3447005ba4f888fa2e4a7335014c7d04878a (patch) | |
tree | 6edb060f88aac9284698facc59e6ae8fa68f2988 | |
parent | f140ed6d956d3595551d34836029325f1ae819d6 (diff) |
st/mesa: fix type confusion with reladdrs
The reality is that this doesn't matter, because we manually emit the
ARL to the sampler reladdr, and those arguments don't get an extra load
later, so it's effectively just a boolean. However having the types be
wrong is confusing and could trigger very odd bugs should usage change
down the line.
Signed-off-by: Ilia Mirkin <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
-rw-r--r-- | src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 2216bdf120d..b7eaa13ffb2 100644 --- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -2226,7 +2226,7 @@ glsl_to_tgsi_visitor::visit_expression(ir_expression* ir, st_src_reg *op) GLSL_TYPE_UINT); if (!const_offset) { buffer.reladdr = ralloc(mem_ctx, st_src_reg); - memcpy(buffer.reladdr, &sampler_reladdr, sizeof(sampler_reladdr)); + *buffer.reladdr = op[0]; emit_arl(ir, sampler_reladdr, op[0]); } emit_asm(ir, TGSI_OPCODE_RESQ, result_dst)->buffer = buffer; @@ -3247,9 +3247,9 @@ glsl_to_tgsi_visitor::visit_ssbo_intrinsic(ir_call *ir) if (!const_block) { block->accept(this); - emit_arl(ir, sampler_reladdr, this->result); buffer.reladdr = ralloc(mem_ctx, st_src_reg); - memcpy(buffer.reladdr, &sampler_reladdr, sizeof(sampler_reladdr)); + *buffer.reladdr = this->result; + emit_arl(ir, sampler_reladdr, this->result); } /* Calculate the surface offset */ @@ -3464,9 +3464,9 @@ glsl_to_tgsi_visitor::visit_image_intrinsic(ir_call *ir) get_deref_offsets(img, &sampler_array_size, &sampler_base, (unsigned int *)&image.index, &reladdr); if (reladdr.file != PROGRAM_UNDEFINED) { - emit_arl(ir, sampler_reladdr, reladdr); image.reladdr = ralloc(mem_ctx, st_src_reg); - memcpy(image.reladdr, &sampler_reladdr, sizeof(reladdr)); + *image.reladdr = reladdr; + emit_arl(ir, sampler_reladdr, reladdr); } st_dst_reg dst = undef_dst; |