mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
i915: fix incorrect texcoord optimization in TGSI compiler
i915_fpc_optimize_mov_before_tex replaces a MOV+TEX pair with a direct TEX from the input register when the MOV copies from the input with identity swizzle. But it only checked the source swizzle, not the MOV's writemask. When the MOV wrote a subset of the channels the TEX reads (e.g., MOV TEMP.y, IN.y before a 2D TEX that reads XY), the optimization replaced the TEX source with IN, losing the X channel that was set by a different MOV. This caused incorrect texture sampling coordinates in shaders with multi-MOV texcoord construction (blur filters, shadow maps, etc.). Fix: verify the MOV's dest writemask covers all channels the TEX instruction reads before applying the optimization. Assisted-by: Claude
This commit is contained in:
parent
b1e709384b
commit
badd52c7d5
1 changed files with 2 additions and 0 deletions
|
|
@ -405,6 +405,8 @@ i915_fpc_optimize_mov_before_tex(struct i915_optimize_context *ctx,
|
|||
target_is_texture2d(next->FullInstruction.Texture.Texture) &&
|
||||
same_src_dst_reg(&next->FullInstruction.Src[0],
|
||||
¤t->FullInstruction.Dst[0]) &&
|
||||
(current->FullInstruction.Dst[0].Register.WriteMask &
|
||||
i915_tex_mask(next)) == i915_tex_mask(next) &&
|
||||
is_unswizzled(¤t->FullInstruction.Src[0], i915_tex_mask(next)) &&
|
||||
unused_from(ctx, ¤t->FullInstruction.Dst[0], index)) {
|
||||
memcpy(&next->FullInstruction.Src[0], ¤t->FullInstruction.Src[0],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue