Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Shader Validation Failed...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shader Validation Failed...

thanks for the quick response, however, I am validating my code (using
glValidateProgram) after I set the uniforms
using (glUniform1i) for all of the different samplers.

One thing I should have noted is that I'm using the JOGL bindings from
Sun.  I don't think that this should matter at all,
but perhaps it does...

I'd be happy to send you the code if you want to try it out.

I will also run it in the debugger this evening on my Macbook and try
to get you a dump of the bus error.


On Nov 7, 2007 10:56 PM, Nick Burns <email@hidden> wrote:
> When you initially compile and link your shader all of the uniforms are
> inited to 0(zero) including...
> uniform sampler2D tex;
> uniform sampler2D norms;
> uniform sampler2D speculars;
> uniform sampler2DShadow shadowMap;
> If you try to validate after linking you will get a validation failure
> (which is correct and easily remediable)
> Because you have a sampler2DShadow and a sampler2D on the same unit -- unit
> 0
> To remedy that validation failure -- simply set the uniforms for the
> samplers (e.g. 0 and 1) and then validate.
> Be sure that you check for the existence of the ARB_fragment_program_shadow
> extension before you use shadow textures...
> (Although implied by GLSL if the driver/HW does not actually support the
> functionality it will fall back to SW)
> see
> Be careful to check to see if you are within the limits of HW for your
> shaders
> In specific -- your fragment shader may not actually fit on a GMA950 (in
> Leopard where we added ARB_fragment_program_shadow support to this driver)
> Either by exceeding texture indirection stages, alu ops, or ...
> Use
>  CGLGetParameter (..., kCGLCPGPUFragmentProcessing, ...);
>  CGLGetParameter (..., kCGLCPGPUVertexProcessing, ...); // keep in mind that
> GMA950 only uses SW vertex processing
> If you exceed HW limits you can cut down your shader in any number of ways
> (vectorization, multi-pass, texture lookup instead of expensive ops like
> pow/sin/...)
> And lastly...
> (A backtrace would be helpful for the crash you got in 10.4.10)
>  - Nick
> On Nov 7, 2007, at 6:41 PM, Brendan Burns wrote:
> Hello,
> I'm writing a projective texture shadowing shader, my code works
> correctly on Linux (x86 & AMD64) without any errors, however on OS X I
> receive the following error:
> Validation Failed: Sampler error:
>  Samplers of different types use the same texture image unit.
>   - or -
>  A sampler's texture unit is out of range (greater than max allowed
> or negative).
> On an iMac (10.4.10, Intel Core Duo, Radeon x1600) I get the error,
> but the program runs correctly.
> On a Macbook (10.4.10, Intel Core Duo, Intel 950) I get the error, the
> program runs correctly about 80% of the time, the other 20% of the
> time I get a Bus Error:
> Invalid memory access of location 000000b4 eip=19f844e8
> Bus error
> The shaders are available at:
> Any comments would be helpful.
> Thanks
> --brendan
>  _______________________________________________
> 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

 >Shader Validation Failed... (From: "Brendan Burns" <email@hidden>)
 >Re: Shader Validation Failed... (From: Nick Burns <email@hidden>)

Visit the Apple Store online or at retail locations.

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.