Connect fragment shader outputs to raster operations stage
Bug: b/124177079
Change-Id: I0dbcd154c2a28c43d9895e264cc794fc2ed289f2
Reviewed-on: https://swiftshader-review.googlesource.com/c/25029
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Tested-by: Chris Forbes <chrisforbes@google.com>
diff --git a/src/Pipeline/PixelProgram.cpp b/src/Pipeline/PixelProgram.cpp
index 61621bf..94ec809 100644
--- a/src/Pipeline/PixelProgram.cpp
+++ b/src/Pipeline/PixelProgram.cpp
@@ -31,22 +31,15 @@
{
enableIndex = 0;
- // For our own sanity, ensure color outputs are written,
- // even if the shader neglects to write them.
- for(int i = 0; i < RENDERTARGETS; i++)
- {
- if(state.targetFormat[i] != VK_FORMAT_UNDEFINED)
- {
- oC[i] = Vector4f(0.0f, 0.0f, 0.0f, 0.0f);
- }
- }
-
spirvShader->emit(&routine);
spirvShader->emitEpilog(&routine);
for(int i = 0; i < RENDERTARGETS; i++)
{
- c[i] = oC[i];
+ c[i].x = routine.outputs[i * 4];
+ c[i].y = routine.outputs[i * 4 + 1];
+ c[i].z = routine.outputs[i * 4 + 2];
+ c[i].w = routine.outputs[i * 4 + 3];
}
clampColor(c);
diff --git a/src/Pipeline/PixelProgram.hpp b/src/Pipeline/PixelProgram.hpp
index 2151ad1..2959418 100644
--- a/src/Pipeline/PixelProgram.hpp
+++ b/src/Pipeline/PixelProgram.hpp
@@ -39,7 +39,6 @@
private:
// Color outputs
Vector4f c[RENDERTARGETS];
- RegisterArray<RENDERTARGETS, true> oC;
// Per pixel based on conditions reached
Int enableIndex;