Commit 5faa15bf by Austin Kinross Committed by Jamie Madill

Fix null sampler warning in TextureTest.TextureNPOT_GL_ALPHA_UBYTE

The test deliberately tries to render a scene using an invalid texture. ANGLE rendered this correctly, but when it bound the dummy 1x1 black texture that's used instead of invalid textures, it didn't bind a sampler state. This meant that D3D had no pixel shader samplers bound, and outputted a debug warning. Also, technically the test should have been setting GL_UNPACK_ALIGNMENT=1, but that wasn't impacting the result of the test. BUG=angleproject:1248 Change-Id: I871706d518077ea840a585ae0df8f9176e130cb1 Reviewed-on: https://chromium-review.googlesource.com/321391Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 2173db3d
...@@ -427,7 +427,15 @@ gl::Error RendererD3D::applyTextures(const gl::Data &data, gl::SamplerType shade ...@@ -427,7 +427,15 @@ gl::Error RendererD3D::applyTextures(const gl::Data &data, gl::SamplerType shade
{ {
// Texture is not sampler complete or it is in use by the framebuffer. Bind the incomplete texture. // Texture is not sampler complete or it is in use by the framebuffer. Bind the incomplete texture.
gl::Texture *incompleteTexture = getIncompleteTexture(textureType); gl::Texture *incompleteTexture = getIncompleteTexture(textureType);
gl::Error error = setTexture(shaderType, samplerIndex, incompleteTexture);
gl::Error error = setSamplerState(shaderType, samplerIndex, incompleteTexture,
incompleteTexture->getSamplerState());
if (error.isError())
{
return error;
}
error = setTexture(shaderType, samplerIndex, incompleteTexture);
if (error.isError()) if (error.isError())
{ {
return error; return error;
......
...@@ -885,6 +885,9 @@ TEST_P(Texture2DTest, TextureNPOT_GL_ALPHA_UBYTE) ...@@ -885,6 +885,9 @@ TEST_P(Texture2DTest, TextureNPOT_GL_ALPHA_UBYTE)
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
// Default unpack alignment is 4. The values of 'pixels' below needs it to be 1.
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glActiveTexture(GL_TEXTURE0); glActiveTexture(GL_TEXTURE0);
glGenTextures(1, &tex2D); glGenTextures(1, &tex2D);
glBindTexture(GL_TEXTURE_2D, tex2D); glBindTexture(GL_TEXTURE_2D, tex2D);
......
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