@@ -347,6 +347,7 @@ class GLUniform {
347347 const UpdateType _updateType;
348348 const int _components;
349349 const bool _isTexture;
350+ const bool _AMDSkipBindless;
350351
351352 protected:
352353 GLShader* _shader;
@@ -355,7 +356,7 @@ class GLUniform {
355356
356357 GLUniform ( GLShader* shader, const char * name, const char * type, const GLuint std430Size, const GLuint std430Alignment,
357358 const UpdateType updateType, const int components = 0 ,
358- const bool isTexture = false ) :
359+ const bool isTexture = false , const bool AMDSkipBindless = false ) :
359360 _name ( name ),
360361 _type ( type ),
361362 _std430BaseSize ( std430Size ),
@@ -364,6 +365,7 @@ class GLUniform {
364365 _updateType ( updateType ),
365366 _components ( components ),
366367 _isTexture ( isTexture ),
368+ _AMDSkipBindless ( AMDSkipBindless ),
367369 _shader ( shader ) {
368370 _shader->RegisterUniform ( this );
369371 }
@@ -522,9 +524,9 @@ class GLShaderManager {
522524
523525class GLUniformSampler : protected GLUniform {
524526 protected:
525- GLUniformSampler ( GLShader* shader, const char * name, const char * type, const UpdateType updateType ) :
527+ GLUniformSampler ( GLShader* shader, const char * name, const char * type, const UpdateType updateType, const bool AMDSkipBindless = false ) :
526528 GLUniform ( shader, name, type, glConfig.bindlessTexturesAvailable ? 2 : 1 ,
527- glConfig.bindlessTexturesAvailable ? 2 : 1 , updateType, 0 , true ) {
529+ glConfig.bindlessTexturesAvailable ? 2 : 1 , updateType, 0 , true , AMDSkipBindless ) {
528530 }
529531
530532 inline GLint GetLocation () {
@@ -550,6 +552,12 @@ class GLUniformSampler : protected GLUniform {
550552 currentValueBindless = value;
551553
552554 if ( glConfig.usingBindlessTextures ) {
555+ if ( _AMDSkipBindless
556+ && ( glConfig.driverVendor == glDriverVendor_t::ATI || glConfig.driverVendor == glDriverVendor_t::MESA )
557+ && workaround_glDriver_amd_mesa_skipBindlessDepthTarget.Get () ) {
558+ return ;
559+ }
560+
553561 if ( _shader->UseMaterialSystem () && _updateType == TEXDATA_OR_PUSH ) {
554562 return ;
555563 }
@@ -579,8 +587,8 @@ class GLUniformSampler : protected GLUniform {
579587
580588class GLUniformSampler2D : protected GLUniformSampler {
581589 protected:
582- GLUniformSampler2D ( GLShader* shader, const char * name, const UpdateType updateType ) :
583- GLUniformSampler ( shader, name, " sampler2D" , updateType ) {
590+ GLUniformSampler2D ( GLShader* shader, const char * name, const UpdateType updateType, const bool AMDSkipBindless = false ) :
591+ GLUniformSampler ( shader, name, " sampler2D" , updateType, AMDSkipBindless ) {
584592 }
585593};
586594
@@ -1743,7 +1751,7 @@ class u_DepthMap :
17431751 GLUniformSampler2D {
17441752 public:
17451753 u_DepthMap ( GLShader* shader ) :
1746- GLUniformSampler2D ( shader, " u_DepthMap" , CONST ) {
1754+ GLUniformSampler2D ( shader, " u_DepthMap" , CONST, true ) {
17471755 }
17481756
17491757 void SetUniform_DepthMapBindless ( GLuint64 bindlessHandle ) {
0 commit comments