[Piglit] [PATCH 03/37] glean/tfragprog1: port ADD tests to shader_runner

Dylan Baker dylan at pnwbakers.com
Fri May 20 00:35:02 UTC 2016


Quoting Pohjolainen, Topi (2016-05-19 12:36:08)
> On Fri, May 06, 2016 at 01:40:15PM -0700, Dylan Baker wrote:
> > Quoting Pohjolainen, Topi (2016-05-04 10:25:31)
> > [sni[
> > > Okay, I don't how I mis-read the original tests so badly - CLAMP01 is the part
> > > that defines the expected value. Anyway, if we want ADD_SAT to kick in, we need
> > > to change the input so that the result > 1.
> > > You have tried to define the inputs in such a way that yields all green in
> > > succees case. This is how most tests are setup. However, there are also tests
> > > that use other combinations and it might be justified here - otherwise we have
> > > just easy values of zero in all other channels other than green. If we
> > > wanted to keep strictly to the original, we would write:
> > > 
> > > fragment program]
> > > ARBfp1.0
> > > PARAM p = program.local[0];
> > > TEMP s;
> > > ADD s, p, p;
> > > ADD_SAT result.color, p, s;
> > > END
> > > 
> > > [test]
> > > clear color 0.5 0.5 0.5 0.5
> > > clear
> > > 
> > > parameter local_fp 0 (0.5, 0.25, 1.0, 0.5)
> > > draw rect -1 -1 2 2
> > > probe all rgba 1.0 0.75 1.0 1.0
> > > 
> > > 
> > > ------------
> > > Original had:
> > > 
> > > #define PARAM1 { 0.5, 0.25, 1.0, 0.5 }
> > > static const GLfloat Param1[4] = PARAM1;
> > 
> > Right, but that's not strictly true either because the original defines
> > a value for result.color. I have a v2 of this patch I'll send that
> > covers the "x < -1", "-1 < x < 0", "1 > x > 0", and the "x > 1" case.
> 
> The original was:
> 
>                "ADD with saturation",
>                 "!!ARBfp1.0\n"
>                 "PARAM p = program.local[1]; \n"
>                 "TEMP t; \n"
>                 "ADD t, p, p; \n"
>                 "ADD_SAT result.color, t, p; \n"
>                 "END \n",
>                 { CLAMP01(Param1[0] + Param1[0] + Param1[0]),
>                   CLAMP01(Param1[1] + Param1[1] + Param1[1]),
>                   CLAMP01(Param1[2] + Param1[2] + Param1[2]),
>                   CLAMP01(Param1[3] + Param1[3] + Param1[3]),
>                 },
>                 DONT_CARE_Z
> 
> to me the one I defined looks pretty identical. What do you mean by
> "the original defines a value for result.color"?

In the C code that runs before each arb program, glColor is called,
which sets frag.color, which for some reason I though that t was set in
terms of frag.color. But I guess I was just not all there at the time.

Still, does this new version look close enough to the original?

Dylan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20160519/ee886770/attachment.sig>


More information about the Piglit mailing list