Commit 9c335865 by Jamie Madill Committed by Commit Bot

Refactor StateManager11 for dirty bits.

This will make iterating over an internal set of dirty bits simpler. This also reorganizes the framebuffer invalidation logic a bit, including how the sample count is pulled from the Framebuffer. BUG=angleproject:1156 Change-Id: I79dbcd11704ab52568c587d836af9c1bff1d2d1f Reviewed-on: https://chromium-review.googlesource.com/529708 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent ab4be84f
...@@ -137,7 +137,7 @@ void SecureHashAlgorithm::Final() ...@@ -137,7 +137,7 @@ void SecureHashAlgorithm::Final()
Process(); Process();
for (int t = 0; t < 5; ++t) for (int t = 0; t < 5; ++t)
H[t] = ByteSwap(H[t]); H[t] = ByteSwap(H[t]);
} }
void SecureHashAlgorithm::Update(const void *data, size_t nbytes) void SecureHashAlgorithm::Update(const void *data, size_t nbytes)
...@@ -188,11 +188,11 @@ void SecureHashAlgorithm::Process() ...@@ -188,11 +188,11 @@ void SecureHashAlgorithm::Process()
// //
// W and M are in a union, so no need to memcpy. // W and M are in a union, so no need to memcpy.
// memcpy(W, M, sizeof(M)); // memcpy(W, M, sizeof(M));
for (t = 0; t < 16; ++t) for (t = 0; t < 16; ++t)
W[t] = ByteSwap(W[t]); W[t] = ByteSwap(W[t]);
// b. // b.
for (t = 16; t < 80; ++t) for (t = 16; t < 80; ++t)
W[t] = S(1, W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16]); W[t] = S(1, W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16]);
// c. // c.
......
...@@ -418,6 +418,16 @@ bool FramebufferState::colorAttachmentsAreUniqueImages() const ...@@ -418,6 +418,16 @@ bool FramebufferState::colorAttachmentsAreUniqueImages() const
return true; return true;
} }
bool FramebufferState::hasDepth() const
{
return (mDepthAttachment.isAttached() && mDepthAttachment.getDepthSize() > 0);
}
bool FramebufferState::hasStencil() const
{
return (mStencilAttachment.isAttached() && mStencilAttachment.getStencilSize() > 0);
}
Framebuffer::Framebuffer(const Caps &caps, rx::GLImplFactory *factory, GLuint id) Framebuffer::Framebuffer(const Caps &caps, rx::GLImplFactory *factory, GLuint id)
: mState(caps), : mState(caps),
mImpl(factory->createFramebuffer(mState)), mImpl(factory->createFramebuffer(mState)),
...@@ -711,13 +721,12 @@ size_t Framebuffer::getNumColorBuffers() const ...@@ -711,13 +721,12 @@ size_t Framebuffer::getNumColorBuffers() const
bool Framebuffer::hasDepth() const bool Framebuffer::hasDepth() const
{ {
return (mState.mDepthAttachment.isAttached() && mState.mDepthAttachment.getDepthSize() > 0); return mState.hasDepth();
} }
bool Framebuffer::hasStencil() const bool Framebuffer::hasStencil() const
{ {
return (mState.mStencilAttachment.isAttached() && return mState.hasStencil();
mState.mStencilAttachment.getStencilSize() > 0);
} }
bool Framebuffer::usingExtendedDrawBuffers() const bool Framebuffer::usingExtendedDrawBuffers() const
...@@ -1079,16 +1088,24 @@ int Framebuffer::getSamples(const Context *context) ...@@ -1079,16 +1088,24 @@ int Framebuffer::getSamples(const Context *context)
{ {
if (complete(context)) if (complete(context))
{ {
// For a complete framebuffer, all attachments must have the same sample count. return getCachedSamples(context);
// In this case return the first nonzero sample size. }
const auto *firstNonNullAttachment = mState.getFirstNonNullAttachment();
if (firstNonNullAttachment) return 0;
{ }
ASSERT(firstNonNullAttachment->isAttached());
return firstNonNullAttachment->getSamples(); int Framebuffer::getCachedSamples(const Context *context)
} {
// For a complete framebuffer, all attachments must have the same sample count.
// In this case return the first nonzero sample size.
const auto *firstNonNullAttachment = mState.getFirstNonNullAttachment();
if (firstNonNullAttachment)
{
ASSERT(firstNonNullAttachment->isAttached());
return firstNonNullAttachment->getSamples();
} }
// No attachments found.
return 0; return 0;
} }
......
...@@ -89,6 +89,9 @@ class FramebufferState final : angle::NonCopyable ...@@ -89,6 +89,9 @@ class FramebufferState final : angle::NonCopyable
GLint getDefaultSamples() const { return mDefaultSamples; }; GLint getDefaultSamples() const { return mDefaultSamples; };
GLboolean getDefaultFixedSampleLocations() const { return mDefaultFixedSampleLocations; }; GLboolean getDefaultFixedSampleLocations() const { return mDefaultFixedSampleLocations; };
bool hasDepth() const;
bool hasStencil() const;
private: private:
friend class Framebuffer; friend class Framebuffer;
...@@ -201,6 +204,9 @@ class Framebuffer final : public LabeledObject, public OnAttachmentDirtyReceiver ...@@ -201,6 +204,9 @@ class Framebuffer final : public LabeledObject, public OnAttachmentDirtyReceiver
GLenum checkStatus(const ValidationContext *context); GLenum checkStatus(const ValidationContext *context);
int getSamples(const ValidationContext *context); int getSamples(const ValidationContext *context);
// For when we don't want to check completeness in getSamples().
int getCachedSamples(const Context *context);
// Helper for checkStatus == GL_FRAMEBUFFER_COMPLETE. // Helper for checkStatus == GL_FRAMEBUFFER_COMPLETE.
bool complete(const Context *context); bool complete(const Context *context);
bool cachedComplete() const; bool cachedComplete() const;
......
...@@ -327,7 +327,7 @@ egl::Error DisplayD3D::waitClient(const gl::Context *context) const ...@@ -327,7 +327,7 @@ egl::Error DisplayD3D::waitClient(const gl::Context *context) const
for (auto &surface : mState.surfaceSet) for (auto &surface : mState.surfaceSet)
{ {
SurfaceD3D *surfaceD3D = GetImplAs<SurfaceD3D>(surface); SurfaceD3D *surfaceD3D = GetImplAs<SurfaceD3D>(surface);
surfaceD3D->checkForOutOfDateSwapChain(context->getCurrentDisplay()); surfaceD3D->checkForOutOfDateSwapChain(context);
} }
return egl::NoError(); return egl::NoError();
...@@ -341,13 +341,13 @@ egl::Error DisplayD3D::waitNative(const gl::Context *context, EGLint engine) con ...@@ -341,13 +341,13 @@ egl::Error DisplayD3D::waitNative(const gl::Context *context, EGLint engine) con
if (drawSurface != nullptr) if (drawSurface != nullptr)
{ {
SurfaceD3D *drawSurfaceD3D = GetImplAs<SurfaceD3D>(drawSurface); SurfaceD3D *drawSurfaceD3D = GetImplAs<SurfaceD3D>(drawSurface);
drawSurfaceD3D->checkForOutOfDateSwapChain(context->getCurrentDisplay()); drawSurfaceD3D->checkForOutOfDateSwapChain(context);
} }
if (readSurface != nullptr) if (readSurface != nullptr)
{ {
SurfaceD3D *readurfaceD3D = GetImplAs<SurfaceD3D>(readSurface); SurfaceD3D *readurfaceD3D = GetImplAs<SurfaceD3D>(readSurface);
readurfaceD3D->checkForOutOfDateSwapChain(context->getCurrentDisplay()); readurfaceD3D->checkForOutOfDateSwapChain(context);
} }
return egl::NoError(); return egl::NoError();
......
...@@ -151,7 +151,8 @@ egl::Error SurfaceD3D::resetSwapChain(const egl::Display *display) ...@@ -151,7 +151,8 @@ egl::Error SurfaceD3D::resetSwapChain(const egl::Display *display)
return egl::EglBadAlloc(); return egl::EglBadAlloc();
} }
egl::Error error = resetSwapChain(display, width, height); // This is a bit risky to pass the proxy context here, but it can happen at almost any time.
egl::Error error = resetSwapChain(display->getProxyContext(), width, height);
if (error.isError()) if (error.isError())
{ {
SafeDelete(mSwapChain); SafeDelete(mSwapChain);
...@@ -161,7 +162,7 @@ egl::Error SurfaceD3D::resetSwapChain(const egl::Display *display) ...@@ -161,7 +162,7 @@ egl::Error SurfaceD3D::resetSwapChain(const egl::Display *display)
return egl::NoError(); return egl::NoError();
} }
egl::Error SurfaceD3D::resizeSwapChain(const egl::Display *display, egl::Error SurfaceD3D::resizeSwapChain(const gl::Context *context,
int backbufferWidth, int backbufferWidth,
int backbufferHeight) int backbufferHeight)
{ {
...@@ -169,7 +170,7 @@ egl::Error SurfaceD3D::resizeSwapChain(const egl::Display *display, ...@@ -169,7 +170,7 @@ egl::Error SurfaceD3D::resizeSwapChain(const egl::Display *display,
ASSERT(mSwapChain); ASSERT(mSwapChain);
EGLint status = EGLint status =
mSwapChain->resize(display, std::max(1, backbufferWidth), std::max(1, backbufferHeight)); mSwapChain->resize(context, std::max(1, backbufferWidth), std::max(1, backbufferHeight));
if (status == EGL_CONTEXT_LOST) if (status == EGL_CONTEXT_LOST)
{ {
...@@ -187,14 +188,14 @@ egl::Error SurfaceD3D::resizeSwapChain(const egl::Display *display, ...@@ -187,14 +188,14 @@ egl::Error SurfaceD3D::resizeSwapChain(const egl::Display *display,
return egl::NoError(); return egl::NoError();
} }
egl::Error SurfaceD3D::resetSwapChain(const egl::Display *display, egl::Error SurfaceD3D::resetSwapChain(const gl::Context *context,
int backbufferWidth, int backbufferWidth,
int backbufferHeight) int backbufferHeight)
{ {
ASSERT(backbufferWidth >= 0 && backbufferHeight >= 0); ASSERT(backbufferWidth >= 0 && backbufferHeight >= 0);
ASSERT(mSwapChain); ASSERT(mSwapChain);
EGLint status = mSwapChain->reset(display, std::max(1, backbufferWidth), EGLint status = mSwapChain->reset(context, std::max(1, backbufferWidth),
std::max(1, backbufferHeight), mSwapInterval); std::max(1, backbufferHeight), mSwapInterval);
if (status == EGL_CONTEXT_LOST) if (status == EGL_CONTEXT_LOST)
...@@ -214,7 +215,7 @@ egl::Error SurfaceD3D::resetSwapChain(const egl::Display *display, ...@@ -214,7 +215,7 @@ egl::Error SurfaceD3D::resetSwapChain(const egl::Display *display,
return egl::NoError(); return egl::NoError();
} }
egl::Error SurfaceD3D::swapRect(const egl::Display *display, egl::Error SurfaceD3D::swapRect(const gl::Context *context,
EGLint x, EGLint x,
EGLint y, EGLint y,
EGLint width, EGLint width,
...@@ -237,7 +238,7 @@ egl::Error SurfaceD3D::swapRect(const egl::Display *display, ...@@ -237,7 +238,7 @@ egl::Error SurfaceD3D::swapRect(const egl::Display *display,
if (width != 0 && height != 0) if (width != 0 && height != 0)
{ {
EGLint status = mSwapChain->swapRect(display, x, y, width, height); EGLint status = mSwapChain->swapRect(context, x, y, width, height);
if (status == EGL_CONTEXT_LOST) if (status == EGL_CONTEXT_LOST)
{ {
...@@ -250,12 +251,12 @@ egl::Error SurfaceD3D::swapRect(const egl::Display *display, ...@@ -250,12 +251,12 @@ egl::Error SurfaceD3D::swapRect(const egl::Display *display,
} }
} }
checkForOutOfDateSwapChain(display); checkForOutOfDateSwapChain(context);
return egl::NoError(); return egl::NoError();
} }
bool SurfaceD3D::checkForOutOfDateSwapChain(const egl::Display *display) bool SurfaceD3D::checkForOutOfDateSwapChain(const gl::Context *context)
{ {
RECT client; RECT client;
int clientWidth = getWidth(); int clientWidth = getWidth();
...@@ -281,11 +282,11 @@ bool SurfaceD3D::checkForOutOfDateSwapChain(const egl::Display *display) ...@@ -281,11 +282,11 @@ bool SurfaceD3D::checkForOutOfDateSwapChain(const egl::Display *display)
if (mSwapIntervalDirty) if (mSwapIntervalDirty)
{ {
resetSwapChain(display, clientWidth, clientHeight); resetSwapChain(context, clientWidth, clientHeight);
} }
else if (sizeDirty) else if (sizeDirty)
{ {
resizeSwapChain(display, clientWidth, clientHeight); resizeSwapChain(context, clientWidth, clientHeight);
} }
return wasDirty; return wasDirty;
...@@ -293,7 +294,7 @@ bool SurfaceD3D::checkForOutOfDateSwapChain(const egl::Display *display) ...@@ -293,7 +294,7 @@ bool SurfaceD3D::checkForOutOfDateSwapChain(const egl::Display *display)
egl::Error SurfaceD3D::swap(const gl::Context *context) egl::Error SurfaceD3D::swap(const gl::Context *context)
{ {
return swapRect(context->getCurrentDisplay(), 0, 0, mWidth, mHeight); return swapRect(context, 0, 0, mWidth, mHeight);
} }
egl::Error SurfaceD3D::postSubBuffer(const gl::Context *context, egl::Error SurfaceD3D::postSubBuffer(const gl::Context *context,
...@@ -302,7 +303,7 @@ egl::Error SurfaceD3D::postSubBuffer(const gl::Context *context, ...@@ -302,7 +303,7 @@ egl::Error SurfaceD3D::postSubBuffer(const gl::Context *context,
EGLint width, EGLint width,
EGLint height) EGLint height)
{ {
return swapRect(context->getCurrentDisplay(), x, y, width, height); return swapRect(context, x, y, width, height);
} }
rx::SwapChainD3D *SurfaceD3D::getSwapChain() const rx::SwapChainD3D *SurfaceD3D::getSwapChain() const
......
...@@ -55,7 +55,7 @@ class SurfaceD3D : public SurfaceImpl ...@@ -55,7 +55,7 @@ class SurfaceD3D : public SurfaceImpl
egl::Error resetSwapChain(const egl::Display *display); egl::Error resetSwapChain(const egl::Display *display);
// Returns true if swapchain changed due to resize or interval update // Returns true if swapchain changed due to resize or interval update
bool checkForOutOfDateSwapChain(const egl::Display *display); bool checkForOutOfDateSwapChain(const gl::Context *context);
gl::Error getAttachmentRenderTarget(const gl::Context *context, gl::Error getAttachmentRenderTarget(const gl::Context *context,
GLenum binding, GLenum binding,
...@@ -71,15 +71,15 @@ class SurfaceD3D : public SurfaceImpl ...@@ -71,15 +71,15 @@ class SurfaceD3D : public SurfaceImpl
EGLClientBuffer clientBuffer, EGLClientBuffer clientBuffer,
const egl::AttributeMap &attribs); const egl::AttributeMap &attribs);
egl::Error swapRect(const egl::Display *display, egl::Error swapRect(const gl::Context *context,
EGLint x, EGLint x,
EGLint y, EGLint y,
EGLint width, EGLint width,
EGLint height); EGLint height);
egl::Error resetSwapChain(const egl::Display *display, egl::Error resetSwapChain(const gl::Context *context,
int backbufferWidth, int backbufferWidth,
int backbufferHeight); int backbufferHeight);
egl::Error resizeSwapChain(const egl::Display *display, egl::Error resizeSwapChain(const gl::Context *context,
int backbufferWidth, int backbufferWidth,
int backbufferHeight); int backbufferHeight);
......
...@@ -22,6 +22,11 @@ ...@@ -22,6 +22,11 @@
#define ANGLE_FORCE_VSYNC_OFF 0 #define ANGLE_FORCE_VSYNC_OFF 0
#endif #endif
namespace gl
{
class Context;
} // namespace gl
namespace egl namespace egl
{ {
class Display; class Display;
...@@ -40,14 +45,14 @@ class SwapChainD3D : angle::NonCopyable ...@@ -40,14 +45,14 @@ class SwapChainD3D : angle::NonCopyable
GLenum depthBufferFormat); GLenum depthBufferFormat);
virtual ~SwapChainD3D(); virtual ~SwapChainD3D();
virtual EGLint resize(const egl::Display *display, virtual EGLint resize(const gl::Context *context,
EGLint backbufferWidth, EGLint backbufferWidth,
EGLint backbufferSize) = 0; EGLint backbufferSize) = 0;
virtual EGLint reset(const egl::Display *display, virtual EGLint reset(const gl::Context *context,
EGLint backbufferWidth, EGLint backbufferWidth,
EGLint backbufferHeight, EGLint backbufferHeight,
EGLint swapInterval) = 0; EGLint swapInterval) = 0;
virtual EGLint swapRect(const egl::Display *display, virtual EGLint swapRect(const gl::Context *context,
EGLint x, EGLint x,
EGLint y, EGLint y,
EGLint width, EGLint width,
......
...@@ -1104,7 +1104,7 @@ gl::Error Blit11::swizzleTexture(const gl::Context *context, ...@@ -1104,7 +1104,7 @@ gl::Error Blit11::swizzleTexture(const gl::Context *context,
stateManager->setShaderResource(gl::SAMPLER_PIXEL, 0, nullptr); stateManager->setShaderResource(gl::SAMPLER_PIXEL, 0, nullptr);
// Apply render target // Apply render target
stateManager->setOneTimeRenderTarget(dest.get(), nullptr); stateManager->setOneTimeRenderTarget(context, dest.get(), nullptr);
// Set the viewport // Set the viewport
D3D11_VIEWPORT viewport; D3D11_VIEWPORT viewport;
...@@ -1128,7 +1128,7 @@ gl::Error Blit11::swizzleTexture(const gl::Context *context, ...@@ -1128,7 +1128,7 @@ gl::Error Blit11::swizzleTexture(const gl::Context *context,
// Unbind shader resources and dirty state. // Unbind shader resources and dirty state.
stateManager->setShaderResource(gl::SAMPLER_PIXEL, 0, nullptr); stateManager->setShaderResource(gl::SAMPLER_PIXEL, 0, nullptr);
mRenderer->markAllStateDirty(); mRenderer->markAllStateDirty(context);
return gl::NoError(); return gl::NoError();
} }
...@@ -1239,7 +1239,7 @@ gl::Error Blit11::copyTexture(const gl::Context *context, ...@@ -1239,7 +1239,7 @@ gl::Error Blit11::copyTexture(const gl::Context *context,
stateManager->setShaderResource(gl::SAMPLER_PIXEL, 0, nullptr); stateManager->setShaderResource(gl::SAMPLER_PIXEL, 0, nullptr);
// Apply render target // Apply render target
stateManager->setOneTimeRenderTarget(dest.get(), nullptr); stateManager->setOneTimeRenderTarget(context, dest.get(), nullptr);
// Set the viewport // Set the viewport
D3D11_VIEWPORT viewport; D3D11_VIEWPORT viewport;
...@@ -1277,7 +1277,7 @@ gl::Error Blit11::copyTexture(const gl::Context *context, ...@@ -1277,7 +1277,7 @@ gl::Error Blit11::copyTexture(const gl::Context *context,
// Unbind shader resource and invalidate state. // Unbind shader resource and invalidate state.
stateManager->setShaderResource(gl::SAMPLER_PIXEL, 0, nullptr); stateManager->setShaderResource(gl::SAMPLER_PIXEL, 0, nullptr);
mRenderer->markAllStateDirty(); mRenderer->markAllStateDirty(context);
return gl::NoError(); return gl::NoError();
} }
...@@ -1371,7 +1371,7 @@ gl::Error Blit11::copyDepth(const gl::Context *context, ...@@ -1371,7 +1371,7 @@ gl::Error Blit11::copyDepth(const gl::Context *context,
stateManager->setShaderResource(gl::SAMPLER_PIXEL, 0, nullptr); stateManager->setShaderResource(gl::SAMPLER_PIXEL, 0, nullptr);
// Apply render target // Apply render target
stateManager->setOneTimeRenderTarget(nullptr, dest.get()); stateManager->setOneTimeRenderTarget(context, nullptr, dest.get());
// Set the viewport // Set the viewport
D3D11_VIEWPORT viewport; D3D11_VIEWPORT viewport;
...@@ -1396,7 +1396,7 @@ gl::Error Blit11::copyDepth(const gl::Context *context, ...@@ -1396,7 +1396,7 @@ gl::Error Blit11::copyDepth(const gl::Context *context,
// Unbind shader resources and invalidate all state. // Unbind shader resources and invalidate all state.
stateManager->setShaderResource(gl::SAMPLER_PIXEL, 0, nullptr); stateManager->setShaderResource(gl::SAMPLER_PIXEL, 0, nullptr);
mRenderer->markAllStateDirty(); mRenderer->markAllStateDirty(context);
return gl::NoError(); return gl::NoError();
} }
...@@ -2013,7 +2013,7 @@ gl::ErrorOrResult<TextureHelper11> Blit11::resolveDepth(const gl::Context *conte ...@@ -2013,7 +2013,7 @@ gl::ErrorOrResult<TextureHelper11> Blit11::resolveDepth(const gl::Context *conte
ANGLE_TRY(initResolveDepthOnly(depth->getFormatSet(), extents)); ANGLE_TRY(initResolveDepthOnly(depth->getFormatSet(), extents));
// Notify the Renderer that all state should be invalidated. // Notify the Renderer that all state should be invalidated.
mRenderer->markAllStateDirty(); mRenderer->markAllStateDirty(context);
ANGLE_TRY(mResolveDepthStencilVS.resolve(mRenderer)); ANGLE_TRY(mResolveDepthStencilVS.resolve(mRenderer));
ANGLE_TRY(mResolveDepthPS.resolve(mRenderer)); ANGLE_TRY(mResolveDepthPS.resolve(mRenderer));
...@@ -2172,7 +2172,7 @@ gl::ErrorOrResult<TextureHelper11> Blit11::resolveStencil(const gl::Context *con ...@@ -2172,7 +2172,7 @@ gl::ErrorOrResult<TextureHelper11> Blit11::resolveStencil(const gl::Context *con
} }
// Notify the Renderer that all state should be invalidated. // Notify the Renderer that all state should be invalidated.
mRenderer->markAllStateDirty(); mRenderer->markAllStateDirty(context);
ID3D11RenderTargetView *rtvs[] = {mResolvedDepthStencilRTView.get()}; ID3D11RenderTargetView *rtvs[] = {mResolvedDepthStencilRTView.get()};
......
...@@ -710,13 +710,13 @@ gl::Error Clear11::clearFramebuffer(const gl::Context *context, ...@@ -710,13 +710,13 @@ gl::Error Clear11::clearFramebuffer(const gl::Context *context,
deviceContext->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST); deviceContext->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
// Apply render targets // Apply render targets
stateManager->setOneTimeRenderTargets(&rtvs[0], numRtvs, dsv); stateManager->setOneTimeRenderTargets(context, &rtvs[0], numRtvs, dsv);
// Draw the fullscreen quad // Draw the fullscreen quad
deviceContext->Draw(6, 0); deviceContext->Draw(6, 0);
// Clean up // Clean up
mRenderer->markAllStateDirty(); mRenderer->markAllStateDirty(context);
return gl::NoError(); return gl::NoError();
} }
......
...@@ -61,7 +61,12 @@ void UpdateCachedRenderTarget(const gl::Context *context, ...@@ -61,7 +61,12 @@ void UpdateCachedRenderTarget(const gl::Context *context,
RenderTarget11 *newRenderTarget = nullptr; RenderTarget11 *newRenderTarget = nullptr;
if (attachment) if (attachment)
{ {
attachment->getRenderTarget(context, &newRenderTarget); // TODO(jmadill): Don't swallow this error.
gl::Error error = attachment->getRenderTarget(context, &newRenderTarget);
if (error.isError())
{
ERR() << "Internal rendertarget error: " << error;
}
} }
if (newRenderTarget != cachedRenderTarget) if (newRenderTarget != cachedRenderTarget)
{ {
...@@ -394,8 +399,6 @@ void Framebuffer11::updateDepthStencilRenderTarget(const gl::Context *context) ...@@ -394,8 +399,6 @@ void Framebuffer11::updateDepthStencilRenderTarget(const gl::Context *context)
void Framebuffer11::syncState(const gl::Context *context, void Framebuffer11::syncState(const gl::Context *context,
const gl::Framebuffer::DirtyBits &dirtyBits) const gl::Framebuffer::DirtyBits &dirtyBits)
{ {
mRenderer->getStateManager()->invalidateRenderTarget();
const auto &mergedDirtyBits = dirtyBits | mInternalDirtyBits; const auto &mergedDirtyBits = dirtyBits | mInternalDirtyBits;
mInternalDirtyBits.reset(); mInternalDirtyBits.reset();
...@@ -426,6 +429,9 @@ void Framebuffer11::syncState(const gl::Context *context, ...@@ -426,6 +429,9 @@ void Framebuffer11::syncState(const gl::Context *context,
ASSERT(!mInternalDirtyBits.any()); ASSERT(!mInternalDirtyBits.any());
FramebufferD3D::syncState(context, dirtyBits); FramebufferD3D::syncState(context, dirtyBits);
// Call this last to allow the state manager to take advantage of the cached render targets.
mRenderer->getStateManager()->invalidateRenderTarget(context);
} }
void Framebuffer11::signal(size_t channelID) void Framebuffer11::signal(size_t channelID)
...@@ -459,4 +465,18 @@ void Framebuffer11::syncInternalState(const gl::Context *context) ...@@ -459,4 +465,18 @@ void Framebuffer11::syncInternalState(const gl::Context *context)
syncState(context, gl::Framebuffer::DirtyBits()); syncState(context, gl::Framebuffer::DirtyBits());
} }
RenderTarget11 *Framebuffer11::getFirstRenderTarget() const
{
ASSERT(mInternalDirtyBits.none());
for (auto *renderTarget : mCachedColorRenderTargets)
{
if (renderTarget)
{
return renderTarget;
}
}
return mCachedDepthStencilRenderTarget;
}
} // namespace rx } // namespace rx
...@@ -47,6 +47,8 @@ class Framebuffer11 : public FramebufferD3D, public OnRenderTargetDirtyReceiver ...@@ -47,6 +47,8 @@ class Framebuffer11 : public FramebufferD3D, public OnRenderTargetDirtyReceiver
return mCachedDepthStencilRenderTarget; return mCachedDepthStencilRenderTarget;
} }
RenderTarget11 *getFirstRenderTarget() const;
bool hasAnyInternalDirtyBit() const; bool hasAnyInternalDirtyBit() const;
void syncInternalState(const gl::Context *context); void syncInternalState(const gl::Context *context);
......
...@@ -202,7 +202,7 @@ gl::Error PixelTransfer11::copyBufferToTexture(const gl::Context *context, ...@@ -202,7 +202,7 @@ gl::Error PixelTransfer11::copyBufferToTexture(const gl::Context *context,
deviceContext->OMSetDepthStencilState(mCopyDepthStencilState.get(), 0xFFFFFFFF); deviceContext->OMSetDepthStencilState(mCopyDepthStencilState.get(), 0xFFFFFFFF);
deviceContext->RSSetState(mCopyRasterizerState.get()); deviceContext->RSSetState(mCopyRasterizerState.get());
stateManager->setOneTimeRenderTarget(textureRTV.get(), nullptr); stateManager->setOneTimeRenderTarget(context, textureRTV.get(), nullptr);
if (!StructEquals(mParamsData, shaderParams)) if (!StructEquals(mParamsData, shaderParams))
{ {
...@@ -232,7 +232,7 @@ gl::Error PixelTransfer11::copyBufferToTexture(const gl::Context *context, ...@@ -232,7 +232,7 @@ gl::Error PixelTransfer11::copyBufferToTexture(const gl::Context *context,
ID3D11Buffer *nullBuffer = nullptr; ID3D11Buffer *nullBuffer = nullptr;
deviceContext->VSSetConstantBuffers(0, 1, &nullBuffer); deviceContext->VSSetConstantBuffers(0, 1, &nullBuffer);
mRenderer->markAllStateDirty(); mRenderer->markAllStateDirty(context);
return gl::NoError(); return gl::NoError();
} }
......
...@@ -834,7 +834,8 @@ void Renderer11::initializeDevice() ...@@ -834,7 +834,8 @@ void Renderer11::initializeDevice()
mStateManager.initialize(rendererCaps); mStateManager.initialize(rendererCaps);
markAllStateDirty(); // No context is available here, use the proxy context in the display.
markAllStateDirty(mDisplay->getProxyContext());
// Gather stats on DXGI and D3D feature level // Gather stats on DXGI and D3D feature level
ANGLE_HISTOGRAM_BOOLEAN("GPU.ANGLE.SupportsDXGI1_2", mRenderer11DeviceCaps.supportsDXGI1_2); ANGLE_HISTOGRAM_BOOLEAN("GPU.ANGLE.SupportsDXGI1_2", mRenderer11DeviceCaps.supportsDXGI1_2);
...@@ -2739,7 +2740,7 @@ template void Renderer11::applyDriverConstantsIfNeeded<dx_ComputeConstants11>( ...@@ -2739,7 +2740,7 @@ template void Renderer11::applyDriverConstantsIfNeeded<dx_ComputeConstants11>(
size_t samplerMetadataReferencedBytes, size_t samplerMetadataReferencedBytes,
const d3d11::Buffer &driverConstantBuffer); const d3d11::Buffer &driverConstantBuffer);
void Renderer11::markAllStateDirty() void Renderer11::markAllStateDirty(const gl::Context *context)
{ {
TRACE_EVENT0("gpu.angle", "Renderer11::markAllStateDirty"); TRACE_EVENT0("gpu.angle", "Renderer11::markAllStateDirty");
...@@ -2758,7 +2759,7 @@ void Renderer11::markAllStateDirty() ...@@ -2758,7 +2759,7 @@ void Renderer11::markAllStateDirty()
mForceSetComputeSamplerStates[csamplerId] = true; mForceSetComputeSamplerStates[csamplerId] = true;
} }
mStateManager.invalidateEverything(); mStateManager.invalidateEverything(context);
mAppliedIB = nullptr; mAppliedIB = nullptr;
mAppliedIBFormat = DXGI_FORMAT_UNKNOWN; mAppliedIBFormat = DXGI_FORMAT_UNKNOWN;
......
...@@ -353,7 +353,7 @@ class Renderer11 : public RendererD3D ...@@ -353,7 +353,7 @@ class Renderer11 : public RendererD3D
GLenum sourcePixelsType, GLenum sourcePixelsType,
const gl::Box &destArea) override; const gl::Box &destArea) override;
void markAllStateDirty(); void markAllStateDirty(const gl::Context *context);
gl::Error packPixels(const TextureHelper11 &textureHelper, gl::Error packPixels(const TextureHelper11 &textureHelper,
const PackPixelsParams &params, const PackPixelsParams &params,
uint8_t *pixelsOut); uint8_t *pixelsOut);
......
...@@ -71,13 +71,18 @@ class StateManager11 final : angle::NonCopyable ...@@ -71,13 +71,18 @@ class StateManager11 final : angle::NonCopyable
ID3D11ShaderResourceView *srv); ID3D11ShaderResourceView *srv);
gl::Error clearTextures(gl::SamplerType samplerType, size_t rangeStart, size_t rangeEnd); gl::Error clearTextures(gl::SamplerType samplerType, size_t rangeStart, size_t rangeEnd);
void invalidateRenderTarget(); // Checks are done on a framebuffer state change to trigger other state changes.
void invalidateBoundViews(); // The Context is allowed to be nullptr for these methods, when called in EGL init code.
void invalidateRenderTarget(const gl::Context *context);
void invalidateBoundViews(const gl::Context *context);
void invalidateVertexBuffer(); void invalidateVertexBuffer();
void invalidateEverything(); void invalidateEverything(const gl::Context *context);
void setOneTimeRenderTarget(ID3D11RenderTargetView *rtv, ID3D11DepthStencilView *dsv); void setOneTimeRenderTarget(const gl::Context *context,
void setOneTimeRenderTargets(ID3D11RenderTargetView **rtvs, ID3D11RenderTargetView *rtv,
ID3D11DepthStencilView *dsv);
void setOneTimeRenderTargets(const gl::Context *context,
ID3D11RenderTargetView **rtvs,
UINT numRtvs, UINT numRtvs,
ID3D11DepthStencilView *dsv); ID3D11DepthStencilView *dsv);
...@@ -120,14 +125,13 @@ class StateManager11 final : angle::NonCopyable ...@@ -120,14 +125,13 @@ class StateManager11 final : angle::NonCopyable
gl::Error syncDepthStencilState(const gl::State &glState); gl::Error syncDepthStencilState(const gl::State &glState);
gl::Error syncRasterizerState(const gl::RasterizerState &rasterState); gl::Error syncRasterizerState(const gl::Context *context, GLenum drawMode);
void syncScissorRectangle(const gl::Rectangle &scissor, bool enabled); void syncScissorRectangle(const gl::Rectangle &scissor, bool enabled);
void syncViewport(const gl::Caps *caps, const gl::Rectangle &viewport, float zNear, float zFar); void syncViewport(const gl::Caps *caps, const gl::Rectangle &viewport, float zNear, float zFar);
void syncPresentPath(bool presentPathFastActive, void checkPresentPath(const gl::Context *context);
const gl::FramebufferAttachment *framebufferAttachment);
gl::Error syncFramebuffer(const gl::Context *context, gl::Framebuffer *framebuffer); gl::Error syncFramebuffer(const gl::Context *context, gl::Framebuffer *framebuffer);
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
#include <EGL/eglext.h> #include <EGL/eglext.h>
#include "libANGLE/features.h" #include "libANGLE/features.h"
#include "libANGLE/renderer/d3d/d3d11/formatutils11.h"
#include "libANGLE/renderer/d3d/d3d11/NativeWindow11.h" #include "libANGLE/renderer/d3d/d3d11/NativeWindow11.h"
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h" #include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
#include "libANGLE/renderer/d3d/d3d11/formatutils11.h"
#include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h" #include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h"
#include "libANGLE/renderer/d3d/d3d11/texture_format_table.h" #include "libANGLE/renderer/d3d/d3d11/texture_format_table.h"
#include "third_party/trace_event/trace_event.h" #include "third_party/trace_event/trace_event.h"
...@@ -147,13 +147,13 @@ void SwapChain11::releaseOffscreenDepthBuffer() ...@@ -147,13 +147,13 @@ void SwapChain11::releaseOffscreenDepthBuffer()
mDepthStencilSRView.reset(); mDepthStencilSRView.reset();
} }
EGLint SwapChain11::resetOffscreenBuffers(const egl::Display *display, EGLint SwapChain11::resetOffscreenBuffers(const gl::Context *context,
int backbufferWidth, int backbufferWidth,
int backbufferHeight) int backbufferHeight)
{ {
if (mNeedsOffscreenTexture) if (mNeedsOffscreenTexture)
{ {
EGLint result = resetOffscreenColorBuffer(display, backbufferWidth, backbufferHeight); EGLint result = resetOffscreenColorBuffer(context, backbufferWidth, backbufferHeight);
if (result != EGL_SUCCESS) if (result != EGL_SUCCESS)
{ {
return result; return result;
...@@ -172,7 +172,7 @@ EGLint SwapChain11::resetOffscreenBuffers(const egl::Display *display, ...@@ -172,7 +172,7 @@ EGLint SwapChain11::resetOffscreenBuffers(const egl::Display *display,
return EGL_SUCCESS; return EGL_SUCCESS;
} }
EGLint SwapChain11::resetOffscreenColorBuffer(const egl::Display *display, EGLint SwapChain11::resetOffscreenColorBuffer(const gl::Context *context,
int backbufferWidth, int backbufferWidth,
int backbufferHeight) int backbufferHeight)
{ {
...@@ -325,7 +325,7 @@ EGLint SwapChain11::resetOffscreenColorBuffer(const egl::Display *display, ...@@ -325,7 +325,7 @@ EGLint SwapChain11::resetOffscreenColorBuffer(const egl::Display *display,
if (mSwapChain) if (mSwapChain)
{ {
swapRect(display, 0, 0, backbufferWidth, backbufferHeight); swapRect(context, 0, 0, backbufferWidth, backbufferHeight);
} }
} }
...@@ -414,7 +414,7 @@ EGLint SwapChain11::resetOffscreenDepthBuffer(int backbufferWidth, int backbuffe ...@@ -414,7 +414,7 @@ EGLint SwapChain11::resetOffscreenDepthBuffer(int backbufferWidth, int backbuffe
return EGL_SUCCESS; return EGL_SUCCESS;
} }
EGLint SwapChain11::resize(const egl::Display *display, EGLint SwapChain11::resize(const gl::Context *context,
EGLint backbufferWidth, EGLint backbufferWidth,
EGLint backbufferHeight) EGLint backbufferHeight)
{ {
...@@ -496,7 +496,7 @@ EGLint SwapChain11::resize(const egl::Display *display, ...@@ -496,7 +496,7 @@ EGLint SwapChain11::resize(const egl::Display *display,
mFirstSwap = true; mFirstSwap = true;
return resetOffscreenBuffers(display, backbufferWidth, backbufferHeight); return resetOffscreenBuffers(context, backbufferWidth, backbufferHeight);
} }
DXGI_FORMAT SwapChain11::getSwapChainNativeFormat() const DXGI_FORMAT SwapChain11::getSwapChainNativeFormat() const
...@@ -527,7 +527,7 @@ DXGI_FORMAT SwapChain11::getSwapChainNativeFormat() const ...@@ -527,7 +527,7 @@ DXGI_FORMAT SwapChain11::getSwapChainNativeFormat() const
} }
} }
EGLint SwapChain11::reset(const egl::Display *display, EGLint SwapChain11::reset(const gl::Context *context,
EGLint backbufferWidth, EGLint backbufferWidth,
EGLint backbufferHeight, EGLint backbufferHeight,
EGLint swapInterval) EGLint swapInterval)
...@@ -543,7 +543,7 @@ EGLint SwapChain11::reset(const egl::Display *display, ...@@ -543,7 +543,7 @@ EGLint SwapChain11::reset(const egl::Display *display,
// If the swap chain already exists, just resize // If the swap chain already exists, just resize
if (mSwapChain != nullptr) if (mSwapChain != nullptr)
{ {
return resize(display, backbufferWidth, backbufferHeight); return resize(context, backbufferWidth, backbufferHeight);
} }
TRACE_EVENT0("gpu.angle", "SwapChain11::reset"); TRACE_EVENT0("gpu.angle", "SwapChain11::reset");
...@@ -616,7 +616,7 @@ EGLint SwapChain11::reset(const egl::Display *display, ...@@ -616,7 +616,7 @@ EGLint SwapChain11::reset(const egl::Display *display,
mFirstSwap = true; mFirstSwap = true;
return resetOffscreenBuffers(display, backbufferWidth, backbufferHeight); return resetOffscreenBuffers(context, backbufferWidth, backbufferHeight);
} }
void SwapChain11::initPassThroughResources() void SwapChain11::initPassThroughResources()
...@@ -718,7 +718,7 @@ void SwapChain11::initPassThroughResources() ...@@ -718,7 +718,7 @@ void SwapChain11::initPassThroughResources()
} }
// parameters should be validated/clamped by caller // parameters should be validated/clamped by caller
EGLint SwapChain11::swapRect(const egl::Display *display, EGLint SwapChain11::swapRect(const gl::Context *context,
EGLint x, EGLint x,
EGLint y, EGLint y,
EGLint width, EGLint width,
...@@ -726,14 +726,14 @@ EGLint SwapChain11::swapRect(const egl::Display *display, ...@@ -726,14 +726,14 @@ EGLint SwapChain11::swapRect(const egl::Display *display,
{ {
if (mNeedsOffscreenTexture) if (mNeedsOffscreenTexture)
{ {
EGLint result = copyOffscreenToBackbuffer(display, x, y, width, height); EGLint result = copyOffscreenToBackbuffer(context, x, y, width, height);
if (result != EGL_SUCCESS) if (result != EGL_SUCCESS)
{ {
return result; return result;
} }
} }
EGLint result = present(display, x, y, width, height); EGLint result = present(context, x, y, width, height);
if (result != EGL_SUCCESS) if (result != EGL_SUCCESS)
{ {
return result; return result;
...@@ -744,7 +744,7 @@ EGLint SwapChain11::swapRect(const egl::Display *display, ...@@ -744,7 +744,7 @@ EGLint SwapChain11::swapRect(const egl::Display *display,
return EGL_SUCCESS; return EGL_SUCCESS;
} }
EGLint SwapChain11::copyOffscreenToBackbuffer(const egl::Display *display, EGLint SwapChain11::copyOffscreenToBackbuffer(const gl::Context *context,
EGLint x, EGLint x,
EGLint y, EGLint y,
EGLint width, EGLint width,
...@@ -818,8 +818,8 @@ EGLint SwapChain11::copyOffscreenToBackbuffer(const egl::Display *display, ...@@ -818,8 +818,8 @@ EGLint SwapChain11::copyOffscreenToBackbuffer(const egl::Display *display,
deviceContext->PSSetShader(mPassThroughPS.get(), nullptr, 0); deviceContext->PSSetShader(mPassThroughPS.get(), nullptr, 0);
deviceContext->GSSetShader(nullptr, nullptr, 0); deviceContext->GSSetShader(nullptr, nullptr, 0);
// Apply render targets // Apply render targets. Use the proxy context in display.
stateManager->setOneTimeRenderTarget(mBackBufferRTView.get(), nullptr); stateManager->setOneTimeRenderTarget(context, mBackBufferRTView.get(), nullptr);
// Set the viewport // Set the viewport
D3D11_VIEWPORT viewport; D3D11_VIEWPORT viewport;
...@@ -845,12 +845,12 @@ EGLint SwapChain11::copyOffscreenToBackbuffer(const egl::Display *display, ...@@ -845,12 +845,12 @@ EGLint SwapChain11::copyOffscreenToBackbuffer(const egl::Display *display,
// cleanup is caught under the current eglSwapBuffers() PIX/Graphics Diagnostics call rather than the next one. // cleanup is caught under the current eglSwapBuffers() PIX/Graphics Diagnostics call rather than the next one.
stateManager->setShaderResource(gl::SAMPLER_PIXEL, 0, nullptr); stateManager->setShaderResource(gl::SAMPLER_PIXEL, 0, nullptr);
mRenderer->markAllStateDirty(); mRenderer->markAllStateDirty(context);
return EGL_SUCCESS; return EGL_SUCCESS;
} }
EGLint SwapChain11::present(const egl::Display *display, EGLint SwapChain11::present(const gl::Context *context,
EGLint x, EGLint x,
EGLint y, EGLint y,
EGLint width, EGLint width,
...@@ -894,8 +894,8 @@ EGLint SwapChain11::present(const egl::Display *display, ...@@ -894,8 +894,8 @@ EGLint SwapChain11::present(const egl::Display *display,
mFirstSwap = false; mFirstSwap = false;
// Some swapping mechanisms such as DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL unbind the current render // Some swapping mechanisms such as DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL unbind the current render
// target. Mark it dirty. // target. Mark it dirty. Use the proxy context in display since there is none available.
mRenderer->getStateManager()->invalidateRenderTarget(); mRenderer->getStateManager()->invalidateRenderTarget(context);
if (result == DXGI_ERROR_DEVICE_REMOVED) if (result == DXGI_ERROR_DEVICE_REMOVED)
{ {
......
...@@ -31,14 +31,14 @@ class SwapChain11 final : public SwapChainD3D ...@@ -31,14 +31,14 @@ class SwapChain11 final : public SwapChainD3D
EGLint samples); EGLint samples);
virtual ~SwapChain11(); virtual ~SwapChain11();
EGLint resize(const egl::Display *display, EGLint resize(const gl::Context *context,
EGLint backbufferWidth, EGLint backbufferWidth,
EGLint backbufferHeight) override; EGLint backbufferHeight) override;
EGLint reset(const egl::Display *display, EGLint reset(const gl::Context *context,
EGLint backbufferWidth, EGLint backbufferWidth,
EGLint backbufferHeight, EGLint backbufferHeight,
EGLint swapInterval) override; EGLint swapInterval) override;
EGLint swapRect(const egl::Display *display, EGLint swapRect(const gl::Context *context,
EGLint x, EGLint x,
EGLint y, EGLint y,
EGLint width, EGLint width,
...@@ -69,22 +69,22 @@ class SwapChain11 final : public SwapChainD3D ...@@ -69,22 +69,22 @@ class SwapChain11 final : public SwapChainD3D
void releaseOffscreenColorBuffer(); void releaseOffscreenColorBuffer();
void releaseOffscreenDepthBuffer(); void releaseOffscreenDepthBuffer();
EGLint resetOffscreenBuffers(const egl::Display *display, EGLint resetOffscreenBuffers(const gl::Context *context,
int backbufferWidth, int backbufferWidth,
int backbufferHeight); int backbufferHeight);
EGLint resetOffscreenColorBuffer(const egl::Display *display, EGLint resetOffscreenColorBuffer(const gl::Context *context,
int backbufferWidth, int backbufferWidth,
int backbufferHeight); int backbufferHeight);
EGLint resetOffscreenDepthBuffer(int backbufferWidth, int backbufferHeight); EGLint resetOffscreenDepthBuffer(int backbufferWidth, int backbufferHeight);
DXGI_FORMAT getSwapChainNativeFormat() const; DXGI_FORMAT getSwapChainNativeFormat() const;
EGLint copyOffscreenToBackbuffer(const egl::Display *display, EGLint copyOffscreenToBackbuffer(const gl::Context *context,
EGLint x, EGLint x,
EGLint y, EGLint y,
EGLint width, EGLint width,
EGLint height); EGLint height);
EGLint present(const egl::Display *display, EGLint x, EGLint y, EGLint width, EGLint height); EGLint present(const gl::Context *context, EGLint x, EGLint y, EGLint width, EGLint height);
UINT getD3DSamples() const; UINT getD3DSamples() const;
Renderer11 *mRenderer; Renderer11 *mRenderer;
......
...@@ -784,7 +784,7 @@ gl::Error TextureStorage11_2D::onDestroy(const gl::Context *context) ...@@ -784,7 +784,7 @@ gl::Error TextureStorage11_2D::onDestroy(const gl::Context *context)
{ {
// If the keyed mutex is released that will unbind it and cause the state cache to become // If the keyed mutex is released that will unbind it and cause the state cache to become
// desynchronized. // desynchronized.
mRenderer->getStateManager()->invalidateBoundViews(); mRenderer->getStateManager()->invalidateBoundViews(context);
} }
delete this; delete this;
...@@ -1269,7 +1269,7 @@ gl::Error TextureStorage11_External::onDestroy(const gl::Context *context) ...@@ -1269,7 +1269,7 @@ gl::Error TextureStorage11_External::onDestroy(const gl::Context *context)
{ {
// If the keyed mutex is released that will unbind it and cause the state cache to become // If the keyed mutex is released that will unbind it and cause the state cache to become
// desynchronized. // desynchronized.
mRenderer->getStateManager()->invalidateBoundViews(); mRenderer->getStateManager()->invalidateBoundViews(context);
} }
delete this; delete this;
......
...@@ -79,13 +79,13 @@ static DWORD convertInterval(EGLint interval) ...@@ -79,13 +79,13 @@ static DWORD convertInterval(EGLint interval)
#endif #endif
} }
EGLint SwapChain9::resize(const egl::Display *display, int backbufferWidth, int backbufferHeight) EGLint SwapChain9::resize(const gl::Context *context, int backbufferWidth, int backbufferHeight)
{ {
// D3D9 does not support resizing swap chains without recreating them // D3D9 does not support resizing swap chains without recreating them
return reset(display, backbufferWidth, backbufferHeight, mSwapInterval); return reset(context, backbufferWidth, backbufferHeight, mSwapInterval);
} }
EGLint SwapChain9::reset(const egl::Display *display, EGLint SwapChain9::reset(const gl::Context *context,
int backbufferWidth, int backbufferWidth,
int backbufferHeight, int backbufferHeight,
EGLint swapInterval) EGLint swapInterval)
...@@ -268,7 +268,7 @@ EGLint SwapChain9::reset(const egl::Display *display, ...@@ -268,7 +268,7 @@ EGLint SwapChain9::reset(const egl::Display *display,
} }
// parameters should be validated/clamped by caller // parameters should be validated/clamped by caller
EGLint SwapChain9::swapRect(const egl::Display *display, EGLint SwapChain9::swapRect(const gl::Context *context,
EGLint x, EGLint x,
EGLint y, EGLint y,
EGLint width, EGLint width,
......
...@@ -30,12 +30,12 @@ class SwapChain9 : public SwapChainD3D ...@@ -30,12 +30,12 @@ class SwapChain9 : public SwapChainD3D
EGLint orientation); EGLint orientation);
virtual ~SwapChain9(); virtual ~SwapChain9();
EGLint resize(const egl::Display *display, EGLint backbufferWidth, EGLint backbufferHeight); EGLint resize(const gl::Context *context, EGLint backbufferWidth, EGLint backbufferHeight);
virtual EGLint reset(const egl::Display *display, virtual EGLint reset(const gl::Context *context,
EGLint backbufferWidth, EGLint backbufferWidth,
EGLint backbufferHeight, EGLint backbufferHeight,
EGLint swapInterval); EGLint swapInterval);
virtual EGLint swapRect(const egl::Display *display, virtual EGLint swapRect(const gl::Context *context,
EGLint x, EGLint x,
EGLint y, EGLint y,
EGLint width, EGLint width,
......
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