Commit 13455079 by Geoff Lang Committed by Commit Bot

Pass a context pointer to Framebuffer[Impl]::getSamplePosition

BUG=angleproject:2464 Change-Id: Icd260db9bbd11699b2d0f6152e898c38baa4844d Reviewed-on: https://chromium-review.googlesource.com/1052219Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 7348fc5b
......@@ -4804,7 +4804,7 @@ void Context::getMultisamplefv(GLenum pname, GLuint index, GLfloat *val)
switch (pname)
{
case GL_SAMPLE_POSITION:
handleError(framebuffer->getSamplePosition(index, val));
handleError(framebuffer->getSamplePosition(this, index, val));
break;
default:
UNREACHABLE();
......
......@@ -1458,9 +1458,9 @@ int Framebuffer::getCachedSamples(const Context *context)
return 0;
}
Error Framebuffer::getSamplePosition(size_t index, GLfloat *xy) const
Error Framebuffer::getSamplePosition(const Context *context, size_t index, GLfloat *xy) const
{
ANGLE_TRY(mImpl->getSamplePosition(index, xy));
ANGLE_TRY(mImpl->getSamplePosition(context, index, xy));
return NoError();
}
......
......@@ -216,7 +216,7 @@ class Framebuffer final : public angle::ObserverInterface, public LabeledObject
// This method calls checkStatus.
int getSamples(const Context *context);
Error getSamplePosition(size_t index, GLfloat *xy) const;
Error getSamplePosition(const Context *context, size_t index, GLfloat *xy) const;
GLint getDefaultWidth() const;
GLint getDefaultHeight() const;
......
......@@ -83,7 +83,9 @@ class FramebufferImpl : angle::NonCopyable
virtual gl::Error syncState(const gl::Context *context,
const gl::Framebuffer::DirtyBits &dirtyBits) = 0;
virtual gl::Error getSamplePosition(size_t index, GLfloat *xy) const = 0;
virtual gl::Error getSamplePosition(const gl::Context *context,
size_t index,
GLfloat *xy) const = 0;
const gl::FramebufferState &getState() const { return mState; }
......
......@@ -39,7 +39,7 @@ class MockFramebufferImpl : public rx::FramebufferImpl
MOCK_METHOD5(readPixels,
gl::Error(const gl::Context *, const gl::Rectangle &, GLenum, GLenum, void *));
MOCK_CONST_METHOD2(getSamplePosition, gl::Error(size_t, GLfloat *));
MOCK_CONST_METHOD3(getSamplePosition, gl::Error(const gl::Context *, size_t, GLfloat *));
MOCK_METHOD5(blit,
gl::Error(const gl::Context *,
......
......@@ -375,7 +375,9 @@ gl::Error Framebuffer11::syncState(const gl::Context *context,
return gl::NoError();
}
gl::Error Framebuffer11::getSamplePosition(size_t index, GLfloat *xy) const
gl::Error Framebuffer11::getSamplePosition(const gl::Context *context,
size_t index,
GLfloat *xy) const
{
const gl::FramebufferAttachment *attachment = mState.getFirstNonNullAttachment();
ASSERT(attachment);
......
......@@ -50,7 +50,9 @@ class Framebuffer11 : public FramebufferD3D
RenderTarget11 *getFirstRenderTarget() const;
gl::Error getSamplePosition(size_t index, GLfloat *xy) const override;
gl::Error getSamplePosition(const gl::Context *context,
size_t index,
GLfloat *xy) const override;
private:
gl::Error clearImpl(const gl::Context *context, const ClearParameters &clearParams) override;
......
......@@ -402,7 +402,9 @@ GLenum Framebuffer9::getRenderTargetImplementationFormat(RenderTargetD3D *render
return d3dFormatInfo.info().glInternalFormat;
}
gl::Error Framebuffer9::getSamplePosition(size_t index, GLfloat *xy) const
gl::Error Framebuffer9::getSamplePosition(const gl::Context *context,
size_t index,
GLfloat *xy) const
{
UNREACHABLE();
return gl::InternalError() << "getSamplePosition is unsupported to d3d9.";
......
......@@ -32,7 +32,9 @@ class Framebuffer9 : public FramebufferD3D
const GLenum *attachments,
const gl::Rectangle &area) override;
gl::Error getSamplePosition(size_t index, GLfloat *xy) const override;
gl::Error getSamplePosition(const gl::Context *context,
size_t index,
GLfloat *xy) const override;
gl::Error syncState(const gl::Context *context,
const gl::Framebuffer::DirtyBits &dirtyBits) override;
......
......@@ -588,7 +588,9 @@ Error FramebufferGL::blit(const gl::Context *context,
return gl::NoError();
}
gl::Error FramebufferGL::getSamplePosition(size_t index, GLfloat *xy) const
gl::Error FramebufferGL::getSamplePosition(const gl::Context *context,
size_t index,
GLfloat *xy) const
{
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
mFunctions->getMultisamplefv(GL_SAMPLE_POSITION, static_cast<GLuint>(index), xy);
......
......@@ -85,7 +85,9 @@ class FramebufferGL : public FramebufferImpl
GLbitfield mask,
GLenum filter) override;
gl::Error getSamplePosition(size_t index, GLfloat *xy) const override;
gl::Error getSamplePosition(const gl::Context *context,
size_t index,
GLfloat *xy) const override;
bool checkStatus(const gl::Context *context) const override;
......
......@@ -191,7 +191,9 @@ gl::Error FramebufferNULL::syncState(const gl::Context *context,
return gl::NoError();
}
gl::Error FramebufferNULL::getSamplePosition(size_t index, GLfloat *xy) const
gl::Error FramebufferNULL::getSamplePosition(const gl::Context *context,
size_t index,
GLfloat *xy) const
{
return gl::NoError();
}
......
......@@ -68,7 +68,9 @@ class FramebufferNULL : public FramebufferImpl
gl::Error syncState(const gl::Context *context,
const gl::Framebuffer::DirtyBits &dirtyBits) override;
gl::Error getSamplePosition(size_t index, GLfloat *xy) const override;
gl::Error getSamplePosition(const gl::Context *context,
size_t index,
GLfloat *xy) const override;
};
} // namespace rx
......
......@@ -715,7 +715,9 @@ gl::Error FramebufferVk::clearWithDraw(ContextVk *contextVk, VkColorComponentFla
return gl::NoError();
}
gl::Error FramebufferVk::getSamplePosition(size_t index, GLfloat *xy) const
gl::Error FramebufferVk::getSamplePosition(const gl::Context *context,
size_t index,
GLfloat *xy) const
{
UNIMPLEMENTED();
return gl::InternalError() << "getSamplePosition is unimplemented.";
......
......@@ -84,7 +84,9 @@ class FramebufferVk : public FramebufferImpl, public vk::CommandGraphResource
gl::Error syncState(const gl::Context *context,
const gl::Framebuffer::DirtyBits &dirtyBits) override;
gl::Error getSamplePosition(size_t index, GLfloat *xy) const override;
gl::Error getSamplePosition(const gl::Context *context,
size_t index,
GLfloat *xy) const override;
const vk::RenderPassDesc &getRenderPassDesc();
gl::Error getCommandGraphNodeForDraw(ContextVk *contextVk, vk::CommandGraphNode **nodeOut);
......
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