From patchwork Tue Jun 23 23:32:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: 'Timothy Arceri' via Patchwork Forward X-Patchwork-Id: 50250 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E0643216E1 for ; Tue, 23 Jun 2015 23:32:18 +0000 (UTC) Received: by lbbwc1 with SMTP id wc1sf6341693lbb.3 for ; Tue, 23 Jun 2015 16:32:17 -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:mime-version:subject:precedence :list-id:list-unsubscribe:list-archive:list-post:list-help :list-subscribe:content-type:content-transfer-encoding:errors-to :sender:x-original-sender:x-original-authentication-results :mailing-list:reply-to; bh=Xo5coxHx/MnkTLnH3y0yUduilN1G2GW7TxkRe7c5284=; b=MSCkcXKLTPLBB1nrLFo9v2seisAOOVUxz2E8w2iYOZfTv7qwGYRqNHfZfPbr+5dTR0 HCgxS7l5ukVzTcNPJqh11fKRr38JtcZPwFHZfnglxIqoVBLNk8rKKSn3tZQ+wmfshKRv 5V+OnbE6F9579EvHVZknpdXoPngF2Vx19AxfxbqXVSLnxenPMrWLsRii9KFY7ptAcGYi KDWr7u44SwsnE2p6DhDi+wxPl0neHRFLY1oyp411HH+ZJOb3Jc7QRWInsb1sgDysOZtT gQVwtCUCj5TI0dQaIM1DZO99P10N2QGREJE9r1wJN/57LnlzTf7iE2nt4CKEfzdlRdIh B0hA== X-Gm-Message-State: ALoCoQnsg/R8LReyRkRFZbfI5RO2EzPq9wxQIgjLaatai6Ox9p0EKtWNsO0plyWg49bi46HF0BiT X-Received: by 10.180.182.49 with SMTP id eb17mr3077610wic.2.1435102337902; Tue, 23 Jun 2015 16:32:17 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.8.1 with SMTP id n1ls104540laa.87.gmail; Tue, 23 Jun 2015 16:32:17 -0700 (PDT) X-Received: by 10.112.154.71 with SMTP id vm7mr36576271lbb.96.1435102337764; Tue, 23 Jun 2015 16:32:17 -0700 (PDT) Received: from mail-la0-x22b.google.com (mail-la0-x22b.google.com. [2a00:1450:4010:c03::22b]) by mx.google.com with ESMTPS id h18si20515748lbo.172.2015.06.23.16.32.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Jun 2015 16:32:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22b as permitted sender) client-ip=2a00:1450:4010:c03::22b; Received: by lagx9 with SMTP id x9so16016594lag.1 for ; Tue, 23 Jun 2015 16:32:17 -0700 (PDT) X-Received: by 10.112.222.133 with SMTP id qm5mr37503011lbc.86.1435102337647; Tue, 23 Jun 2015 16:32:17 -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.108.230 with SMTP id hn6csp3399133lbb; Tue, 23 Jun 2015 16:32:16 -0700 (PDT) X-Received: by 10.70.89.199 with SMTP id bq7mr72899795pdb.168.1435102334922; Tue, 23 Jun 2015 16:32:14 -0700 (PDT) Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id tl1si36834543pac.65.2015.06.23.16.32.14; Tue, 23 Jun 2015 16:32:14 -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 BF29F6EAA9; Tue, 23 Jun 2015 16:32:13 -0700 (PDT) X-Original-To: piglit@lists.freedesktop.org Delivered-To: piglit@lists.freedesktop.org Received: from nm25-vm7.bullet.mail.gq1.yahoo.com (nm25-vm7.bullet.mail.gq1.yahoo.com [98.136.217.118]) by gabe.freedesktop.org (Postfix) with ESMTP id B8BEC6EAA9 for ; Tue, 23 Jun 2015 16:32:12 -0700 (PDT) Received: from [98.137.12.56] by nm25.bullet.mail.gq1.yahoo.com with NNFMP; 23 Jun 2015 23:32:12 -0000 Received: from [208.71.42.199] by tm1.bullet.mail.gq1.yahoo.com with NNFMP; 23 Jun 2015 23:32:12 -0000 Received: from [127.0.0.1] by smtp210.mail.gq1.yahoo.com with NNFMP; 23 Jun 2015 23:32:12 -0000 X-Yahoo-Newman-Id: 254118.3710.bm@smtp210.mail.gq1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: asPmdQAVM1mJuHKolNmmAd2BdWTXJ4vITDzSffXJRUGDbXN OXPrMXS4boTiSRigc19E1T3KYyniy5xUHVQGsb5PPaGPulP3joH2PXQgK1_5 GxlGkzlIKFTlHStKlvp_GT3.GEkgM.VyfuoYjSU8Rgye5qjRG_RZp45Nj0St kpMvl8raegPEauMnCUznD3cy9XfhfcXKQZPUQHfqNDSwKttn4lSe87j3g6cW nobo9alPlDe.qO1PrDipCZOIX6.jE8B.HPIfDWpwg9H7xxwWNwkWzgD6rKDF zOA6iW1LRcRELFMxDLZaNAlMdvW5Exzg50ru7jwKPG5bqgDe_k5cdZeH.j1G 42oQm7hYD.OIFG2VvPGQ2welg2GRBbvqcgdfK.j7oobJLjLr9dTIVWGZci6P YfiU12uF6okvZkZgZgsL8xH716uFxTjfG2M5xgmuKp2gaPJZWJJP8l2.Taql hY_JQM905K04s6rJ8PYkGVXDkCiRT8xjAzw3O3a975a_X9r2idU71bV2xRrP ofVqJsoCGF.YzOBpPcHysTiRaB8KQy9MV9IY- X-Yahoo-SMTP: 9BNlx.aswBAkr0D8mG_whiOP1dyU From: "'Timothy Arceri' via Patchwork Forward" To: piglit@lists.freedesktop.org Date: Wed, 24 Jun 2015 09:32:00 +1000 Message-Id: <1435102320-16332-1-git-send-email-t_arceri@yahoo.com.au> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1434802475-4020-5-git-send-email-t_arceri@yahoo.com.au> References: <1434802475-4020-5-git-send-email-t_arceri@yahoo.com.au> MIME-Version: 1.0 Subject: [Piglit] [PATCH V2 5/8] arb_arrays_of_arrays: test binding limits for uniforms 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: , 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:c03::22b as permitted sender) smtp.mail=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 Test results: Nvidia GeForce 840M - NVIDIA 346.47: atmoic counters - pass samplers - fail interface blocks - fail The Nvidia driver fails because is doesn't support interfce block AoA and because it doesn't seem to think the sampler AoA goes over the limit if I change the sampler to a 4 element single dimension array it passes. V2: use GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS for sampler test --- tests/all.py | 6 + tests/spec/CMakeLists.txt | 1 + tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt | 15 ++ tests/spec/arb_arrays_of_arrays/CMakeLists.txt | 1 + tests/spec/arb_arrays_of_arrays/max-binding.c | 208 ++++++++++++++++++++++ 5 files changed, 231 insertions(+) create mode 100644 tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt create mode 100644 tests/spec/arb_arrays_of_arrays/CMakeLists.txt create mode 100644 tests/spec/arb_arrays_of_arrays/max-binding.c diff --git a/tests/all.py b/tests/all.py index 905047f..fee9fa3 100644 --- a/tests/all.py +++ b/tests/all.py @@ -1670,6 +1670,12 @@ with profile.group_manager( g(['amd_performance_monitor_api'], 'api', run_concurrent=False) g(['amd_performance_monitor_measure'], 'measure', run_concurrent=False) +# Group ARB_arrays_of_arrays +with profile.group_manager( + PiglitGLTest, + grouptools.join('spec', 'ARB_arrays_of_arrays')) as g: + g(['arb_arrays_of_arrays-max-binding'], run_concurrent=False) + # Group ARB_point_sprite with profile.group_manager( PiglitGLTest, grouptools.join('spec', 'ARB_point_sprite')) as g: diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt index 2ce4692..c282936 100644 --- a/tests/spec/CMakeLists.txt +++ b/tests/spec/CMakeLists.txt @@ -1,5 +1,6 @@ add_subdirectory (amd_performance_monitor) add_subdirectory (amd_pinned_memory) +add_subdirectory (arb_arrays_of_arrays) add_subdirectory (arb_base_instance) add_subdirectory (arb_buffer_storage) add_subdirectory (arb_clear_buffer_object) diff --git a/tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt b/tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt new file mode 100644 index 0000000..276fa52 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/CMakeLists.gl.txt @@ -0,0 +1,15 @@ +include_directories( + ${GLEXT_INCLUDE_DIR} + ${OPENGL_INCLUDE_PATH} + ${piglit_SOURCE_DIR}/tests/util +) + +link_libraries ( + piglitutil_${piglit_target_api} + ${OPENGL_gl_LIBRARY} + ${OPENGL_glu_LIBRARY} +) + +piglit_add_executable (arb_arrays_of_arrays-max-binding max-binding.c) + +# vim: ft=cmake: diff --git a/tests/spec/arb_arrays_of_arrays/CMakeLists.txt b/tests/spec/arb_arrays_of_arrays/CMakeLists.txt new file mode 100644 index 0000000..144a306 --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/CMakeLists.txt @@ -0,0 +1 @@ +piglit_include_target_api() diff --git a/tests/spec/arb_arrays_of_arrays/max-binding.c b/tests/spec/arb_arrays_of_arrays/max-binding.c new file mode 100644 index 0000000..6b6e80c --- /dev/null +++ b/tests/spec/arb_arrays_of_arrays/max-binding.c @@ -0,0 +1,208 @@ +/* + * Copyright © 2015 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +/** @file max-binding.c + * + * Test that using more than the maximum number of suported interface block, + * sampler, or atomic bindings fails with a compile error. + */ + +#include "piglit-util-gl.h" + +PIGLIT_GL_TEST_CONFIG_BEGIN + + config.supports_gl_core_version = 32; + + config.window_width = 1; + config.window_height = 1; + config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA; + +PIGLIT_GL_TEST_CONFIG_END + +static bool +generate_and_compile_shader(GLuint stage, const char *src_template, + unsigned binding) +{ + char *src; + int ret; + + ret = asprintf(&src, src_template, binding); + assert(ret); + + ret = piglit_compile_shader_text_nothrow(stage, src); + + free(src); + return ret; +} + +static bool +run_test_sampler_max_bindings(unsigned binding) +{ + const char *src_template = "#version 150\n" + "#extension GL_ARB_arrays_of_arrays : enable\n" + "#extension GL_ARB_shading_language_420pack : enable\n" + "layout(binding=%d) uniform sampler2D sampler[2][2];\n" + "in vec2 coord;" + "\n" + "void main() {\n" + " gl_FragColor = texture2D(sampler[1][1], coord);" + "}\n"; + return generate_and_compile_shader(GL_FRAGMENT_SHADER, src_template, + binding); +} + +static bool +run_test_interface_max_bindings(unsigned binding) +{ + const char *src_template = "#version 150\n" + "#extension GL_ARB_arrays_of_arrays : enable\n" + "#extension GL_ARB_shading_language_420pack : enable\n" + "layout(binding=%d) uniform ArraysOfArraysBlock\n" + "{\n" + " mat4 a;" + "} i[2][2];\n" + "void main() {\n" + " gl_Position = vec4(1.0);" + "}\n"; + return generate_and_compile_shader(GL_VERTEX_SHADER, src_template, + binding); +} + +static bool +run_test_ac_fragment_max_bindings(unsigned binding) +{ + const char *src_template = "#version 150\n" + "#extension GL_ARB_shader_atomic_counters : enable\n" + "#extension GL_ARB_arrays_of_arrays : enable\n" + "\n" + "layout(binding=%d) uniform atomic_uint x[2][2];" + "\n" + "void main() {\n" + "}\n"; + return generate_and_compile_shader(GL_FRAGMENT_SHADER, src_template, + binding); +} + +static bool +run_test_ac_vertex_max_bindings(unsigned binding) +{ + const char *src_template = "#version 150\n" + "#extension GL_ARB_shader_atomic_counters : enable\n" + "#extension GL_ARB_arrays_of_arrays : enable\n" + "\n" + "in vec4 position;\n" + "layout(binding=%d) uniform atomic_uint x[2][2];" + "\n" + "void main() {\n" + " gl_Position = position;\n" + "}\n"; + return generate_and_compile_shader(GL_VERTEX_SHADER, src_template, + binding); +} + +static void +subtest_fail(enum piglit_result *status, char *name) +{ + piglit_report_subtest_result(PIGLIT_FAIL, name); + *status = PIGLIT_FAIL; +} + +void +piglit_init(int argc, char **argv) +{ + enum piglit_result status = PIGLIT_PASS; + int max_ab_binding; + int max_samp_binding; + int max_ifc_blk_binding; + + /* assume the templates use this number of elements */ + int array_elements = 4; + + if (piglit_is_extension_supported("GL_ARB_shader_atomic_counters")) { + glGetIntegerv(GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, + &max_ab_binding); + } + glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, + &max_samp_binding); + glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &max_ifc_blk_binding); + + /* require 3.2 for interface block support */ + piglit_require_gl_version(32); + piglit_require_extension("GL_ARB_arrays_of_arrays"); + piglit_require_extension("GL_ARB_shading_language_420pack"); + + /* text above max limit */ + if(run_test_interface_max_bindings(max_ifc_blk_binding-(array_elements-1))) + subtest_fail(&status, "Test interface block binding above " + "maximum number of uniform " + "buffer bindings"); + + /* test max boundary */ + if(!run_test_interface_max_bindings(max_ifc_blk_binding-array_elements)) + subtest_fail(&status, "Test interface block binding on " + "boundary of maximum number of uniform " + "buffer bindings"); + + /* text above max limit */ + if(run_test_sampler_max_bindings(max_samp_binding-(array_elements-1))) + subtest_fail(&status, "Test sampler binding above " + "maximum number of texture " + "unit bindings"); + + /* test max boundary */ + if(!run_test_sampler_max_bindings(max_samp_binding-array_elements)) + subtest_fail(&status, "Test sampler binding on boundary " + "of maximum number of texure " + "unit bindings"); + + if (piglit_is_extension_supported("GL_ARB_shader_atomic_counters")) { + /* text above max limit */ + if(run_test_ac_fragment_max_bindings(max_ab_binding)) + subtest_fail(&status, "Fragment shader test above " + "maximum number of atomic " + "counter bindings"); + + if(run_test_ac_vertex_max_bindings(max_ab_binding)) + subtest_fail(&status, "Vertex shader test above " + "maximum number of atomic " + "counter bindings"); + /* test max boundary */ + if(!run_test_ac_fragment_max_bindings(max_ab_binding-1)) + subtest_fail(&status, "Fragment shader test boundary " + "of maximum number of atomic " + "counter bindings"); + + if(!run_test_ac_vertex_max_bindings(max_ab_binding-1)) + subtest_fail(&status, "Vertex shader test boundary " + "of maximum number of atomic " + "counter bindings"); + } + + piglit_report_result(status); +} + +enum piglit_result +piglit_display(void) +{ + return PIGLIT_PASS; +}