[Piglit] [PATCH] arb_clear_texture: add a trivial test

Ilia Mirkin imirkin at alum.mit.edu
Fri Mar 7 21:01:26 PST 2014

On Fri, Mar 7, 2014 at 11:26 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> On Fri, Mar 7, 2014 at 8:02 PM, Eric Anholt <eric at anholt.net> wrote:
>> Ilia Mirkin <imirkin at alum.mit.edu> writes:
>>> On Fri, Mar 7, 2014 at 2:38 PM, Eric Anholt <eric at anholt.net> wrote:
>>>> Ilia Mirkin <imirkin at alum.mit.edu> writes:
>>>> Other than that, this is a nice simple test.  We're going to want an
>>>> all-the-formats testcase before we land clear_texture in Mesa, but this
>>>> is a good start.
>>> Absolutely. And testing glClearTexSubImage too (where the visual
>>> representation may become more interesting). And an api-errors style
>>> test. And I want to test various widths/heights, in case e.g. POT
>>> works but NPOT doesn't. I'm thinking that 32 and 33 actually cover
>>> most cases.
>> This all sounds good!
>>> Should I make these into subtests, or is it fine to just have the one
>>> test? Long-term, should this 'simple' test go away entirely in favor
>>> of a all-formats test that does it all?
>> I think there's a lot to be said for having a dead simple sanity test
>> test, along with all the complicated stuff.  When you're first lighting
>> up the extension, having all the other variants in the way obscures the
>> initial debugging.
>> For similar reasons, I lean toward separate test files instead of
>> subtests unless the code sharing is massive.  I'm trying to optimize for
>> me debugging the driver in the future, not me writing the test now.  The
>> bodies of tests don't change much over time, so there's less maintenance
>> burden from code duplication than in most codebases we work on.
> I'm trying to implement the piglit_draw_rect_tex suggestion (based on
> ext_unpack_subimage.c), and am having a lot of trouble with the GL
> basics. Here's the code that I have now:
> program = piglit_build_simple_program(vertex_shader, fragment_shader);
> glUseProgram(program);
> ... do the clears on texture[0] and texture[1] ...
> /* Render both textures to the screen */
> glBindFramebuffer(GL_FRAMEBUFFER, piglit_winsys_fbo);
> glBindTexture(GL_TEXTURE_2D, texture[0]);
> piglit_draw_rect_tex(0, 0, 32, 32, 0, 0, 32, 32);
> glBindTexture(GL_TEXTURE_2D, texture[1]);
> piglit_draw_rect_tex(32, 32, 32, 32, 0, 0, 32, 32);
> This does not work. I'm sure the solution to this problem is quite
> trivial, but I have no idea what to look for. Semi-relatedly, what
> should the split between piglit_init and piglit_display be?

Nevermind, got it all figured out. Turns out that
piglit_present_results() is actually quite important :) I've ended up
with a solution copied from fbo-drawbuffers.c which does not rely on
shaders either. I guess I'll eventually have to go that route (to get
at MS samples), but this is all much simpler for now. v3 should be
coming up soon.


More information about the Piglit mailing list