[Piglit] [PATCH 1/2] shader_runner: Add support for "polygon mode"
Ilia Mirkin
imirkin at alum.mit.edu
Thu Mar 23 16:49:08 UTC 2017
On Thu, Mar 23, 2017 at 11:46 AM, Lyude <lyude at redhat.com> wrote:
> This adds support for the "polygon mode" command in shader_runner, which
> allows us to change the current GL_POLYGON_MODE at runtime for drawing
> the front and/or back of prims using glPolygonMode().
>
> Signed-off-by: Lyude <lyude at redhat.com>
> ---
> tests/shaders/shader_runner.c | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index b487e8a..c57e457 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -3335,7 +3335,21 @@ piglit_display(void)
> expected))
> result = PIGLIT_FAIL;
>
> - } else if (parse_str(line, "probe all rgba ", &rest)) {
> + } else if (parse_str(rest, "polygon mode ", &rest)) {
The other line you replaced does parse_str(line). Should this be line
as well, or is the other parse_str wrong, or is there a legit reason
for the difference?
> + GLenum face, mode;
> +
> + REQUIRE(parse_enum_gl(rest, &face, &rest) &&
> + parse_enum_gl(rest, &mode, &rest),
> + "Polygon mode command not understood at %s\n",
> + rest);
> +
> + glPolygonMode(face, mode);
> +
> + if (!piglit_check_gl_error(GL_NO_ERROR)) {
> + fprintf(stderr, "glPolygonMode error\n");
> + piglit_report_result(PIGLIT_FAIL);
I think you're meant to do result = PIGLIT_FAIL so that execution can
go on normally (and there's a mode where a single shader_runner
process executes a ton of tests). Also that fprintf kinda sucks - it
won't tell you which of the 75 polygon modes fail. I think there's a
way now to indicate where you are.
Which reminds me - for the multi-test case, there might be a reset
function somewhere - not sure. If there is, you probably have to reset
the polygon mode there too.
> + }
> + } else if (parse_str(line, "probe all rgba ", &rest)) {
> parse_floats(rest, c, 4, NULL);
> if (result != PIGLIT_FAIL &&
> !piglit_probe_rect_rgba(0, 0, read_width,
> --
> 2.9.3
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit
More information about the Piglit
mailing list