Rename color output semantic.
Change-Id: Iaa6cf9367f291a4bc3bde899484ca323ff54a0d4
Reviewed-on: https://swiftshader-review.googlesource.com/5381
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/Renderer/Context.cpp b/src/Renderer/Context.cpp
index 1edecd8..bc7f37f 100644
--- a/src/Renderer/Context.cpp
+++ b/src/Renderer/Context.cpp
@@ -1260,7 +1260,7 @@
if(vertexShader)
{
- vertexDiffuse = vertexShader->output[D0][component].active();
+ vertexDiffuse = vertexShader->output[C0][component].active();
}
else if(!preTransformed)
{
@@ -1327,7 +1327,7 @@
}
else
{
- vertexSpecular = vertexShader->output[D1][component].active();
+ vertexSpecular = vertexShader->output[C1][component].active();
}
// Pixel processor requires specular component
diff --git a/src/Renderer/SetupProcessor.cpp b/src/Renderer/SetupProcessor.cpp
index 1bedf79..08e52c9 100644
--- a/src/Renderer/SetupProcessor.cpp
+++ b/src/Renderer/SetupProcessor.cpp
@@ -173,7 +173,7 @@
state.gradient[interpolant][component].flat = point && !sprite;
break;
case Shader::USAGE_COLOR:
- state.gradient[interpolant][component].attribute = D0 + index;
+ state.gradient[interpolant][component].attribute = C0 + index;
state.gradient[interpolant][component].flat = flatShading;
break;
default:
@@ -203,7 +203,7 @@
{
if(context->colorActive(color, component))
{
- state.color[color][component].attribute = D0 + color;
+ state.color[color][component].attribute = C0 + color;
state.color[color][component].flat = flatShading;
}
}
diff --git a/src/Renderer/Vertex.hpp b/src/Renderer/Vertex.hpp
index 01a7273..bc38da6 100644
--- a/src/Renderer/Vertex.hpp
+++ b/src/Renderer/Vertex.hpp
@@ -24,8 +24,8 @@
enum Out // Default vertex output semantic
{
Pos = 0,
- D0 = 1, // Diffuse
- D1 = 2, // Specular
+ C0 = 1, // Diffuse
+ C1 = 2, // Specular
T0 = 3,
T1 = 4,
T2 = 5,
diff --git a/src/Renderer/VertexProcessor.cpp b/src/Renderer/VertexProcessor.cpp
index 0b76520..fa13b2b 100644
--- a/src/Renderer/VertexProcessor.cpp
+++ b/src/Renderer/VertexProcessor.cpp
@@ -956,12 +956,12 @@
if(context->diffuseActive() && (context->lightingEnable || context->input[Color0]))
{
- state.output[D0].write = 0xF;
+ state.output[C0].write = 0xF;
}
if(context->specularActive())
{
- state.output[D1].write = 0xF;
+ state.output[C1].write = 0xF;
}
for(int stage = 0; stage < 8; stage++)
@@ -990,7 +990,7 @@
{
if(context->input[Color0 + i])
{
- state.output[D0 + i].write = 0xF;
+ state.output[C0 + i].write = 0xF;
}
}
@@ -1010,8 +1010,8 @@
if(context->vertexShaderVersion() < 0x0300)
{
- state.output[D0].clamp = 0xF;
- state.output[D1].clamp = 0xF;
+ state.output[C0].clamp = 0xF;
+ state.output[C1].clamp = 0xF;
state.output[Fog].xClamp = true;
}
diff --git a/src/Shader/VertexPipeline.cpp b/src/Shader/VertexPipeline.cpp
index a214d90..8db3ca0 100644
--- a/src/Shader/VertexPipeline.cpp
+++ b/src/Shader/VertexPipeline.cpp
@@ -196,17 +196,17 @@
{
Vector4f diffuse = v[Color0];
- o[D0].x = diffuse.x;
- o[D0].y = diffuse.y;
- o[D0].z = diffuse.z;
- o[D0].w = diffuse.w;
+ o[C0].x = diffuse.x;
+ o[C0].y = diffuse.y;
+ o[C0].z = diffuse.z;
+ o[C0].w = diffuse.w;
}
else
{
- o[D0].x = Float4(1.0f);
- o[D0].y = Float4(1.0f);
- o[D0].z = Float4(1.0f);
- o[D0].w = Float4(1.0f);
+ o[C0].x = Float4(1.0f);
+ o[C0].y = Float4(1.0f);
+ o[C0].z = Float4(1.0f);
+ o[C0].w = Float4(1.0f);
}
// FIXME: Don't process if not used at all
@@ -214,30 +214,30 @@
{
Vector4f specular = v[Color1];
- o[D1].x = specular.x;
- o[D1].y = specular.y;
- o[D1].z = specular.z;
- o[D1].w = specular.w;
+ o[C1].x = specular.x;
+ o[C1].y = specular.y;
+ o[C1].z = specular.z;
+ o[C1].w = specular.w;
}
else
{
- o[D1].x = Float4(0.0f);
- o[D1].y = Float4(0.0f);
- o[D1].z = Float4(0.0f);
- o[D1].w = Float4(1.0f);
+ o[C1].x = Float4(0.0f);
+ o[C1].y = Float4(0.0f);
+ o[C1].z = Float4(0.0f);
+ o[C1].w = Float4(1.0f);
}
}
else
{
- o[D0].x = Float4(0.0f);
- o[D0].y = Float4(0.0f);
- o[D0].z = Float4(0.0f);
- o[D0].w = Float4(0.0f);
+ o[C0].x = Float4(0.0f);
+ o[C0].y = Float4(0.0f);
+ o[C0].z = Float4(0.0f);
+ o[C0].w = Float4(0.0f);
- o[D1].x = Float4(0.0f);
- o[D1].y = Float4(0.0f);
- o[D1].z = Float4(0.0f);
- o[D1].w = Float4(0.0f);
+ o[C1].x = Float4(0.0f);
+ o[C1].y = Float4(0.0f);
+ o[C1].z = Float4(0.0f);
+ o[C1].w = Float4(0.0f);
Vector4f ambient;
Float4 globalAmbient = *Pointer<Float4>(data + OFFSET(DrawData,ff.globalAmbient)); // FIXME: Unpack
@@ -321,9 +321,9 @@
Float4 lightDiffuse = *Pointer<Float4>(data + OFFSET(DrawData,ff.lightDiffuse[i]));
- o[D0].x = o[D0].x + diff.x * dot * lightDiffuse.x; // FIXME: Clamp first?
- o[D0].y = o[D0].y + diff.y * dot * lightDiffuse.y; // FIXME: Clamp first?
- o[D0].z = o[D0].z + diff.z * dot * lightDiffuse.z; // FIXME: Clamp first?
+ o[C0].x = o[C0].x + diff.x * dot * lightDiffuse.x; // FIXME: Clamp first?
+ o[C0].y = o[C0].y + diff.y * dot * lightDiffuse.y; // FIXME: Clamp first?
+ o[C0].z = o[C0].z + diff.z * dot * lightDiffuse.z; // FIXME: Clamp first?
}
// Specular
@@ -386,15 +386,15 @@
if(secondaryColor)
{
- o[D1].x = o[D1].x + spec.x;
- o[D1].y = o[D1].y + spec.y;
- o[D1].z = o[D1].z + spec.z;
+ o[C1].x = o[C1].x + spec.x;
+ o[C1].y = o[C1].y + spec.y;
+ o[C1].z = o[C1].z + spec.z;
}
else
{
- o[D0].x = o[D0].x + spec.x;
- o[D0].y = o[D0].y + spec.y;
- o[D0].z = o[D0].z + spec.z;
+ o[C0].x = o[C0].x + spec.x;
+ o[C0].y = o[C0].y + spec.y;
+ o[C0].z = o[C0].z + spec.z;
}
}
}
@@ -425,51 +425,51 @@
}
else ASSERT(false);
- o[D0].x = o[D0].x + ambient.x;
- o[D0].y = o[D0].y + ambient.y;
- o[D0].z = o[D0].z + ambient.z;
+ o[C0].x = o[C0].x + ambient.x;
+ o[C0].y = o[C0].y + ambient.y;
+ o[C0].z = o[C0].z + ambient.z;
// Emissive
if(state.vertexEmissiveMaterialSourceActive == MATERIAL_MATERIAL)
{
Float4 materialEmission = *Pointer<Float4>(data + OFFSET(DrawData,ff.materialEmission)); // FIXME: Unpack
- o[D0].x = o[D0].x + materialEmission.x;
- o[D0].y = o[D0].y + materialEmission.y;
- o[D0].z = o[D0].z + materialEmission.z;
+ o[C0].x = o[C0].x + materialEmission.x;
+ o[C0].y = o[C0].y + materialEmission.y;
+ o[C0].z = o[C0].z + materialEmission.z;
}
else if(state.vertexEmissiveMaterialSourceActive == MATERIAL_COLOR1)
{
Vector4f materialSpecular = v[Color0];
- o[D0].x = o[D0].x + materialSpecular.x;
- o[D0].y = o[D0].y + materialSpecular.y;
- o[D0].z = o[D0].z + materialSpecular.z;
+ o[C0].x = o[C0].x + materialSpecular.x;
+ o[C0].y = o[C0].y + materialSpecular.y;
+ o[C0].z = o[C0].z + materialSpecular.z;
}
else if(state.vertexEmissiveMaterialSourceActive == MATERIAL_COLOR2)
{
Vector4f materialSpecular = v[Color1];
- o[D0].x = o[D0].x + materialSpecular.x;
- o[D0].y = o[D0].y + materialSpecular.y;
- o[D0].z = o[D0].z + materialSpecular.z;
+ o[C0].x = o[C0].x + materialSpecular.x;
+ o[C0].y = o[C0].y + materialSpecular.y;
+ o[C0].z = o[C0].z + materialSpecular.z;
}
else ASSERT(false);
// Diffuse alpha component
if(state.vertexDiffuseMaterialSourceActive == MATERIAL_MATERIAL)
{
- o[D0].w = Float4(*Pointer<Float4>(data + OFFSET(DrawData,ff.materialDiffuse[0]))).wwww; // FIXME: Unpack
+ o[C0].w = Float4(*Pointer<Float4>(data + OFFSET(DrawData,ff.materialDiffuse[0]))).wwww; // FIXME: Unpack
}
else if(state.vertexDiffuseMaterialSourceActive == MATERIAL_COLOR1)
{
Vector4f alpha = v[Color0];
- o[D0].w = alpha.w;
+ o[C0].w = alpha.w;
}
else if(state.vertexDiffuseMaterialSourceActive == MATERIAL_COLOR2)
{
Vector4f alpha = v[Color1];
- o[D0].w = alpha.w;
+ o[C0].w = alpha.w;
}
else ASSERT(false);
@@ -478,17 +478,17 @@
// Specular alpha component
if(state.vertexSpecularMaterialSourceActive == MATERIAL_MATERIAL)
{
- o[D1].w = Float4(*Pointer<Float4>(data + OFFSET(DrawData,ff.materialSpecular[3]))).wwww; // FIXME: Unpack
+ o[C1].w = Float4(*Pointer<Float4>(data + OFFSET(DrawData,ff.materialSpecular[3]))).wwww; // FIXME: Unpack
}
else if(state.vertexSpecularMaterialSourceActive == MATERIAL_COLOR1)
{
Vector4f alpha = v[Color0];
- o[D1].w = alpha.w;
+ o[C1].w = alpha.w;
}
else if(state.vertexSpecularMaterialSourceActive == MATERIAL_COLOR2)
{
Vector4f alpha = v[Color1];
- o[D1].w = alpha.w;
+ o[C1].w = alpha.w;
}
else ASSERT(false);
}
@@ -512,7 +512,7 @@
case FOG_NONE:
if(state.specularActive)
{
- o[Fog].x = o[D1].w;
+ o[Fog].x = o[C1].w;
}
else
{
diff --git a/src/Shader/VertexProgram.cpp b/src/Shader/VertexProgram.cpp
index d59a33b..26608f4 100644
--- a/src/Shader/VertexProgram.cpp
+++ b/src/Shader/VertexProgram.cpp
@@ -410,10 +410,10 @@
}
break;
case Shader::PARAMETER_ATTROUT:
- if(dst.x) pDst.x = o[D0 + dst.index].x;
- if(dst.y) pDst.y = o[D0 + dst.index].y;
- if(dst.z) pDst.z = o[D0 + dst.index].z;
- if(dst.w) pDst.w = o[D0 + dst.index].w;
+ if(dst.x) pDst.x = o[C0 + dst.index].x;
+ if(dst.y) pDst.y = o[C0 + dst.index].y;
+ if(dst.z) pDst.z = o[C0 + dst.index].z;
+ if(dst.w) pDst.w = o[C0 + dst.index].w;
break;
case Shader::PARAMETER_TEXCRDOUT:
// case Shader::PARAMETER_OUTPUT:
@@ -541,10 +541,10 @@
}
break;
case Shader::PARAMETER_ATTROUT:
- if(dst.x) o[D0 + dst.index].x = d.x;
- if(dst.y) o[D0 + dst.index].y = d.y;
- if(dst.z) o[D0 + dst.index].z = d.z;
- if(dst.w) o[D0 + dst.index].w = d.w;
+ if(dst.x) o[C0 + dst.index].x = d.x;
+ if(dst.y) o[C0 + dst.index].y = d.y;
+ if(dst.z) o[C0 + dst.index].z = d.z;
+ if(dst.w) o[C0 + dst.index].w = d.w;
break;
case Shader::PARAMETER_TEXCRDOUT:
// case Shader::PARAMETER_OUTPUT:
@@ -640,10 +640,10 @@
for(int i = 0; i < 2; i++)
{
- o[D0 + i].x = v[Color0 + i].x;
- o[D0 + i].y = v[Color0 + i].y;
- o[D0 + i].z = v[Color0 + i].z;
- o[D0 + i].w = v[Color0 + i].w;
+ o[C0 + i].x = v[Color0 + i].x;
+ o[C0 + i].y = v[Color0 + i].y;
+ o[C0 + i].z = v[Color0 + i].z;
+ o[C0 + i].w = v[Color0 + i].w;
}
for(int i = 0; i < 8; i++)
diff --git a/src/Shader/VertexShader.cpp b/src/Shader/VertexShader.cpp
index 1de8c93..cfbda0c 100644
--- a/src/Shader/VertexShader.cpp
+++ b/src/Shader/VertexShader.cpp
@@ -209,17 +209,17 @@
case Shader::PARAMETER_ATTROUT:
if(dst.index == 0)
{
- if(dst.x) output[D0][0] = Semantic(Shader::USAGE_COLOR, 0);
- if(dst.y) output[D0][1] = Semantic(Shader::USAGE_COLOR, 0);
- if(dst.z) output[D0][2] = Semantic(Shader::USAGE_COLOR, 0);
- if(dst.w) output[D0][3] = Semantic(Shader::USAGE_COLOR, 0);
+ if(dst.x) output[C0][0] = Semantic(Shader::USAGE_COLOR, 0);
+ if(dst.y) output[C0][1] = Semantic(Shader::USAGE_COLOR, 0);
+ if(dst.z) output[C0][2] = Semantic(Shader::USAGE_COLOR, 0);
+ if(dst.w) output[C0][3] = Semantic(Shader::USAGE_COLOR, 0);
}
else if(dst.index == 1)
{
- if(dst.x) output[D1][0] = Semantic(Shader::USAGE_COLOR, 1);
- if(dst.y) output[D1][1] = Semantic(Shader::USAGE_COLOR, 1);
- if(dst.z) output[D1][2] = Semantic(Shader::USAGE_COLOR, 1);
- if(dst.w) output[D1][3] = Semantic(Shader::USAGE_COLOR, 1);
+ if(dst.x) output[C1][0] = Semantic(Shader::USAGE_COLOR, 1);
+ if(dst.y) output[C1][1] = Semantic(Shader::USAGE_COLOR, 1);
+ if(dst.z) output[C1][2] = Semantic(Shader::USAGE_COLOR, 1);
+ if(dst.w) output[C1][3] = Semantic(Shader::USAGE_COLOR, 1);
}
else ASSERT(false);
break;