PDA

View Full Version : ATI driver bug with glBindSampler



l_belev
06-09-2011, 11:41 AM
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.

Alfonse Reinheart
06-09-2011, 11:58 AM
The 11.5a drivers seem to work fine with samplers. Maybe you could try those.

l_belev
06-10-2011, 05:15 AM
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

Numega
08-21-2011, 06:12 PM
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.

Hongwei Li
09-06-2011, 08:17 PM
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.

tksuoran
11-17-2011, 06:22 AM
Still broken in GL version 4.1.11251 / Catalyst 11.11

Hongwei Li
11-17-2011, 08:18 PM
Still in alpha stage. Need at one month for public release.

tksuoran
11-18-2011, 03:46 AM
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.

l_belev
01-20-2012, 05:16 AM
Appears to be fixed in 11.12
Thanx ATI devs!

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