Commit 603a1b53 by Chris Forbes

Fix provoking vertex convention and remove configurability

- secondaryColor control only made sense in fixed-function - Vulkan provoking vertex is always the first vertex Bug: b/125909515 Test: dEQP-VK.rasterization.flatshading.* Change-Id: I9b6826e093076ee7ca5ef6deaf1b1fbd1c2f39e3 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/27509 Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent fc06fd13
...@@ -28,8 +28,6 @@ namespace sw ...@@ -28,8 +28,6 @@ namespace sw
bool booleanFaceRegister = false; bool booleanFaceRegister = false;
bool fullPixelPositionRegister = false; bool fullPixelPositionRegister = false;
bool leadingVertexFirst = false; // Flat shading uses first vertex, else last
bool secondaryColor = false; // Specular lighting is applied after texturing
bool colorsDefaultToZero = false; bool colorsDefaultToZero = false;
bool forceWindowed = false; bool forceWindowed = false;
......
...@@ -46,8 +46,6 @@ namespace sw ...@@ -46,8 +46,6 @@ namespace sw
{ {
extern bool booleanFaceRegister; extern bool booleanFaceRegister;
extern bool fullPixelPositionRegister; extern bool fullPixelPositionRegister;
extern bool leadingVertexFirst; // Flat shading uses first vertex, else last
extern bool secondaryColor; // Specular lighting is applied after texturing
extern bool colorsDefaultToZero; extern bool colorsDefaultToZero;
extern bool forceWindowed; extern bool forceWindowed;
...@@ -79,8 +77,6 @@ namespace sw ...@@ -79,8 +77,6 @@ namespace sw
{ {
sw::booleanFaceRegister = conventions.booleanFaceRegister; sw::booleanFaceRegister = conventions.booleanFaceRegister;
sw::fullPixelPositionRegister = conventions.fullPixelPositionRegister; sw::fullPixelPositionRegister = conventions.fullPixelPositionRegister;
sw::leadingVertexFirst = conventions.leadingVertexFirst;
sw::secondaryColor = conventions.secondaryColor;
sw::colorsDefaultToZero = conventions.colorsDefaultToZero; sw::colorsDefaultToZero = conventions.colorsDefaultToZero;
sw::exactColorRounding = exactColorRounding; sw::exactColorRounding = exactColorRounding;
initialized = true; initialized = true;
...@@ -886,18 +882,9 @@ namespace sw ...@@ -886,18 +882,9 @@ namespace sw
for(unsigned int i = 0; i < triangleCount; i++) for(unsigned int i = 0; i < triangleCount; i++)
{ {
if(leadingVertexFirst)
{
batch[i][0] = index + 0; batch[i][0] = index + 0;
batch[i][1] = index + (index & 1) + 1; batch[i][1] = index + (index & 1) + 1;
batch[i][2] = index + (~index & 1) + 1; batch[i][2] = index + (~index & 1) + 1;
}
else
{
batch[i][0] = index + (index & 1);
batch[i][1] = index + (~index & 1);
batch[i][2] = index + 2;
}
index += 1; index += 1;
} }
...@@ -909,18 +896,9 @@ namespace sw ...@@ -909,18 +896,9 @@ namespace sw
for(unsigned int i = 0; i < triangleCount; i++) for(unsigned int i = 0; i < triangleCount; i++)
{ {
if(leadingVertexFirst)
{
batch[i][0] = index + 1; batch[i][0] = index + 1;
batch[i][1] = index + 2; batch[i][1] = index + 2;
batch[i][2] = 0; batch[i][2] = 0;
}
else
{
batch[i][0] = 0;
batch[i][1] = index + 1;
batch[i][2] = index + 2;
}
index += 1; index += 1;
} }
......
...@@ -63,8 +63,6 @@ namespace sw ...@@ -63,8 +63,6 @@ namespace sw
bool symmetricNormalizedDepth; bool symmetricNormalizedDepth;
bool booleanFaceRegister; bool booleanFaceRegister;
bool fullPixelPositionRegister; bool fullPixelPositionRegister;
bool leadingVertexFirst;
bool secondaryColor;
bool colorsDefaultToZero; bool colorsDefaultToZero;
}; };
...@@ -74,8 +72,6 @@ namespace sw ...@@ -74,8 +72,6 @@ namespace sw
true, // symmetricNormalizedDepth true, // symmetricNormalizedDepth
true, // booleanFaceRegister true, // booleanFaceRegister
true, // fullPixelPositionRegister true, // fullPixelPositionRegister
false, // leadingVertexFirst
false, // secondaryColor
true, // colorsDefaultToZero true, // colorsDefaultToZero
}; };
...@@ -85,8 +81,6 @@ namespace sw ...@@ -85,8 +81,6 @@ namespace sw
false, // symmetricNormalizedDepth false, // symmetricNormalizedDepth
false, // booleanFaceRegister false, // booleanFaceRegister
false, // fullPixelPositionRegister false, // fullPixelPositionRegister
true, // leadingVertexFirst
true, // secondardyColor
false, // colorsDefaultToZero false, // colorsDefaultToZero
}; };
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
namespace sw namespace sw
{ {
extern TranscendentalPrecision logPrecision; extern TranscendentalPrecision logPrecision;
extern bool leadingVertexFirst;
SetupRoutine::SetupRoutine(const SetupProcessor::State &state) : state(state) SetupRoutine::SetupRoutine(const SetupProcessor::State &state) : state(state)
{ {
...@@ -522,7 +521,7 @@ namespace sw ...@@ -522,7 +521,7 @@ namespace sw
} }
else else
{ {
int leadingVertex = leadingVertexFirst ? OFFSET(Triangle,v0) : OFFSET(Triangle,v2); int leadingVertex = OFFSET(Triangle,v0);
Float C = *Pointer<Float>(triangle + leadingVertex + attribute); Float C = *Pointer<Float>(triangle + leadingVertex + attribute);
*Pointer<Float4>(primitive + planeEquation + 0, 16) = Float4(0, 0, 0, 0); *Pointer<Float4>(primitive + planeEquation + 0, 16) = Float4(0, 0, 0, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment