Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1961)

Issue 4992047: Add/remove more functions to use shims. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 11 months ago by zmo
Modified:
13 years, 11 months ago
Reviewers:
kbr1, kbr, dgkoch
CC:
angleproject-review_googlegroups.com, bjacob
Base URL:
http://angleproject.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Add/remove more functions to use shims. Remove normalize and add cos instead to avoid a crash in Mac with ATI cards (angle bug 193, 202). Also add atan and mod as it's also buggy on Mac/Win with NVIDIA cards. Also, trying to minimize emulated functions by adding masks for fragment/vertex shaders. ANGLEBUG=196 Committed: http://code.google.com/p/angleproject/source/detail?r=748

Patch Set 1 #

Total comments: 1

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 8

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+334 lines, -72 lines) Patch
M src/common/version.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/compiler/BuiltInFunctionEmulator.h View 1 6 chunks +44 lines, -17 lines 0 comments Download
M src/compiler/BuiltInFunctionEmulator.cpp View 1 2 3 5 chunks +246 lines, -28 lines 0 comments Download
M src/compiler/Compiler.cpp View 1 1 chunk +2 lines, -1 line 0 comments Download
M src/compiler/OutputGLSLBase.cpp View 1 2 chunks +28 lines, -22 lines 0 comments Download
M src/compiler/intermediate.h View 1 2 3 4 chunks +13 lines, -3 lines 0 comments Download

Messages

Total messages: 8
zmo
Please review.
13 years, 11 months ago (2011-09-09 21:21:58 UTC) #1
zmo
On 2011/09/09 21:21:58, zmo wrote: > Please review. Wait, there is a bug. Let me ...
13 years, 11 months ago (2011-09-09 21:41:37 UTC) #2
dgkoch
http://codereview.appspot.com/4992047/diff/1/src/common/version.h File src/common/version.h (right): http://codereview.appspot.com/4992047/diff/1/src/common/version.h#newcode4 src/common/version.h:4: #define BUILD_REVISION 746 748
13 years, 11 months ago (2011-09-09 23:25:43 UTC) #3
zmo
Revised. This one should work. Please review.
13 years, 11 months ago (2011-09-10 01:22:00 UTC) #4
kbr1
LGTM It's scary to see how many driver bugs are being uncovered here. We definitely ...
13 years, 11 months ago (2011-09-10 22:10:27 UTC) #5
zmo
http://codereview.appspot.com/4992047/diff/8001/src/compiler/BuiltInFunctionEmulator.cpp File src/compiler/BuiltInFunctionEmulator.cpp (right): http://codereview.appspot.com/4992047/diff/8001/src/compiler/BuiltInFunctionEmulator.cpp#newcode19 src/compiler/BuiltInFunctionEmulator.cpp:19: "float webgl_atan_emu(float y, float x) { float rt = ...
13 years, 11 months ago (2011-09-12 18:22:43 UTC) #6
zmo
What's scarier is, we haven't tested them all yet. Gregg only added tests for a ...
13 years, 11 months ago (2011-09-12 18:26:55 UTC) #7
kbr1
13 years, 11 months ago (2011-09-12 18:34:31 UTC) #8
On 2011/09/12 18:22:43, zmo wrote:
>
http://codereview.appspot.com/4992047/diff/8001/src/compiler/BuiltInFunctionE...
> File src/compiler/BuiltInFunctionEmulator.cpp (right):
> 
>
http://codereview.appspot.com/4992047/diff/8001/src/compiler/BuiltInFunctionE...
> src/compiler/BuiltInFunctionEmulator.cpp:19: "float webgl_atan_emu(float y,
> float x) { float rt = atan(y, x); if (rt > 2.0) rt = 0.0;  return rt; }",
> On 2011/09/10 22:10:27, kbr1 wrote:
> > Did you try any other tricks not involving conditionals to fool the
compiler?
> > For example, would the following work?
> > 
> > float rt = atan(y, x);
> > return clamp(rt, 0.0, 2.0);
> 
> I tried * 1.0 or + 0.0, and they all work.  The reason I choose a conditional
> cause that will never be true is that 1) it's harder to be optimized out (by
> current or future compilers) 2) hope it's really cheap.

My experience has been that using conditionals in shaders is not cheap. I would
use the simplest possible expression that works around the problem.

>
http://codereview.appspot.com/4992047/diff/8001/src/compiler/BuiltInFunctionE...
> src/compiler/BuiltInFunctionEmulator.cpp:335: // Right now all the emulated
> functions with two parameters, the two
> On 2011/09/10 22:10:27, kbr1 wrote:
> > Small grammatical correction: all -> for all
> 
> Done.
> 
>
http://codereview.appspot.com/4992047/diff/8001/src/compiler/BuiltInFunctionE...
> src/compiler/BuiltInFunctionEmulator.cpp:339: return TFunctionUnknown;
> On 2011/09/10 22:10:27, kbr1 wrote:
> > Also check the nominal size and return early if it happens to be > 4. Or
> ASSERT
> > that it's <= 4.
> 
> Done.
> 
> http://codereview.appspot.com/4992047/diff/8001/src/compiler/intermediate.h
> File src/compiler/intermediate.h (right):
> 
>
http://codereview.appspot.com/4992047/diff/8001/src/compiler/intermediate.h#n...
> src/compiler/intermediate.h:478: bool useEmulatedFunction; // if set to true,
> replace the function call by an emulated one.
> On 2011/09/10 22:10:27, kbr1 wrote:
> > Could you expand the comment a bit? Perhaps "replace the built-in function
> call
> > with an emulated one to work around driver bugs".
> 
> Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b