Fixes program validation regression.

TRAC #11654 The sampler validation at render time was occurring before uniforms were applied and samplers were bound to their texture units. Sampler validation now occurs after shaders and textures have been applied. Signed-off-by: Andrew Lewycky Signed-off-by: Daniel Koch Author: Shannon Woods git-svn-id: https://angleproject.googlecode.com/svn/trunk@207 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent dec19e20
...@@ -1862,11 +1862,6 @@ void Context::drawArrays(GLenum mode, GLint first, GLsizei count) ...@@ -1862,11 +1862,6 @@ void Context::drawArrays(GLenum mode, GLint first, GLsizei count)
return; return;
} }
if (!getCurrentProgram()->validateSamplers())
{
return error(GL_INVALID_OPERATION);
}
if (!applyRenderTarget(false)) if (!applyRenderTarget(false))
{ {
return error(GL_INVALID_FRAMEBUFFER_OPERATION); return error(GL_INVALID_FRAMEBUFFER_OPERATION);
...@@ -1877,6 +1872,11 @@ void Context::drawArrays(GLenum mode, GLint first, GLsizei count) ...@@ -1877,6 +1872,11 @@ void Context::drawArrays(GLenum mode, GLint first, GLsizei count)
applyShaders(); applyShaders();
applyTextures(); applyTextures();
if (!getCurrentProgram()->validateSamplers())
{
return error(GL_INVALID_OPERATION);
}
if (!cullSkipsDraw(mode)) if (!cullSkipsDraw(mode))
{ {
device->BeginScene(); device->BeginScene();
...@@ -1909,11 +1909,6 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, const void* ...@@ -1909,11 +1909,6 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, const void*
return; return;
} }
if (!getCurrentProgram()->validateSamplers())
{
return error(GL_INVALID_OPERATION);
}
if (!applyRenderTarget(false)) if (!applyRenderTarget(false))
{ {
return error(GL_INVALID_FRAMEBUFFER_OPERATION); return error(GL_INVALID_FRAMEBUFFER_OPERATION);
...@@ -1925,6 +1920,11 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, const void* ...@@ -1925,6 +1920,11 @@ void Context::drawElements(GLenum mode, GLsizei count, GLenum type, const void*
applyShaders(); applyShaders();
applyTextures(); applyTextures();
if (!getCurrentProgram()->validateSamplers())
{
return error(GL_INVALID_OPERATION);
}
if (!cullSkipsDraw(mode)) if (!cullSkipsDraw(mode))
{ {
device->BeginScene(); device->BeginScene();
......
...@@ -2205,7 +2205,10 @@ void Program::validate() ...@@ -2205,7 +2205,10 @@ void Program::validate()
appendToInfoLog("Program has not been successfully linked."); appendToInfoLog("Program has not been successfully linked.");
mValidated = false; mValidated = false;
} }
else if (!validateSamplers()) else
{
applyUniforms();
if (!validateSamplers())
{ {
appendToInfoLog("Samplers of conflicting types refer to the same texture image unit."); appendToInfoLog("Samplers of conflicting types refer to the same texture image unit.");
mValidated = false; mValidated = false;
...@@ -2214,6 +2217,7 @@ void Program::validate() ...@@ -2214,6 +2217,7 @@ void Program::validate()
{ {
mValidated = true; mValidated = true;
} }
}
} }
bool Program::validateSamplers() const bool Program::validateSamplers() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment