From patchwork Sat Oct 17 04:33:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: 'Timothy Arceri' via Patchwork Forward X-Patchwork-Id: 55151 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lf0-f71.google.com (mail-lf0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 6467A22FFA for ; Sat, 17 Oct 2015 04:33:44 +0000 (UTC) Received: by lfbe131 with SMTP id e131sf24029341lfb.3 for ; Fri, 16 Oct 2015 21:33:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:reply-to; bh=JY2mGw0i0fqmgBgV9/aihXKescCF/FUzZ869w6B+g7E=; b=iwDWCXxVf4+d+5s03DL62uQ3ATxwkP3uTjDq92b5mH53LwOlwt9TxFUE7vWl3PdIkk UIDqAnK8HmNhidjPPajtseAsxFM7cnr0Z4aQYbAC1bNaXAl+bbGcgZ1quejrnAvEpwTA RTM2Nf4yGzJbpvTfHaz821bMy1sHHIp04+9W+IG0GBQw0miuiRR9E28y7JP7FzwZsrly /X3LMmpL5JnXMG5upK/D1+GpYb8Y1RoCYO6n3eZpQAGvPGteOn4Iiqx6sIhb3BTPzsOh lnH35ocU4UQGDO6/dn7TQBfNSNGtYTfjlCygKNRzS9GKESc/W7A5Cw3uriGM6Jv+esxs 4bSA== X-Gm-Message-State: ALoCoQkjalMniXyw1ZmdGA6mu/+iPCCpC3pEgWENPaZEK1Pa5LsaMjaW7+RgtPg+PnFjnrCDhvK2 X-Received: by 10.112.55.69 with SMTP id q5mr4535263lbp.24.1445056422940; Fri, 16 Oct 2015 21:33:42 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.15.106 with SMTP id e103ls178622lfi.14.gmail; Fri, 16 Oct 2015 21:33:42 -0700 (PDT) X-Received: by 10.112.12.3 with SMTP id u3mr7803246lbb.30.1445056422682; Fri, 16 Oct 2015 21:33:42 -0700 (PDT) Received: from mail-lf0-x231.google.com (mail-lf0-x231.google.com. [2a00:1450:4010:c07::231]) by mx.google.com with ESMTPS id x17si11836748lbg.12.2015.10.16.21.33.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Oct 2015 21:33:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c07::231 as permitted sender) client-ip=2a00:1450:4010:c07::231; Received: by lffy185 with SMTP id y185so87324131lff.2 for ; Fri, 16 Oct 2015 21:33:42 -0700 (PDT) X-Received: by 10.25.20.24 with SMTP id k24mr5920299lfi.117.1445056422525; Fri, 16 Oct 2015 21:33:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp279142lbq; Fri, 16 Oct 2015 21:33:40 -0700 (PDT) X-Received: by 10.67.22.34 with SMTP id hp2mr20535027pad.92.1445056420361; Fri, 16 Oct 2015 21:33:40 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id py5si34164209pbb.88.2015.10.16.21.33.40; Fri, 16 Oct 2015 21:33:40 -0700 (PDT) Received-SPF: pass (google.com: domain of piglit-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9AF226E1DA; Fri, 16 Oct 2015 21:33:39 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm13-vm6.bullet.mail.gq1.yahoo.com (nm13-vm6.bullet.mail.gq1.yahoo.com [98.136.218.237]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9BA1F6E1DA for ; Fri, 16 Oct 2015 21:33:37 -0700 (PDT) Received: from [98.137.12.174] by nm13.bullet.mail.gq1.yahoo.com with NNFMP; 17 Oct 2015 04:33:36 -0000 Received: from [208.71.42.201] by tm13.bullet.mail.gq1.yahoo.com with NNFMP; 17 Oct 2015 04:33:36 -0000 Received: from [127.0.0.1] by smtp212.mail.gq1.yahoo.com with NNFMP; 17 Oct 2015 04:33:36 -0000 X-Yahoo-Newman-Id: 376347.72576.bm@smtp212.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: c6TF3fkVM1lby1arx9nEHEeghcCaHIIP2d6hAYSEYFch4ce ocJmbqIUdNU1roUOrOBAaVYdN9gUjR1jmk6UzZxuB7m_mh007Xo02DJ_AFnN 0VtIVDCnCtNIdWQLmGXD_8ada274R9a2.KOesPlXKr69R3JCzNk0pEcz5b0l 8bTcMyiDBQXF_FcSxh06FxTIFgLXRzXege_s8.3OFRPuZwlOrKwyKuxYAfU5 gljhXa8euQ2AaAo96.XGQJThmO0odFfOnuiCb60GDrjLX8fpZIFU1zAbRYW8 rpGJlO4wmbrR9Dzu2s6675tWHt9czvI1xHLX4arMx9azd9e6eP2l.yUV9cWT sEDfkwOsDMLjyBliGxXM6FpKFxJXigmIKBrXHptxfPleknIdmJn47MHVeDio qtxe92MKtaLPaXrgawuyCTXwiZClko4Xp.1b2NpwdeOD_cmeo7wS.QwRB99N X_rfdZtZ9t_XWjs4Owvc_phu8tZtu7g7UFKq.gGRJg_syPBxT8hhtOiU_V6c yeRYI8YfMwsV.E6O.hHwbWZuuiqRcchtFFf8- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Sat, 17 Oct 2015 15:33:24 +1100 Message-Id: <1445056404-7734-1-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.4.3 Subject: [Piglit] [PATCH] arb_gpu_shader5: update stream test with interface block subtest X-BeenThere: piglit@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: piglit-bounces@lists.freedesktop.org Sender: "Piglit" X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c07::231 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@yahoo.com.au; dmarc=fail (p=NONE dis=NONE) header.from=yahoo.com.au Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 X-Original-From: Timothy Arceri Reply-To: Timothy Arceri This tests a bug with Mesa named inteface instances. Test results: Nvidia GeForce 840M - NVIDIA 346.47: pass Mesa 11.1-dev - fail --- tests/spec/arb_gpu_shader5/execution/xfb-streams.c | 105 +++++++++++++++++---- 1 file changed, 88 insertions(+), 17 deletions(-) diff --git a/tests/spec/arb_gpu_shader5/execution/xfb-streams.c b/tests/spec/arb_gpu_shader5/execution/xfb-streams.c index eb14856..0957587 100644 --- a/tests/spec/arb_gpu_shader5/execution/xfb-streams.c +++ b/tests/spec/arb_gpu_shader5/execution/xfb-streams.c @@ -81,6 +81,46 @@ static const char gs_tmpl[] = " EndStreamPrimitive(1);\n" "}"; +static const char gs_tmpl_blocks[] = + "#version 150\n" + "#extension GL_ARB_gpu_shader5 : enable\n" + "layout(points, invocations = %d) in;\n" + "layout(points, max_vertices = 4) out;\n" + "out float stream0_0_out;\n" + "layout(stream = 1) out Block1 {\n" + " vec2 stream1_0_out;\n" + " vec3 stream1_1_out;\n" + "};\n" + "layout(stream = 2) out Block2 {\n" + " float stream2_0_out;\n" + " vec4 stream2_1_out;\n" + "} blockWithName;\n" + "layout(stream = 3) out vec3 stream3_0_out;\n" + "void main() {\n" + " gl_Position = gl_in[0].gl_Position;\n" + + " stream0_0_out = 1.0 + gl_InvocationID;\n" + " EmitVertex();\n" + " EndPrimitive();\n" + + " stream3_0_out = vec3(12.0 + gl_InvocationID, 13.0 + gl_InvocationID,\n" + " 14.0 + gl_InvocationID);\n" + " EmitStreamVertex(3);\n" + " EndStreamPrimitive(3);\n" + + " blockWithName.stream2_0_out = 7.0 + gl_InvocationID;\n" + " blockWithName.stream2_1_out = vec4(8.0 + gl_InvocationID, 9.0 + gl_InvocationID,\n" + " 10.0 + gl_InvocationID, 11.0 + gl_InvocationID);\n" + " EmitStreamVertex(2);\n" + " EndStreamPrimitive(2);\n" + + " stream1_0_out = vec2(2.0 + gl_InvocationID, 3.0 + gl_InvocationID);\n" + " stream1_1_out = vec3(4.0 + gl_InvocationID, 5.0 + gl_InvocationID,\n" + " 6.0 + gl_InvocationID);\n" + " EmitStreamVertex(1);\n" + " EndStreamPrimitive(1);\n" + "}"; + const char *stream_names[] = { "first", "second", "third", "forth" }; int stream_float_counts[] = { 1, 5, 5, 3 }; @@ -93,29 +133,39 @@ static const char *varyings[] = { "stream3_0_out" }; -static void -build_and_use_program(GLint gs_invocation_n) +static const char *varyings_blocks[] = { + "stream0_0_out", "gl_NextBuffer", + "stream1_0_out", "stream1_1_out", "gl_NextBuffer", + "Block2.stream2_0_out", "Block2.stream2_1_out", + "gl_NextBuffer", "stream3_0_out" +}; + +static bool +build_and_use_program(GLint gs_invocation_n, const char *gs_template, + const char **gs_varyings, int array_size) { GLuint prog; char *gs_text; - asprintf(&gs_text, gs_tmpl, gs_invocation_n); + asprintf(&gs_text, gs_template, gs_invocation_n); prog = piglit_build_simple_program_multiple_shaders( GL_VERTEX_SHADER, vs_pass_thru_text, GL_GEOMETRY_SHADER, gs_text, 0); free(gs_text); - glTransformFeedbackVaryings(prog, ARRAY_SIZE(varyings), varyings, + glTransformFeedbackVaryings(prog, array_size, gs_varyings, GL_INTERLEAVED_ATTRIBS); glLinkProgram(prog); if (!piglit_link_check_status(prog)) - piglit_report_result(PIGLIT_FAIL); + return false; if (!piglit_check_gl_error(GL_NO_ERROR)) - piglit_report_result(PIGLIT_FAIL); + return false; glUseProgram(prog); + + return true; } static bool @@ -136,13 +186,13 @@ probe_buffers(const GLuint *xfb, const GLuint *queries, unsigned primitive_n) if (query_result != primitive_n) { printf("Expected %u primitives generated, got %u\n", primitive_n, query_result); - piglit_report_result(PIGLIT_FAIL); + return false; } glGetQueryObjectuiv(queries[STREAMS+i], GL_QUERY_RESULT, &query_result); if (query_result != primitive_n) { printf("Expected %u TF primitives written, got %u\n", primitive_n, query_result); - piglit_report_result(PIGLIT_FAIL); + return false; } } @@ -185,9 +235,9 @@ probe_buffers(const GLuint *xfb, const GLuint *queries, unsigned primitive_n) return pass; } -void -piglit_init(int argc, char **argv) -{ +static bool +run_subtest(const char *gs_template, const char **gs_varyings, + int array_size) { bool pass; unsigned primitive_n; GLint gs_invocation_n; @@ -201,17 +251,20 @@ piglit_init(int argc, char **argv) glGetIntegerv(GL_MAX_GEOMETRY_SHADER_INVOCATIONS, &gs_invocation_n); if (!piglit_check_gl_error(GL_NO_ERROR)) - piglit_report_result(PIGLIT_FAIL); + return false; if (gs_invocation_n <= 0) { printf("Maximum amount of geometry shader invocations " "needs to be positive (%u).\n", gs_invocation_n); - piglit_report_result(PIGLIT_FAIL); + return false; } primitive_n = gs_invocation_n; - build_and_use_program(gs_invocation_n); + if (!build_and_use_program(gs_invocation_n, gs_template, gs_varyings, + array_size)) { + return false; + } /* Set up the transform feedback buffers. */ glGenBuffers(ARRAY_SIZE(xfb), xfb); @@ -227,7 +280,7 @@ piglit_init(int argc, char **argv) glEnable(GL_RASTERIZER_DISCARD); if (!piglit_check_gl_error(GL_NO_ERROR)) - piglit_report_result(PIGLIT_FAIL); + return false; glGenQueries(ARRAY_SIZE(queries), queries); for (i = 0; i < STREAMS; i++) { @@ -251,14 +304,32 @@ piglit_init(int argc, char **argv) glDeleteVertexArrays(1, &vao); if (!piglit_check_gl_error(GL_NO_ERROR)) - piglit_report_result(PIGLIT_FAIL); + return false; pass = probe_buffers(xfb, queries, primitive_n); glDeleteBuffers(ARRAY_SIZE(xfb), xfb); glDeleteQueries(ARRAY_SIZE(queries), queries); - piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL); + return pass; +} + +void +piglit_init(int argc, char **argv) +{ + bool test1; + bool test2; + + test1 = run_subtest(gs_tmpl, varyings, ARRAY_SIZE(varyings)); + piglit_report_subtest_result(test1 ? PIGLIT_PASS : PIGLIT_FAIL, + "arb_gpu_shader5-xfb-streams"); + + test2 = run_subtest(gs_tmpl_blocks, varyings_blocks, + ARRAY_SIZE(varyings_blocks)); + piglit_report_subtest_result(test2 ? PIGLIT_PASS : PIGLIT_FAIL, + "arb_gpu_shader5-xfb-streams-blocks"); + + piglit_report_result(test1 && test2 ? PIGLIT_PASS : PIGLIT_FAIL); } enum piglit_result