Followup to #17471: Fix Lubos' VR sky clearing hack

This commit is contained in:
Henrik Rydgård 2023-06-04 10:18:36 +02:00
parent 27b8d27efc
commit 75dd31894c
2 changed files with 8 additions and 5 deletions

View File

@ -711,9 +711,8 @@ void GLQueueRunner::RunSteps(const std::vector<GLRStep *> &steps, GLFrameData &f
case GLRStepType::RENDER:
renderCount++;
if (IsVREnabled()) {
GLRStep &vrStep = step;
PreprocessStepVR(&vrStep);
PerformRenderPass(vrStep, renderCount == 1, renderCount == totalRenderCount, frameData.profile);
PreprocessStepVR(&step);
PerformRenderPass(step, renderCount == 1, renderCount == totalRenderCount, frameData.profile);
} else {
PerformRenderPass(step, renderCount == 1, renderCount == totalRenderCount, frameData.profile);
}

View File

@ -561,10 +561,14 @@ void PreprocessSkyplane(GLRStep* step) {
// Clear sky with the fog color.
if (!vrCompat[VR_COMPAT_FBO_CLEAR]) {
GLRRenderData &skyClear = step->commands.insert(step->commands.begin());
skyClear.cmd = GLRRenderCommand::CLEAR; // intentional zero-initialize
skyClear.cmd = GLRRenderCommand::CLEAR;
skyClear.clear.colorMask = 0xF;
skyClear.clear.clearMask = GL_COLOR_BUFFER_BIT;
skyClear.clear.clearMask = GL_COLOR_BUFFER_BIT; // don't need to initialize clearZ, clearStencil
skyClear.clear.clearColor = vrCompat[VR_COMPAT_FOG_COLOR];
skyClear.clear.scissorX = 0;
skyClear.clear.scissorY = 0;
skyClear.clear.scissorW = 0; // signal no scissor
skyClear.clear.scissorH = 0;
vrCompat[VR_COMPAT_FBO_CLEAR] = true;
}