Commit dea2777c by Jamie Madill Committed by Commit Bot

D3D11: Rename TextureStorage swizzle invalidation.

Since we'll also be storing a cache of depth textures as well as swizzle info, generalize the invalidation methods. BUG=angleproject:1493 BUG=chromium:638323 Change-Id: I8fef049b01c81483fcf28196866a22d5cfed32a1 Reviewed-on: https://chromium-review.googlesource.com/380036Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 96f4f45e
...@@ -29,7 +29,7 @@ namespace rx ...@@ -29,7 +29,7 @@ namespace rx
namespace namespace
{ {
gl::Error InvalidateAttachmentSwizzles(const gl::FramebufferAttachment *attachment) gl::Error MarkAttachmentsDirty(const gl::FramebufferAttachment *attachment)
{ {
if (attachment && attachment->type() == GL_TEXTURE) if (attachment && attachment->type() == GL_TEXTURE)
{ {
...@@ -45,7 +45,7 @@ gl::Error InvalidateAttachmentSwizzles(const gl::FramebufferAttachment *attachme ...@@ -45,7 +45,7 @@ gl::Error InvalidateAttachmentSwizzles(const gl::FramebufferAttachment *attachme
TextureStorage11 *texStorage11 = GetAs<TextureStorage11>(texStorage); TextureStorage11 *texStorage11 = GetAs<TextureStorage11>(texStorage);
ASSERT(texStorage11); ASSERT(texStorage11);
texStorage11->invalidateSwizzleCacheLevel(attachment->mipLevel()); texStorage11->markLevelDirty(attachment->mipLevel());
} }
} }
...@@ -89,18 +89,18 @@ Framebuffer11::~Framebuffer11() ...@@ -89,18 +89,18 @@ Framebuffer11::~Framebuffer11()
{ {
} }
gl::Error Framebuffer11::invalidateSwizzles() const gl::Error Framebuffer11::markAttachmentsDirty() const
{ {
for (const auto &colorAttachment : mState.getColorAttachments()) for (const auto &colorAttachment : mState.getColorAttachments())
{ {
if (colorAttachment.isAttached()) if (colorAttachment.isAttached())
{ {
ANGLE_TRY(InvalidateAttachmentSwizzles(&colorAttachment)); ANGLE_TRY(MarkAttachmentsDirty(&colorAttachment));
} }
} }
ANGLE_TRY(InvalidateAttachmentSwizzles(mState.getDepthAttachment())); ANGLE_TRY(MarkAttachmentsDirty(mState.getDepthAttachment()));
ANGLE_TRY(InvalidateAttachmentSwizzles(mState.getStencilAttachment())); ANGLE_TRY(MarkAttachmentsDirty(mState.getStencilAttachment()));
return gl::NoError(); return gl::NoError();
} }
...@@ -128,7 +128,7 @@ gl::Error Framebuffer11::clearImpl(ContextImpl *context, const ClearParameters & ...@@ -128,7 +128,7 @@ gl::Error Framebuffer11::clearImpl(ContextImpl *context, const ClearParameters &
ANGLE_TRY(clearer->clearFramebuffer(clearParams, mState)); ANGLE_TRY(clearer->clearFramebuffer(clearParams, mState));
} }
ANGLE_TRY(invalidateSwizzles()); ANGLE_TRY(markAttachmentsDirty());
return gl::NoError(); return gl::NoError();
} }
...@@ -351,7 +351,7 @@ gl::Error Framebuffer11::blitImpl(const gl::Rectangle &sourceArea, ...@@ -351,7 +351,7 @@ gl::Error Framebuffer11::blitImpl(const gl::Rectangle &sourceArea,
blitDepth, blitStencil)); blitDepth, blitStencil));
} }
ANGLE_TRY(invalidateSwizzles()); ANGLE_TRY(markAttachmentsDirty());
return gl::NoError(); return gl::NoError();
} }
......
...@@ -28,7 +28,7 @@ class Framebuffer11 : public FramebufferD3D, public angle::SignalReceiver ...@@ -28,7 +28,7 @@ class Framebuffer11 : public FramebufferD3D, public angle::SignalReceiver
gl::Error invalidateSub(size_t count, const GLenum *attachments, const gl::Rectangle &area) override; gl::Error invalidateSub(size_t count, const GLenum *attachments, const gl::Rectangle &area) override;
// Invalidate the cached swizzles of all bound texture attachments. // Invalidate the cached swizzles of all bound texture attachments.
gl::Error invalidateSwizzles() const; gl::Error markAttachmentsDirty() const;
void syncState(const gl::Framebuffer::DirtyBits &dirtyBits) override; void syncState(const gl::Framebuffer::DirtyBits &dirtyBits) override;
......
...@@ -2934,7 +2934,7 @@ gl::Error Renderer11::copyImage2D(const gl::Framebuffer *framebuffer, ...@@ -2934,7 +2934,7 @@ gl::Error Renderer11::copyImage2D(const gl::Framebuffer *framebuffer,
ANGLE_TRY(copyImageInternal(framebuffer, sourceRect, destFormat, destOffset, destRenderTarget)); ANGLE_TRY(copyImageInternal(framebuffer, sourceRect, destFormat, destOffset, destRenderTarget));
storage11->invalidateSwizzleCacheLevel(level); storage11->markLevelDirty(level);
return gl::NoError(); return gl::NoError();
} }
...@@ -2952,7 +2952,7 @@ gl::Error Renderer11::copyImageCube(const gl::Framebuffer *framebuffer, const gl ...@@ -2952,7 +2952,7 @@ gl::Error Renderer11::copyImageCube(const gl::Framebuffer *framebuffer, const gl
ANGLE_TRY(copyImageInternal(framebuffer, sourceRect, destFormat, destOffset, destRenderTarget)); ANGLE_TRY(copyImageInternal(framebuffer, sourceRect, destFormat, destOffset, destRenderTarget));
storage11->invalidateSwizzleCacheLevel(level); storage11->markLevelDirty(level);
return gl::NoError(); return gl::NoError();
} }
...@@ -2970,7 +2970,7 @@ gl::Error Renderer11::copyImage3D(const gl::Framebuffer *framebuffer, const gl:: ...@@ -2970,7 +2970,7 @@ gl::Error Renderer11::copyImage3D(const gl::Framebuffer *framebuffer, const gl::
ANGLE_TRY(copyImageInternal(framebuffer, sourceRect, destFormat, destOffset, destRenderTarget)); ANGLE_TRY(copyImageInternal(framebuffer, sourceRect, destFormat, destOffset, destRenderTarget));
storage11->invalidateSwizzleCacheLevel(level); storage11->markLevelDirty(level);
return gl::NoError(); return gl::NoError();
} }
...@@ -2987,7 +2987,7 @@ gl::Error Renderer11::copyImage2DArray(const gl::Framebuffer *framebuffer, const ...@@ -2987,7 +2987,7 @@ gl::Error Renderer11::copyImage2DArray(const gl::Framebuffer *framebuffer, const
ASSERT(destRenderTarget); ASSERT(destRenderTarget);
ANGLE_TRY(copyImageInternal(framebuffer, sourceRect, destFormat, destOffset, destRenderTarget)); ANGLE_TRY(copyImageInternal(framebuffer, sourceRect, destFormat, destOffset, destRenderTarget));
storage11->invalidateSwizzleCacheLevel(level); storage11->markLevelDirty(level);
return gl::NoError(); return gl::NoError();
} }
...@@ -3077,7 +3077,7 @@ gl::Error Renderer11::copyTexture(const gl::Texture *source, ...@@ -3077,7 +3077,7 @@ gl::Error Renderer11::copyTexture(const gl::Texture *source,
unpackUnmultiplyAlpha)); unpackUnmultiplyAlpha));
} }
destStorage11->invalidateSwizzleCacheLevel(destLevel); destStorage11->markLevelDirty(destLevel);
return gl::Error(GL_NO_ERROR); return gl::Error(GL_NO_ERROR);
} }
......
...@@ -492,16 +492,11 @@ gl::Error StateManager11::setBlendState(const gl::Framebuffer *framebuffer, ...@@ -492,16 +492,11 @@ gl::Error StateManager11::setBlendState(const gl::Framebuffer *framebuffer,
{ {
if (!mBlendStateIsDirty && sampleMask == mCurSampleMask) if (!mBlendStateIsDirty && sampleMask == mCurSampleMask)
{ {
return gl::Error(GL_NO_ERROR); return gl::NoError();
} }
ID3D11BlendState *dxBlendState = nullptr; ID3D11BlendState *dxBlendState = nullptr;
gl::Error error = ANGLE_TRY(mRenderer->getStateCache().getBlendState(framebuffer, blendState, &dxBlendState));
mRenderer->getStateCache().getBlendState(framebuffer, blendState, &dxBlendState);
if (error.isError())
{
return error;
}
ASSERT(dxBlendState != nullptr); ASSERT(dxBlendState != nullptr);
...@@ -532,7 +527,7 @@ gl::Error StateManager11::setBlendState(const gl::Framebuffer *framebuffer, ...@@ -532,7 +527,7 @@ gl::Error StateManager11::setBlendState(const gl::Framebuffer *framebuffer,
mBlendStateIsDirty = false; mBlendStateIsDirty = false;
return error; return gl::NoError();
} }
gl::Error StateManager11::setDepthStencilState(const gl::State &glState) gl::Error StateManager11::setDepthStencilState(const gl::State &glState)
...@@ -552,7 +547,7 @@ gl::Error StateManager11::setDepthStencilState(const gl::State &glState) ...@@ -552,7 +547,7 @@ gl::Error StateManager11::setDepthStencilState(const gl::State &glState)
disableDepth == mCurDisableDepth.value() && mCurDisableStencil.valid() && disableDepth == mCurDisableDepth.value() && mCurDisableStencil.valid() &&
disableStencil == mCurDisableStencil.value()) disableStencil == mCurDisableStencil.value())
{ {
return gl::Error(GL_NO_ERROR); return gl::NoError();
} }
const auto &depthStencilState = glState.getDepthStencilState(); const auto &depthStencilState = glState.getDepthStencilState();
...@@ -572,12 +567,8 @@ gl::Error StateManager11::setDepthStencilState(const gl::State &glState) ...@@ -572,12 +567,8 @@ gl::Error StateManager11::setDepthStencilState(const gl::State &glState)
(depthStencilState.stencilBackMask & maxStencil)); (depthStencilState.stencilBackMask & maxStencil));
ID3D11DepthStencilState *dxDepthStencilState = NULL; ID3D11DepthStencilState *dxDepthStencilState = NULL;
gl::Error error = mRenderer->getStateCache().getDepthStencilState( ANGLE_TRY(mRenderer->getStateCache().getDepthStencilState(
depthStencilState, disableDepth, disableStencil, &dxDepthStencilState); depthStencilState, disableDepth, disableStencil, &dxDepthStencilState));
if (error.isError())
{
return error;
}
ASSERT(dxDepthStencilState); ASSERT(dxDepthStencilState);
...@@ -601,7 +592,7 @@ gl::Error StateManager11::setDepthStencilState(const gl::State &glState) ...@@ -601,7 +592,7 @@ gl::Error StateManager11::setDepthStencilState(const gl::State &glState)
mDepthStencilStateIsDirty = false; mDepthStencilStateIsDirty = false;
return gl::Error(GL_NO_ERROR); return gl::NoError();
} }
gl::Error StateManager11::setRasterizerState(const gl::RasterizerState &rasterState) gl::Error StateManager11::setRasterizerState(const gl::RasterizerState &rasterState)
...@@ -610,11 +601,10 @@ gl::Error StateManager11::setRasterizerState(const gl::RasterizerState &rasterSt ...@@ -610,11 +601,10 @@ gl::Error StateManager11::setRasterizerState(const gl::RasterizerState &rasterSt
if (!mRasterizerStateIsDirty && rasterState.pointDrawMode == mCurRasterState.pointDrawMode && if (!mRasterizerStateIsDirty && rasterState.pointDrawMode == mCurRasterState.pointDrawMode &&
rasterState.multiSample == mCurRasterState.multiSample) rasterState.multiSample == mCurRasterState.multiSample)
{ {
return gl::Error(GL_NO_ERROR); return gl::NoError();
} }
ID3D11RasterizerState *dxRasterState = nullptr; ID3D11RasterizerState *dxRasterState = nullptr;
gl::Error error(GL_NO_ERROR);
if (mCurPresentPathFastEnabled) if (mCurPresentPathFastEnabled)
{ {
...@@ -633,18 +623,13 @@ gl::Error StateManager11::setRasterizerState(const gl::RasterizerState &rasterSt ...@@ -633,18 +623,13 @@ gl::Error StateManager11::setRasterizerState(const gl::RasterizerState &rasterSt
modifiedRasterState.frontFace = GL_CCW; modifiedRasterState.frontFace = GL_CCW;
} }
error = mRenderer->getStateCache().getRasterizerState(modifiedRasterState, ANGLE_TRY(mRenderer->getStateCache().getRasterizerState(
mCurScissorEnabled, &dxRasterState); modifiedRasterState, mCurScissorEnabled, &dxRasterState));
} }
else else
{ {
error = mRenderer->getStateCache().getRasterizerState(rasterState, mCurScissorEnabled, ANGLE_TRY(mRenderer->getStateCache().getRasterizerState(rasterState, mCurScissorEnabled,
&dxRasterState); &dxRasterState));
}
if (error.isError())
{
return error;
} }
mRenderer->getDeviceContext()->RSSetState(dxRasterState); mRenderer->getDeviceContext()->RSSetState(dxRasterState);
...@@ -652,7 +637,7 @@ gl::Error StateManager11::setRasterizerState(const gl::RasterizerState &rasterSt ...@@ -652,7 +637,7 @@ gl::Error StateManager11::setRasterizerState(const gl::RasterizerState &rasterSt
mCurRasterState = rasterState; mCurRasterState = rasterState;
mRasterizerStateIsDirty = false; mRasterizerStateIsDirty = false;
return error; return gl::NoError();
} }
void StateManager11::setScissorRectangle(const gl::Rectangle &scissor, bool enabled) void StateManager11::setScissorRectangle(const gl::Rectangle &scissor, bool enabled)
...@@ -867,7 +852,7 @@ gl::Error StateManager11::onMakeCurrent(const gl::ContextState &data) ...@@ -867,7 +852,7 @@ gl::Error StateManager11::onMakeCurrent(const gl::ContextState &data)
} }
} }
return gl::Error(GL_NO_ERROR); return gl::NoError();
} }
void StateManager11::setShaderResource(gl::SamplerType shaderType, void StateManager11::setShaderResource(gl::SamplerType shaderType,
...@@ -901,7 +886,7 @@ gl::Error StateManager11::clearTextures(gl::SamplerType samplerType, ...@@ -901,7 +886,7 @@ gl::Error StateManager11::clearTextures(gl::SamplerType samplerType,
{ {
if (rangeStart == rangeEnd) if (rangeStart == rangeEnd)
{ {
return gl::Error(GL_NO_ERROR); return gl::NoError();
} }
auto &currentSRVs = (samplerType == gl::SAMPLER_VERTEX ? mCurVertexSRVs : mCurPixelSRVs); auto &currentSRVs = (samplerType == gl::SAMPLER_VERTEX ? mCurVertexSRVs : mCurPixelSRVs);
...@@ -911,7 +896,7 @@ gl::Error StateManager11::clearTextures(gl::SamplerType samplerType, ...@@ -911,7 +896,7 @@ gl::Error StateManager11::clearTextures(gl::SamplerType samplerType,
if (clearRange.empty()) if (clearRange.empty())
{ {
return gl::Error(GL_NO_ERROR); return gl::NoError();
} }
auto deviceContext = mRenderer->getDeviceContext(); auto deviceContext = mRenderer->getDeviceContext();
...@@ -933,7 +918,7 @@ gl::Error StateManager11::clearTextures(gl::SamplerType samplerType, ...@@ -933,7 +918,7 @@ gl::Error StateManager11::clearTextures(gl::SamplerType samplerType,
currentSRVs.update(samplerIndex, nullptr); currentSRVs.update(samplerIndex, nullptr);
} }
return gl::Error(GL_NO_ERROR); return gl::NoError();
} }
void StateManager11::unsetConflictingSRVs(gl::SamplerType samplerType, void StateManager11::unsetConflictingSRVs(gl::SamplerType samplerType,
...@@ -989,11 +974,7 @@ void StateManager11::deinitialize() ...@@ -989,11 +974,7 @@ void StateManager11::deinitialize()
gl::Error StateManager11::syncFramebuffer(gl::Framebuffer *framebuffer) gl::Error StateManager11::syncFramebuffer(gl::Framebuffer *framebuffer)
{ {
Framebuffer11 *framebuffer11 = GetImplAs<Framebuffer11>(framebuffer); Framebuffer11 *framebuffer11 = GetImplAs<Framebuffer11>(framebuffer);
gl::Error error = framebuffer11->invalidateSwizzles(); ANGLE_TRY(framebuffer11->markAttachmentsDirty());
if (error.isError())
{
return error;
}
if (framebuffer11->hasAnyInternalDirtyBit()) if (framebuffer11->hasAnyInternalDirtyBit())
{ {
...@@ -1003,7 +984,7 @@ gl::Error StateManager11::syncFramebuffer(gl::Framebuffer *framebuffer) ...@@ -1003,7 +984,7 @@ gl::Error StateManager11::syncFramebuffer(gl::Framebuffer *framebuffer)
if (!mRenderTargetIsDirty) if (!mRenderTargetIsDirty)
{ {
return gl::Error(GL_NO_ERROR); return gl::NoError();
} }
mRenderTargetIsDirty = false; mRenderTargetIsDirty = false;
...@@ -1017,7 +998,7 @@ gl::Error StateManager11::syncFramebuffer(gl::Framebuffer *framebuffer) ...@@ -1017,7 +998,7 @@ gl::Error StateManager11::syncFramebuffer(gl::Framebuffer *framebuffer)
const gl::Extents &size = framebuffer->getFirstColorbuffer()->getSize(); const gl::Extents &size = framebuffer->getFirstColorbuffer()->getSize();
if (size.width == 0 || size.height == 0) if (size.width == 0 || size.height == 0)
{ {
return gl::Error(GL_NO_ERROR); return gl::NoError();
} }
} }
...@@ -1101,7 +1082,7 @@ gl::Error StateManager11::syncFramebuffer(gl::Framebuffer *framebuffer) ...@@ -1101,7 +1082,7 @@ gl::Error StateManager11::syncFramebuffer(gl::Framebuffer *framebuffer)
setViewportBounds(renderTargetWidth, renderTargetHeight); setViewportBounds(renderTargetWidth, renderTargetHeight);
return gl::Error(GL_NO_ERROR); return gl::NoError();
} }
gl::Error StateManager11::updateCurrentValueAttribs(const gl::State &state, gl::Error StateManager11::updateCurrentValueAttribs(const gl::State &state,
...@@ -1124,15 +1105,11 @@ gl::Error StateManager11::updateCurrentValueAttribs(const gl::State &state, ...@@ -1124,15 +1105,11 @@ gl::Error StateManager11::updateCurrentValueAttribs(const gl::State &state,
currentValueAttrib->currentValueType = currentValue.Type; currentValueAttrib->currentValueType = currentValue.Type;
currentValueAttrib->attribute = &vertexAttributes[attribIndex]; currentValueAttrib->attribute = &vertexAttributes[attribIndex];
gl::Error error = vertexDataManager->storeCurrentValue(currentValue, currentValueAttrib, ANGLE_TRY(vertexDataManager->storeCurrentValue(currentValue, currentValueAttrib,
static_cast<size_t>(attribIndex)); static_cast<size_t>(attribIndex)));
if (error.isError())
{
return error;
}
} }
return gl::Error(GL_NO_ERROR); return gl::NoError();
} }
const std::vector<TranslatedAttribute> &StateManager11::getCurrentValueAttribs() const const std::vector<TranslatedAttribute> &StateManager11::getCurrentValueAttribs() const
......
...@@ -368,7 +368,7 @@ gl::Error TextureStorage11::generateSwizzles(const gl::SwizzleState &swizzleTarg ...@@ -368,7 +368,7 @@ gl::Error TextureStorage11::generateSwizzles(const gl::SwizzleState &swizzleTarg
return gl::Error(GL_NO_ERROR); return gl::Error(GL_NO_ERROR);
} }
void TextureStorage11::invalidateSwizzleCacheLevel(int mipLevel) void TextureStorage11::markLevelDirty(int mipLevel)
{ {
if (mipLevel >= 0 && static_cast<unsigned int>(mipLevel) < ArraySize(mSwizzleCache)) if (mipLevel >= 0 && static_cast<unsigned int>(mipLevel) < ArraySize(mSwizzleCache))
{ {
...@@ -378,11 +378,11 @@ void TextureStorage11::invalidateSwizzleCacheLevel(int mipLevel) ...@@ -378,11 +378,11 @@ void TextureStorage11::invalidateSwizzleCacheLevel(int mipLevel)
} }
} }
void TextureStorage11::invalidateSwizzleCache() void TextureStorage11::markDirty()
{ {
for (unsigned int mipLevel = 0; mipLevel < ArraySize(mSwizzleCache); mipLevel++) for (unsigned int mipLevel = 0; mipLevel < ArraySize(mSwizzleCache); mipLevel++)
{ {
invalidateSwizzleCacheLevel(mipLevel); markLevelDirty(mipLevel);
} }
} }
...@@ -395,7 +395,7 @@ gl::Error TextureStorage11::updateSubresourceLevel(ID3D11Resource *srcTexture, ...@@ -395,7 +395,7 @@ gl::Error TextureStorage11::updateSubresourceLevel(ID3D11Resource *srcTexture,
const GLint level = index.mipIndex; const GLint level = index.mipIndex;
invalidateSwizzleCacheLevel(level); markLevelDirty(level);
gl::Extents texSize(getLevelWidth(level), getLevelHeight(level), getLevelDepth(level)); gl::Extents texSize(getLevelWidth(level), getLevelHeight(level), getLevelDepth(level));
...@@ -511,7 +511,7 @@ gl::Error TextureStorage11::generateMipmap(const gl::ImageIndex &sourceIndex, ...@@ -511,7 +511,7 @@ gl::Error TextureStorage11::generateMipmap(const gl::ImageIndex &sourceIndex,
{ {
ASSERT(sourceIndex.layerIndex == destIndex.layerIndex); ASSERT(sourceIndex.layerIndex == destIndex.layerIndex);
invalidateSwizzleCacheLevel(destIndex.mipIndex); markLevelDirty(destIndex.mipIndex);
RenderTargetD3D *source = nullptr; RenderTargetD3D *source = nullptr;
gl::Error error = getRenderTarget(sourceIndex, &source); gl::Error error = getRenderTarget(sourceIndex, &source);
...@@ -554,7 +554,7 @@ void TextureStorage11::verifySwizzleExists(const gl::SwizzleState &swizzleState) ...@@ -554,7 +554,7 @@ void TextureStorage11::verifySwizzleExists(const gl::SwizzleState &swizzleState)
void TextureStorage11::clearSRVCache() void TextureStorage11::clearSRVCache()
{ {
invalidateSwizzleCache(); markDirty();
auto iter = mSrvCache.begin(); auto iter = mSrvCache.begin();
while (iter != mSrvCache.end()) while (iter != mSrvCache.end())
...@@ -599,7 +599,7 @@ gl::Error TextureStorage11::copyToStorage(TextureStorage *destStorage) ...@@ -599,7 +599,7 @@ gl::Error TextureStorage11::copyToStorage(TextureStorage *destStorage)
ID3D11DeviceContext *immediateContext = mRenderer->getDeviceContext(); ID3D11DeviceContext *immediateContext = mRenderer->getDeviceContext();
immediateContext->CopyResource(destResource, sourceResouce); immediateContext->CopyResource(destResource, sourceResouce);
dest11->invalidateSwizzleCache(); dest11->markDirty();
return gl::Error(GL_NO_ERROR); return gl::Error(GL_NO_ERROR);
} }
...@@ -613,7 +613,7 @@ gl::Error TextureStorage11::setData(const gl::ImageIndex &index, ...@@ -613,7 +613,7 @@ gl::Error TextureStorage11::setData(const gl::ImageIndex &index,
{ {
ASSERT(!image->isDirty()); ASSERT(!image->isDirty());
invalidateSwizzleCacheLevel(index.mipIndex); markLevelDirty(index.mipIndex);
ID3D11Resource *resource = nullptr; ID3D11Resource *resource = nullptr;
ANGLE_TRY(getResource(&resource)); ANGLE_TRY(getResource(&resource));
...@@ -884,7 +884,7 @@ gl::Error TextureStorage11_2D::copyToStorage(TextureStorage *destStorage) ...@@ -884,7 +884,7 @@ gl::Error TextureStorage11_2D::copyToStorage(TextureStorage *destStorage)
} }
immediateContext->CopyResource(destResource, sourceResouce); immediateContext->CopyResource(destResource, sourceResouce);
dest11->invalidateSwizzleCache(); dest11->markDirty();
} }
return gl::Error(GL_NO_ERROR); return gl::Error(GL_NO_ERROR);
...@@ -1628,7 +1628,7 @@ gl::Error TextureStorage11_EGLImage::copyToStorage(TextureStorage *destStorage) ...@@ -1628,7 +1628,7 @@ gl::Error TextureStorage11_EGLImage::copyToStorage(TextureStorage *destStorage)
ID3D11DeviceContext *immediateContext = mRenderer->getDeviceContext(); ID3D11DeviceContext *immediateContext = mRenderer->getDeviceContext();
immediateContext->CopyResource(destResource, sourceResouce); immediateContext->CopyResource(destResource, sourceResouce);
dest11->invalidateSwizzleCache(); dest11->markDirty();
return gl::Error(GL_NO_ERROR); return gl::Error(GL_NO_ERROR);
} }
...@@ -1981,7 +1981,7 @@ gl::Error TextureStorage11_Cube::copyToStorage(TextureStorage *destStorage) ...@@ -1981,7 +1981,7 @@ gl::Error TextureStorage11_Cube::copyToStorage(TextureStorage *destStorage)
immediateContext->CopyResource(destResource, sourceResouce); immediateContext->CopyResource(destResource, sourceResouce);
} }
dest11->invalidateSwizzleCache(); dest11->markDirty();
return gl::Error(GL_NO_ERROR); return gl::Error(GL_NO_ERROR);
} }
......
...@@ -59,8 +59,8 @@ class TextureStorage11 : public TextureStorage ...@@ -59,8 +59,8 @@ class TextureStorage11 : public TextureStorage
virtual UINT getSubresourceIndex(const gl::ImageIndex &index) const; virtual UINT getSubresourceIndex(const gl::ImageIndex &index) const;
gl::Error generateSwizzles(const gl::SwizzleState &swizzleTarget); gl::Error generateSwizzles(const gl::SwizzleState &swizzleTarget);
void invalidateSwizzleCacheLevel(int mipLevel); void markLevelDirty(int mipLevel);
void invalidateSwizzleCache(); void markDirty();
gl::Error updateSubresourceLevel(ID3D11Resource *texture, unsigned int sourceSubresource, gl::Error updateSubresourceLevel(ID3D11Resource *texture, unsigned int sourceSubresource,
const gl::ImageIndex &index, const gl::Box &copyArea); const gl::ImageIndex &index, const gl::Box &copyArea);
......
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