[Mesa-dev] [PATCH] i965/fs: Fix implied_mrf_writes for scratch writes

Kenneth Graunke kenneth at whitecape.org
Sat May 23 12:05:18 PDT 2015


On Saturday, May 23, 2015 11:57:32 AM Jason Ekstrand wrote:
> On Sat, May 23, 2015 at 11:53 AM, Kenneth Graunke <kenneth at whitecape.org> wrote:
> > On Tuesday, May 19, 2015 05:37:04 PM Jason Ekstrand wrote:
> >> We build the entire message in the generator so all the MRF writes are
> >> implied.
> >> ---
> >>  src/mesa/drivers/dri/i965/brw_fs.cpp | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
> >> index 9b3186b..42a0d78 100644
> >> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
> >> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
> >> @@ -1050,7 +1050,7 @@ fs_visitor::implied_mrf_writes(fs_inst *inst)
> >>     case FS_OPCODE_VARYING_PULL_CONSTANT_LOAD:
> >>        return inst->mlen;
> >>     case SHADER_OPCODE_GEN4_SCRATCH_WRITE:
> >> -      return 2;
> >> +      return inst->mlen;
> >>     case SHADER_OPCODE_UNTYPED_ATOMIC:
> >>     case SHADER_OPCODE_UNTYPED_SURFACE_READ:
> >>     case SHADER_OPCODE_UNTYPED_SURFACE_WRITE:
> >>
> >
> > Good catch!
> 
> You should thank Neil.  He pointed out a bug that made me go look at
> spilling again.

Thanks, Neil! :)

> > These should be equivalent in SIMD8 mode - we write 1 register
> > (BRW_DATAPORT_OWORD_BLOCK_2_OWORDS), giving us a mlen of 2.
> >
> > But for SIMD16, the old code would break, since mlen is 3.
> >
> > Cc: mesa-stable at lists.freedesktop.org
> > Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
> 
> Note: The patch was only compile-tested as actually testing that it
> fixes something is neigh impossible.  Are you ok with pushing it?
> --Jason

You should definitely Piglit test it for regressions, but I don't think
we need to verify that it fixes anything before pushing.  It fixes a bug
found by inspection which also happens to be challenging to test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150523/a9d10438/attachment.sig>


More information about the mesa-dev mailing list