Bug 43871 - shader with uniform array/record and if clauses is not translated correctly into TGSI IR
Summary: shader with uniform array/record and if clauses is not translated correctly i...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-15 14:48 UTC by vincent
Modified: 2012-11-20 19:01 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description vincent 2011-12-15 14:48:05 UTC
Hi,

the following fragment shader :

__
#version 130
uniform int mode;
uniform vec3 red;
uniform struct {
      vec3 green;
      vec3 blue;
} teststruct;
uniform vec3 testarray[3];
out vec3 fragColor;

void main()
{
   if (mode == 0)
      fragColor = red;
   if (mode == 1)
      fragColor = teststruct.green + teststruct.blue;
   if (mode == 2)
   {
      fragColor = vec3(0.);
      for(int i = 0; i < 3; i++)
         fragColor += testarray[i];
   }
}
__

is lowered to :
__
FRAG
PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1
DCL IN[0], COLOR, LINEAR
DCL OUT[0], COLOR
  0: MOV OUT[0], IN[0]
  1: END
__

using mesa from git, swrast, and setting glsl supported version to 130 in st_extensions.c ; glsl_compiler --dump-lir seems correct, so it might be an issue with glsl-to-tgsi.
Comment 1 Andreas Boll 2012-09-03 10:56:04 UTC
(In reply to comment #0)

> using mesa from git, swrast, and setting glsl supported version to 130 in
> st_extensions.c ; glsl_compiler --dump-lir seems correct, so it might be an
> issue with glsl-to-tgsi.

Reassigning to mesa-core since the issue could be in glsl-to-tgsi.
In the meantime GLSL 1.30 has been enabled by default on r600g.
Is this still an issue with current mesa from git?
Comment 2 Andreas Boll 2012-11-20 19:01:58 UTC
Vincent said on irc that this isn't an issue anymore.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.