File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,11 @@ class Shader::Implementation : public IECore::RefCounted
181181 }
182182 }
183183
184- if ( p.type == GL_SAMPLER_1D || p.type == GL_SAMPLER_2D || p.type == GL_SAMPLER_3D )
184+ if (
185+ p.type == GL_SAMPLER_1D || p.type == GL_SAMPLER_2D || p.type == GL_SAMPLER_3D ||
186+ p.type == GL_INT_SAMPLER_1D || p.type == GL_INT_SAMPLER_2D || p.type == GL_INT_SAMPLER_3D ||
187+ p.type == GL_UNSIGNED_INT_SAMPLER_1D || p.type == GL_UNSIGNED_INT_SAMPLER_2D || p.type == GL_UNSIGNED_INT_SAMPLER_3D
188+ )
185189 {
186190 // we assign a specific texture unit to each individual
187191 // sampler parameter - this makes it much easier to save
@@ -663,8 +667,10 @@ const Shader *Shader::Setup::shader() const
663667void Shader::Setup::addUniformParameter ( const std::string &name, ConstTexturePtr value )
664668{
665669 const Parameter *p = m_memberData->shader ->uniformParameter ( name );
666- if ( !p || p->type != GL_SAMPLER_2D )
670+ if ( !p || ( p->type != GL_SAMPLER_2D && p-> type != GL_INT_SAMPLER_2D && p-> type != GL_UNSIGNED_INT_SAMPLER_2D ) )
667671 {
672+ // We can only support 2D samplers, because `Texture::bind()`
673+ // unconditionally uses the GL_TEXTURE_2D target.
668674 return ;
669675 }
670676
You can’t perform that action at this time.
0 commit comments