Scissor fix

This commit is contained in:
Henrik Rydgård 2017-12-14 17:55:56 +01:00
parent 7c17cb6754
commit 970458a0c2
2 changed files with 3 additions and 9 deletions

View file

@ -344,7 +344,7 @@ private:
GLRFramebuffer *curFB_ = nullptr;
GLuint globalVAO_;
GLuint globalVAO_ = 0;
GLint curFramebuffer_ = 0;
int curFBWidth_ = 0;
@ -357,7 +357,7 @@ private:
GLint readbackBuffer_ = 0;
int readbackBufferSize_ = 0;
float maxAnisotropyLevel_;
float maxAnisotropyLevel_ = 0.0f;
// Framebuffer state?
GLuint currentDrawHandle_ = 0;

View file

@ -395,12 +395,7 @@ public:
}
void SetScissorRect(int left, int top, int width, int height) override {
int y = top;
if (!curFB_) {
// We render "upside down" to the backbuffer since GL is silly.
y = targetHeight_ - (top + height);
}
renderManager_.SetScissor({ left, y, width, height });
renderManager_.SetScissor({ left, top, width, height });
}
void SetViewports(int count, Viewport *viewports) override {
@ -492,7 +487,6 @@ private:
int curVBufferOffsets_[4]{};
OpenGLBuffer *curIBuffer_ = nullptr;
int curIBufferOffset_ = 0;
OpenGLFramebuffer *curFB_;
// Frames in flight is not such a strict concept as with Vulkan until we start using glBufferStorage and fences.
// But might as well have the structure ready, and can't hurt to rotate buffers.