Commit 64839155 by Geoff Lang

Update blit calls to return Error objects instead of calling gl::error.

BUG=angle:520 Change-Id: I94c3ad327433cf275744e98be6cb2ba91be49c0f Reviewed-on: https://chromium-review.googlesource.com/216640Reviewed-by: 's avatarBrandon Jones <bajones@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent f7ed7054
...@@ -2319,8 +2319,8 @@ size_t Context::getBoundFramebufferTextureSerials(FramebufferTextureSerialArray ...@@ -2319,8 +2319,8 @@ size_t Context::getBoundFramebufferTextureSerials(FramebufferTextureSerialArray
return serialCount; return serialCount;
} }
void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, Error Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter) GLbitfield mask, GLenum filter)
{ {
Framebuffer *readFramebuffer = mState.getReadFramebuffer(); Framebuffer *readFramebuffer = mState.getReadFramebuffer();
Framebuffer *drawFramebuffer = mState.getDrawFramebuffer(); Framebuffer *drawFramebuffer = mState.getDrawFramebuffer();
...@@ -2345,10 +2345,16 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1 ...@@ -2345,10 +2345,16 @@ void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1
Rectangle dstRect(dstX0, dstY0, dstX1 - dstX0, dstY1 - dstY0); Rectangle dstRect(dstX0, dstY0, dstX1 - dstX0, dstY1 - dstY0);
if (blitRenderTarget || blitDepth || blitStencil) if (blitRenderTarget || blitDepth || blitStencil)
{ {
const Rectangle *scissor = mState.isScissorTestEnabled() ? &mState.getScissor() : NULL; const gl::Rectangle *scissor = mState.isScissorTestEnabled() ? &mState.getScissor() : NULL;
mRenderer->blitRect(readFramebuffer, srcRect, drawFramebuffer, dstRect, scissor, gl::Error error = mRenderer->blitRect(readFramebuffer, srcRect, drawFramebuffer, dstRect, scissor,
blitRenderTarget, blitDepth, blitStencil, filter); blitRenderTarget, blitDepth, blitStencil, filter);
if (error.isError())
{
return error;
}
} }
return gl::Error(GL_NO_ERROR);
} }
void Context::releaseShaderCompiler() void Context::releaseShaderCompiler()
......
...@@ -215,8 +215,8 @@ class Context ...@@ -215,8 +215,8 @@ class Context
void getCurrentReadFormatType(GLenum *internalFormat, GLenum *format, GLenum *type); void getCurrentReadFormatType(GLenum *internalFormat, GLenum *format, GLenum *type);
void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, Error blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter); GLbitfield mask, GLenum filter);
rx::Renderer *getRenderer() { return mRenderer; } rx::Renderer *getRenderer() { return mRenderer; }
......
...@@ -5644,8 +5644,13 @@ void __stdcall glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint sr ...@@ -5644,8 +5644,13 @@ void __stdcall glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint sr
return; return;
} }
context->blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, gl::Error error = context->blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1,
mask, filter); mask, filter);
if (error.isError())
{
context->recordError(error);
return;
}
} }
} }
...@@ -8294,8 +8299,13 @@ void __stdcall glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLi ...@@ -8294,8 +8299,13 @@ void __stdcall glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLi
return; return;
} }
context->blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, gl::Error error = context->blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1,
mask, filter); mask, filter);
if (error.isError())
{
context->recordError(error);
return;
}
} }
} }
......
...@@ -184,8 +184,8 @@ class Renderer ...@@ -184,8 +184,8 @@ class Renderer
virtual bool copyImage2DArray(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat, virtual bool copyImage2DArray(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
GLint xoffset, GLint yoffset, GLint zOffset, TextureStorage *storage, GLint level) = 0; GLint xoffset, GLint yoffset, GLint zOffset, TextureStorage *storage, GLint level) = 0;
virtual bool blitRect(gl::Framebuffer *readTarget, const gl::Rectangle &readRect, gl::Framebuffer *drawTarget, const gl::Rectangle &drawRect, virtual gl::Error blitRect(gl::Framebuffer *readTarget, const gl::Rectangle &readRect, gl::Framebuffer *drawTarget, const gl::Rectangle &drawRect,
const gl::Rectangle *scissor, bool blitRenderTarget, bool blitDepth, bool blitStencil, GLenum filter) = 0; const gl::Rectangle *scissor, bool blitRenderTarget, bool blitDepth, bool blitStencil, GLenum filter) = 0;
virtual gl::Error readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, virtual gl::Error readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format,
GLenum type, GLuint outputPitch, const gl::PixelPackState &pack, uint8_t *pixels) = 0; GLenum type, GLuint outputPitch, const gl::PixelPackState &pack, uint8_t *pixels) = 0;
......
...@@ -504,9 +504,9 @@ gl::Error Blit11::swizzleTexture(ID3D11ShaderResourceView *source, ID3D11RenderT ...@@ -504,9 +504,9 @@ gl::Error Blit11::swizzleTexture(ID3D11ShaderResourceView *source, ID3D11RenderT
return gl::Error(GL_NO_ERROR); return gl::Error(GL_NO_ERROR);
} }
bool Blit11::copyTexture(ID3D11ShaderResourceView *source, const gl::Box &sourceArea, const gl::Extents &sourceSize, gl::Error Blit11::copyTexture(ID3D11ShaderResourceView *source, const gl::Box &sourceArea, const gl::Extents &sourceSize,
ID3D11RenderTargetView *dest, const gl::Box &destArea, const gl::Extents &destSize, ID3D11RenderTargetView *dest, const gl::Box &destArea, const gl::Extents &destSize,
const gl::Rectangle *scissor, GLenum destFormat, GLenum filter) const gl::Rectangle *scissor, GLenum destFormat, GLenum filter)
{ {
HRESULT result; HRESULT result;
ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext(); ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext();
...@@ -528,7 +528,7 @@ bool Blit11::copyTexture(ID3D11ShaderResourceView *source, const gl::Box &source ...@@ -528,7 +528,7 @@ bool Blit11::copyTexture(ID3D11ShaderResourceView *source, const gl::Box &source
if (i == mBlitShaderMap.end()) if (i == mBlitShaderMap.end())
{ {
UNREACHABLE(); UNREACHABLE();
return false; return gl::Error(GL_OUT_OF_MEMORY, "Could not find appropriate shader for internal texture blit.");
} }
const Shader& shader = i->second; const Shader& shader = i->second;
...@@ -538,8 +538,7 @@ bool Blit11::copyTexture(ID3D11ShaderResourceView *source, const gl::Box &source ...@@ -538,8 +538,7 @@ bool Blit11::copyTexture(ID3D11ShaderResourceView *source, const gl::Box &source
result = deviceContext->Map(mVertexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource); result = deviceContext->Map(mVertexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
if (FAILED(result)) if (FAILED(result))
{ {
ERR("Failed to map vertex buffer for texture copy, HRESULT: 0x%X.", result); return gl::Error(GL_OUT_OF_MEMORY, "Failed to map internal vertex buffer for texture copy, HRESULT: 0x%X.", result);
return false;
} }
UINT stride = 0; UINT stride = 0;
...@@ -609,7 +608,10 @@ bool Blit11::copyTexture(ID3D11ShaderResourceView *source, const gl::Box &source ...@@ -609,7 +608,10 @@ bool Blit11::copyTexture(ID3D11ShaderResourceView *source, const gl::Box &source
{ {
case GL_NEAREST: sampler = mPointSampler; break; case GL_NEAREST: sampler = mPointSampler; break;
case GL_LINEAR: sampler = mLinearSampler; break; case GL_LINEAR: sampler = mLinearSampler; break;
default: UNREACHABLE(); return false;
default:
UNREACHABLE();
return gl::Error(GL_OUT_OF_MEMORY, "Internal error, unknown blit filter mode.");
} }
deviceContext->PSSetSamplers(0, 1, &sampler); deviceContext->PSSetSamplers(0, 1, &sampler);
...@@ -627,21 +629,21 @@ bool Blit11::copyTexture(ID3D11ShaderResourceView *source, const gl::Box &source ...@@ -627,21 +629,21 @@ bool Blit11::copyTexture(ID3D11ShaderResourceView *source, const gl::Box &source
mRenderer->markAllStateDirty(); mRenderer->markAllStateDirty();
return true; return gl::Error(GL_NO_ERROR);
} }
bool Blit11::copyStencil(ID3D11Resource *source, unsigned int sourceSubresource, const gl::Box &sourceArea, const gl::Extents &sourceSize, gl::Error Blit11::copyStencil(ID3D11Resource *source, unsigned int sourceSubresource, const gl::Box &sourceArea, const gl::Extents &sourceSize,
ID3D11Resource *dest, unsigned int destSubresource, const gl::Box &destArea, const gl::Extents &destSize, ID3D11Resource *dest, unsigned int destSubresource, const gl::Box &destArea, const gl::Extents &destSize,
const gl::Rectangle *scissor) const gl::Rectangle *scissor)
{ {
return copyDepthStencil(source, sourceSubresource, sourceArea, sourceSize, return copyDepthStencil(source, sourceSubresource, sourceArea, sourceSize,
dest, destSubresource, destArea, destSize, dest, destSubresource, destArea, destSize,
scissor, true); scissor, true);
} }
bool Blit11::copyDepth(ID3D11ShaderResourceView *source, const gl::Box &sourceArea, const gl::Extents &sourceSize, gl::Error Blit11::copyDepth(ID3D11ShaderResourceView *source, const gl::Box &sourceArea, const gl::Extents &sourceSize,
ID3D11DepthStencilView *dest, const gl::Box &destArea, const gl::Extents &destSize, ID3D11DepthStencilView *dest, const gl::Box &destArea, const gl::Extents &destSize,
const gl::Rectangle *scissor) const gl::Rectangle *scissor)
{ {
HRESULT result; HRESULT result;
ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext(); ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext();
...@@ -651,8 +653,7 @@ bool Blit11::copyDepth(ID3D11ShaderResourceView *source, const gl::Box &sourceAr ...@@ -651,8 +653,7 @@ bool Blit11::copyDepth(ID3D11ShaderResourceView *source, const gl::Box &sourceAr
result = deviceContext->Map(mVertexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource); result = deviceContext->Map(mVertexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
if (FAILED(result)) if (FAILED(result))
{ {
ERR("Failed to map vertex buffer for texture copy, HRESULT: 0x%X.", result); return gl::Error(GL_OUT_OF_MEMORY, "Failed to map internal vertex buffer for texture copy, HRESULT: 0x%X.", result);
return false;
} }
UINT stride = 0; UINT stride = 0;
...@@ -733,21 +734,21 @@ bool Blit11::copyDepth(ID3D11ShaderResourceView *source, const gl::Box &sourceAr ...@@ -733,21 +734,21 @@ bool Blit11::copyDepth(ID3D11ShaderResourceView *source, const gl::Box &sourceAr
mRenderer->markAllStateDirty(); mRenderer->markAllStateDirty();
return true; return gl::Error(GL_NO_ERROR);
} }
bool Blit11::copyDepthStencil(ID3D11Resource *source, unsigned int sourceSubresource, const gl::Box &sourceArea, const gl::Extents &sourceSize, gl::Error Blit11::copyDepthStencil(ID3D11Resource *source, unsigned int sourceSubresource, const gl::Box &sourceArea, const gl::Extents &sourceSize,
ID3D11Resource *dest, unsigned int destSubresource, const gl::Box &destArea, const gl::Extents &destSize, ID3D11Resource *dest, unsigned int destSubresource, const gl::Box &destArea, const gl::Extents &destSize,
const gl::Rectangle *scissor) const gl::Rectangle *scissor)
{ {
return copyDepthStencil(source, sourceSubresource, sourceArea, sourceSize, return copyDepthStencil(source, sourceSubresource, sourceArea, sourceSize,
dest, destSubresource, destArea, destSize, dest, destSubresource, destArea, destSize,
scissor, false); scissor, false);
} }
bool Blit11::copyDepthStencil(ID3D11Resource *source, unsigned int sourceSubresource, const gl::Box &sourceArea, const gl::Extents &sourceSize, gl::Error Blit11::copyDepthStencil(ID3D11Resource *source, unsigned int sourceSubresource, const gl::Box &sourceArea, const gl::Extents &sourceSize,
ID3D11Resource *dest, unsigned int destSubresource, const gl::Box &destArea, const gl::Extents &destSize, ID3D11Resource *dest, unsigned int destSubresource, const gl::Box &destArea, const gl::Extents &destSize,
const gl::Rectangle *scissor, bool stencilOnly) const gl::Rectangle *scissor, bool stencilOnly)
{ {
ID3D11Device *device = mRenderer->getDevice(); ID3D11Device *device = mRenderer->getDevice();
ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext(); ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext();
...@@ -761,7 +762,7 @@ bool Blit11::copyDepthStencil(ID3D11Resource *source, unsigned int sourceSubreso ...@@ -761,7 +762,7 @@ bool Blit11::copyDepthStencil(ID3D11Resource *source, unsigned int sourceSubreso
{ {
SafeRelease(sourceStaging); SafeRelease(sourceStaging);
SafeRelease(destStaging); SafeRelease(destStaging);
return false; return gl::Error(GL_OUT_OF_MEMORY, "Failed to create internal staging textures for depth stencil blit.");
} }
DXGI_FORMAT format = GetTextureFormat(source); DXGI_FORMAT format = GetTextureFormat(source);
...@@ -782,23 +783,23 @@ bool Blit11::copyDepthStencil(ID3D11Resource *source, unsigned int sourceSubreso ...@@ -782,23 +783,23 @@ bool Blit11::copyDepthStencil(ID3D11Resource *source, unsigned int sourceSubreso
dxgiFormatInfo.depthBits % 8 == 0); dxgiFormatInfo.depthBits % 8 == 0);
} }
D3D11_MAPPED_SUBRESOURCE sourceMapping, destMapping; D3D11_MAPPED_SUBRESOURCE sourceMapping;
deviceContext->Map(sourceStaging, 0, D3D11_MAP_READ, 0, &sourceMapping); HRESULT result = deviceContext->Map(sourceStaging, 0, D3D11_MAP_READ, 0, &sourceMapping);
deviceContext->Map(destStaging, 0, D3D11_MAP_WRITE, 0, &destMapping); if (FAILED(result))
{
SafeRelease(sourceStaging);
SafeRelease(destStaging);
return gl::Error(GL_OUT_OF_MEMORY, "Failed to map internal source staging texture for depth stencil blit, HRESULT: 0x%X.", result);
}
if (!sourceMapping.pData || !destMapping.pData) D3D11_MAPPED_SUBRESOURCE destMapping;
result = deviceContext->Map(destStaging, 0, D3D11_MAP_WRITE, 0, &destMapping);
if (FAILED(result))
{ {
if (!sourceMapping.pData) deviceContext->Unmap(sourceStaging, 0);
{
deviceContext->Unmap(sourceStaging, 0);
}
if (!destMapping.pData)
{
deviceContext->Unmap(destStaging, 0);
}
SafeRelease(sourceStaging); SafeRelease(sourceStaging);
SafeRelease(destStaging); SafeRelease(destStaging);
return false; return gl::Error(GL_OUT_OF_MEMORY, "Failed to map internal destination staging texture for depth stencil blit, HRESULT: 0x%X.", result);
} }
gl::Rectangle clippedDestArea(destArea.x, destArea.y, destArea.width, destArea.height); gl::Rectangle clippedDestArea(destArea.x, destArea.y, destArea.width, destArea.height);
...@@ -877,7 +878,7 @@ bool Blit11::copyDepthStencil(ID3D11Resource *source, unsigned int sourceSubreso ...@@ -877,7 +878,7 @@ bool Blit11::copyDepthStencil(ID3D11Resource *source, unsigned int sourceSubreso
SafeRelease(sourceStaging); SafeRelease(sourceStaging);
SafeRelease(destStaging); SafeRelease(destStaging);
return true; return gl::Error(GL_NO_ERROR);
} }
bool Blit11::compareBlitParameters(const Blit11::BlitParameters &a, const Blit11::BlitParameters &b) bool Blit11::compareBlitParameters(const Blit11::BlitParameters &a, const Blit11::BlitParameters &b)
......
...@@ -19,12 +19,6 @@ namespace rx ...@@ -19,12 +19,6 @@ namespace rx
{ {
class Renderer11; class Renderer11;
enum Filter
{
Point,
Linear,
};
class Blit11 class Blit11
{ {
public: public:
...@@ -34,22 +28,22 @@ class Blit11 ...@@ -34,22 +28,22 @@ class Blit11
gl::Error swizzleTexture(ID3D11ShaderResourceView *source, ID3D11RenderTargetView *dest, const gl::Extents &size, gl::Error swizzleTexture(ID3D11ShaderResourceView *source, ID3D11RenderTargetView *dest, const gl::Extents &size,
GLenum swizzleRed, GLenum swizzleGreen, GLenum swizzleBlue, GLenum swizzleAlpha); GLenum swizzleRed, GLenum swizzleGreen, GLenum swizzleBlue, GLenum swizzleAlpha);
bool copyTexture(ID3D11ShaderResourceView *source, const gl::Box &sourceArea, const gl::Extents &sourceSize, gl::Error copyTexture(ID3D11ShaderResourceView *source, const gl::Box &sourceArea, const gl::Extents &sourceSize,
ID3D11RenderTargetView *dest, const gl::Box &destArea, const gl::Extents &destSize, ID3D11RenderTargetView *dest, const gl::Box &destArea, const gl::Extents &destSize,
const gl::Rectangle *scissor, GLenum destFormat, GLenum filter); const gl::Rectangle *scissor, GLenum destFormat, GLenum filter);
bool copyStencil(ID3D11Resource *source, unsigned int sourceSubresource, const gl::Box &sourceArea, const gl::Extents &sourceSize,
ID3D11Resource *dest, unsigned int destSubresource, const gl::Box &destArea, const gl::Extents &destSize,
const gl::Rectangle *scissor);
bool copyDepth(ID3D11ShaderResourceView *source, const gl::Box &sourceArea, const gl::Extents &sourceSize, gl::Error copyStencil(ID3D11Resource *source, unsigned int sourceSubresource, const gl::Box &sourceArea, const gl::Extents &sourceSize,
ID3D11DepthStencilView *dest, const gl::Box &destArea, const gl::Extents &destSize,
const gl::Rectangle *scissor);
bool copyDepthStencil(ID3D11Resource *source, unsigned int sourceSubresource, const gl::Box &sourceArea, const gl::Extents &sourceSize,
ID3D11Resource *dest, unsigned int destSubresource, const gl::Box &destArea, const gl::Extents &destSize, ID3D11Resource *dest, unsigned int destSubresource, const gl::Box &destArea, const gl::Extents &destSize,
const gl::Rectangle *scissor); const gl::Rectangle *scissor);
gl::Error copyDepth(ID3D11ShaderResourceView *source, const gl::Box &sourceArea, const gl::Extents &sourceSize,
ID3D11DepthStencilView *dest, const gl::Box &destArea, const gl::Extents &destSize,
const gl::Rectangle *scissor);
gl::Error copyDepthStencil(ID3D11Resource *source, unsigned int sourceSubresource, const gl::Box &sourceArea, const gl::Extents &sourceSize,
ID3D11Resource *dest, unsigned int destSubresource, const gl::Box &destArea, const gl::Extents &destSize,
const gl::Rectangle *scissor);
private: private:
rx::Renderer11 *mRenderer; rx::Renderer11 *mRenderer;
...@@ -60,9 +54,9 @@ class Blit11 ...@@ -60,9 +54,9 @@ class Blit11
bool m3DBlit; bool m3DBlit;
}; };
bool copyDepthStencil(ID3D11Resource *source, unsigned int sourceSubresource, const gl::Box &sourceArea, const gl::Extents &sourceSize, gl::Error copyDepthStencil(ID3D11Resource *source, unsigned int sourceSubresource, const gl::Box &sourceArea, const gl::Extents &sourceSize,
ID3D11Resource *dest, unsigned int destSubresource, const gl::Box &destArea, const gl::Extents &destSize, ID3D11Resource *dest, unsigned int destSubresource, const gl::Box &destArea, const gl::Extents &destSize,
const gl::Rectangle *scissor, bool stencilOnly); const gl::Rectangle *scissor, bool stencilOnly);
static bool compareBlitParameters(const BlitParameters &a, const BlitParameters &b); static bool compareBlitParameters(const BlitParameters &a, const BlitParameters &b);
......
...@@ -129,8 +129,8 @@ class Renderer11 : public Renderer ...@@ -129,8 +129,8 @@ class Renderer11 : public Renderer
virtual bool copyImage2DArray(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat, virtual bool copyImage2DArray(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
GLint xoffset, GLint yoffset, GLint zOffset, TextureStorage *storage, GLint level); GLint xoffset, GLint yoffset, GLint zOffset, TextureStorage *storage, GLint level);
virtual bool blitRect(gl::Framebuffer *readTarget, const gl::Rectangle &readRect, gl::Framebuffer *drawTarget, const gl::Rectangle &drawRect, virtual gl::Error blitRect(gl::Framebuffer *readTarget, const gl::Rectangle &readRect, gl::Framebuffer *drawTarget, const gl::Rectangle &drawRect,
const gl::Rectangle *scissor, bool blitRenderTarget, bool blitDepth, bool blitStencil, GLenum filter); const gl::Rectangle *scissor, bool blitRenderTarget, bool blitDepth, bool blitStencil, GLenum filter);
virtual gl::Error readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, virtual gl::Error readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format,
GLenum type, GLuint outputPitch, const gl::PixelPackState &pack, uint8_t *pixels); GLenum type, GLuint outputPitch, const gl::PixelPackState &pack, uint8_t *pixels);
...@@ -212,9 +212,9 @@ class Renderer11 : public Renderer ...@@ -212,9 +212,9 @@ class Renderer11 : public Renderer
gl::Error readTextureData(ID3D11Texture2D *texture, unsigned int subResource, const gl::Rectangle &area, GLenum format, gl::Error readTextureData(ID3D11Texture2D *texture, unsigned int subResource, const gl::Rectangle &area, GLenum format,
GLenum type, GLuint outputPitch, const gl::PixelPackState &pack, uint8_t *pixels); GLenum type, GLuint outputPitch, const gl::PixelPackState &pack, uint8_t *pixels);
bool blitRenderbufferRect(const gl::Rectangle &readRect, const gl::Rectangle &drawRect, RenderTarget *readRenderTarget, gl::Error blitRenderbufferRect(const gl::Rectangle &readRect, const gl::Rectangle &drawRect, RenderTarget *readRenderTarget,
RenderTarget *drawRenderTarget, GLenum filter, const gl::Rectangle *scissor, RenderTarget *drawRenderTarget, GLenum filter, const gl::Rectangle *scissor,
bool colorBlit, bool depthBlit, bool stencilBlit); bool colorBlit, bool depthBlit, bool stencilBlit);
ID3D11Texture2D *resolveMultisampledTexture(ID3D11Texture2D *source, unsigned int subresource); ID3D11Texture2D *resolveMultisampledTexture(ID3D11Texture2D *source, unsigned int subresource);
static void invalidateFBOAttachmentSwizzles(gl::FramebufferAttachment *attachment, int mipLevel); static void invalidateFBOAttachmentSwizzles(gl::FramebufferAttachment *attachment, int mipLevel);
......
...@@ -316,9 +316,9 @@ bool TextureStorage11::updateSubresourceLevel(ID3D11Resource *srcTexture, unsign ...@@ -316,9 +316,9 @@ bool TextureStorage11::updateSubresourceLevel(ID3D11Resource *srcTexture, unsign
// CopySubresourceRegion cannot copy partial depth stencils, use the blitter instead // CopySubresourceRegion cannot copy partial depth stencils, use the blitter instead
Blit11 *blitter = mRenderer->getBlitter(); Blit11 *blitter = mRenderer->getBlitter();
return blitter->copyDepthStencil(srcTexture, sourceSubresource, copyArea, texSize, return !blitter->copyDepthStencil(srcTexture, sourceSubresource, copyArea, texSize,
dstTexture, dstSubresource, copyArea, texSize, dstTexture, dstSubresource, copyArea, texSize,
NULL); NULL).isError();
} }
else else
{ {
......
...@@ -2469,8 +2469,8 @@ bool Renderer9::copyImage2DArray(gl::Framebuffer *framebuffer, const gl::Rectang ...@@ -2469,8 +2469,8 @@ bool Renderer9::copyImage2DArray(gl::Framebuffer *framebuffer, const gl::Rectang
return false; return false;
} }
bool Renderer9::blitRect(gl::Framebuffer *readFramebuffer, const gl::Rectangle &readRect, gl::Framebuffer *drawFramebuffer, const gl::Rectangle &drawRect, gl::Error Renderer9::blitRect(gl::Framebuffer *readFramebuffer, const gl::Rectangle &readRect, gl::Framebuffer *drawFramebuffer, const gl::Rectangle &drawRect,
const gl::Rectangle *scissor, bool blitRenderTarget, bool blitDepth, bool blitStencil, GLenum filter) const gl::Rectangle *scissor, bool blitRenderTarget, bool blitDepth, bool blitStencil, GLenum filter)
{ {
ASSERT(filter == GL_NEAREST); ASSERT(filter == GL_NEAREST);
...@@ -2505,8 +2505,7 @@ bool Renderer9::blitRect(gl::Framebuffer *readFramebuffer, const gl::Rectangle & ...@@ -2505,8 +2505,7 @@ bool Renderer9::blitRect(gl::Framebuffer *readFramebuffer, const gl::Rectangle &
if (!readSurface || !drawSurface) if (!readSurface || !drawSurface)
{ {
ERR("Failed to retrieve the render target."); return gl::Error(GL_OUT_OF_MEMORY, "Failed to retrieve the internal render targets for the blit framebuffers.");
return gl::error(GL_OUT_OF_MEMORY, false);
} }
gl::Extents srcSize(readRenderTarget->getWidth(), readRenderTarget->getHeight(), 1); gl::Extents srcSize(readRenderTarget->getWidth(), readRenderTarget->getHeight(), 1);
...@@ -2600,8 +2599,7 @@ bool Renderer9::blitRect(gl::Framebuffer *readFramebuffer, const gl::Rectangle & ...@@ -2600,8 +2599,7 @@ bool Renderer9::blitRect(gl::Framebuffer *readFramebuffer, const gl::Rectangle &
if (FAILED(result)) if (FAILED(result))
{ {
ERR("BlitFramebufferANGLE failed: StretchRect returned %x.", result); return gl::Error(GL_OUT_OF_MEMORY, "Internal blit failed, StretchRect returned 0x%X.", result);
return false;
} }
} }
...@@ -2634,8 +2632,7 @@ bool Renderer9::blitRect(gl::Framebuffer *readFramebuffer, const gl::Rectangle & ...@@ -2634,8 +2632,7 @@ bool Renderer9::blitRect(gl::Framebuffer *readFramebuffer, const gl::Rectangle &
if (!readSurface || !drawSurface) if (!readSurface || !drawSurface)
{ {
ERR("Failed to retrieve the render target."); return gl::Error(GL_OUT_OF_MEMORY, "Failed to retrieve the internal render targets for the blit framebuffers.");
return gl::error(GL_OUT_OF_MEMORY, false);
} }
HRESULT result = mDevice->StretchRect(readSurface, NULL, drawSurface, NULL, D3DTEXF_NONE); HRESULT result = mDevice->StretchRect(readSurface, NULL, drawSurface, NULL, D3DTEXF_NONE);
...@@ -2645,12 +2642,11 @@ bool Renderer9::blitRect(gl::Framebuffer *readFramebuffer, const gl::Rectangle & ...@@ -2645,12 +2642,11 @@ bool Renderer9::blitRect(gl::Framebuffer *readFramebuffer, const gl::Rectangle &
if (FAILED(result)) if (FAILED(result))
{ {
ERR("BlitFramebufferANGLE failed: StretchRect returned %x.", result); return gl::Error(GL_OUT_OF_MEMORY, "Internal blit failed, StretchRect returned 0x%X.", result);
return false;
} }
} }
return true; return gl::Error(GL_NO_ERROR);
} }
gl::Error Renderer9::readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, gl::Error Renderer9::readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format,
......
...@@ -133,8 +133,8 @@ class Renderer9 : public Renderer ...@@ -133,8 +133,8 @@ class Renderer9 : public Renderer
virtual bool copyImage2DArray(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat, virtual bool copyImage2DArray(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
GLint xoffset, GLint yoffset, GLint zOffset, TextureStorage *storage, GLint level); GLint xoffset, GLint yoffset, GLint zOffset, TextureStorage *storage, GLint level);
virtual bool blitRect(gl::Framebuffer *readTarget, const gl::Rectangle &readRect, gl::Framebuffer *drawTarget, const gl::Rectangle &drawRect, virtual gl::Error blitRect(gl::Framebuffer *readTarget, const gl::Rectangle &readRect, gl::Framebuffer *drawTarget, const gl::Rectangle &drawRect,
const gl::Rectangle *scissor, bool blitRenderTarget, bool blitDepth, bool blitStencil, GLenum filter); const gl::Rectangle *scissor, bool blitRenderTarget, bool blitDepth, bool blitStencil, GLenum filter);
virtual gl::Error readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, virtual gl::Error readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format,
GLenum type, GLuint outputPitch, const gl::PixelPackState &pack, uint8_t *pixels); GLenum type, GLuint outputPitch, const gl::PixelPackState &pack, uint8_t *pixels);
......
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