Commit 5c9e165b by Chris Forbes

Remove residue of texcoord replacement

Change-Id: I063e3590d4ea79b2d28cc1af3a213ab37b76723d Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31248Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 5b424e69
...@@ -84,7 +84,6 @@ namespace sw ...@@ -84,7 +84,6 @@ namespace sw
state.cullMode = context->cullMode; state.cullMode = context->cullMode;
state.twoSidedStencil = context->stencilActive() && context->twoSidedStencil; state.twoSidedStencil = context->stencilActive() && context->twoSidedStencil;
state.slopeDepthBias = context->slopeDepthBias != 0.0f; state.slopeDepthBias = context->slopeDepthBias != 0.0f;
state.vFace = context->pixelShader && context->pixelShader->hasBuiltinInput(spv::BuiltInFrontFacing);
state.multiSample = context->sampleCount; state.multiSample = context->sampleCount;
state.rasterizerDiscard = context->rasterizerDiscard; state.rasterizerDiscard = context->rasterizerDiscard;
......
...@@ -45,7 +45,6 @@ namespace sw ...@@ -45,7 +45,6 @@ namespace sw
VkCullModeFlags cullMode : BITS(VK_CULL_MODE_FLAG_BITS_MAX_ENUM); VkCullModeFlags cullMode : BITS(VK_CULL_MODE_FLAG_BITS_MAX_ENUM);
bool twoSidedStencil : 1; bool twoSidedStencil : 1;
bool slopeDepthBias : 1; bool slopeDepthBias : 1;
bool vFace : 1;
unsigned int multiSample : 3; // 1, 2 or 4 unsigned int multiSample : 3; // 1, 2 or 4
bool rasterizerDiscard : 1; bool rasterizerDiscard : 1;
......
...@@ -444,15 +444,11 @@ namespace sw ...@@ -444,15 +444,11 @@ namespace sw
for (int interpolant = 0; interpolant < MAX_INTERFACE_COMPONENTS; interpolant++) for (int interpolant = 0; interpolant < MAX_INTERFACE_COMPONENTS; interpolant++)
{ {
// Note: `sprite` mode controls whether to replace this interpolant with the point sprite PointCoord value.
// This was an interesting thing to support for old GL because any texture coordinate could be replaced in this way.
// In modern GL and in Vulkan, the [gl_]PointCoord builtin variable to the fragment shader is used instead.
if (state.gradient[interpolant].Type != SpirvShader::ATTRIBTYPE_UNUSED) if (state.gradient[interpolant].Type != SpirvShader::ATTRIBTYPE_UNUSED)
setupGradient(primitive, tri, w012, M, v0, v1, v2, setupGradient(primitive, tri, w012, M, v0, v1, v2,
OFFSET(Vertex, v[interpolant]), OFFSET(Vertex, v[interpolant]),
OFFSET(Primitive, V[interpolant]), OFFSET(Primitive, V[interpolant]),
state.gradient[interpolant].Flat, state.gradient[interpolant].Flat,
false /* is pointcoord */,
!state.gradient[interpolant].NoPerspective, 0); !state.gradient[interpolant].NoPerspective, 0);
} }
...@@ -462,38 +458,15 @@ namespace sw ...@@ -462,38 +458,15 @@ namespace sw
routine = function("SetupRoutine"); routine = function("SetupRoutine");
} }
void SetupRoutine::setupGradient(Pointer<Byte> &primitive, Pointer<Byte> &triangle, Float4 &w012, Float4 (&m)[3], Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2, int attribute, int planeEquation, bool flat, bool sprite, bool perspective, int component) void SetupRoutine::setupGradient(Pointer<Byte> &primitive, Pointer<Byte> &triangle, Float4 &w012, Float4 (&m)[3], Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2, int attribute, int planeEquation, bool flat, bool perspective, int component)
{ {
Float4 i;
if(!flat) if(!flat)
{ {
if(!sprite) Float4 i;
{ i.x = *Pointer<Float>(v0 + attribute);
i.x = *Pointer<Float>(v0 + attribute); i.y = *Pointer<Float>(v1 + attribute);
i.y = *Pointer<Float>(v1 + attribute); i.z = *Pointer<Float>(v2 + attribute);
i.z = *Pointer<Float>(v2 + attribute); i.w = 0;
i.w = 0;
}
else
{
if(component == 0) i.x = 0.5f;
if(component == 1) i.x = 0.5f;
if(component == 2) i.x = 0.0f;
if(component == 3) i.x = 1.0f;
if(component == 0) i.y = 1.0f;
if(component == 1) i.y = 0.5f;
if(component == 2) i.y = 0.0f;
if(component == 3) i.y = 1.0f;
if(component == 0) i.z = 0.5f;
if(component == 1) i.z = 1.0f;
if(component == 2) i.z = 0.0f;
if(component == 3) i.z = 1.0f;
i.w = 0;
}
if(!perspective) if(!perspective)
{ {
......
...@@ -33,7 +33,7 @@ namespace sw ...@@ -33,7 +33,7 @@ namespace sw
Routine *getRoutine(); Routine *getRoutine();
private: private:
void setupGradient(Pointer<Byte> &primitive, Pointer<Byte> &triangle, Float4 &w012, Float4 (&m)[3], Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2, int attribute, int planeEquation, bool flatShading, bool sprite, bool perspective, int component); void setupGradient(Pointer<Byte> &primitive, Pointer<Byte> &triangle, Float4 &w012, Float4 (&m)[3], Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2, int attribute, int planeEquation, bool flatShading, bool perspective, int component);
void edge(Pointer<Byte> &primitive, Pointer<Byte> &data, const Int &Xa, const Int &Ya, const Int &Xb, const Int &Yb, Int &q); void edge(Pointer<Byte> &primitive, Pointer<Byte> &data, const Int &Xa, const Int &Ya, const Int &Xb, const Int &Yb, Int &q);
void conditionalRotate1(Bool condition, Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2); void conditionalRotate1(Bool condition, Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2);
void conditionalRotate2(Bool condition, Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2); void conditionalRotate2(Bool condition, Pointer<Byte> &v0, Pointer<Byte> &v1, Pointer<Byte> &v2);
......
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