[Mesa-dev] [PATCH] i965/fs: Gen4: Zero out extra coordinates when using shadow compare

Kenneth Graunke kenneth at whitecape.org
Tue Aug 27 08:46:05 PDT 2013


On 08/27/2013 02:47 AM, Chris Forbes wrote:
> Sorry, saw the bogus comment style just after I sent this out.
>
> -- Chris
>
> On Tue, Aug 27, 2013 at 9:45 PM, Chris Forbes <chrisf at ijw.co.nz> wrote:
>> Fixes broken rendering if these MRFs contained anything other than zero.
>>
>> NOTE: This is a candidate for stable branches.
>> Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
>> ---
>>   src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
>> index 964ad40..c3eecfa 100644
>> --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
>> +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
>> @@ -868,7 +868,12 @@ fs_visitor::emit_texture_gen4(ir_texture *ir, fs_reg dst, fs_reg coordinate,
>>           emit(MOV(fs_reg(MRF, base_mrf + mlen + i), coordinate));
>>           coordinate.reg_offset++;
>>         }
>> -      /* gen4's SIMD8 sampler always has the slots for u,v,r present. */
>> +
>> +      /* gen4's SIMD8 sampler always has the slots for u,v,r present.
>> +       * the unused slots must be zeroed.*/
>> +      for (int i = ir->coordinate->type->vector_elements; i<3; i++) {

Another instance of forgetting to do this? :(

i < 3 please (with spaces).  Either way,

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

>> +         emit(MOV(fs_reg(MRF, base_mrf + mlen + i), fs_reg(0.0f)));
>> +      }
>>         mlen += 3;
>>
>>         if (ir->op == ir_tex) {
>> --
>> 1.8.4
>>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>



More information about the mesa-dev mailing list