Replace Shader,VertexShader,PixelShader with SpirvShader
Also deletes tons of fixed-function-centric stuff that will never be
used by the Vulkan backend. Very little of the SPIRV integration
actually does anything interesting yet (we don't generate code) but this
wires on the new shader representation.
Bug: b/120799499
Change-Id: Ib76e2086113098aebd526a0da461689d4344e8c2
Reviewed-on: https://swiftshader-review.googlesource.com/c/23090
Tested-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
diff --git a/src/Pipeline/VertexRoutine.cpp b/src/Pipeline/VertexRoutine.cpp
index f0bfc2a..7d76dbe 100644
--- a/src/Pipeline/VertexRoutine.cpp
+++ b/src/Pipeline/VertexRoutine.cpp
@@ -14,7 +14,6 @@
#include "VertexRoutine.hpp"
-#include "VertexShader.hpp"
#include "Constants.hpp"
#include "Device/Vertex.hpp"
#include "Device/Renderer.hpp"
@@ -23,13 +22,11 @@
namespace sw
{
- extern bool halfIntegerCoordinates; // Pixel centers are not at integer coordinates
- extern bool symmetricNormalizedDepth; // [-1, 1] instead of [0, 1]
-
- VertexRoutine::VertexRoutine(const VertexProcessor::State &state, const VertexShader *shader)
- : v(shader && shader->indirectAddressableInput),
- o(shader && shader->indirectAddressableOutput),
- state(state)
+ VertexRoutine::VertexRoutine(const VertexProcessor::State &state, SpirvShader const *spirvShader)
+ : v(true), /* TODO: indirect addressable */
+ o(true),
+ state(state),
+ spirvShader(spirvShader)
{
}
@@ -63,7 +60,6 @@
readInput(indexQ);
program(indexQ);
- postTransform();
computeClipFlags();
Pointer<Byte> cacheLine0 = vertexCache + tagIndex * UInt((int)sizeof(Vertex));
@@ -74,18 +70,6 @@
Pointer<Byte> cacheLine = vertexCache + cacheIndex * UInt((int)sizeof(Vertex));
writeVertex(vertex, cacheLine);
- if(state.transformFeedbackEnabled != 0)
- {
- transformFeedback(vertex, primitiveNumber, indexInPrimitive);
-
- indexInPrimitive++;
- If(indexInPrimitive == 3)
- {
- primitiveNumber++;
- indexInPrimitive = 0;
- }
- }
-
vertex += sizeof(Vertex);
batch += sizeof(unsigned int);
vertexCount--;
@@ -603,17 +587,6 @@
return v;
}
- void VertexRoutine::postTransform()
- {
- int pos = state.positionRegister;
-
- if(!halfIntegerCoordinates)
- {
- o[pos].x = o[pos].x + *Pointer<Float4>(data + OFFSET(DrawData,halfPixelX)) * o[pos].w;
- o[pos].y = o[pos].y + *Pointer<Float4>(data + OFFSET(DrawData,halfPixelY)) * o[pos].w;
- }
- }
-
void VertexRoutine::writeCache(Pointer<Byte> &cacheLine)
{
Vector4f v;
@@ -719,38 +692,4 @@
*Pointer<Int4>(vertex + OFFSET(Vertex,X)) = *Pointer<Int4>(cache + OFFSET(Vertex,X));
*Pointer<Int>(vertex + OFFSET(Vertex,clipFlags)) = *Pointer<Int>(cache + OFFSET(Vertex,clipFlags));
}
-
- void VertexRoutine::transformFeedback(const Pointer<Byte> &vertex, const UInt &primitiveNumber, const UInt &indexInPrimitive)
- {
- If(indexInPrimitive < state.verticesPerPrimitive)
- {
- UInt tOffset = primitiveNumber * state.verticesPerPrimitive + indexInPrimitive;
-
- for(int i = 0; i < MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS; i++)
- {
- if(state.transformFeedbackEnabled & (1ULL << i))
- {
- UInt reg = *Pointer<UInt>(data + OFFSET(DrawData, vs.reg[i]));
- UInt row = *Pointer<UInt>(data + OFFSET(DrawData, vs.row[i]));
- UInt col = *Pointer<UInt>(data + OFFSET(DrawData, vs.col[i]));
- UInt str = *Pointer<UInt>(data + OFFSET(DrawData, vs.str[i]));
-
- Pointer<Byte> t = *Pointer<Pointer<Byte>>(data + OFFSET(DrawData, vs.t[i])) + (tOffset * str * sizeof(float));
- Pointer<Byte> v = vertex + OFFSET(Vertex, v) + reg * sizeof(float);
-
- For(UInt r = 0, r < row, r++)
- {
- UInt rOffsetX = r * col * sizeof(float);
- UInt rOffset4 = r * sizeof(float4);
-
- For(UInt c = 0, c < col, c++)
- {
- UInt cOffset = c * sizeof(float);
- *Pointer<Float>(t + rOffsetX + cOffset) = *Pointer<Float>(v + rOffset4 + cOffset);
- }
- }
- }
- }
- }
- }
}