Rename render target to color buffer
The Vulkan spec does not use the term 'render target' (except in
extensions that probably borrow it from other APIs). Instead is uses
'attachment', and distinguishes between color, depth, and stencil
attachments. Render target can be confused to just refer to color
attachments, or any buffer that can be rendered to by the graphics
pipeline.
While the term 'color buffer' isn't used much either in the Vulkan spec,
the term 'depth buffer' is. Also, color buffer was the term used in the
OpenGL spec for color framebuffer attachments. Thus its meaning should
be well understood, or at least better than 'render target'.
Bug: b/134584057
Change-Id: I9ccc898ac98b99a9ab86098a465ab8331719cb66
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/57070
Presubmit-Ready: Nicolas Capens <nicolascapens@google.com>
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Sean Risser <srisser@google.com>
diff --git a/src/Pipeline/PixelProgram.cpp b/src/Pipeline/PixelProgram.cpp
index 3c6d136..42ce095 100644
--- a/src/Pipeline/PixelProgram.cpp
+++ b/src/Pipeline/PixelProgram.cpp
@@ -206,7 +206,7 @@
spirvShader->clearPhis(&routine);
}
- for(int i = 0; i < RENDERTARGETS; i++)
+ for(int i = 0; i < MAX_COLOR_BUFFERS; i++)
{
c[i].x = routine.outputs[i * 4];
c[i].y = routine.outputs[i * 4 + 1];
@@ -274,14 +274,14 @@
void PixelProgram::rasterOperation(Pointer<Byte> cBuffer[4], Int &x, Int sMask[4], Int zMask[4], Int cMask[4], const SampleSet &samples)
{
- for(int index = 0; index < RENDERTARGETS; index++)
+ for(int index = 0; index < MAX_COLOR_BUFFERS; index++)
{
if(!state.colorWriteActive(index))
{
continue;
}
- auto format = state.targetFormat[index];
+ auto format = state.colorFormat[index];
switch(format)
{
case VK_FORMAT_A1R5G5B5_UNORM_PACK16:
@@ -356,16 +356,16 @@
}
}
-void PixelProgram::clampColor(Vector4f oC[RENDERTARGETS])
+void PixelProgram::clampColor(Vector4f oC[MAX_COLOR_BUFFERS])
{
- for(int index = 0; index < RENDERTARGETS; index++)
+ for(int index = 0; index < MAX_COLOR_BUFFERS; index++)
{
if(!state.colorWriteActive(index) && !(index == 0 && state.alphaToCoverage))
{
continue;
}
- switch(state.targetFormat[index])
+ switch(state.colorFormat[index])
{
case VK_FORMAT_UNDEFINED:
break;
@@ -423,7 +423,7 @@
case VK_FORMAT_A2R10G10B10_UINT_PACK32:
break;
default:
- UNSUPPORTED("VkFormat: %d", int(state.targetFormat[index]));
+ UNSUPPORTED("VkFormat: %d", int(state.colorFormat[index]));
}
}
}