gl_VertexID implementation This cl implements support for gl_VertexID. Passes the functional.shaders.builtin_variable.vertex_id test. Change-Id: I5550e3ecba30e29f1e38ace608d730833a1e9598 Reviewed-on: https://swiftshader-review.googlesource.com/10958 Tested-by: Alexis Hétu <sugoi@google.com> Reviewed-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/Shader/VertexShader.hpp b/src/Shader/VertexShader.hpp index 0ca7b93..9a9a0a6 100644 --- a/src/Shader/VertexShader.hpp +++ b/src/Shader/VertexShader.hpp
@@ -45,6 +45,7 @@ void setPositionRegister(int posReg); void setPointSizeRegister(int ptSizeReg); void declareInstanceId() { instanceIdDeclared = true; } + void declareVertexId() { vertexIdDeclared = true; } const Semantic& getInput(int inputIdx) const; const Semantic& getOutput(int outputIdx, int component) const; @@ -52,6 +53,7 @@ int getPositionRegister() const { return positionRegister; } int getPointSizeRegister() const { return pointSizeRegister; } bool isInstanceIdDeclared() const { return instanceIdDeclared; } + bool isVertexIdDeclared() const { return vertexIdDeclared; } private: void analyze(); @@ -68,6 +70,7 @@ int pointSizeRegister; bool instanceIdDeclared; + bool vertexIdDeclared; bool textureSampling; }; }