Commit 82962a0d by Jamie Madill Committed by Commit Bot

Capture/Replay: Complete RasterizerState capture.

The dither check was incorrect. Fix the dither capture and add the missing rasterizer discard and polygon offset capture. Noticed when capturing the T-Rex replay. Bug: angleproject:5134 Change-Id: I5222625175ec7e078a9c0ad6c6fd3507db3a7769 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2449158 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarCourtney Goeltzenleuchter <courtneygo@google.com>
parent a22a19a4
...@@ -3103,7 +3103,6 @@ void CaptureMidExecutionSetup(const gl::Context *context, ...@@ -3103,7 +3103,6 @@ void CaptureMidExecutionSetup(const gl::Context *context,
}; };
// Rasterizer state. Missing ES 3.x features. // Rasterizer state. Missing ES 3.x features.
// TODO(http://anglebug.com/3662): Complete state capture.
const gl::RasterizerState &defaultRasterState = replayState.getRasterizerState(); const gl::RasterizerState &defaultRasterState = replayState.getRasterizerState();
const gl::RasterizerState &currentRasterState = apiState.getRasterizerState(); const gl::RasterizerState &currentRasterState = apiState.getRasterizerState();
if (currentRasterState.cullFace != defaultRasterState.cullFace) if (currentRasterState.cullFace != defaultRasterState.cullFace)
...@@ -3121,6 +3120,30 @@ void CaptureMidExecutionSetup(const gl::Context *context, ...@@ -3121,6 +3120,30 @@ void CaptureMidExecutionSetup(const gl::Context *context,
cap(CaptureFrontFace(replayState, true, currentRasterState.frontFace)); cap(CaptureFrontFace(replayState, true, currentRasterState.frontFace));
} }
if (currentRasterState.polygonOffsetFill != defaultRasterState.polygonOffsetFill)
{
capCap(GL_POLYGON_OFFSET_FILL, currentRasterState.polygonOffsetFill);
}
if (currentRasterState.polygonOffsetFactor != defaultRasterState.polygonOffsetFactor ||
currentRasterState.polygonOffsetUnits != defaultRasterState.polygonOffsetUnits)
{
cap(CapturePolygonOffset(replayState, true, currentRasterState.polygonOffsetFactor,
currentRasterState.polygonOffsetUnits));
}
// pointDrawMode/multiSample are only used in the D3D back-end right now.
if (currentRasterState.rasterizerDiscard != defaultRasterState.rasterizerDiscard)
{
capCap(GL_RASTERIZER_DISCARD, currentRasterState.rasterizerDiscard);
}
if (currentRasterState.dither != defaultRasterState.dither)
{
capCap(GL_DITHER, currentRasterState.dither);
}
// Depth/stencil state. // Depth/stencil state.
const gl::DepthStencilState &defaultDSState = replayState.getDepthStencilState(); const gl::DepthStencilState &defaultDSState = replayState.getDepthStencilState();
const gl::DepthStencilState &currentDSState = apiState.getDepthStencilState(); const gl::DepthStencilState &currentDSState = apiState.getDepthStencilState();
...@@ -3343,11 +3366,6 @@ void CaptureMidExecutionSetup(const gl::Context *context, ...@@ -3343,11 +3366,6 @@ void CaptureMidExecutionSetup(const gl::Context *context,
currentScissor.width, currentScissor.height)); currentScissor.width, currentScissor.height));
} }
if (apiState.isDitherEnabled())
{
capCap(GL_DITHER, apiState.isDitherEnabled());
}
// Allow the replayState object to be destroyed conveniently. // Allow the replayState object to be destroyed conveniently.
replayState.setBufferBinding(context, gl::BufferBinding::Array, nullptr); replayState.setBufferBinding(context, gl::BufferBinding::Array, nullptr);
} }
......
...@@ -153,6 +153,7 @@ struct RasterizerState final ...@@ -153,6 +153,7 @@ struct RasterizerState final
GLfloat polygonOffsetFactor; GLfloat polygonOffsetFactor;
GLfloat polygonOffsetUnits; GLfloat polygonOffsetUnits;
// pointDrawMode/multiSample are only used in the D3D back-end right now.
bool pointDrawMode; bool pointDrawMode;
bool multiSample; bool multiSample;
......
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