Remove useless ifdef.
It should depend on features available in graphics drivers and not on headers that were used for compilation. In theory there was a possible case that GL_VERSION_3_3 was not defined and CVS->getGLSLVersion() >= 330 was true, so that bind wasn't done at all. And still GL_VERSION_3_3 should be always true for OpenGL renderer because it's defined in glew.
This commit is contained in:
parent
3c8369b915
commit
d124c61e3c
@ -248,7 +248,6 @@ GLuint TextureShaderBase::createSamplers(SamplerTypeNew sampler_type)
|
||||
// ----------------------------------------------------------------------------
|
||||
GLuint TextureShaderBase::createNearestSampler()
|
||||
{
|
||||
#ifdef GL_VERSION_3_3
|
||||
unsigned id;
|
||||
glGenSamplers(1, &id);
|
||||
glSamplerParameteri(id, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
@ -258,13 +257,11 @@ GLuint TextureShaderBase::createNearestSampler()
|
||||
if (CVS->isEXTTextureFilterAnisotropicUsable())
|
||||
glSamplerParameterf(id, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.);
|
||||
return id;
|
||||
#endif
|
||||
} // createNearestSampler
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
GLuint TextureShaderBase::createTrilinearSampler()
|
||||
{
|
||||
#ifdef GL_VERSION_3_3
|
||||
unsigned id;
|
||||
glGenSamplers(1, &id);
|
||||
glSamplerParameteri(id, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
@ -279,13 +276,11 @@ GLuint TextureShaderBase::createTrilinearSampler()
|
||||
glSamplerParameterf(id, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)aniso);
|
||||
}
|
||||
return id;
|
||||
#endif
|
||||
} // createTrilinearSampler
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
GLuint TextureShaderBase::createBilinearSampler()
|
||||
{
|
||||
#ifdef GL_VERSION_3_3
|
||||
unsigned id;
|
||||
glGenSamplers(1, &id);
|
||||
glSamplerParameteri(id, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
@ -295,12 +290,10 @@ GLuint TextureShaderBase::createBilinearSampler()
|
||||
if (CVS->isEXTTextureFilterAnisotropicUsable())
|
||||
glSamplerParameterf(id, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.);
|
||||
return id;
|
||||
#endif
|
||||
} // createBilinearSampler
|
||||
// ----------------------------------------------------------------------------
|
||||
GLuint TextureShaderBase::createShadowSampler()
|
||||
{
|
||||
#ifdef GL_VERSION_3_3
|
||||
unsigned id;
|
||||
glGenSamplers(1, &id);
|
||||
glSamplerParameteri(id, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
@ -310,13 +303,11 @@ GLuint TextureShaderBase::createShadowSampler()
|
||||
glSamplerParameterf(id, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE);
|
||||
glSamplerParameterf(id, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
|
||||
return id;
|
||||
#endif
|
||||
} // createShadowSampler
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
GLuint TextureShaderBase::createBilinearClampedSampler()
|
||||
{
|
||||
#ifdef GL_VERSION_3_3
|
||||
unsigned id;
|
||||
glGenSamplers(1, &id);
|
||||
glSamplerParameteri(id, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
@ -326,14 +317,12 @@ GLuint TextureShaderBase::createBilinearClampedSampler()
|
||||
if (CVS->isEXTTextureFilterAnisotropicUsable())
|
||||
glSamplerParameterf(id, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.);
|
||||
return id;
|
||||
#endif
|
||||
} // createBilinearClampedSampler
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
GLuint TextureShaderBase::createTrilinearClampedArray()
|
||||
{
|
||||
#ifdef GL_VERSION_3_3
|
||||
unsigned id;
|
||||
glGenSamplers(1, &id);
|
||||
glSamplerParameteri(id, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
@ -348,12 +337,10 @@ GLuint TextureShaderBase::createTrilinearClampedArray()
|
||||
glSamplerParameterf(id, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)aniso);
|
||||
}
|
||||
return id;
|
||||
#endif
|
||||
} // createTrilinearClampedArray
|
||||
// ----------------------------------------------------------------------------
|
||||
GLuint TextureShaderBase::createSemiTrilinearSampler()
|
||||
{
|
||||
#ifdef GL_VERSION_3_3
|
||||
unsigned id;
|
||||
glGenSamplers(1, &id);
|
||||
glSamplerParameteri(id, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
@ -363,7 +350,6 @@ GLuint TextureShaderBase::createSemiTrilinearSampler()
|
||||
if (CVS->isEXTTextureFilterAnisotropicUsable())
|
||||
glSamplerParameterf(id, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.);
|
||||
return id;
|
||||
#endif
|
||||
} // createSemiTrilinearSampler
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -173,11 +173,9 @@ public:
|
||||
{
|
||||
if (CVS->getGLSLVersion() >= 330)
|
||||
{
|
||||
#ifdef GL_VERSION_3_3
|
||||
glActiveTexture(GL_TEXTURE0 + m_texture_units[N]);
|
||||
glBindTexture(m_texture_type[N], tex_id);
|
||||
glBindSampler(m_texture_units[N], m_sampler_ids[N]);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user