[Piglit] [PATCH] [v3] Add test case of render FBO with point coordinate.
Yuanhan Liu
yuanhan.liu at linux.intel.com
Sun Feb 12 18:23:00 PST 2012
On Mon, Feb 13, 2012 at 01:42:46AM +0000, Zhao, Jian J wrote:
> > -----Original Message-----
> > From: Yuanhan Liu [mailto:yuanhan.liu at linux.intel.com]
> > Sent: Thursday, February 09, 2012 5:55 PM
> > To: Zhao, Jian J
> > Cc: piglit at lists.freedesktop.org
> > Subject: Re: [Piglit] [PATCH] [v3] Add test case of render FBO with point
> > coordinate.
> >
> > On Thu, Feb 09, 2012 at 05:52:15PM +0800, Yuanhan Liu wrote:
> > > On Thu, Feb 09, 2012 at 03:51:57PM +0800, Jian Zhao wrote:
> > > > Add test case of rendering with point coordinate, it should work
> > > > with direct rendering, rendering with FBO.
> > > >
> > > > As the es spec 2.0.25 says:
> > > > "the gl-PointCoord fragment shader input defines a per-fragment
> > > > coordinate space (s; t) where s varies from 0 to 1 across the point
> > > > horizontally left-to-right, and t ranges from 0 to 1 across the
> > > > point vertically top-to-bottom."
> > > >
> > > > v2: To simplify the case, set the point size in the program instead
> > > > of the shader. (per Yuanhan's suggestion)
> > > >
> > > > v3: Put the case in the fbo directory, move the FBO setup code into
> > > > piglit_init and will not draw it to the screen when run with '-auto'
> > > > option. (per Ian's suggestion)
> > > >
> > > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44613
> > > > Signed-off-by: Jian Zhao <jian.j.zhao at intel.com>
> > > > ---
[snip]...
> > Reviewed-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
>
> Hi Yuanhan,
> Thanks for your review. If there is no objections here, could you please help me push it upstream? Thanks.
Sure. But I would like to postpone one day, so that if someone has an
objection or comments or Reviewed-by, please drop here today ;)
Thanks,
Yuanhan Liu
>
>
> Best regards
> zhaojian
>
> > >
> > > Besides that, looks good to me, and:
> > >
> > > Reviewed-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>
> > >
> > >
> > > Thanks,
> > > Yuanhan Liu
> > > > + }
> > > > +
> > > > +
> > > > + pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
> > > > +
> > > > + return pass ? PIGLIT_PASS : PIGLIT_FAIL; }
> > > > +
> > > > +void
> > > > +piglit_init(int argc, char **argv)
> > > > +{
> > > > + GLuint vs, fs;
> > > > + int PointSize = 64;
> > > > +
> > > > + piglit_require_extension("GL_ARB_point_sprite");
> > > > + piglit_require_extension("GL_ARB_framebuffer_object");
> > > > +
> > > > + glEnable(GL_POINT_SPRITE_ARB);
> > > > + glPointSize(PointSize);
> > > > +
> > > > + piglit_require_vertex_shader();
> > > > + piglit_require_fragment_shader();
> > > > +
> > > > + fs = piglit_compile_shader_text(GL_FRAGMENT_SHADER, fs_text);
> > > > + vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vs_text);
> > > > + prog = piglit_link_simple_program(vs, fs);
> > > > +
> > > > + piglit_UseProgram(prog);
> > > > +
> > > > + glGenRenderbuffers(1, &rb);
> > > > + glBindRenderbuffer(GL_RENDERBUFFER, rb);
> > > > + glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA, 100, 100);
> > > > +
> > > > + glGenFramebuffers(1, &fb);
> > > > + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb);
> > > > + glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER,
> > GL_COLOR_ATTACHMENT0,
> > > > + GL_RENDERBUFFER, rb);
> > > > +}
> > > > --
> > > > 1.7.0.1
> > > _______________________________________________
> > > Piglit mailing list
> > > Piglit at lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/piglit
More information about the Piglit
mailing list