Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: "const mat4" - glsl-crash; bug in TPPStreamCompiler::getNewConstantSourceVar() ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "const mat4" - glsl-crash; bug in TPPStreamCompiler::getNewConstantSourceVar() ?



This shader-code works on Linux and windows with nvidia and ati
boards but crashes my mac.

Now the funny  part: If i remove the 'const' in front of the mat4
everything works really slow but
at least it works.

Matrices don't really work in Apple's GLSL implementation. Simple shaders like:

   attribute mat4 model_matrix;

   void main() {
       gl_Position = gl_ModelViewProjectionMatrix *
           model_matrix * gl_Vertex;
   }

or

   #define BATCH_SIZE 4 // 16
   attribute float model_index;
   uniform mat4 model_matrices[BATCH_SIZE];
   uniform vec4 colors[BATCH_SIZE];
   void main() {
       int int_index = int(floor(model_index));
       gl_Position = gl_ModelViewProjectionMatrix *
           model_matrices[int_index] * gl_Vertex;
       gl_FrontColor = colors[int_index];
   }

either don't render correctly, or crash, depending on your precise
video hardware and OS.

I don't know anything in particular about const mat4, but my
experiences lead me to believe that it's not all that likely to work.

-Keith
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >"const mat4" - glsl-crash; bug in TPPStreamCompiler::getNewConstantSourceVar() ? (From: Johannes Behr <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.