Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: ATI - indirect index sampler limitation

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2008
    Posts
    11

    ATI - indirect index sampler limitation

    For reference to anyone else with the same problem:

    The following works on NVIDIA but not on "ATI Radeon HD 4800 Series"

    Code :
    uniform sampler2D ShadowTexture[2];
    void main()
    {
    	int splitPlane = 0;
    	float value =  texture2D(ShadowTexture[splitPlane], vec2(0.0, 0.0)).x;

    With amd_catalyst_12.1a_preview_win7_32-64 ,you get the following error

    ERROR: error(#15) Extension: 'sm5' isn't supported=> sampler array isn't support indirect index Sampler array indexes must be integral constant expressions

    With earlier drivers, the fragment is discarded without any error.

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    895

    Re: ATI - indirect index sampler limitation

    The Radeon HD 4800 series does not support shader model 5. Therefore non-constant indices aren't allowed for array lookups. If you change the following line

    Code :
    const int splitPlane = 0;

    it should work. I bet you're testing on a GeForce 4xx+ model, right? These support SM5 so your comparison is a bit lacking. If your testing with a GF 2xx- generation card then the CG compiler doesn't obey the limitations of SM4 correctly.

    If you want shader model 5 you need to upgrade to a HD 5000+ card.

    Edit: BTW, are you implementing cascaded shadow maps?

  3. #3
    Junior Member Newbie
    Join Date
    Nov 2008
    Posts
    11

    Re: ATI - indirect index sampler limitation

    Many thanks. That makes sense.

    Yes, we have implemented cascaded shadow maps - good guess!

    It now works fine by avoiding using the non-const array lookups.

    (by expanding the loop "for (int splitPlane=0; splitPlane<3; splitPlane++)")

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Location
    Germany
    Posts
    895

    Re: ATI - indirect index sampler limitation

    In that case you can also pack 1-4 views into a single texture if that fits your render path more naturally (as it does in my case).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •