From patchwork Sat Jun 14 12:36:00 2014 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: 31897 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BF7DC201EF for ; Sat, 14 Jun 2014 12:36:46 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id v10sf6609399pde.11 for ; Sat, 14 Jun 2014 05:36:45 -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:in-reply-to:references:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :mime-version:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:reply-to :content-type:content-transfer-encoding; bh=b6DfX0R1V44VjiHF0AmUjgBE0Am8LUzrD+bhp1dVTM0=; b=UrgajDrEhpglqwWheIyG3daGil31uFW/b40KCHOPKJy8y1+2YIRHZ6ZcbkBKKxzy7+ 5VcCSHRPu+MDoS5UBdqgJAQD56zztESlb+ZtvCLAU+nuzi+6pMmsXyGbx2EnboTDupH0 9nwupeX5HI2anZa0zHV3dgxpohMpkzCwkxT3/4r6MVF/JgqU/KeggpokwzvBJWRIXYlK 2lv603UBMR3ZCZ0jMOl96uxXQn2a7Kz3Bw3FvvCOCoVPLobkF5sVG7AvPlXMxPVniMut rlOqELLVYptSTaQwTIzHYPrHYUW9anpcmniI3tQKXAJX3wnvDfANEgpfNr2x7ZC2sGl7 VmwA== X-Gm-Message-State: ALoCoQnMFHox4xexYsN/CbeEHXFaSSj7Ov7CfpyvwSKatsHrRsw5bP/VvZ0aWUzkQGtvSfYGcQiN X-Received: by 10.66.149.67 with SMTP id ty3mr337153pab.27.1402749405913; Sat, 14 Jun 2014 05:36:45 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.234 with SMTP id a97ls3953767qgf.51.gmail; Sat, 14 Jun 2014 05:36:45 -0700 (PDT) X-Received: by 10.58.29.198 with SMTP id m6mr6691977veh.15.1402749405794; Sat, 14 Jun 2014 05:36:45 -0700 (PDT) Received: from mail-vc0-x231.google.com (mail-vc0-x231.google.com [2607:f8b0:400c:c03::231]) by mx.google.com with ESMTPS id gq6si2322779vdc.65.2014.06.14.05.36.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 14 Jun 2014 05:36:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::231 as permitted sender) client-ip=2607:f8b0:400c:c03::231; Received: by mail-vc0-f177.google.com with SMTP id ij19so3275046vcb.8 for ; Sat, 14 Jun 2014 05:36:45 -0700 (PDT) X-Received: by 10.221.50.70 with SMTP id vd6mr55883vcb.51.1402749405700; Sat, 14 Jun 2014 05:36:45 -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.221.54.6 with SMTP id vs6csp20558vcb; Sat, 14 Jun 2014 05:36:44 -0700 (PDT) X-Received: by 10.66.185.4 with SMTP id ey4mr5148218pac.126.1402749404580; Sat, 14 Jun 2014 05:36:44 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id ce7si7821767pad.113.2014.06.14.05.36.44 for ; Sat, 14 Jun 2014 05:36:44 -0700 (PDT) Received-SPF: none (google.com: piglit-bounces@lists.freedesktop.org does not designate permitted sender hosts) client-ip=131.252.210.177; Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 00BC86E131; Sat, 14 Jun 2014 05:36:44 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm45-vm5.bullet.mail.bf1.yahoo.com (nm45-vm5.bullet.mail.bf1.yahoo.com [216.109.115.76]) by gabe.freedesktop.org (Postfix) with ESMTP id EC14A6E132 for ; Sat, 14 Jun 2014 05:36:42 -0700 (PDT) Received: from [66.196.81.174] by nm45.bullet.mail.bf1.yahoo.com with NNFMP; 14 Jun 2014 12:36:42 -0000 Received: from [68.142.230.73] by tm20.bullet.mail.bf1.yahoo.com with NNFMP; 14 Jun 2014 12:36:42 -0000 Received: from [127.0.0.1] by smtp230.mail.bf1.yahoo.com with NNFMP; 14 Jun 2014 12:36:42 -0000 X-Yahoo-Newman-Id: 237730.78592.bm@smtp230.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: TG9YH7wVM1kg3iXgjy7hKVhIS2uX_OT3IRaVXGq1MtvHxMT pu2UxZa0o5MJYyUFdTv5cXphFr8aT9nZsv8SdTWpBEvI2snaCYbYMoUV8ub3 j3skpKLl1Yi2PyeDiY3D7bEvESqMSWs55ZjgIzNowDzcyFgcq0LM38ppLblW KcVo3r.vQGqpD0f_1ORUGF7U95qFR3ByXzyD1ck7QzlbA6AcxnxVKbX_IuoA TxaVf3bBYm34v4dkTn8hsKGb.TzSReO4svbex_PMICYldY5HU4CZr_Szy.1g tX0X1JGaSQ5aX2XgeGIYFwdIGWUlu2AqPFUpwQ053.gJX8W_EmQ62U6H3vVr SxK9M10UccPh0n68JjT8bZdtu.jpBW6GcRojuhr1LGfs3Q4wawX93KAVpdy4 Y_inmV6KI5alfyh5ia0DXx0BNxbA8RsX14ExkDpFCKEnFU_dcyQj9BRsIdVb fSjzF5Oro9FIr0HhblOKWlfHhK5Qw6apc24SNWVtEQXetIwoK7QuvL6SVaQC Brb2iCiI7A2gipVyfstuyrxca.c8- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU X-Rocket-Received: from localhost.localdomain (t_arceri@60.240.113.240 with plain [98.139.211.125]) by smtp230.mail.bf1.yahoo.com with SMTP; 14 Jun 2014 12:36:42 +0000 UTC From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Sat, 14 Jun 2014 22:36:00 +1000 Message-Id: <1402749361-11643-9-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1402749361-11643-1-git-send-email-t_arceri@yahoo.com.au> References: <1402749361-11643-1-git-send-email-t_arceri@yahoo.com.au> Subject: [Piglit] [PATCH V4 08/11] arb_arrays_of_arrays: redeclaration and subroutine tests X-BeenThere: piglit@lists.freedesktop.org X-Mailman-Version: 2.1.15 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 2607:f8b0:400c:c03::231 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@; 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 Test results are from the following hardware/driver combinations: AMD Radeon HD 6670 - Catalyst 13.251 OpenGL 4.3 Nvidia GeForce 210 - NVIDIA 331.20 OpenGL 3.3 Intel Ivy Bridge - Mesa 10.1(815e064) with ARB_arrays_of_arrays enabled redeclaration-initializer.vert AMD: fail Nvida: pass Intel: pass redeclaration-too-small.vert AMD: pass Nvida: fail (Nvidia only warns for outofbounds) Intel: pass redeclaration-too-small2.vert AMD: pass Nvida: fail (Nvidia only warns for outofbounds) Intel: pass redeclaration.vert AMD: fail Nvida: pass Intel: pass redeclaration2.vert AMD: pass Nvida: pass Intel: pass subroutine.vert AMD: pass Nvida: skip Intel: skip Signed-off-by: Timothy Arceri --- .../compiler/redeclaration-initializer.vert | 31 ++++++++++++++++++ .../compiler/redeclaration-too-small.vert | 29 +++++++++++++++++ .../compiler/redeclaration-too-small2.vert | 23 ++++++++++++++ .../compiler/redeclaration.vert | 29 +++++++++++++++++ .../compiler/redeclaration2.vert | 29 +++++++++++++++++ .../arb_arrays_of_arrays/compiler/subroutine.vert | 37 ++++++++++++++++++++++ 6 files changed, 178 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/redeclaration-initializer.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/redeclaration-too-small.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/redeclaration-too-small2.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/redeclaration.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/redeclaration2.vert create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/subroutine.vert diff --git a/tests/spec/arb_arrays_of_arrays/compiler/redeclaration-initializer.vert b/tests/spec/arb_arrays_of_arrays/compiler/redeclaration-initializer.vert new file mode 100644 index 0000000..8108cd0 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/redeclaration-initializer.vert @@ -0,0 +1,31 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * require_extensions: GL_ARB_arrays_of_arrays + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "It is legal to declare an array without a size and then later + * re-declare the same name as an array of the same type and specify a + * size." + */ +#version 120 +#extension GL_ARB_arrays_of_arrays: enable + +float a_function(float[3][2]); + +void main() +{ + float [][2] an_array; + + an_array[0][1] = 0.0; + an_array[1][1] = 1.0; + an_array[2][0] = 2.0; + + float [][2] an_array = float[][2](float[2](0.0, 1.0), + float[2](0.0, 1.0), + float[2](0.0, 1.0)); + + gl_Position = vec4(a_function(an_array)); +} diff --git a/tests/spec/arb_arrays_of_arrays/compiler/redeclaration-too-small.vert b/tests/spec/arb_arrays_of_arrays/compiler/redeclaration-too-small.vert new file mode 100644 index 0000000..deebdb3 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/redeclaration-too-small.vert @@ -0,0 +1,29 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * require_extensions: GL_ARB_arrays_of_arrays + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "It is legal to declare an array without a size and then later + * re-declare the same name as an array of the same type and specify a + * size." + */ +#version 120 +#extension GL_ARB_arrays_of_arrays: enable + +float a_function(float[2][3]); + +void main() +{ + float [][3] an_array; + + an_array[0][2] = 0.0; + an_array[1][2] = 1.0; + an_array[2][2] = 2.0; + + float [2][3] an_array; + + gl_Position = vec4(a_function(an_array)); +} diff --git a/tests/spec/arb_arrays_of_arrays/compiler/redeclaration-too-small2.vert b/tests/spec/arb_arrays_of_arrays/compiler/redeclaration-too-small2.vert new file mode 100644 index 0000000..14a78a2 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/redeclaration-too-small2.vert @@ -0,0 +1,23 @@ +/* [config] + * expect_result: fail + * glsl_version: 1.20 + * require_extensions: GL_ARB_arrays_of_arrays + * [end config] + */ +#version 120 +#extension GL_ARB_arrays_of_arrays: enable + +float x[][2]; + +void foo() { x[3][1] = 2.; } + +// The left most array must be at least 4 elements because of +// the previous access to x[3][1]. +float x[][2] = float[][2](float[2](1., 2.), + float[2](1., 2.)); + +void main() +{ + foo(); + gl_Position = vec4(x[0][0]); +} diff --git a/tests/spec/arb_arrays_of_arrays/compiler/redeclaration.vert b/tests/spec/arb_arrays_of_arrays/compiler/redeclaration.vert new file mode 100644 index 0000000..57bf467 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/redeclaration.vert @@ -0,0 +1,29 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * require_extensions: GL_ARB_arrays_of_arrays + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "It is legal to declare an array without a size and then later + * re-declare the same name as an array of the same type and specify a + * size." + */ +#version 120 +#extension GL_ARB_arrays_of_arrays: enable + +float a_function(float[3][3]); + +void main() +{ + float [][3] an_array; + + an_array[0][2] = 0.0; + an_array[1][2] = 1.0; + an_array[2][2] = 2.0; + + float [3][3] an_array; + + gl_Position = vec4(a_function(an_array)); +} diff --git a/tests/spec/arb_arrays_of_arrays/compiler/redeclaration2.vert b/tests/spec/arb_arrays_of_arrays/compiler/redeclaration2.vert new file mode 100644 index 0000000..b31500a --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/redeclaration2.vert @@ -0,0 +1,29 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.20 + * require_extensions: GL_ARB_arrays_of_arrays + * [end config] + * + * From page 19 (page 25 of the PDF) of the GLSL 1.20 spec: + * + * "It is legal to declare an array without a size and then later + * re-declare the same name as an array of the same type and specify a + * size." + */ +#version 120 +#extension GL_ARB_arrays_of_arrays: enable + +float x[][2]; + +void foo() { x[1][1] = 2.; } + +// The left most array must be at least 2 elements because +// of the previous access to x[2][1]. +float x[][2] = float[][2](float[2](1., 2.), + float[2](1., 2.)); + +void main() +{ + foo(); + gl_Position = vec4(x[0][0]); +} diff --git a/tests/spec/arb_arrays_of_arrays/compiler/subroutine.vert b/tests/spec/arb_arrays_of_arrays/compiler/subroutine.vert new file mode 100644 index 0000000..f8d1402 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/compiler/subroutine.vert @@ -0,0 +1,37 @@ +/* [config] + * expect_result: pass + * glsl_version: 1.50 + * require_extensions: GL_ARB_arrays_of_arrays + * require_extensions: GL_ARB_shader_subroutine + * require_extensions: GL_ARB_gpu_shader5 + * [end config] + */ +#version 150 +#extension GL_ARB_arrays_of_arrays: enable +#extension GL_ARB_shader_subroutine: enable +#extension GL_ARB_gpu_shader5: enable + +subroutine vec4[3][2] basicSubRoutine(); + +subroutine (basicSubRoutine) vec4[3][2] option1() { + vec4 a[3][2] = vec4[3][2](vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0)), + vec4[2](vec4(0.0), vec4(1.0))); + return a; +} + +subroutine (basicSubRoutine) vec4[3][2] option2() { + vec4 a[3][2] = vec4[3][2](vec4[2](vec4(1.0), vec4(0.0)), + vec4[2](vec4(1.0), vec4(0.0)), + vec4[2](vec4(1.0), vec4(0.0))); + return a; +} + +subroutine uniform basicSubRoutine subRoutineSelection; + +void main() +{ + vec4[3][2] a = subRoutineSelection(); + + gl_Position = a[0][0]; +}