Commit c8b3d68a authored by Geoff Lang's avatar Geoff Lang Committed by Commit Bot

When binding an image to a texture, make sure the texture is bound.

The the passthrough command decoder did deferred image bindings, it didn't
ensure that the correct GL texture was bound first.  This caused canvas ->
WebGL copies to fail when they are using IOSurface backed canvases.

BUG=990368
TBR=true

Change-Id: I5d555c7a715d0f47382053840c3db78576dc4e82
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1819520
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Reviewed-by: default avatarGeoff Lang <geofflang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#701645}
parent 74f14793
......@@ -319,18 +319,6 @@ crbug.com/990368 [ mac passthrough ] conformance/canvas/canvas-test.html [ Failu
crbug.com/990368 [ mac passthrough ] conformance/canvas/draw-static-webgl-to-multiple-canvas-test.html [ Failure ]
crbug.com/990368 [ mac passthrough ] conformance/canvas/draw-webgl-to-canvas-test.html [ Failure ]
crbug.com/990368 [ mac passthrough ] conformance/canvas/to-data-url-test.html [ Failure ]
crbug.com/990368 [ mac passthrough ] conformance/extensions/oes-texture-float-linear.html [ Failure ]
crbug.com/990368 [ mac passthrough ] conformance/extensions/oes-texture-float-with-canvas.html [ Failure ]
crbug.com/990368 [ mac passthrough ] conformance/glsl/samplers/glsl-function-texture2dproj.html [ Failure ]
crbug.com/990368 [ mac passthrough ] conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_byte.html [ Failure ]
crbug.com/990368 [ mac passthrough ] conformance/textures/canvas/tex-2d-rgb-rgb-unsigned_short_5_6_5.html [ Failure ]
crbug.com/990368 [ mac passthrough ] conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_byte.html [ Failure ]
crbug.com/990368 [ mac passthrough ] conformance/textures/canvas/tex-2d-rgba-rgba-unsigned_short_4_4_4_4.html [ Failure ]
crbug.com/990368 [ mac passthrough ] conformance/textures/misc/canvas-teximage-after-multiple-drawimages.html [ Failure ]
crbug.com/990368 [ mac passthrough ] conformance/textures/misc/texparameter-test.html [ Failure ]
crbug.com/990368 [ mac passthrough ] conformance/textures/misc/texture-active-bind-2.html [ Failure ]
crbug.com/990368 [ mac passthrough ] conformance/textures/misc/texture-active-bind.html [ Failure ]
crbug.com/990368 [ mac passthrough ] conformance/textures/misc/texture-npot.html [ Failure ]
crbug.com/angleproject/3812 [ mac passthrough ] conformance/context/context-attribute-preserve-drawing-buffer.html [ Failure ]
crbug.com/990368 [ mac passthrough ] conformance/context/premultiplyalpha-test.html [ Failure ]
crbug.com/989194 [ mac passthrough ] conformance/extensions/oes-texture-float-with-video.html [ Failure ]
......
......@@ -1747,6 +1747,11 @@ void GLES2DecoderPassthroughImpl::BindOnePendingImage(
if (!image)
return;
// Because the binding is deferred, this texture may not be currently bound
// any more. Bind it again.
GLenum texture_type = TextureTargetToTextureType(target);
api()->glBindTextureFn(texture_type, texture->service_id());
// TODO: internalformat?
if (image->ShouldBindOrCopy() == gl::GLImage::BIND)
image->BindTexImage(target);
......@@ -1757,6 +1762,14 @@ void GLES2DecoderPassthroughImpl::BindOnePendingImage(
// However, for now, we only try once.
texture->set_is_bind_pending(false);
// Re-bind the previous texture
const BoundTexture& bound_texture =
bound_textures_[static_cast<size_t>(GLenumToTextureTarget(texture_type))]
[active_texture_unit_];
GLuint prev_texture =
bound_texture.texture ? bound_texture.texture->service_id() : 0;
api()->glBindTextureFn(texture_type, prev_texture);
// Update any binding points that are currently bound for this texture.
RebindTexture(texture);
......
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