Commit 7b4ef3da by Jamie Madill Committed by Commit Bot

TextureStorage11: Don't use gl::ErrorOrResult.

Bug: angleproject:2738 Change-Id: I062b2fe3ff2b53bb361539c408b61626ac6c2f25 Reviewed-on: https://chromium-review.googlesource.com/1148463Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent d91d15bd
...@@ -254,7 +254,7 @@ gl::Error TextureStorage11::getSRVForSampler(const gl::Context *context, ...@@ -254,7 +254,7 @@ gl::Error TextureStorage11::getSRVForSampler(const gl::Context *context,
{ {
// Ensure drop texture gets created. // Ensure drop texture gets created.
DropStencil result = DropStencil::CREATED; DropStencil result = DropStencil::CREATED;
ANGLE_TRY_RESULT(ensureDropStencilTexture(context), result); ANGLE_TRY(ensureDropStencilTexture(context, &result));
// Clear the SRV cache if necessary. // Clear the SRV cache if necessary.
// TODO(jmadill): Re-use find query result. // TODO(jmadill): Re-use find query result.
...@@ -800,8 +800,8 @@ gl::Error TextureStorage11::setData(const gl::Context *context, ...@@ -800,8 +800,8 @@ gl::Error TextureStorage11::setData(const gl::Context *context,
return gl::NoError(); return gl::NoError();
} }
gl::ErrorOrResult<TextureStorage11::DropStencil> TextureStorage11::ensureDropStencilTexture( gl::Error TextureStorage11::ensureDropStencilTexture(const gl::Context *context,
const gl::Context *context) TextureStorage11::DropStencil *dropStencilOut)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED();
return gl::InternalError() << "Drop stencil texture not implemented."; return gl::InternalError() << "Drop stencil texture not implemented.";
...@@ -1354,12 +1354,13 @@ gl::Error TextureStorage11_2D::getSwizzleRenderTarget(int mipLevel, ...@@ -1354,12 +1354,13 @@ gl::Error TextureStorage11_2D::getSwizzleRenderTarget(int mipLevel,
return gl::NoError(); return gl::NoError();
} }
gl::ErrorOrResult<TextureStorage11::DropStencil> TextureStorage11_2D::ensureDropStencilTexture( gl::Error TextureStorage11_2D::ensureDropStencilTexture(const gl::Context *context,
const gl::Context *context) DropStencil *dropStencilOut)
{ {
if (mDropStencilTexture.valid()) if (mDropStencilTexture.valid())
{ {
return DropStencil::ALREADY_EXISTS; *dropStencilOut = DropStencil::ALREADY_EXISTS;
return gl::NoError();
} }
D3D11_TEXTURE2D_DESC dropDesc = {}; D3D11_TEXTURE2D_DESC dropDesc = {};
...@@ -1382,7 +1383,8 @@ gl::ErrorOrResult<TextureStorage11::DropStencil> TextureStorage11_2D::ensureDrop ...@@ -1382,7 +1383,8 @@ gl::ErrorOrResult<TextureStorage11::DropStencil> TextureStorage11_2D::ensureDrop
ANGLE_TRY(initDropStencilTexture(context, gl::ImageIndexIterator::Make2D(0, mMipLevels))); ANGLE_TRY(initDropStencilTexture(context, gl::ImageIndexIterator::Make2D(0, mMipLevels)));
return DropStencil::CREATED; *dropStencilOut = DropStencil::CREATED;
return gl::NoError();
} }
TextureStorage11_External::TextureStorage11_External( TextureStorage11_External::TextureStorage11_External(
...@@ -2421,12 +2423,13 @@ gl::Error TextureStorage11::initDropStencilTexture(const gl::Context *context, ...@@ -2421,12 +2423,13 @@ gl::Error TextureStorage11::initDropStencilTexture(const gl::Context *context,
return gl::NoError(); return gl::NoError();
} }
gl::ErrorOrResult<TextureStorage11::DropStencil> TextureStorage11_Cube::ensureDropStencilTexture( gl::Error TextureStorage11_Cube::ensureDropStencilTexture(const gl::Context *context,
const gl::Context *context) DropStencil *dropStencilOut)
{ {
if (mDropStencilTexture.valid()) if (mDropStencilTexture.valid())
{ {
return DropStencil::ALREADY_EXISTS; *dropStencilOut = DropStencil::ALREADY_EXISTS;
return gl::NoError();
} }
D3D11_TEXTURE2D_DESC dropDesc = {}; D3D11_TEXTURE2D_DESC dropDesc = {};
...@@ -2449,7 +2452,8 @@ gl::ErrorOrResult<TextureStorage11::DropStencil> TextureStorage11_Cube::ensureDr ...@@ -2449,7 +2452,8 @@ gl::ErrorOrResult<TextureStorage11::DropStencil> TextureStorage11_Cube::ensureDr
ANGLE_TRY(initDropStencilTexture(context, gl::ImageIndexIterator::MakeCube(0, mMipLevels))); ANGLE_TRY(initDropStencilTexture(context, gl::ImageIndexIterator::MakeCube(0, mMipLevels)));
return DropStencil::CREATED; *dropStencilOut = DropStencil::CREATED;
return gl::NoError();
} }
TextureStorage11_3D::TextureStorage11_3D(Renderer11 *renderer, TextureStorage11_3D::TextureStorage11_3D(Renderer11 *renderer,
...@@ -3137,12 +3141,13 @@ gl::Error TextureStorage11_2DArray::getSwizzleRenderTarget(int mipLevel, ...@@ -3137,12 +3141,13 @@ gl::Error TextureStorage11_2DArray::getSwizzleRenderTarget(int mipLevel,
return gl::NoError(); return gl::NoError();
} }
gl::ErrorOrResult<TextureStorage11::DropStencil> TextureStorage11_2DArray::ensureDropStencilTexture( gl::Error TextureStorage11_2DArray::ensureDropStencilTexture(const gl::Context *context,
const gl::Context *context) DropStencil *dropStencilOut)
{ {
if (mDropStencilTexture.valid()) if (mDropStencilTexture.valid())
{ {
return DropStencil::ALREADY_EXISTS; *dropStencilOut = DropStencil::ALREADY_EXISTS;
return gl::NoError();
} }
D3D11_TEXTURE2D_DESC dropDesc = {}; D3D11_TEXTURE2D_DESC dropDesc = {};
...@@ -3168,7 +3173,8 @@ gl::ErrorOrResult<TextureStorage11::DropStencil> TextureStorage11_2DArray::ensur ...@@ -3168,7 +3173,8 @@ gl::ErrorOrResult<TextureStorage11::DropStencil> TextureStorage11_2DArray::ensur
ANGLE_TRY(initDropStencilTexture( ANGLE_TRY(initDropStencilTexture(
context, gl::ImageIndexIterator::Make2DArray(0, mMipLevels, layerCounts.data()))); context, gl::ImageIndexIterator::Make2DArray(0, mMipLevels, layerCounts.data())));
return DropStencil::CREATED; *dropStencilOut = DropStencil::CREATED;
return gl::NoError();
} }
TextureStorage11_2DMultisample::TextureStorage11_2DMultisample(Renderer11 *renderer, TextureStorage11_2DMultisample::TextureStorage11_2DMultisample(Renderer11 *renderer,
...@@ -3390,8 +3396,8 @@ gl::Error TextureStorage11_2DMultisample::getSwizzleRenderTarget( ...@@ -3390,8 +3396,8 @@ gl::Error TextureStorage11_2DMultisample::getSwizzleRenderTarget(
return gl::InternalError() << "getSwizzleRenderTarget is unimplemented."; return gl::InternalError() << "getSwizzleRenderTarget is unimplemented.";
} }
gl::ErrorOrResult<TextureStorage11::DropStencil> gl::Error TextureStorage11_2DMultisample::ensureDropStencilTexture(const gl::Context *context,
TextureStorage11_2DMultisample::ensureDropStencilTexture(const gl::Context *context) DropStencil *dropStencilOut)
{ {
UNIMPLEMENTED(); UNIMPLEMENTED();
return gl::InternalError() << "Drop stencil texture not implemented."; return gl::InternalError() << "Drop stencil texture not implemented.";
......
...@@ -139,7 +139,8 @@ class TextureStorage11 : public TextureStorage ...@@ -139,7 +139,8 @@ class TextureStorage11 : public TextureStorage
CREATED, CREATED,
ALREADY_EXISTS ALREADY_EXISTS
}; };
virtual gl::ErrorOrResult<DropStencil> ensureDropStencilTexture(const gl::Context *context); virtual gl::Error ensureDropStencilTexture(const gl::Context *context,
DropStencil *dropStencilOut);
gl::Error initDropStencilTexture(const gl::Context *context, const gl::ImageIndexIterator &it); gl::Error initDropStencilTexture(const gl::Context *context, const gl::ImageIndexIterator &it);
// The baseLevel parameter should *not* have mTopLevel applied. // The baseLevel parameter should *not* have mTopLevel applied.
...@@ -267,7 +268,8 @@ class TextureStorage11_2D : public TextureStorage11 ...@@ -267,7 +268,8 @@ class TextureStorage11_2D : public TextureStorage11
gl::Error getSwizzleTexture(const TextureHelper11 **outTexture) override; gl::Error getSwizzleTexture(const TextureHelper11 **outTexture) override;
gl::Error getSwizzleRenderTarget(int mipLevel, const d3d11::RenderTargetView **outRTV) override; gl::Error getSwizzleRenderTarget(int mipLevel, const d3d11::RenderTargetView **outRTV) override;
gl::ErrorOrResult<DropStencil> ensureDropStencilTexture(const gl::Context *context) override; gl::Error ensureDropStencilTexture(const gl::Context *context,
DropStencil *dropStencilOut) override;
gl::Error ensureTextureExists(int mipLevels); gl::Error ensureTextureExists(int mipLevels);
...@@ -474,7 +476,8 @@ class TextureStorage11_Cube : public TextureStorage11 ...@@ -474,7 +476,8 @@ class TextureStorage11_Cube : public TextureStorage11
gl::Error getSwizzleTexture(const TextureHelper11 **outTexture) override; gl::Error getSwizzleTexture(const TextureHelper11 **outTexture) override;
gl::Error getSwizzleRenderTarget(int mipLevel, const d3d11::RenderTargetView **outRTV) override; gl::Error getSwizzleRenderTarget(int mipLevel, const d3d11::RenderTargetView **outRTV) override;
gl::ErrorOrResult<DropStencil> ensureDropStencilTexture(const gl::Context *context) override; gl::Error ensureDropStencilTexture(const gl::Context *context,
DropStencil *dropStencilOut) override;
gl::Error ensureTextureExists(int mipLevels); gl::Error ensureTextureExists(int mipLevels);
...@@ -607,7 +610,8 @@ class TextureStorage11_2DArray : public TextureStorage11 ...@@ -607,7 +610,8 @@ class TextureStorage11_2DArray : public TextureStorage11
gl::Error getSwizzleTexture(const TextureHelper11 **outTexture) override; gl::Error getSwizzleTexture(const TextureHelper11 **outTexture) override;
gl::Error getSwizzleRenderTarget(int mipLevel, const d3d11::RenderTargetView **outRTV) override; gl::Error getSwizzleRenderTarget(int mipLevel, const d3d11::RenderTargetView **outRTV) override;
gl::ErrorOrResult<DropStencil> ensureDropStencilTexture(const gl::Context *context) override; gl::Error ensureDropStencilTexture(const gl::Context *context,
DropStencil *dropStencilOut) override;
private: private:
struct LevelLayerRangeKey struct LevelLayerRangeKey
...@@ -698,7 +702,8 @@ class TextureStorage11_2DMultisample : public TextureStorage11 ...@@ -698,7 +702,8 @@ class TextureStorage11_2DMultisample : public TextureStorage11
gl::Error getSwizzleTexture(const TextureHelper11 **outTexture) override; gl::Error getSwizzleTexture(const TextureHelper11 **outTexture) override;
gl::Error getSwizzleRenderTarget(int mipLevel, const d3d11::RenderTargetView **outRTV) override; gl::Error getSwizzleRenderTarget(int mipLevel, const d3d11::RenderTargetView **outRTV) override;
gl::ErrorOrResult<DropStencil> ensureDropStencilTexture(const gl::Context *context) override; gl::Error ensureDropStencilTexture(const gl::Context *context,
DropStencil *dropStencilOut) override;
gl::Error ensureTextureExists(int mipLevels); gl::Error ensureTextureExists(int mipLevels);
......
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