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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user