Fix dynamic rendering implicit clears with multiview
Applied the same fix that had been previously applied to
CmdClearAttachment::execute() to CmdBeginRendering::execute().
Also, multiview is set when viewMask > 0, so the logic was
modified to take that into account.
Tests: dEQP-VK.multiview.dynamic_rendering.readback_implicit_clear.*
Bug: b/204502119
Change-Id: I98fddd81ebf82412bd5f5e13ce8a9fe645905e41
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/63288
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Alexis Hétu <sugoi@google.com>
Commit-Queue: Alexis Hétu <sugoi@google.com>
diff --git a/src/Pipeline/PixelProgram.cpp b/src/Pipeline/PixelProgram.cpp
index 42fefc1..d6cbe0a 100644
--- a/src/Pipeline/PixelProgram.cpp
+++ b/src/Pipeline/PixelProgram.cpp
@@ -98,7 +98,7 @@
routine.helperInvocation = ~maskAny(cMask, samples);
routine.windowSpacePosition[0] = x + SIMD::Int(0, 1, 0, 1);
routine.windowSpacePosition[1] = y + SIMD::Int(0, 0, 1, 1);
- routine.viewID = *Pointer<Int>(data + OFFSET(DrawData, viewID));
+ routine.layer = *Pointer<Int>(data + OFFSET(DrawData, layer));
// PointCoord formula reference: https://www.khronos.org/registry/vulkan/specs/1.2/html/vkspec.html#primsrast-points-basic
// Note we don't add a 0.5 offset to x and y here (like for fragCoord) because pointCoordX/Y have 0.5 subtracted as part of the viewport transform.
@@ -108,7 +108,7 @@
routine.setInputBuiltin(spirvShader, spv::BuiltInViewIndex, [&](const SpirvShader::BuiltinMapping &builtin, Array<SIMD::Float> &value) {
assert(builtin.SizeInComponents == 1);
- value[builtin.FirstComponent] = As<SIMD::Float>(SIMD::Int(routine.viewID));
+ value[builtin.FirstComponent] = As<SIMD::Float>(SIMD::Int(routine.layer));
});
routine.setInputBuiltin(spirvShader, spv::BuiltInFragCoord, [&](const SpirvShader::BuiltinMapping &builtin, Array<SIMD::Float> &value) {