[Mesa-dev] [PATCH] glsl: Optimize certain if-statements to just casts from the condition
Ian Romanick
idr at freedesktop.org
Thu Jan 15 19:52:31 PST 2015
On 01/16/2015 04:25 PM, Matt Turner wrote:
> On Thu, Jan 15, 2015 at 6:46 PM, Ian Romanick <idr at freedesktop.org> wrote:
>> On 01/16/2015 08:15 AM, Matt Turner wrote:
>>> From: Ian Romanick <ian.d.romanick at intel.com>
>>>
>>> Some shaders end up with code that looks something like:
>>>
>>> if (some_condition)
>>> result = 1.0;
>>> else
>>> result = 0.0;
>>>
>>> This pass converts those if-statements to
>>>
>>> result = float(some_condition);
>>>
>>> total instructions in shared programs: 5934568 -> 5921818 (-0.21%)
>>> instructions in affected programs: 723433 -> 710683 (-1.76%)
>>> GAINED: 26
>>> LOST: 7
>>
>> I was getting really different results here... on my more recent version
>> (that should produce the same IR), I was getting basically the reverse
>> lost / gained. The other results were about the same.
>>
>> I updated both Mesa and shader-db, and I'm not able to do a full
>> shader-db run now. At semi-arbitrary points in the run I get
>>
>> Exception: Only shader 0 found.
>> shaders/closed/unreal4/sun-temple/180.shader_test
>
> You need commit f0aec4ee1e3 to avoid an assertion failure.
It looks like
3167a80bb1119616b70fbbcf2661d3fb511a6034 is the first bad commit
commit 3167a80bb1119616b70fbbcf2661d3fb511a6034
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Tue Jan 13 14:56:54 2015 -0800
i965: Fix "vertex" vs. "geometry" and "VS" vs. "GS" in debug output.
We were happily printing "Native code for unnamed vertex shader" and
"VS vec4" program for geometry shaders in our INTEL_DEBUG=gs output,
as well as the KHR_debug output used by shader-db.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
broke shaders/closed/xcom-enemy-unknown/26.shader_test:
AssertionError: File: shaders/closed/xcom-enemy-unknown/26.shader_test
does not have any shaders
Looking that the preceding output from run.py, it looks like no vertex
shaders are counted, and xcom-enemy-unknown/26.shader_test only has a
vertex shader. I should have a patch soon... where should I send it?
>> If I run that shader_test by hand, I get multiple shader emitted. I'm
>> using the older run.py... is it possible that's broken?
>
> It's been working for me in occasional usage to generate *.out files.
More information about the mesa-dev
mailing list