ATI driver bug with glBindSampler

The latest catalyst (11.5) appears to have a bug with glBindSampler - it fails with INVALID_VALUE on totally valid arguments.
I traced the assembly code in the driver and found out that it does wrong argument validation - at the place where it checks if the first argument is between 0 and MAX_TEXTURE_IMAGE_UNITS-1 it also checks if the second argument is zero (which it is not) - if either of these two is false it generates INVALID_VALUE. Nonzero second argument is valid when it is taken from glGenSamplers.
When i nop-ed out the second condition in the driver dll, it works perfectly.
I am posting this, in case anyone else has encountered this problem too, to let him know how it can be fixed.
Also if any ATI driver guy is reading this forum, please fix this bug!

This bug is present in the older version 11.2 too.

The 11.5a drivers seem to work fine with samplers. Maybe you could try those.

Thank you for your response!

Where do i get 11.5a from?
The AMD driver site only gives 11.5:
http://sites.amd.com/us/game/downloads/Pages/radeon_xp-32.aspx

I installed the 11.5b hotfix and it still has the same issue

I did some investigation into this, and it looks like you must call glSamplerParameter() before calling glBindSampler(). I don’t think the ATI driver is creating a sampler object until they get a glSamplerParameter() call.

Yes, it is a driver bug. The sampler object has not been created in the driver when calling glBindSampler. Instead, driver sees no existing sampler object and returns INVALID_VALUE. Similar as texture object, the sampler object is lazy created in the glBindXXXX. However, the current AMD driver fails to do so.

We’ll make it work soon.

Still broken in GL version 4.1.11251 / Catalyst 11.11

Still in alpha stage. Need at one month for public release.

I now apply sampler state before binding sampler to texture unit. This workaround works for most textures. However, this is not quite enough: I still have to setup texture filtering (linear/linear) in the texture object in order to get PCF shadow maps working correctly.

Appears to be fixed in 11.12
Thanx ATI devs!

This was especially nasty bug because it had no easy workaround.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.