Re: "const mat4" - glsl-crash; bug in TPPStreamCompiler::getNewConstantSourceVar() ?
Re: "const mat4" - glsl-crash; bug in TPPStreamCompiler::getNewConstantSourceVar() ?
Subject : Re: "const mat4" - glsl-crash; bug in TPPStreamCompiler::getNewConstantSourceVar() ?
From: "Keith Bauer" <email@hidden >
Date: Tue, 20 Feb 2007 22:00:26 +1300
Delivered-to: email@hidden
Delivered-to: email@hidden
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=YDfnlmrLVaKeOCy/DwM5WFuor2SUOeab+j1pG1Nck4qkqW2Dx5BbLMT2LpC7FMR2Y9xtbpDlETVMaPsziDPaTvWc12r/+pHLiOY9yJCuT1lj8klXeBeAN4g9yP0TnseQccCX3qd6yLN7LZmPpEVvD5U070/dw4JIdyyUra3Fikk=
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
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.