1 // Copyright 2016 The SwiftShader Authors. All Rights Reserved. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef sw_VertexShader_hpp 16 #define sw_VertexShader_hpp 17 18 #include "Shader.hpp" 19 #include "Main/Config.hpp" 20 21 namespace sw 22 { 23 class VertexShader : public Shader 24 { 25 public: 26 explicit VertexShader(const VertexShader *vs = 0); 27 explicit VertexShader(const unsigned long *token); 28 29 virtual ~VertexShader(); 30 31 static int validate(const unsigned long *const token); // Returns number of instructions if valid 32 bool containsTextureSampling() const; 33 34 virtual void analyze(); 35 36 int positionRegister; // FIXME: Private 37 int pointSizeRegister; // FIXME: Private 38 39 bool instanceIdDeclared; 40 41 Semantic input[MAX_VERTEX_INPUTS]; // FIXME: Private 42 Semantic output[MAX_VERTEX_OUTPUTS][4]; // FIXME: Private 43 44 private: 45 void analyzeInput(); 46 void analyzeOutput(); 47 void analyzeTextureSampling(); 48 49 bool textureSampling; 50 }; 51 } 52 53 #endif // sw_VertexShader_hpp 54