зеркало из https://github.com/AvaloniaUI/angle.git
Use angle::Result and pass a context pointer to TransformFeedbackImpl
BUG=angleproject:3020 Change-Id: Ib0877dd33f9a8c6ea57976642f1b904258cb6a86 Reviewed-on: https://chromium-review.googlesource.com/c/1374273 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
This commit is contained in:
Родитель
9b02506c85
Коммит
91002266bd
|
@ -2785,7 +2785,7 @@ void Context::detachBuffer(Buffer *buffer)
|
|||
// Attachments to unbound container objects, such as
|
||||
// deletion of a buffer attached to a vertex array object which is not bound to the context,
|
||||
// are not affected and continue to act as references on the deleted object
|
||||
mGLState.detachBuffer(this, buffer);
|
||||
ANGLE_CONTEXT_TRY(mGLState.detachBuffer(this, buffer));
|
||||
}
|
||||
|
||||
void Context::detachFramebuffer(GLuint framebuffer)
|
||||
|
@ -3165,7 +3165,7 @@ void Context::beginTransformFeedback(PrimitiveMode primitiveMode)
|
|||
ASSERT(transformFeedback != nullptr);
|
||||
ASSERT(!transformFeedback->isPaused());
|
||||
|
||||
transformFeedback->begin(this, primitiveMode, mGLState.getProgram());
|
||||
ANGLE_CONTEXT_TRY(transformFeedback->begin(this, primitiveMode, mGLState.getProgram()));
|
||||
mStateCache.onActiveTransformFeedbackChange(this);
|
||||
}
|
||||
|
||||
|
@ -5186,7 +5186,7 @@ void Context::bindBufferRange(BufferBinding target,
|
|||
GLsizeiptr size)
|
||||
{
|
||||
Buffer *object = mState.mBuffers->checkBufferAllocation(mImplementation.get(), buffer);
|
||||
mGLState.setIndexedBufferBinding(this, target, index, object, offset, size);
|
||||
ANGLE_CONTEXT_TRY(mGLState.setIndexedBufferBinding(this, target, index, object, offset, size));
|
||||
if (target == BufferBinding::Uniform)
|
||||
{
|
||||
mUniformBufferObserverBindings[index].bind(object);
|
||||
|
@ -6438,7 +6438,7 @@ bool Context::isVertexArray(GLuint array)
|
|||
void Context::endTransformFeedback()
|
||||
{
|
||||
TransformFeedback *transformFeedback = mGLState.getCurrentTransformFeedback();
|
||||
transformFeedback->end(this);
|
||||
ANGLE_CONTEXT_TRY(transformFeedback->end(this));
|
||||
mStateCache.onActiveTransformFeedbackChange(this);
|
||||
}
|
||||
|
||||
|
@ -6515,14 +6515,14 @@ bool Context::isTransformFeedback(GLuint id)
|
|||
void Context::pauseTransformFeedback()
|
||||
{
|
||||
TransformFeedback *transformFeedback = mGLState.getCurrentTransformFeedback();
|
||||
transformFeedback->pause();
|
||||
ANGLE_CONTEXT_TRY(transformFeedback->pause(this));
|
||||
mStateCache.onActiveTransformFeedbackChange(this);
|
||||
}
|
||||
|
||||
void Context::resumeTransformFeedback()
|
||||
{
|
||||
TransformFeedback *transformFeedback = mGLState.getCurrentTransformFeedback();
|
||||
transformFeedback->resume();
|
||||
ANGLE_CONTEXT_TRY(transformFeedback->resume(this));
|
||||
mStateCache.onActiveTransformFeedbackChange(this);
|
||||
}
|
||||
|
||||
|
|
|
@ -1429,19 +1429,19 @@ Query *State::getActiveQuery(QueryType type) const
|
|||
return mActiveQueries[type].get();
|
||||
}
|
||||
|
||||
void State::setIndexedBufferBinding(const Context *context,
|
||||
BufferBinding target,
|
||||
GLuint index,
|
||||
Buffer *buffer,
|
||||
GLintptr offset,
|
||||
GLsizeiptr size)
|
||||
angle::Result State::setIndexedBufferBinding(const Context *context,
|
||||
BufferBinding target,
|
||||
GLuint index,
|
||||
Buffer *buffer,
|
||||
GLintptr offset,
|
||||
GLsizeiptr size)
|
||||
{
|
||||
setBufferBinding(context, target, buffer);
|
||||
|
||||
switch (target)
|
||||
{
|
||||
case BufferBinding::TransformFeedback:
|
||||
mTransformFeedback->bindIndexedBuffer(context, index, buffer, offset, size);
|
||||
ANGLE_TRY(mTransformFeedback->bindIndexedBuffer(context, index, buffer, offset, size));
|
||||
setBufferBinding(context, target, buffer);
|
||||
break;
|
||||
case BufferBinding::Uniform:
|
||||
|
@ -1460,6 +1460,8 @@ void State::setIndexedBufferBinding(const Context *context,
|
|||
UNREACHABLE();
|
||||
break;
|
||||
}
|
||||
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
const OffsetBindingPointer<Buffer> &State::getIndexedUniformBuffer(size_t index) const
|
||||
|
@ -1491,11 +1493,11 @@ Buffer *State::getTargetBuffer(BufferBinding target) const
|
|||
}
|
||||
}
|
||||
|
||||
void State::detachBuffer(const Context *context, const Buffer *buffer)
|
||||
angle::Result State::detachBuffer(const Context *context, const Buffer *buffer)
|
||||
{
|
||||
if (!buffer->isBound())
|
||||
{
|
||||
return;
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
GLuint bufferName = buffer->id();
|
||||
for (auto target : angle::AllEnums<BufferBinding>())
|
||||
|
@ -1509,7 +1511,7 @@ void State::detachBuffer(const Context *context, const Buffer *buffer)
|
|||
TransformFeedback *curTransformFeedback = getCurrentTransformFeedback();
|
||||
if (curTransformFeedback)
|
||||
{
|
||||
curTransformFeedback->detachBuffer(context, bufferName);
|
||||
ANGLE_TRY(curTransformFeedback->detachBuffer(context, bufferName));
|
||||
}
|
||||
|
||||
getVertexArray()->detachBuffer(context, bufferName);
|
||||
|
@ -1537,6 +1539,8 @@ void State::detachBuffer(const Context *context, const Buffer *buffer)
|
|||
UpdateIndexedBufferBinding(context, &buf, nullptr, BufferBinding::ShaderStorage, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void State::setEnableVertexAttribArray(unsigned int attribNum, bool enabled)
|
||||
|
|
|
@ -283,19 +283,19 @@ class State : angle::NonCopyable
|
|||
}
|
||||
|
||||
Buffer *getTargetBuffer(BufferBinding target) const;
|
||||
void setIndexedBufferBinding(const Context *context,
|
||||
BufferBinding target,
|
||||
GLuint index,
|
||||
Buffer *buffer,
|
||||
GLintptr offset,
|
||||
GLsizeiptr size);
|
||||
angle::Result setIndexedBufferBinding(const Context *context,
|
||||
BufferBinding target,
|
||||
GLuint index,
|
||||
Buffer *buffer,
|
||||
GLintptr offset,
|
||||
GLsizeiptr size);
|
||||
|
||||
const OffsetBindingPointer<Buffer> &getIndexedUniformBuffer(size_t index) const;
|
||||
const OffsetBindingPointer<Buffer> &getIndexedAtomicCounterBuffer(size_t index) const;
|
||||
const OffsetBindingPointer<Buffer> &getIndexedShaderStorageBuffer(size_t index) const;
|
||||
|
||||
// Detach a buffer from all bindings
|
||||
void detachBuffer(const Context *context, const Buffer *buffer);
|
||||
angle::Result detachBuffer(const Context *context, const Buffer *buffer);
|
||||
|
||||
// Vertex attrib manipulation
|
||||
void setEnableVertexAttribArray(unsigned int attribNum, bool enabled);
|
||||
|
|
|
@ -108,13 +108,15 @@ const std::string &TransformFeedback::getLabel() const
|
|||
return mState.mLabel;
|
||||
}
|
||||
|
||||
void TransformFeedback::begin(const Context *context, PrimitiveMode primitiveMode, Program *program)
|
||||
angle::Result TransformFeedback::begin(const Context *context,
|
||||
PrimitiveMode primitiveMode,
|
||||
Program *program)
|
||||
{
|
||||
ANGLE_TRY(mImplementation->begin(context, primitiveMode));
|
||||
mState.mActive = true;
|
||||
mState.mPrimitiveMode = primitiveMode;
|
||||
mState.mPaused = false;
|
||||
mState.mVerticesDrawn = 0;
|
||||
mImplementation->begin(primitiveMode);
|
||||
bindProgram(context, program);
|
||||
|
||||
if (program)
|
||||
|
@ -135,33 +137,37 @@ void TransformFeedback::begin(const Context *context, PrimitiveMode primitiveMod
|
|||
{
|
||||
mState.mVertexCapacity = 0;
|
||||
}
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedback::end(const Context *context)
|
||||
angle::Result TransformFeedback::end(const Context *context)
|
||||
{
|
||||
ANGLE_TRY(mImplementation->end(context));
|
||||
mState.mActive = false;
|
||||
mState.mPrimitiveMode = PrimitiveMode::InvalidEnum;
|
||||
mState.mPaused = false;
|
||||
mState.mVerticesDrawn = 0;
|
||||
mState.mVertexCapacity = 0;
|
||||
mImplementation->end();
|
||||
if (mState.mProgram)
|
||||
{
|
||||
mState.mProgram->release(context);
|
||||
mState.mProgram = nullptr;
|
||||
}
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedback::pause()
|
||||
angle::Result TransformFeedback::pause(const Context *context)
|
||||
{
|
||||
ANGLE_TRY(mImplementation->pause(context));
|
||||
mState.mPaused = true;
|
||||
mImplementation->pause();
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedback::resume()
|
||||
angle::Result TransformFeedback::resume(const Context *context)
|
||||
{
|
||||
ANGLE_TRY(mImplementation->resume(context));
|
||||
mState.mPaused = false;
|
||||
mImplementation->resume();
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
bool TransformFeedback::isPaused() const
|
||||
|
@ -219,7 +225,7 @@ bool TransformFeedback::hasBoundProgram(GLuint program) const
|
|||
return mState.mProgram != nullptr && mState.mProgram->id() == program;
|
||||
}
|
||||
|
||||
void TransformFeedback::detachBuffer(const Context *context, GLuint bufferName)
|
||||
angle::Result TransformFeedback::detachBuffer(const Context *context, GLuint bufferName)
|
||||
{
|
||||
bool isBound = context->isCurrentTransformFeedback(this);
|
||||
for (size_t index = 0; index < mState.mIndexedBuffers.size(); index++)
|
||||
|
@ -231,16 +237,19 @@ void TransformFeedback::detachBuffer(const Context *context, GLuint bufferName)
|
|||
mState.mIndexedBuffers[index]->onTFBindingChanged(context, false, true);
|
||||
}
|
||||
mState.mIndexedBuffers[index].set(context, nullptr, 0, 0);
|
||||
mImplementation->bindIndexedBuffer(index, mState.mIndexedBuffers[index]);
|
||||
ANGLE_TRY(
|
||||
mImplementation->bindIndexedBuffer(context, index, mState.mIndexedBuffers[index]));
|
||||
}
|
||||
}
|
||||
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedback::bindIndexedBuffer(const Context *context,
|
||||
size_t index,
|
||||
Buffer *buffer,
|
||||
size_t offset,
|
||||
size_t size)
|
||||
angle::Result TransformFeedback::bindIndexedBuffer(const Context *context,
|
||||
size_t index,
|
||||
Buffer *buffer,
|
||||
size_t offset,
|
||||
size_t size)
|
||||
{
|
||||
ASSERT(index < mState.mIndexedBuffers.size());
|
||||
bool isBound = context && context->isCurrentTransformFeedback(this);
|
||||
|
@ -254,7 +263,7 @@ void TransformFeedback::bindIndexedBuffer(const Context *context,
|
|||
buffer->onTFBindingChanged(context, true, true);
|
||||
}
|
||||
|
||||
mImplementation->bindIndexedBuffer(index, mState.mIndexedBuffers[index]);
|
||||
return mImplementation->bindIndexedBuffer(context, index, mState.mIndexedBuffers[index]);
|
||||
}
|
||||
|
||||
const OffsetBindingPointer<Buffer> &TransformFeedback::getIndexedBuffer(size_t index) const
|
||||
|
|
|
@ -63,10 +63,10 @@ class TransformFeedback final : public RefCountObject, public LabeledObject
|
|||
void setLabel(const Context *context, const std::string &label) override;
|
||||
const std::string &getLabel() const override;
|
||||
|
||||
void begin(const Context *context, PrimitiveMode primitiveMode, Program *program);
|
||||
void end(const Context *context);
|
||||
void pause();
|
||||
void resume();
|
||||
angle::Result begin(const Context *context, PrimitiveMode primitiveMode, Program *program);
|
||||
angle::Result end(const Context *context);
|
||||
angle::Result pause(const Context *context);
|
||||
angle::Result resume(const Context *context);
|
||||
|
||||
bool isActive() const { return mState.mActive; }
|
||||
|
||||
|
@ -83,18 +83,18 @@ class TransformFeedback final : public RefCountObject, public LabeledObject
|
|||
|
||||
bool hasBoundProgram(GLuint program) const;
|
||||
|
||||
void bindIndexedBuffer(const Context *context,
|
||||
size_t index,
|
||||
Buffer *buffer,
|
||||
size_t offset,
|
||||
size_t size);
|
||||
angle::Result bindIndexedBuffer(const Context *context,
|
||||
size_t index,
|
||||
Buffer *buffer,
|
||||
size_t offset,
|
||||
size_t size);
|
||||
const OffsetBindingPointer<Buffer> &getIndexedBuffer(size_t index) const;
|
||||
size_t getIndexedBufferCount() const;
|
||||
|
||||
// Returns true if any buffer bound to this object is also bound to another target.
|
||||
bool buffersBoundForOtherUse() const;
|
||||
|
||||
void detachBuffer(const Context *context, GLuint bufferName);
|
||||
angle::Result detachBuffer(const Context *context, GLuint bufferName);
|
||||
|
||||
rx::TransformFeedbackImpl *getImplementation();
|
||||
const rx::TransformFeedbackImpl *getImplementation() const;
|
||||
|
|
|
@ -72,12 +72,13 @@ TEST_F(TransformFeedbackTest, SideEffectsOfStartAndStop)
|
|||
testing::InSequence seq;
|
||||
|
||||
EXPECT_FALSE(mFeedback->isActive());
|
||||
EXPECT_CALL(*mImpl, begin(gl::PrimitiveMode::Triangles));
|
||||
mFeedback->begin(nullptr, gl::PrimitiveMode::Triangles, nullptr);
|
||||
EXPECT_CALL(*mImpl, begin(nullptr, gl::PrimitiveMode::Triangles));
|
||||
EXPECT_EQ(angle::Result::Continue,
|
||||
mFeedback->begin(nullptr, gl::PrimitiveMode::Triangles, nullptr));
|
||||
EXPECT_TRUE(mFeedback->isActive());
|
||||
EXPECT_EQ(gl::PrimitiveMode::Triangles, mFeedback->getPrimitiveMode());
|
||||
EXPECT_CALL(*mImpl, end());
|
||||
mFeedback->end(nullptr);
|
||||
EXPECT_CALL(*mImpl, end(nullptr));
|
||||
EXPECT_EQ(angle::Result::Continue, mFeedback->end(nullptr));
|
||||
EXPECT_FALSE(mFeedback->isActive());
|
||||
}
|
||||
|
||||
|
@ -86,17 +87,18 @@ TEST_F(TransformFeedbackTest, SideEffectsOfPauseAndResume)
|
|||
testing::InSequence seq;
|
||||
|
||||
EXPECT_FALSE(mFeedback->isActive());
|
||||
EXPECT_CALL(*mImpl, begin(gl::PrimitiveMode::Triangles));
|
||||
mFeedback->begin(nullptr, gl::PrimitiveMode::Triangles, nullptr);
|
||||
EXPECT_CALL(*mImpl, begin(nullptr, gl::PrimitiveMode::Triangles));
|
||||
EXPECT_EQ(angle::Result::Continue,
|
||||
mFeedback->begin(nullptr, gl::PrimitiveMode::Triangles, nullptr));
|
||||
EXPECT_FALSE(mFeedback->isPaused());
|
||||
EXPECT_CALL(*mImpl, pause());
|
||||
mFeedback->pause();
|
||||
EXPECT_CALL(*mImpl, pause(nullptr));
|
||||
EXPECT_EQ(angle::Result::Continue, mFeedback->pause(nullptr));
|
||||
EXPECT_TRUE(mFeedback->isPaused());
|
||||
EXPECT_CALL(*mImpl, resume());
|
||||
mFeedback->resume();
|
||||
EXPECT_CALL(*mImpl, resume(nullptr));
|
||||
EXPECT_EQ(angle::Result::Continue, mFeedback->resume(nullptr));
|
||||
EXPECT_FALSE(mFeedback->isPaused());
|
||||
EXPECT_CALL(*mImpl, end());
|
||||
mFeedback->end(nullptr);
|
||||
EXPECT_CALL(*mImpl, end(nullptr));
|
||||
EXPECT_EQ(angle::Result::Continue, mFeedback->end(nullptr));
|
||||
}
|
||||
|
||||
TEST_F(TransformFeedbackTest, BufferBinding)
|
||||
|
@ -116,8 +118,9 @@ TEST_F(TransformFeedbackTest, BufferBinding)
|
|||
|
||||
EXPECT_EQ(mFeedback->getIndexedBufferCount(), mCaps.maxTransformFeedbackSeparateAttributes);
|
||||
|
||||
EXPECT_CALL(*mImpl, bindIndexedBuffer(_, _));
|
||||
mFeedback->bindIndexedBuffer(nullptr, bindIndex, buffer, 0, 1);
|
||||
EXPECT_CALL(*mImpl, bindIndexedBuffer(_, _, _));
|
||||
EXPECT_EQ(angle::Result::Continue,
|
||||
mFeedback->bindIndexedBuffer(nullptr, bindIndex, buffer, 0, 1));
|
||||
for (size_t i = 0; i < mFeedback->getIndexedBufferCount(); i++)
|
||||
{
|
||||
if (i == bindIndex)
|
||||
|
|
|
@ -21,14 +21,17 @@ class TransformFeedbackImpl : angle::NonCopyable
|
|||
TransformFeedbackImpl(const gl::TransformFeedbackState &state) : mState(state) {}
|
||||
virtual ~TransformFeedbackImpl() {}
|
||||
|
||||
virtual void begin(gl::PrimitiveMode primitiveMode) = 0;
|
||||
virtual void end() = 0;
|
||||
virtual void pause() = 0;
|
||||
virtual void resume() = 0;
|
||||
virtual angle::Result begin(const gl::Context *context, gl::PrimitiveMode primitiveMode) = 0;
|
||||
virtual angle::Result end(const gl::Context *context) = 0;
|
||||
virtual angle::Result pause(const gl::Context *context) = 0;
|
||||
virtual angle::Result resume(const gl::Context *context) = 0;
|
||||
|
||||
virtual void bindGenericBuffer(const gl::BindingPointer<gl::Buffer> &binding) = 0;
|
||||
virtual void bindIndexedBuffer(size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding) = 0;
|
||||
virtual angle::Result bindGenericBuffer(const gl::Context *context,
|
||||
const gl::BindingPointer<gl::Buffer> &binding) = 0;
|
||||
virtual angle::Result bindIndexedBuffer(
|
||||
const gl::Context *context,
|
||||
size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding) = 0;
|
||||
|
||||
protected:
|
||||
const gl::TransformFeedbackState &mState;
|
||||
|
|
|
@ -24,13 +24,17 @@ class MockTransformFeedbackImpl : public TransformFeedbackImpl
|
|||
{}
|
||||
~MockTransformFeedbackImpl() { destructor(); }
|
||||
|
||||
MOCK_METHOD1(begin, void(gl::PrimitiveMode));
|
||||
MOCK_METHOD0(end, void());
|
||||
MOCK_METHOD0(pause, void());
|
||||
MOCK_METHOD0(resume, void());
|
||||
MOCK_METHOD2(begin, angle::Result(const gl::Context *, gl::PrimitiveMode));
|
||||
MOCK_METHOD1(end, angle::Result(const gl::Context *));
|
||||
MOCK_METHOD1(pause, angle::Result(const gl::Context *));
|
||||
MOCK_METHOD1(resume, angle::Result(const gl::Context *));
|
||||
|
||||
MOCK_METHOD1(bindGenericBuffer, void(const gl::BindingPointer<gl::Buffer> &));
|
||||
MOCK_METHOD2(bindIndexedBuffer, void(size_t, const gl::OffsetBindingPointer<gl::Buffer> &));
|
||||
MOCK_METHOD2(bindGenericBuffer,
|
||||
angle::Result(const gl::Context *, const gl::BindingPointer<gl::Buffer> &));
|
||||
MOCK_METHOD3(bindIndexedBuffer,
|
||||
angle::Result(const gl::Context *,
|
||||
size_t,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &));
|
||||
|
||||
MOCK_METHOD0(destructor, void());
|
||||
};
|
||||
|
|
|
@ -27,7 +27,8 @@ TransformFeedback11::TransformFeedback11(const gl::TransformFeedbackState &state
|
|||
|
||||
TransformFeedback11::~TransformFeedback11() {}
|
||||
|
||||
void TransformFeedback11::begin(gl::PrimitiveMode primitiveMode)
|
||||
angle::Result TransformFeedback11::begin(const gl::Context *context,
|
||||
gl::PrimitiveMode primitiveMode)
|
||||
{
|
||||
// Reset all the cached offsets to the binding offsets
|
||||
mIsDirty = true;
|
||||
|
@ -44,38 +45,47 @@ void TransformFeedback11::begin(gl::PrimitiveMode primitiveMode)
|
|||
}
|
||||
}
|
||||
mRenderer->getStateManager()->invalidateTransformFeedback();
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedback11::end()
|
||||
angle::Result TransformFeedback11::end(const gl::Context *context)
|
||||
{
|
||||
mRenderer->getStateManager()->invalidateTransformFeedback();
|
||||
if (mRenderer->getWorkarounds().flushAfterEndingTransformFeedback)
|
||||
{
|
||||
mRenderer->getDeviceContext()->Flush();
|
||||
}
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedback11::pause()
|
||||
angle::Result TransformFeedback11::pause(const gl::Context *context)
|
||||
{
|
||||
mRenderer->getStateManager()->invalidateTransformFeedback();
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedback11::resume()
|
||||
angle::Result TransformFeedback11::resume(const gl::Context *context)
|
||||
{
|
||||
mRenderer->getStateManager()->invalidateTransformFeedback();
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedback11::bindGenericBuffer(const gl::BindingPointer<gl::Buffer> &binding)
|
||||
angle::Result TransformFeedback11::bindGenericBuffer(const gl::Context *context,
|
||||
const gl::BindingPointer<gl::Buffer> &binding)
|
||||
{
|
||||
mRenderer->getStateManager()->invalidateTransformFeedback();
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedback11::bindIndexedBuffer(size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding)
|
||||
angle::Result TransformFeedback11::bindIndexedBuffer(
|
||||
const gl::Context *context,
|
||||
size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding)
|
||||
{
|
||||
mIsDirty = true;
|
||||
mBufferOffsets[index] = static_cast<UINT>(binding.getOffset());
|
||||
mRenderer->getStateManager()->invalidateTransformFeedback();
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedback11::onApply()
|
||||
|
|
|
@ -27,14 +27,16 @@ class TransformFeedback11 : public TransformFeedbackImpl
|
|||
TransformFeedback11(const gl::TransformFeedbackState &state, Renderer11 *renderer);
|
||||
~TransformFeedback11() override;
|
||||
|
||||
void begin(gl::PrimitiveMode primitiveMode) override;
|
||||
void end() override;
|
||||
void pause() override;
|
||||
void resume() override;
|
||||
angle::Result begin(const gl::Context *context, gl::PrimitiveMode primitiveMode) override;
|
||||
angle::Result end(const gl::Context *context) override;
|
||||
angle::Result pause(const gl::Context *context) override;
|
||||
angle::Result resume(const gl::Context *context) override;
|
||||
|
||||
void bindGenericBuffer(const gl::BindingPointer<gl::Buffer> &binding) override;
|
||||
void bindIndexedBuffer(size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding) override;
|
||||
angle::Result bindGenericBuffer(const gl::Context *context,
|
||||
const gl::BindingPointer<gl::Buffer> &binding) override;
|
||||
angle::Result bindIndexedBuffer(const gl::Context *context,
|
||||
size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding) override;
|
||||
|
||||
void onApply();
|
||||
|
||||
|
|
|
@ -36,35 +36,46 @@ TransformFeedbackGL::~TransformFeedbackGL()
|
|||
mTransformFeedbackID = 0;
|
||||
}
|
||||
|
||||
void TransformFeedbackGL::begin(gl::PrimitiveMode primitiveMode)
|
||||
angle::Result TransformFeedbackGL::begin(const gl::Context *context,
|
||||
gl::PrimitiveMode primitiveMode)
|
||||
{
|
||||
mStateManager->onTransformFeedbackStateChange();
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedbackGL::end()
|
||||
angle::Result TransformFeedbackGL::end(const gl::Context *context)
|
||||
{
|
||||
mStateManager->onTransformFeedbackStateChange();
|
||||
|
||||
// Immediately end the transform feedback so that the results are visible.
|
||||
syncActiveState(false, gl::PrimitiveMode::InvalidEnum);
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedbackGL::pause()
|
||||
angle::Result TransformFeedbackGL::pause(const gl::Context *context)
|
||||
{
|
||||
mStateManager->onTransformFeedbackStateChange();
|
||||
|
||||
syncPausedState(true);
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedbackGL::resume()
|
||||
angle::Result TransformFeedbackGL::resume(const gl::Context *context)
|
||||
{
|
||||
mStateManager->onTransformFeedbackStateChange();
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedbackGL::bindGenericBuffer(const gl::BindingPointer<gl::Buffer> &binding) {}
|
||||
angle::Result TransformFeedbackGL::bindGenericBuffer(const gl::Context *context,
|
||||
const gl::BindingPointer<gl::Buffer> &binding)
|
||||
{
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedbackGL::bindIndexedBuffer(size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding)
|
||||
angle::Result TransformFeedbackGL::bindIndexedBuffer(
|
||||
const gl::Context *context,
|
||||
size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding)
|
||||
{
|
||||
// Directly bind buffer (not through the StateManager methods) because the buffer bindings are
|
||||
// tracked per transform feedback object
|
||||
|
@ -88,6 +99,7 @@ void TransformFeedbackGL::bindIndexedBuffer(size_t index,
|
|||
{
|
||||
mFunctions->bindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, static_cast<GLuint>(index), 0);
|
||||
}
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
GLuint TransformFeedbackGL::getTransformFeedbackID() const
|
||||
|
|
|
@ -25,14 +25,16 @@ class TransformFeedbackGL : public TransformFeedbackImpl
|
|||
StateManagerGL *stateManager);
|
||||
~TransformFeedbackGL() override;
|
||||
|
||||
void begin(gl::PrimitiveMode primitiveMode) override;
|
||||
void end() override;
|
||||
void pause() override;
|
||||
void resume() override;
|
||||
angle::Result begin(const gl::Context *context, gl::PrimitiveMode primitiveMode) override;
|
||||
angle::Result end(const gl::Context *context) override;
|
||||
angle::Result pause(const gl::Context *context) override;
|
||||
angle::Result resume(const gl::Context *context) override;
|
||||
|
||||
void bindGenericBuffer(const gl::BindingPointer<gl::Buffer> &binding) override;
|
||||
void bindIndexedBuffer(size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding) override;
|
||||
angle::Result bindGenericBuffer(const gl::Context *context,
|
||||
const gl::BindingPointer<gl::Buffer> &binding) override;
|
||||
angle::Result bindIndexedBuffer(const gl::Context *context,
|
||||
size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding) override;
|
||||
|
||||
GLuint getTransformFeedbackID() const;
|
||||
|
||||
|
|
|
@ -20,18 +20,40 @@ TransformFeedbackNULL::TransformFeedbackNULL(const gl::TransformFeedbackState &s
|
|||
|
||||
TransformFeedbackNULL::~TransformFeedbackNULL() {}
|
||||
|
||||
void TransformFeedbackNULL::begin(gl::PrimitiveMode primitiveMode) {}
|
||||
angle::Result TransformFeedbackNULL::begin(const gl::Context *context,
|
||||
gl::PrimitiveMode primitiveMode)
|
||||
{
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedbackNULL::end() {}
|
||||
angle::Result TransformFeedbackNULL::end(const gl::Context *context)
|
||||
{
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedbackNULL::pause() {}
|
||||
angle::Result TransformFeedbackNULL::pause(const gl::Context *context)
|
||||
{
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedbackNULL::resume() {}
|
||||
angle::Result TransformFeedbackNULL::resume(const gl::Context *context)
|
||||
{
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedbackNULL::bindGenericBuffer(const gl::BindingPointer<gl::Buffer> &binding) {}
|
||||
angle::Result TransformFeedbackNULL::bindGenericBuffer(
|
||||
const gl::Context *context,
|
||||
const gl::BindingPointer<gl::Buffer> &binding)
|
||||
{
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
void TransformFeedbackNULL::bindIndexedBuffer(size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding)
|
||||
{}
|
||||
angle::Result TransformFeedbackNULL::bindIndexedBuffer(
|
||||
const gl::Context *context,
|
||||
size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding)
|
||||
{
|
||||
return angle::Result::Continue;
|
||||
}
|
||||
|
||||
} // namespace rx
|
||||
|
|
|
@ -21,14 +21,16 @@ class TransformFeedbackNULL : public TransformFeedbackImpl
|
|||
TransformFeedbackNULL(const gl::TransformFeedbackState &state);
|
||||
~TransformFeedbackNULL() override;
|
||||
|
||||
void begin(gl::PrimitiveMode primitiveMode) override;
|
||||
void end() override;
|
||||
void pause() override;
|
||||
void resume() override;
|
||||
angle::Result begin(const gl::Context *context, gl::PrimitiveMode primitiveMode) override;
|
||||
angle::Result end(const gl::Context *context) override;
|
||||
angle::Result pause(const gl::Context *context) override;
|
||||
angle::Result resume(const gl::Context *context) override;
|
||||
|
||||
void bindGenericBuffer(const gl::BindingPointer<gl::Buffer> &binding) override;
|
||||
void bindIndexedBuffer(size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding) override;
|
||||
angle::Result bindGenericBuffer(const gl::Context *context,
|
||||
const gl::BindingPointer<gl::Buffer> &binding) override;
|
||||
angle::Result bindIndexedBuffer(const gl::Context *context,
|
||||
size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding) override;
|
||||
};
|
||||
|
||||
} // namespace rx
|
||||
|
|
|
@ -20,35 +20,45 @@ TransformFeedbackVk::TransformFeedbackVk(const gl::TransformFeedbackState &state
|
|||
|
||||
TransformFeedbackVk::~TransformFeedbackVk() {}
|
||||
|
||||
void TransformFeedbackVk::begin(gl::PrimitiveMode primitiveMode)
|
||||
angle::Result TransformFeedbackVk::begin(const gl::Context *context,
|
||||
gl::PrimitiveMode primitiveMode)
|
||||
{
|
||||
UNIMPLEMENTED();
|
||||
return angle::Result::Stop;
|
||||
}
|
||||
|
||||
void TransformFeedbackVk::end()
|
||||
angle::Result TransformFeedbackVk::end(const gl::Context *context)
|
||||
{
|
||||
UNIMPLEMENTED();
|
||||
return angle::Result::Stop;
|
||||
}
|
||||
|
||||
void TransformFeedbackVk::pause()
|
||||
angle::Result TransformFeedbackVk::pause(const gl::Context *context)
|
||||
{
|
||||
UNIMPLEMENTED();
|
||||
return angle::Result::Stop;
|
||||
}
|
||||
|
||||
void TransformFeedbackVk::resume()
|
||||
angle::Result TransformFeedbackVk::resume(const gl::Context *context)
|
||||
{
|
||||
UNIMPLEMENTED();
|
||||
return angle::Result::Stop;
|
||||
}
|
||||
|
||||
void TransformFeedbackVk::bindGenericBuffer(const gl::BindingPointer<gl::Buffer> &binding)
|
||||
angle::Result TransformFeedbackVk::bindGenericBuffer(const gl::Context *context,
|
||||
const gl::BindingPointer<gl::Buffer> &binding)
|
||||
{
|
||||
UNIMPLEMENTED();
|
||||
return angle::Result::Stop;
|
||||
}
|
||||
|
||||
void TransformFeedbackVk::bindIndexedBuffer(size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding)
|
||||
angle::Result TransformFeedbackVk::bindIndexedBuffer(
|
||||
const gl::Context *context,
|
||||
size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding)
|
||||
{
|
||||
UNIMPLEMENTED();
|
||||
return angle::Result::Stop;
|
||||
}
|
||||
|
||||
} // namespace rx
|
||||
|
|
|
@ -21,14 +21,16 @@ class TransformFeedbackVk : public TransformFeedbackImpl
|
|||
TransformFeedbackVk(const gl::TransformFeedbackState &state);
|
||||
~TransformFeedbackVk() override;
|
||||
|
||||
void begin(gl::PrimitiveMode primitiveMode) override;
|
||||
void end() override;
|
||||
void pause() override;
|
||||
void resume() override;
|
||||
angle::Result begin(const gl::Context *context, gl::PrimitiveMode primitiveMode) override;
|
||||
angle::Result end(const gl::Context *context) override;
|
||||
angle::Result pause(const gl::Context *context) override;
|
||||
angle::Result resume(const gl::Context *context) override;
|
||||
|
||||
void bindGenericBuffer(const gl::BindingPointer<gl::Buffer> &binding) override;
|
||||
void bindIndexedBuffer(size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding) override;
|
||||
angle::Result bindGenericBuffer(const gl::Context *context,
|
||||
const gl::BindingPointer<gl::Buffer> &binding) override;
|
||||
angle::Result bindIndexedBuffer(const gl::Context *context,
|
||||
size_t index,
|
||||
const gl::OffsetBindingPointer<gl::Buffer> &binding) override;
|
||||
};
|
||||
|
||||
} // namespace rx
|
||||
|
|
Загрузка…
Ссылка в новой задаче