diff options
author | Android Chromium Automerger <chromium-automerger@android> | 2013-11-05 02:34:42 +0000 |
---|---|---|
committer | Android Chromium Automerger <chromium-automerger@android> | 2013-11-05 02:34:42 +0000 |
commit | 6ac4a93b7b4d0d1a1c48bb2d1a7af35b879ce6c7 (patch) | |
tree | 4f495bd940e7c5ee67033cb5cfa12b38b0099215 | |
parent | 6d455ce3bce1e1e07eaaf02ff74e645488d28c76 (diff) | |
parent | 9c318342233f68b915d39c8f1f181b9ef545c4db (diff) | |
download | angle_dx11-6ac4a93b7b4d0d1a1c48bb2d1a7af35b879ce6c7.tar.gz |
Merge third_party/angle_dx11 from https://chromium.googlesource.com/external/angle.git at 9c318342233f68b915d39c8f1f181b9ef545c4db
This commit was generated by merge_from_chromium.py.
Change-Id: I362f70d6dcdf0f8446efef9b0d27f8db770433d5
-rw-r--r-- | AUTHORS | 1 | ||||
-rw-r--r-- | src/compiler/InfoSink.h | 1 | ||||
-rw-r--r-- | src/compiler/preprocessor/ExpressionParser.cpp | 6 | ||||
-rw-r--r-- | src/compiler/preprocessor/ExpressionParser.y | 6 | ||||
-rw-r--r-- | src/libGLESv2/Context.cpp | 28 | ||||
-rw-r--r-- | src/libGLESv2/Context.h | 4 | ||||
-rw-r--r-- | src/libGLESv2/Renderbuffer.cpp | 15 | ||||
-rw-r--r-- | src/libGLESv2/Renderbuffer.h | 5 | ||||
-rw-r--r-- | src/libGLESv2/renderer/Renderer11.cpp | 21 | ||||
-rw-r--r-- | src/libGLESv2/renderer/VertexDataManager.cpp | 4 |
10 files changed, 88 insertions, 3 deletions
@@ -13,6 +13,7 @@ TransGaming Inc. Adobe Systems Inc. Autodesk, Inc. +BlackBerry Limited Cloud Party, Inc. Intel Corporation Mozilla Corporation diff --git a/src/compiler/InfoSink.h b/src/compiler/InfoSink.h index 68888381..be0ddffe 100644 --- a/src/compiler/InfoSink.h +++ b/src/compiler/InfoSink.h @@ -8,6 +8,7 @@ #define _INFOSINK_INCLUDED_ #include <math.h> +#include <stdlib.h> #include "compiler/Common.h" // Returns the fractional part of the given floating-point number. diff --git a/src/compiler/preprocessor/ExpressionParser.cpp b/src/compiler/preprocessor/ExpressionParser.cpp index 67966e95..06c94382 100644 --- a/src/compiler/preprocessor/ExpressionParser.cpp +++ b/src/compiler/preprocessor/ExpressionParser.cpp @@ -92,6 +92,12 @@ #include "ExpressionParser.h" +#if defined(_MSC_VER) +#include <malloc.h> +#else +#include <stdlib.h> +#endif + #include <cassert> #include <sstream> diff --git a/src/compiler/preprocessor/ExpressionParser.y b/src/compiler/preprocessor/ExpressionParser.y index b6d3143e..27ed6ad5 100644 --- a/src/compiler/preprocessor/ExpressionParser.y +++ b/src/compiler/preprocessor/ExpressionParser.y @@ -33,6 +33,12 @@ WHICH GENERATES THE GLSL ES preprocessor expression parser. #include "ExpressionParser.h" +#if defined(_MSC_VER) +#include <malloc.h> +#else +#include <stdlib.h> +#endif + #include <cassert> #include <sstream> diff --git a/src/libGLESv2/Context.cpp b/src/libGLESv2/Context.cpp index e084db1a..fba4104d 100644 --- a/src/libGLESv2/Context.cpp +++ b/src/libGLESv2/Context.cpp @@ -1812,6 +1812,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); @@ -1825,7 +1827,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); @@ -2655,6 +2658,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) diff --git a/src/libGLESv2/Context.h b/src/libGLESv2/Context.h index 349ec130..09eede9f 100644 --- a/src/libGLESv2/Context.h +++ b/src/libGLESv2/Context.h @@ -18,6 +18,7 @@ #include <string> #include <map> +#include <set> #ifdef _MSC_VER #include <hash_map> #else @@ -420,6 +421,9 @@ class Context void initExtensionString(); void initRendererString(); + typedef std::set<unsigned> FramebufferTextureSerialSet; + FramebufferTextureSerialSet getBoundFramebufferTextureSerials(); + rx::Renderer *const mRenderer; State mState; diff --git a/src/libGLESv2/Renderbuffer.cpp b/src/libGLESv2/Renderbuffer.cpp index 12751374..98d33ec6 100644 --- a/src/libGLESv2/Renderbuffer.cpp +++ b/src/libGLESv2/Renderbuffer.cpp @@ -129,6 +129,11 @@ unsigned int RenderbufferTexture2D::getSerial() const return mTexture2D->getRenderTargetSerial(mTarget); } +unsigned int RenderbufferTexture2D::getTextureSerial() const +{ + return mTexture2D->getTextureSerial(); +} + ///// RenderbufferTextureCubeMap Implementation //////// RenderbufferTextureCubeMap::RenderbufferTextureCubeMap(TextureCubeMap *texture, GLenum target) : mTarget(target) @@ -193,6 +198,11 @@ unsigned int RenderbufferTextureCubeMap::getSerial() const return mTextureCubeMap->getRenderTargetSerial(mTarget); } +unsigned int RenderbufferTextureCubeMap::getTextureSerial() const +{ + return mTextureCubeMap->getTextureSerial(); +} + ////// Renderbuffer Implementation ////// Renderbuffer::Renderbuffer(rx::Renderer *renderer, GLuint id, RenderbufferInterface *instance) : RefCountObject(id) @@ -292,6 +302,11 @@ unsigned int Renderbuffer::getSerial() const return mInstance->getSerial(); } +unsigned int Renderbuffer::getTextureSerial() const +{ + return mInstance->getTextureSerial(); +} + void Renderbuffer::setStorage(RenderbufferStorage *newStorage) { ASSERT(newStorage != NULL); diff --git a/src/libGLESv2/Renderbuffer.h b/src/libGLESv2/Renderbuffer.h index eca2f3a7..d46fd445 100644 --- a/src/libGLESv2/Renderbuffer.h +++ b/src/libGLESv2/Renderbuffer.h @@ -60,6 +60,7 @@ class RenderbufferInterface GLuint getStencilSize() const; virtual unsigned int getSerial() const = 0; + virtual unsigned int getTextureSerial() const = 0; private: DISALLOW_COPY_AND_ASSIGN(RenderbufferInterface); @@ -85,6 +86,7 @@ class RenderbufferTexture2D : public RenderbufferInterface virtual GLsizei getSamples() const; virtual unsigned int getSerial() const; + virtual unsigned int getTextureSerial() const; private: DISALLOW_COPY_AND_ASSIGN(RenderbufferTexture2D); @@ -113,6 +115,7 @@ class RenderbufferTextureCubeMap : public RenderbufferInterface virtual GLsizei getSamples() const; virtual unsigned int getSerial() const; + virtual unsigned int getTextureSerial() const; private: DISALLOW_COPY_AND_ASSIGN(RenderbufferTextureCubeMap); @@ -141,6 +144,7 @@ class RenderbufferStorage : public RenderbufferInterface virtual GLsizei getSamples() const; virtual unsigned int getSerial() const; + virtual unsigned int getTextureSerial() const { return 0; } static unsigned int issueSerial(); static unsigned int issueCubeSerials(); @@ -193,6 +197,7 @@ class Renderbuffer : public RefCountObject GLsizei getSamples() const; unsigned int getSerial() const; + unsigned int getTextureSerial() const; void setStorage(RenderbufferStorage *newStorage); diff --git a/src/libGLESv2/renderer/Renderer11.cpp b/src/libGLESv2/renderer/Renderer11.cpp index 6f4da5c6..150e14c2 100644 --- a/src/libGLESv2/renderer/Renderer11.cpp +++ b/src/libGLESv2/renderer/Renderer11.cpp @@ -243,8 +243,6 @@ EGLint Renderer11::initialize() { D3D11_MESSAGE_ID hideMessages[] = { - D3D11_MESSAGE_ID_DEVICE_OMSETRENDERTARGETS_HAZARD, - D3D11_MESSAGE_ID_DEVICE_PSSETSHADERRESOURCES_HAZARD, D3D11_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET }; @@ -919,6 +917,25 @@ bool Renderer11::applyRenderTarget(gl::Framebuffer *framebuffer) renderTargetFormat = colorbuffer->getActualFormat(); missingColorRenderTarget = false; } + +#ifdef _DEBUG + // Workaround for Debug SETSHADERRESOURCES_HAZARD D3D11 warnings + for (unsigned int vertexSerialIndex = 0; vertexSerialIndex < gl::IMPLEMENTATION_MAX_VERTEX_TEXTURE_IMAGE_UNITS; vertexSerialIndex++) + { + if (colorbuffer->getTextureSerial() != 0 && mCurVertexTextureSerials[vertexSerialIndex] == colorbuffer->getTextureSerial()) + { + setTexture(gl::SAMPLER_VERTEX, vertexSerialIndex, NULL); + } + } + + for (unsigned int pixelSerialIndex = 0; pixelSerialIndex < gl::MAX_TEXTURE_IMAGE_UNITS; pixelSerialIndex++) + { + if (colorbuffer->getTextureSerial() != 0 && mCurPixelTextureSerials[pixelSerialIndex] == colorbuffer->getTextureSerial()) + { + setTexture(gl::SAMPLER_PIXEL, pixelSerialIndex, NULL); + } + } +#endif } } diff --git a/src/libGLESv2/renderer/VertexDataManager.cpp b/src/libGLESv2/renderer/VertexDataManager.cpp index 7ff5171f..8034aed8 100644 --- a/src/libGLESv2/renderer/VertexDataManager.cpp +++ b/src/libGLESv2/renderer/VertexDataManager.cpp @@ -266,6 +266,10 @@ GLenum VertexDataManager::prepareVertexData(const gl::VertexAttribute attribs[], return GL_OUT_OF_MEMORY; } + mCurrentValue[i][0] = attribs[i].mCurrentValue[0]; + mCurrentValue[i][1] = attribs[i].mCurrentValue[1]; + mCurrentValue[i][2] = attribs[i].mCurrentValue[2]; + mCurrentValue[i][3] = attribs[i].mCurrentValue[3]; mCurrentValueOffsets[i] = streamOffset; } |