Also take control over Begin/End

This commit is contained in:
Henrik Rydgård 2018-04-05 17:34:32 +02:00
parent 8d6bbc54a9
commit feb3870f7d
3 changed files with 14 additions and 6 deletions

View File

@ -157,14 +157,14 @@ void DrawEngineGLES::ClearInputLayoutMap() {
void DrawEngineGLES::BeginFrame() {
FrameData &frameData = frameData_[render_->GetCurFrame()];
frameData.pushIndex->Begin();
frameData.pushVertex->Begin();
render_->BeginPushBuffer(frameData.pushIndex);
render_->BeginPushBuffer(frameData.pushVertex);
}
void DrawEngineGLES::EndFrame() {
FrameData &frameData = frameData_[render_->GetCurFrame()];
frameData.pushIndex->End();
frameData.pushVertex->End();
render_->EndPushBuffer(frameData.pushIndex);
render_->EndPushBuffer(frameData.pushVertex);
tessDataTransfer->EndFrame();
}

View File

@ -472,6 +472,14 @@ public:
delete pushbuffer;
}
void BeginPushBuffer(GLPushBuffer *pushbuffer) {
pushbuffer->Begin();
}
void EndPushBuffer(GLPushBuffer *pushbuffer) {
pushbuffer->End();
}
void BindFramebufferAsRenderTarget(GLRFramebuffer *fb, GLRRenderPassAction color, GLRRenderPassAction depth, GLRRenderPassAction stencil, uint32_t clearColor, float clearDepth, uint8_t clearStencil);
void BindFramebufferAsTexture(GLRFramebuffer *fb, int binding, int aspectBit, int attachment);
bool CopyFramebufferToMemorySync(GLRFramebuffer *src, int aspectBits, int x, int y, int w, int h, Draw::DataFormat destFormat, uint8_t *pixels, int pixelStride);

View File

@ -540,12 +540,12 @@ OpenGLContext::~OpenGLContext() {
void OpenGLContext::BeginFrame() {
renderManager_.BeginFrame();
FrameData &frameData = frameData_[renderManager_.GetCurFrame()];
frameData.push->Begin();
renderManager_.BeginPushBuffer(frameData.push);
}
void OpenGLContext::EndFrame() {
FrameData &frameData = frameData_[renderManager_.GetCurFrame()];
frameData.push->End(); // upload the data!
renderManager_.EndPushBuffer(frameData.push); // upload the data!
renderManager_.Finish();
}