Shader cleanup
A couple of class members from PixelShader and VertexShader
were still public. Fixed that in this cleanup.
Change-Id: I2dfaac7fd4cecdc791f1ef7236148e74c4b5b486
Reviewed-on: https://swiftshader-review.googlesource.com/5850
Tested-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/Shader/VertexShader.cpp b/src/Shader/VertexShader.cpp
index 733c113..dd62b4b 100644
--- a/src/Shader/VertexShader.cpp
+++ b/src/Shader/VertexShader.cpp
@@ -27,6 +27,7 @@
positionRegister = Pos;
pointSizeRegister = Unused;
instanceIdDeclared = false;
+ textureSampling = false;
for(int i = 0; i < MAX_VERTEX_INPUTS; i++)
{
@@ -59,6 +60,7 @@
positionRegister = Pos;
pointSizeRegister = Unused;
instanceIdDeclared = false;
+ textureSampling = false;
for(int i = 0; i < MAX_VERTEX_INPUTS; i++)
{
@@ -149,6 +151,41 @@
return textureSampling;
}
+ void VertexShader::setInput(int inputIdx, const sw::Shader::Semantic& semantic)
+ {
+ input[inputIdx] = semantic;
+ }
+
+ void VertexShader::setOutput(int outputIdx, int nbComponents, const sw::Shader::Semantic& semantic)
+ {
+ for(int i = 0; i < nbComponents; ++i)
+ {
+ output[outputIdx][i] = semantic;
+ }
+ }
+
+ void VertexShader::setPositionRegister(int posReg)
+ {
+ setOutput(posReg, 4, sw::Shader::Semantic(sw::Shader::USAGE_POSITION, 0));
+ positionRegister = posReg;
+ }
+
+ void VertexShader::setPointSizeRegister(int ptSizeReg)
+ {
+ setOutput(ptSizeReg, 4, sw::Shader::Semantic(sw::Shader::USAGE_PSIZE, 0));
+ pointSizeRegister = ptSizeReg;
+ }
+
+ const sw::Shader::Semantic& VertexShader::getInput(int inputIdx) const
+ {
+ return input[inputIdx];
+ }
+
+ const sw::Shader::Semantic& VertexShader::getOutput(int outputIdx, int component) const
+ {
+ return output[outputIdx][component];
+ }
+
void VertexShader::analyze()
{
analyzeInput();