Fixed sRGB multisample tests

The blitter was not doing the sRGB conversion on the first of
N source samples when accumulating samples for doing an sRGB
resolve.

This cl also includes Chris' initial fix for PixelRoutine and
SpirvShader. See:
https://swiftshader-review.googlesource.com/c/SwiftShader/+/31928

Change-Id: I97ce06fb39788fd623eb9b5c0203e45fd911c1dd
Tests: dEQP-VK.renderpass.suballocation.multisample.*.samples_4
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/32848
Tested-by: Alexis Hétu <sugoi@google.com>
Presubmit-Ready: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
diff --git a/src/Device/Blitter.cpp b/src/Device/Blitter.cpp
index ce4a2b0..63c6040 100644
--- a/src/Device/Blitter.cpp
+++ b/src/Device/Blitter.cpp
@@ -1441,6 +1441,11 @@
 
 							if(state.srcSamples > 1) // Resolve multisampled source
 							{
+								if(state.convertSRGB && state.sourceFormat.isSRGBformat()) // sRGB -> RGB
+								{
+									if(!ApplyScaleAndClamp(color, state)) return nullptr;
+									preScaled = true;
+								}
 								Float4 accum = color;
 								for(int i = 1; i < state.srcSamples; i++)
 								{