On Tue, Apr 8, 2014 at 5:41 PM, Roland Scheidegger <srol...@vmware.com> wrote: > Am 08.04.2014 13:49, schrieb Rob Clark: >> btw, I think I've tracked down at least one of the rendercheck issues >> I was having. Which seems to be a pre-existing condition. The >> problem is a composite operation with xrgb src and a8 dst. Ends up >> generating a shader along the lines of: >> >> 0: TEX TEMP[0], IN[0], SAMP[0], 2D >> 1: MOV TEMP[0].w, IMM[..] >> 2: MOV OUT[0], TEMP[0].wwww >> 3: END >> >> in this case, my compiler optimizes out the texture fetch. But that >> causes a bit of confusion in freedreno because half the driver thinks >> there is a texture and sets things up accordingly. >> >> I'm not entirely sure if XA should detect this.. or if that should be >> fixed in the driver.. > I think the driver should handle that correctly in any case - I could easily > see such shaders being generated in other places too. Obviously, a > driver can optimize away the tex instruction but is not required to do > so (though it would be better if it did...), the shader is perfectly > valid (but needs the sampler to be set up correctly). > If the state tracker should avoid it in the first place, I'm not > certain. If it doesn't add too much complexity, sounds like a good idea. > But just relying on dead code elimination in the drivers doesn't sound > too unreasonable to me neither.
fwiw, the patch to avoid this in XA turned out to not be too bad (I included it in the series I sent earlier today). I also fixed it in freedreno, because the same issue could happen with binning pass shaders (basically a simplified version of vertex shader used for binning pass). But for more conventional gpus I think avoiding binding textures is probably a nice thing. BR, -R > Roland _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev