Set non-mipmapped sampler parameters for emulated backbuffer textures.
When chrome samples these textures to composite them, the sampler parameters are unchanged and the texture becomes incomplete. BUG=665521 Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I170d329cbebb44a2b01d8567e97410cd4a250fb5 Reviewed-on: https://chromium-review.googlesource.com/667996 Reviewed-by: Antoine Labour <piman@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Cr-Commit-Position: refs/heads/master@{#502289}
This commit is contained in:
gpu/command_buffer
@ -186,6 +186,10 @@ GLES2DecoderPassthroughImpl::EmulatedColorBuffer::EmulatedColorBuffer(
|
||||
GLuint color_buffer_texture = 0;
|
||||
glGenTextures(1, &color_buffer_texture);
|
||||
glBindTexture(GL_TEXTURE_2D, color_buffer_texture);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
texture = new TexturePassthrough(color_buffer_texture, GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
|
@ -530,6 +530,41 @@ TEST_F(GLTextureMailboxTest, FrontBufferChangeColor) {
|
||||
}
|
||||
}
|
||||
|
||||
// Verify that front buffer textures have sampler parameters that will not cause
|
||||
// them to be incomplete when sampled
|
||||
TEST_F(GLTextureMailboxTest, FrontBufferSamplerParameters) {
|
||||
SetUpContexts();
|
||||
gl1_.MakeCurrent();
|
||||
Mailbox mailbox;
|
||||
glGenMailboxCHROMIUM(mailbox.name);
|
||||
|
||||
gl2_.MakeCurrent();
|
||||
glResizeCHROMIUM(10, 10, 1, GL_COLOR_SPACE_UNSPECIFIED_CHROMIUM, true);
|
||||
glClearColor(0, 1, 1, 1);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
::gles2::GetGLContext()->SwapBuffers();
|
||||
gl2_.decoder()->TakeFrontBuffer(mailbox);
|
||||
|
||||
gl1_.MakeCurrent();
|
||||
GLuint tex1;
|
||||
glGenTextures(1, &tex1);
|
||||
glBindTexture(GL_TEXTURE_2D, tex1);
|
||||
glConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name);
|
||||
EXPECT_EQ(static_cast<GLenum>(GL_NO_ERROR), glGetError());
|
||||
|
||||
constexpr std::pair<GLenum, GLint> expected_parameters[] = {
|
||||
{GL_TEXTURE_MAG_FILTER, GL_LINEAR},
|
||||
{GL_TEXTURE_MIN_FILTER, GL_LINEAR},
|
||||
{GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE},
|
||||
{GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE},
|
||||
};
|
||||
for (const auto& expected_parameter : expected_parameters) {
|
||||
GLint value = 0;
|
||||
glGetTexParameteriv(GL_TEXTURE_2D, expected_parameter.first, &value);
|
||||
EXPECT_EQ(expected_parameter.second, value);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_F(GLTextureMailboxTest, ProduceTextureDirectInvalidTarget) {
|
||||
SetUpContexts();
|
||||
gl1_.MakeCurrent();
|
||||
|
Reference in New Issue
Block a user