Rename version to shaderModel In order to avoid creating confusion between shader model and the actual shader's version, as specified by the #version token in a glsl shader, version was renamed to shaderModel. Change-Id: I481b6e3fc43168b504c2f2d9506422a697abc3a2 Reviewed-on: https://swiftshader-review.googlesource.com/14629 Tested-by: Alexis Hétu <sugoi@google.com> Reviewed-by: Alexis Hétu <sugoi@google.com>
diff --git a/src/Shader/Shader.cpp b/src/Shader/Shader.cpp index 34a10f0..f7ce731 100644 --- a/src/Shader/Shader.cpp +++ b/src/Shader/Shader.cpp
@@ -1183,12 +1183,12 @@ int Shader::size(unsigned long opcode) const { - return size(opcode, version); + return size(opcode, shaderModel); } - int Shader::size(unsigned long opcode, unsigned short version) + int Shader::size(unsigned long opcode, unsigned short shaderModel) { - if(version > 0x0300) + if(shaderModel > 0x0300) { ASSERT(false); } @@ -1335,7 +1335,7 @@ opcode != OPCODE_PHASE && opcode != OPCODE_END) { - if(version >= 0x0200) + if(shaderModel >= 0x0200) { length = (opcode & 0x0F000000) >> 24; } @@ -1350,7 +1350,7 @@ ASSERT(false); } - if(version == 0x0104) + if(shaderModel == 0x0104) { switch(opcode & 0x0000FFFF) { @@ -1438,9 +1438,9 @@ return shaderType; } - unsigned short Shader::getVersion() const + unsigned short Shader::getShaderModel() const { - return version; + return shaderModel; } void Shader::print(const char *fileName, ...) const @@ -1456,7 +1456,7 @@ for(const auto &inst : instruction) { - file << inst->string(shaderType, version) << std::endl; + file << inst->string(shaderType, shaderModel) << std::endl; } } @@ -1464,7 +1464,7 @@ { std::ofstream file(fileName, std::ofstream::out | std::ofstream::app); - file << instruction[index]->string(shaderType, version) << std::endl; + file << instruction[index]->string(shaderType, shaderModel) << std::endl; } void Shader::append(Instruction *instruction)