Always call bind sampler function.

This fixes errors for Intel HD4000 on Windows.

My understending of this issue is following:
- a shader assigned two textures, i.e. texture1 = sampler1, texture2=sampler2
- then next shader (i.e. importance sampling specular) assigned two textures: texture1=sampler1, texture2=without_sampler
- when we executed setTextureUnits, the glBindSampler function wasn't called at all, so the drivers were trying to use combination texture2=sampler2, even though the sampler2 was prepared for different texture and most likely was already deleted.

We can just always call the glBindSampler function, so that if texture doesn't have a sampler, it will execute it with sampler_id=0 param, which is practically an "unbind" function.
This commit is contained in:
Deve
2017-02-17 01:03:08 +01:00
parent f181acea3d
commit 251c46dcc4

View File

@@ -185,8 +185,7 @@ public:
{
glActiveTexture(GL_TEXTURE0 + m_texture_units[N]);
glBindTexture(m_texture_type[N], tex_id);
if (m_sampler_ids[N] != 0)
glBindSampler(m_texture_units[N], m_sampler_ids[N]);
glBindSampler(m_texture_units[N], m_sampler_ids[N]);
}
else
{