Bug 93560 - opt_combine_constants failing fabsf(reg->f) == table.imm[i].val assertion
Summary: opt_combine_constants failing fabsf(reg->f) == table.imm[i].val assertion
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Matt Turner
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-02 12:54 UTC by Kenneth Graunke
Modified: 2016-01-13 18:39 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Graunke 2016-01-02 12:54:23 UTC
$ shader_runner shaders/closed/UnrealEngine4/PlatformerGame/232.shader_test -auto

shader_runner: brw_fs_combine_constants.cpp:302: bool fs_visitor::opt_combine_constants(): Assertion `fabsf(reg->f) == table.imm[i].val' failed.

It looks like the value is some kind of NaN:

(gdb) p reg->f
$1 = -nan(0x400000)
(gdb) p table.imm[i].val
$2 = nan(0x400000)
Comment 1 Matt Turner 2016-01-11 17:33:11 UTC
I don't know what to say. The shader contains

   vec3((0.0/0.0),(0.0/0.0),(0.0/0.0))

We can change the assert to

   assert(isnan(reg->f) || fabsf(reg->f) == table.imm[i].val);

but I can't believe this is what they intended to do -- it's used directly in the expression that calculates the color output.
Comment 2 Kenneth Graunke 2016-01-11 19:24:06 UTC
Yeah, I can't imagine that's what they want to do either.  That change sounds good, though.
Comment 3 Matt Turner 2016-01-13 18:39:22 UTC
Fixed by:

    i965/fs: Skip assertion on NaN.
    
    A shader in Unreal4 uses the result of divide by zero in its color
    output, producing NaN and triggering this assertion since NaN is not
    equal to itself.


bug/show.html.tmpl processed on Mar 25, 2017 at 07:37:54.
(provided by the Example extension).