From mboxrd@z Thu Jan 1 00:00:00 1970 From: bugzilla-daemon@freedesktop.org Subject: [Bug 71723] New: [GLSL] Sampler arrays indexed with non-constant expressions Date: Mon, 18 Nov 2013 07:20:55 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1455478677==" Return-path: Received: from culpepper.freedesktop.org (unknown [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id 68C42FD7F2 for ; Sun, 17 Nov 2013 23:20:55 -0800 (PST) List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org To: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1455478677== Content-Type: multipart/alternative; boundary="1384759255.fC5aadF0.10214"; charset="us-ascii" --1384759255.fC5aadF0.10214 Date: Mon, 18 Nov 2013 07:20:55 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" https://bugs.freedesktop.org/show_bug.cgi?id=71723 Priority: medium Bug ID: 71723 Assignee: dri-devel@lists.freedesktop.org Summary: [GLSL] Sampler arrays indexed with non-constant expressions Severity: normal Classification: Unclassified OS: Linux (All) Reporter: vluchits@gmail.com Hardware: x86-64 (AMD64) Status: NEW Version: 9.2 Component: Drivers/DRI/Radeon Product: Mesa Created attachment 89383 --> https://bugs.freedesktop.org/attachment.cgi?id=89383&action=edit Test vertex shader Hello, in my opinion GLSL compiler in mesa is too restrictive when it comes to sampler arrays. The attached vertex shader can not be compiled due to the "sampler arrays indexed with non-constant expressions is forbidden in GLSL 1.30 and later": Lines 159-136 of src/glsl/ast_array_index.cpp say: * This restriction was added in GLSL 1.30. Shaders using earlier version * of the language should not be rejected by the compiler front-end for * using this construct. This allows useful things such as using a loop * counter as the index to an array of samplers. If the loop in unrolled, * the code should compile correctly. Instead, emit a warning. If compiler actually attempted to unroll the loop above, it would notice that the code does compile correctly in that case. Instead it just emits and error and, in my opinion, contradicts the comment above by not allowing the aforementioned "useful thing". Can the compiler be changed to _first_ attempt to unroll the loop and then check for sampler array indices being constants? -- You are receiving this mail because: You are the assignee for the bug. --1384759255.fC5aadF0.10214 Date: Mon, 18 Nov 2013 07:20:55 +0000 MIME-Version: 1.0 Content-Type: text/html; charset="UTF-8"
Priority medium
Bug ID 71723
Assignee dri-devel@lists.freedesktop.org
Summary [GLSL] Sampler arrays indexed with non-constant expressions
Severity normal
Classification Unclassified
OS Linux (All)
Reporter vluchits@gmail.com
Hardware x86-64 (AMD64)
Status NEW
Version 9.2
Component Drivers/DRI/Radeon
Product Mesa

Created attachment 89383 [details]
Test vertex shader

Hello,

in my opinion GLSL compiler in mesa is too restrictive when it comes to sampler
arrays. The attached vertex shader can not be compiled due to the "sampler
arrays indexed with non-constant expressions is forbidden in GLSL 1.30 and
later":

Lines 159-136 of src/glsl/ast_array_index.cpp say:

    * This restriction was added in GLSL 1.30.  Shaders using earlier version
    * of the language should not be rejected by the compiler front-end for
    * using this construct.  This allows useful things such as using a loop
    * counter as the index to an array of samplers.  If the loop in unrolled,
    * the code should compile correctly.  Instead, emit a warning.

If compiler actually attempted to unroll the loop above, it would notice that
the code does compile correctly in that case. Instead it just emits and error
and, in my opinion, contradicts the comment above by not allowing the
aforementioned "useful thing".

Can the compiler be changed to _first_ attempt to unroll the loop and then
check for sampler array indices being constants?


You are receiving this mail because:
  • You are the assignee for the bug.
--1384759255.fC5aadF0.10214-- --===============1455478677== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============1455478677==--