[Piglit] [PATCH] Porting basic GL rendering paths test to piglit
Juliet Fru
julietfru at gmail.com
Fri Aug 28 01:43:40 PDT 2015
Hello Brian,
The subject line should probably be something like "port Glean paths test
> to piglit".
>
>
> I will add the subject line to the next patch.
>> + SCISSOR,
>> + STENCIL,
>> + STIPPLE,
>> + TEXTURE,
>> + ZZZ /* end-of-list token */
>> +};
>> +
>>
>> +
>> +enum piglit_result
>> +piglit_display(void)
>> +{
>> + bool pass = true;
>> + enum path p, paths[10];
>> + int i, num_paths = 0;
>> +
>> + /* draw 10x10 pixel quads */
>> + glViewport(0, 0, 10, 10);
>> +
>> + glDisable(GL_DITHER);
>> +
>> + /* Build the list of paths to exercise */
>> + for (p = ALPHA; p != ZZZ; p = (enum path) (p + 1)) {
>> + paths[num_paths++] = p;
>> + }
>> +
>> + /* test always-pass paths */
>> + for (i = 0; i < num_paths; i++) {
>> + glClear(GL_COLOR_BUFFER_BIT);
>> +
>> + set_path_state(paths[i], ALWAYS_PASS);
>> +
>> + /* draw polygon */
>> + piglit_draw_rect(-1,-1,1,1);
>>
>
> I think you want width=2, height=2 to fill the viewport. Also, we usually
> put a space after commas.
>
Could you please give me the sample piglit_draw_rect() call here.
>
>
> +
>> + set_path_state(paths[i], DISABLE);
>> +
>> + /* test buffer */
>> + GLfloat pixel[3];
>> + glReadPixels(4, 4, 1, 1, GL_RGB, GL_FLOAT, pixel);
>> + if (pixel[0] != 1.0 || pixel[1] != 1.0 || pixel[2] !=
>> 1.0) {
>>
>
> You could use piglit_probe_rect_rgb() here.
>
I was a bit confused with the piglit_probe_rect_rgb() use here. It seems
like I have to create an array to place the expected values to be probed
when I pass the argument arguments for the piglit_draw_rect(). I will
appreciate a simple float array I could pass as the last argument for
piglit_probe_rect_rgb.
> Looks like you still have some space indentation, rather than tabs.
>
I initially used piglit_probe_rect_rgb, but was a bit confused. So I
reverted to the original, it might have introduced the whitespaces.
Thanks,
Juliet
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20150828/2a0bcd06/attachment.html>
More information about the Piglit
mailing list