summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/libGLESv2/Context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/angle/src/libGLESv2/Context.cpp')
-rw-r--r--src/3rdparty/angle/src/libGLESv2/Context.cpp30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/3rdparty/angle/src/libGLESv2/Context.cpp b/src/3rdparty/angle/src/libGLESv2/Context.cpp
index e829d508a6..e651785aed 100644
--- a/src/3rdparty/angle/src/libGLESv2/Context.cpp
+++ b/src/3rdparty/angle/src/libGLESv2/Context.cpp
@@ -1779,7 +1779,7 @@ void Context::applyState(GLenum drawMode)
{
mask = 0xFFFFFFFF;
}
- mRenderer->setBlendState(mState.blend, mState.blendColor, mask);
+ mRenderer->setBlendState(framebufferObject, mState.blend, mState.blendColor, mask);
mRenderer->setDepthStencilState(mState.depthStencil, mState.stencilRef, mState.stencilBackRef,
mState.rasterizer.frontFace == GL_CCW);
@@ -1813,6 +1813,8 @@ void Context::applyTextures(SamplerType type)
{
ProgramBinary *programBinary = getCurrentProgramBinary();
+ FramebufferTextureSerialSet boundFramebufferTextures = getBoundFramebufferTextureSerials();
+
// Range of Direct3D samplers of given sampler type
int samplerCount = (type == SAMPLER_PIXEL) ? MAX_TEXTURE_IMAGE_UNITS : mRenderer->getMaxVertexTextureImageUnits();
int samplerRange = programBinary->getUsedSamplerRange(type);
@@ -1826,7 +1828,8 @@ void Context::applyTextures(SamplerType type)
TextureType textureType = programBinary->getSamplerTextureType(type, samplerIndex);
Texture *texture = getSamplerTexture(textureUnit, textureType);
- if (texture->isSamplerComplete())
+ if (texture->isSamplerComplete() &&
+ boundFramebufferTextures.find(texture->getTextureSerial()) == boundFramebufferTextures.end())
{
SamplerState samplerState;
texture->getSamplerState(&samplerState);
@@ -2656,6 +2659,29 @@ const char *Context::getRendererString() const
return mRendererString;
}
+Context::FramebufferTextureSerialSet Context::getBoundFramebufferTextureSerials()
+{
+ FramebufferTextureSerialSet set;
+
+ Framebuffer *drawFramebuffer = getDrawFramebuffer();
+ for (unsigned int i = 0; i < IMPLEMENTATION_MAX_DRAW_BUFFERS; i++)
+ {
+ Renderbuffer *renderBuffer = drawFramebuffer->getColorbuffer(i);
+ if (renderBuffer && renderBuffer->getTextureSerial() != 0)
+ {
+ set.insert(renderBuffer->getTextureSerial());
+ }
+ }
+
+ Renderbuffer *depthStencilBuffer = drawFramebuffer->getDepthOrStencilbuffer();
+ if (depthStencilBuffer && depthStencilBuffer->getTextureSerial() != 0)
+ {
+ set.insert(depthStencilBuffer->getTextureSerial());
+ }
+
+ return set;
+}
+
void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask)