Bug 100061 - LODQ instruction generated with invalid dst mask
Summary: LODQ instruction generated with invalid dst mask
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-04 17:48 UTC by Ilia Mirkin
Modified: 2017-03-19 05:14 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
shader_test demonstrating the issue (9.57 KB, text/plain)
2017-03-04 17:48 UTC, Ilia Mirkin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ilia Mirkin 2017-03-04 17:48:51 UTC
Created attachment 130064 [details]
shader_test demonstrating the issue

The attached shader_test produces an instruction like this:

  2: LODQ TEMP[1], TEMP[1], SAMP[0], 2D

Which is clearly bogus (and hits an assert in nouveau code making sure that the destmask is a subset of .xy). I tried to get this to happen with a much simpler shader, but was unsuccessful. Haven't tried whittling this one down yet. It comes from some radeonsi bug with a trace from Hitman.

My guess is that it's an issue in the st_glsl_to_tgsi register renumbering or copy-prop passes... somehow. (Mostly because I hate them, and hope that this hatred is vindicated by them having bugs.)
Comment 1 Ilia Mirkin 2017-03-19 05:14:57 UTC
commit dab88e9af7a35ebcdd0fc87df97f4b13e908552a
Author: Ilia Mirkin <imirkin@alum.mit.edu>
Date:   Sat Mar 4 13:52:48 2017 -0500

    st/mesa: set result writemask based on ir type
    
    This prevents textureQueryLevels, which maps as LODQ, from ending up
    with a xyzw writemask, which is illegal.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100061
    Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
    Cc: mesa-stable@lists.freedesktop.org
    Reviewed-by: Marek Olšák <marek.olsak@amd.com>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.