[Piglit] [PATCH] Test case on rendering with only fragment shader but no vertex shader.

Zhao, Jian J jian.j.zhao at intel.com
Thu Nov 3 02:46:09 PDT 2011


From: Paul Berry [mailto:stereotype441 at gmail.com]
Sent: Wednesday, November 02, 2011 11:12 PM
To: Zhao, Jian J
Cc: piglit at lists.freedesktop.org
Subject: Re: [Piglit] [PATCH] Test case on rendering with only fragment shader but no vertex shader.

On 2 November 2011 02:07, Zhao, Jian J <jian.j.zhao at intel.com<mailto:jian.j.zhao at intel.com>> wrote:
Hi Paul,
  Thanks for your suggestion.  My answer is inline.

Best regards
ZhaoJian

From: Paul Berry [mailto:stereotype441 at gmail.com<mailto:stereotype441 at gmail.com>]
Sent: Wednesday, November 02, 2011 12:20 AM
To: Zhao, Jian J
Cc: piglit at lists.freedesktop.org<mailto:piglit at lists.freedesktop.org>
Subject: Re: [Piglit] [PATCH] Test case on rendering with only fragment shader but no vertex shader.

Before I get to specific comments, are you familiar with Piglit's "shader runner" framework (look at any of the Piglit files that end in ".shader_test").  It seems like this test could be rewritten as a shader runner test--that would make it shorter and more readable, and save a compilation step.

It's a good idea. But unfortunately I can't reproduce it with shader_runner, I have a look and find it is because it uses glDrawArraysInstancedARB instead of glDrawArrays or just simple glBegin and glEnd. I don't know what is glDrawArraysInstancedARB. What's it difference from glDrawArrays? So I just updated my original patch file.


You're right that it doesn't make sense to use glDrawArraysInstancedARB--that function is only available if your GL implementation supports the ARB_draw_instanced extension, or GL 3.1, and there's no good reason to make your test dependent on those.  (If you're curious, you can find documentation for the extension in http://www.opengl.org/registry/specs/ARB/draw_instanced.txt.  When the extension was folded into GL 3.1, it was renamed to glDrawArraysInstanced).

But shader_runner only tries to use glDrawArraysInstancedARB if your shader_test file contains the command "draw instanced rect".  You should be able to do the testing you need by just drawing a simple rectangle using the "draw rect" command, which works on GL 2.1.

For an example of how this sort of test is typically written using shader_runner, see for instance tests/spec/glsl-1.10/execution/fs-inline-notequal.shader_test.

Thanks very much for your patience with this--I really want to avoid having to add more compiled C programs to piglit if at all possible.


Hi Paul,
  Thanks very much for your explanation and help. And as Ian pointed out, the error is caused by some mistake in my test case.

Best regards
ZhaoJian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20111103/3897333b/attachment.htm>


More information about the Piglit mailing list