From patchwork Sat Feb 28 00:42:44 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: 45274 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f198.google.com (mail-we0-f198.google.com [74.125.82.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1D7DA204BC for ; Sat, 28 Feb 2015 00:43:04 +0000 (UTC) Received: by wesw55 with SMTP id w55sf16529515wes.0 for ; Fri, 27 Feb 2015 16:43:03 -0800 (PST) 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=RGoGdz0a0wRPNaX7pASpBMkXvv+BJbpmQNmvb+E+/Cc=; b=NVYatejPDfw1JYOaRm4RJ+vCJzjdNOO3P0L5mR2e0Sqphfk/O4M5ByIUljWZ5bEaWN OTHY78vHQm5C9QVUhE6wQuPq4mQp8rXdbijUwQOvdLJA5+knfqVNdT8uZkiREWdkKyBq BEtBv2EmnOc4+WV5Bp8OqDs13WDTnYyVdnt+C7Z8WmFziy+kHtVn/eptctQFjwxKhpJj BxqpnXgvBduVPmuWN+US2Lwi5O0LiQIMp44Hx11vkHiOpb2tiRvDo+3nqTEQ1Qt3H9kO 33MnoDalzrAOOu/qS1VLMRZ7zKRhr6y2K84EMTtB/T1MpIvGPpbasJlO+gTukkcj0OTg IiHA== X-Gm-Message-State: ALoCoQnOLOn+e7n9pMx72LKdONA9ZxHBe3g3siq1Lpeicc4EITBk+nnYyTQq6c9Vb5FOPSsclwds X-Received: by 10.180.11.34 with SMTP id n2mr843002wib.2.1425084183414; Fri, 27 Feb 2015 16:43:03 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.198.231 with SMTP id jf7ls237744lac.92.gmail; Fri, 27 Feb 2015 16:43:03 -0800 (PST) X-Received: by 10.112.141.69 with SMTP id rm5mr4105455lbb.48.1425084183184; Fri, 27 Feb 2015 16:43:03 -0800 (PST) Received: from mail-lb0-x22e.google.com (mail-lb0-x22e.google.com. [2a00:1450:4010:c04::22e]) by mx.google.com with ESMTPS id m5si4044969lah.74.2015.02.27.16.43.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Feb 2015 16:43:02 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22e as permitted sender) client-ip=2a00:1450:4010:c04::22e; Received: by lbiv13 with SMTP id v13so1612632lbi.11 for ; Fri, 27 Feb 2015 16:43:02 -0800 (PST) X-Received: by 10.152.4.227 with SMTP id n3mr11836824lan.72.1425084182868; Fri, 27 Feb 2015 16:43:02 -0800 (PST) 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.35.133 with SMTP id h5csp4242723lbj; Fri, 27 Feb 2015 16:43:02 -0800 (PST) X-Received: by 10.66.235.1 with SMTP id ui1mr28129066pac.80.1425084181138; Fri, 27 Feb 2015 16:43:01 -0800 (PST) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id lk3si5641787pbc.244.2015.02.27.16.43.00; Fri, 27 Feb 2015 16:43:01 -0800 (PST) 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 D62E96E9A3; Fri, 27 Feb 2015 16:42:59 -0800 (PST) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm18-vm3.bullet.mail.gq1.yahoo.com (nm18-vm3.bullet.mail.gq1.yahoo.com [98.136.217.218]) by gabe.freedesktop.org (Postfix) with ESMTP id AE0AE6E9A3 for ; Fri, 27 Feb 2015 16:42:58 -0800 (PST) Received: from [98.137.12.175] by nm18.bullet.mail.gq1.yahoo.com with NNFMP; 28 Feb 2015 00:42:57 -0000 Received: from [208.71.42.198] by tm14.bullet.mail.gq1.yahoo.com with NNFMP; 28 Feb 2015 00:42:57 -0000 Received: from [127.0.0.1] by smtp209.mail.gq1.yahoo.com with NNFMP; 28 Feb 2015 00:42:57 -0000 X-Yahoo-Newman-Id: 893060.35408.bm@smtp209.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: vIQpmzYVM1lxvp.vdTiQ9OsVdfUrknE_wSAaVMkhkl9lyz3 8j03T7wrDbtWxRfgEoe9AqW6yghbyVrP.mpwpqWZ2tSYVWi3n9J6ihfcBh5F 43VRAvGhNkZ853JgVETrLafl8g.G8eMDNqzUGKKMAevem9S6WXGupjS1F4DU Ls0CBcoxlGCK2aFyqm.x3p_HXI00jmReVMUghbkaz.WYs39OnBoYJ800my8M 86iimrJv8K86uNsS6ePShf.fS0fWi.F8_Glaz6wJX5PTiabtctrxMzQvTDEV zKmvAF3GqecCZcW2liFh3a4oPe_CE8xRg6XB_CQZRXyEjJV5nvVd8vHk37z4 C95o.BS5WY.PaYk98Q0zH5L2.yIpzkl2k4VRU3DYv82OYXAYj5g1Mkfd1yjs TRdEiB3gFI0YenTEqW43yS8PUsaDAfEknWUI7k.4eCXFMEsDHVPp7FeWjjcv gcx9N2qH1GfXkWcdj19h5GeJdsifAUH3qTCXk1Gp4L4naT4g604tTZumgNYt V3PgTR1mK6nRlpceZnIwNm512eMP0lP3_ X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Sat, 28 Feb 2015 11:42:44 +1100 Message-Id: <1425084165-12569-1-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.1.0 Subject: [Piglit] [PATCH 1/2] glsl-1.50: check array sizes when instance name differ 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:c04::22e 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 Uniform interface blocks can have different instance names across shaders. These tests check that array rules are applied correctly. Test results: Intel Ivybridge - Mesa 10.6 uniform-block-array-instance-name-mismatch - pass uniform-block-array-size-and-instance-name-mismatch - pass AMD Radeon HD 6670 - Catalyst 14.501.1003 OpenGL 4.4 uniform-block-array-instance-name-mismatch - pass uniform-block-array-size-and-instance-name-mismatch - fail --- ...-block-array-instance-name-mismatch.shader_test | 28 +++++++++++++++++ ...ray-size-and-instance-name-mismatch.shader_test | 36 ++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 tests/spec/glsl-1.50/linker/uniform-block-array-instance-name-mismatch.shader_test create mode 100644 tests/spec/glsl-1.50/linker/uniform-block-array-size-and-instance-name-mismatch.shader_test diff --git a/tests/spec/glsl-1.50/linker/uniform-block-array-instance-name-mismatch.shader_test b/tests/spec/glsl-1.50/linker/uniform-block-array-instance-name-mismatch.shader_test new file mode 100644 index 0000000..b7066a4 --- /dev/null +++ b/tests/spec/glsl-1.50/linker/uniform-block-array-instance-name-mismatch.shader_test @@ -0,0 +1,28 @@ +// Instance names for uniforms can differ. Check +// that the shaders link successfully. + +[require] +GLSL >= 1.50 + +[vertex shader] +uniform Foo { + vec4 x; +} foo[3]; + +void main() +{ + gl_Position = vec4(foo[0].x); +} + +[fragment shader] +uniform Foo { + vec4 x; +} bar[3]; + +void main() +{ + gl_FragColor = bar[0].x; +} + +[test] +link success diff --git a/tests/spec/glsl-1.50/linker/uniform-block-array-size-and-instance-name-mismatch.shader_test b/tests/spec/glsl-1.50/linker/uniform-block-array-size-and-instance-name-mismatch.shader_test new file mode 100644 index 0000000..f2a7c70 --- /dev/null +++ b/tests/spec/glsl-1.50/linker/uniform-block-array-size-and-instance-name-mismatch.shader_test @@ -0,0 +1,36 @@ +// From the GLSL 1.50 spec, section 4.3.7 (Interface Blocks): +// +// Furthermore, if a matching block is declared as an array, then +// the array sizes must also match (or follow array matching rules +// for the interface between a vertex and a geometry shader). +// +// In this test, we create a uniform block array in both +// the vertex and fragment shaders, using different array sizes. The +// instance name of the interface differs across shaders. Then we +// check that the implementation correctly reported an error. + +[require] +GLSL >= 1.50 + +[vertex shader] +uniform Foo { + vec4 x; +} foo[3]; + +void main() +{ + gl_Position = vec4(foo[0].x); +} + +[fragment shader] +uniform Foo { + vec4 x; +} bar[2]; + +void main() +{ + gl_FragColor = bar[0].x; +} + +[test] +link error