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() ?



There are some known issues with const matrices (currently working on that bug)...
For now you will have to work around them (or use non-const mats or vectors)
For all practical purposes 'const mat4' is not really better than 'mat4' in our GLSL (at least for now)
Unless you do constant math in the shader -- like... const mat4 = (const mat4) * (const mat4)


Can you define 'really slow' -- is this shader falling back (can you check the CGLGetParam)?

I do not see where lightPM is defined -- is the below snippet the entire shader?

 - Nick

On Feb 20, 2007, at 12:54 AM, Johannes Behr wrote:

Hi,

I'm one of the www.opensg.org developer and try to get the shadow- mapping code running on my 15'' macbook Pro
The system utilizes some vertex-shader-code for the shadow-map generator which looks like this:


//-------------------------------------------------------------------- -------------------------------------------------
uniform float texFactor;
varying vec4 projCoord;
varying vec4 texPos;


const mat4 bias = mat4 (0.5,0.0,0.0,0.0,0.0,0.5,0.0,0.0,0.0,0.0,0.5,0.0,0.5,0.5,0.5,1.0);
void main(void)
{
vec4 realPos = gl_ModelViewMatrix * gl_Vertex;
projCoord = lightPM * realPos;
projCoord.x *= texFactor;
texPos = gl_ModelViewProjectionMatrix * gl_Vertex;
projCoord = bias * projCoord;
texPos = bias * texPos;
gl_Position = ftransform();
}
//-------------------------------------------------------------------- -------------------------------------------------


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.


AFAIK is this the right way to initialize a const mat4?

Is this a bug or feature?

best regarts,
  Johannes

//-------------------------------------------------------------------- -------------------------------------------------------------
The Problem and system information:


Date/Time:      2007-02-19 19:45:21.050 +0100
OS Version:     10.4.8 (Build 8L2127)
Report Version: 4

Command: bin
Path: /bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/ bin:/bin:/usr/bin:/usr/local/bin:/opt/bmrt/bin:/opt/flow/bin:/Users/ jbehr/src/OpenSG/Builds/i386-apple-darwin-g++/bin:/Users/jbehr/src/ OpenSG/Builds/i386-apple-darwin-g++/SystemTest:/Users/jbehr/src/ OpenSG/Builds/i386-apple-darwin-g++/ContribTest:/opt/teem/bin:/ Users/jbehr/src/Avalon/opt/talic/dist/bin
Parent: tcsh [27721]


Version: ??? (???)

PID:    11998
Thread: 0

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0xc0000000

Thread 0 Crashed:
0 libGLProgrammability.dylib 0x96fd4f15 TPPStreamCompiler::getNewConstantSourceVar(constData*, unsigned, unsigned short) + 399


...

Model: MacBookPro1,1, BootROM MBP11.0055.B08, 2 processors, Intel Core Duo, 2.16 GHz, 1 GB
Graphics: ATI Radeon X1600, ATY,RadeonX1600, PCIe, 256 MB
Memory Module: BANK 1/DIMM1, 1 GB, DDR2 SDRAM, 667 MHz
AirPort: spairport_wireless_card_type_airport_extreme (0x168C, 0x86), 0.1.30
Bluetooth: Version 1.7.9f12, 2 service, 1 devices, 1 incoming serial ports
Network Service: Built-in Ethernet, Ethernet, en0
Serial ATA Device: ST9100824AS, 93.16 GB
Parallel ATA Device: MATSHITADVD-R UJ-857
USB Device: Built-in iSight, Micron, Up to 480 Mb/sec, 500 mA
USB Device: Kensington PocketMouse Pro, Kensington, Up to 1.5 Mb/ sec, 500 mA
USB Device: Apple Internal Keyboard / Trackpad, Apple Computer, Up to 12 Mb/sec, 500 mA
USB Device: IR Receiver, Apple Computer, Inc., Up to 12 Mb/sec, 500 mA
USB Device: Bluetooth HCI, Up to 12 Mb/sec, 500 mA




_______________________________________________
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

_______________________________________________ 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.