diff --git a/src/ObjLoading/Techset/TechniqueDefinition.cpp b/src/ObjLoading/Techset/TechniqueDefinition.cpp deleted file mode 100644 index 6d6351c9..00000000 --- a/src/ObjLoading/Techset/TechniqueDefinition.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "TechniqueDefinition.h" - -using namespace techset; - -ShaderArgumentLiteralConstant::ShaderArgumentLiteralConstant() - : m_value{} -{ -} - -ShaderArgumentLiteralConstant::ShaderArgumentLiteralConstant(const float v0, const float v1, const float v2, const float v3) - : m_value{v0, v1, v2, v3} -{ -} - -ShaderArgumentLiteralConstant::ShaderArgumentLiteralConstant(float value[4]) - : m_value{value[0], value[1], value[2], value[3]} -{ -} - -bool techset::operator<(const ShaderArgumentLiteralConstant& lhs, const ShaderArgumentLiteralConstant& rhs) -{ - if (lhs.m_value[0] < rhs.m_value[0]) - return true; - if (lhs.m_value[0] > rhs.m_value[0]) - return false; - if (lhs.m_value[1] < rhs.m_value[1]) - return true; - if (lhs.m_value[1] > rhs.m_value[1]) - return false; - if (lhs.m_value[2] < rhs.m_value[2]) - return true; - if (lhs.m_value[2] > rhs.m_value[2]) - return false; - if (lhs.m_value[3] < rhs.m_value[3]) - return true; - if (lhs.m_value[3] > rhs.m_value[3]) - return false; - return false; -} - -bool techset::operator<=(const ShaderArgumentLiteralConstant& lhs, const ShaderArgumentLiteralConstant& rhs) -{ - return !(rhs < lhs); -} - -bool techset::operator>(const ShaderArgumentLiteralConstant& lhs, const ShaderArgumentLiteralConstant& rhs) -{ - return rhs < lhs; -} - -bool techset::operator>=(const ShaderArgumentLiteralConstant& lhs, const ShaderArgumentLiteralConstant& rhs) -{ - return !(lhs < rhs); -} diff --git a/src/ObjLoading/Techset/TechniqueDefinition.h b/src/ObjLoading/Techset/TechniqueDefinition.h deleted file mode 100644 index 3be432e1..00000000 --- a/src/ObjLoading/Techset/TechniqueDefinition.h +++ /dev/null @@ -1,70 +0,0 @@ -#pragma once - -#include -#include -#include - -namespace techset -{ - enum class ShaderArgumentType - { - CODE_CONSTANT, - LITERAL_CONSTANT, - MATERIAL_CONSTANT - }; - - class ShaderArgumentLiteralConstant - { - public: - float m_value[4]; - - ShaderArgumentLiteralConstant(); - ShaderArgumentLiteralConstant(float v0, float v1, float v2, float v3); - explicit ShaderArgumentLiteralConstant(float value[4]); - - friend bool operator<(const ShaderArgumentLiteralConstant& lhs, const ShaderArgumentLiteralConstant& rhs); - friend bool operator<=(const ShaderArgumentLiteralConstant& lhs, const ShaderArgumentLiteralConstant& rhs); - friend bool operator>(const ShaderArgumentLiteralConstant& lhs, const ShaderArgumentLiteralConstant& rhs); - friend bool operator>=(const ShaderArgumentLiteralConstant& lhs, const ShaderArgumentLiteralConstant& rhs); - }; - - class ShaderArgumentDefinition - { - public: - ShaderArgumentType m_type; - std::string m_shader_argument_name; - size_t m_shader_argument_index; - - std::vector m_code_constant_accessors; - - ShaderArgumentLiteralConstant m_literal_constant; - - bool m_material_constant_is_hash; - size_t m_material_constant_hash; - std::string m_material_constant_name; - }; - - class ShaderDefinition - { - public: - size_t m_version_major; - size_t m_version_minor; - std::string m_shader_name; - std::vector m_arguments; - }; - - class VertexStreamRoutingDefinition - { - std::string m_destination_name; - std::string m_source_name; - }; - - class TechniqueDefinition - { - public: - std::string m_state_map; - std::unique_ptr m_vertex_shader; - std::unique_ptr m_pixel_shader; - std::vector m_vertex_stream_routing; - }; -} diff --git a/src/ObjLoading/Techset/TechniqueDefinitionAcceptor.cpp b/src/ObjLoading/Techset/TechniqueDefinitionAcceptor.cpp index ae209e17..6aad707a 100644 --- a/src/ObjLoading/Techset/TechniqueDefinitionAcceptor.cpp +++ b/src/ObjLoading/Techset/TechniqueDefinitionAcceptor.cpp @@ -48,40 +48,43 @@ ShaderArgumentLiteralSource::ShaderArgumentLiteralSource(float value[4]) { } -bool techset::operator<(const ShaderArgumentLiteralSource& lhs, const ShaderArgumentLiteralSource& rhs) +namespace techset { - if (lhs.m_value[0] < rhs.m_value[0]) - return true; - if (lhs.m_value[0] > rhs.m_value[0]) + bool operator<(const ShaderArgumentLiteralSource& lhs, const ShaderArgumentLiteralSource& rhs) + { + if (lhs.m_value[0] < rhs.m_value[0]) + return true; + if (lhs.m_value[0] > rhs.m_value[0]) + return false; + if (lhs.m_value[1] < rhs.m_value[1]) + return true; + if (lhs.m_value[1] > rhs.m_value[1]) + return false; + if (lhs.m_value[2] < rhs.m_value[2]) + return true; + if (lhs.m_value[2] > rhs.m_value[2]) + return false; + if (lhs.m_value[3] < rhs.m_value[3]) + return true; + if (lhs.m_value[3] > rhs.m_value[3]) + return false; return false; - if (lhs.m_value[1] < rhs.m_value[1]) - return true; - if (lhs.m_value[1] > rhs.m_value[1]) - return false; - if (lhs.m_value[2] < rhs.m_value[2]) - return true; - if (lhs.m_value[2] > rhs.m_value[2]) - return false; - if (lhs.m_value[3] < rhs.m_value[3]) - return true; - if (lhs.m_value[3] > rhs.m_value[3]) - return false; - return false; -} + } -bool techset::operator<=(const ShaderArgumentLiteralSource& lhs, const ShaderArgumentLiteralSource& rhs) -{ - return !(rhs < lhs); -} + bool operator<=(const ShaderArgumentLiteralSource& lhs, const ShaderArgumentLiteralSource& rhs) + { + return !(rhs < lhs); + } -bool techset::operator>(const ShaderArgumentLiteralSource& lhs, const ShaderArgumentLiteralSource& rhs) -{ - return rhs < lhs; -} + bool operator>(const ShaderArgumentLiteralSource& lhs, const ShaderArgumentLiteralSource& rhs) + { + return rhs < lhs; + } -bool techset::operator>=(const ShaderArgumentLiteralSource& lhs, const ShaderArgumentLiteralSource& rhs) -{ - return !(lhs < rhs); + bool operator>=(const ShaderArgumentLiteralSource& lhs, const ShaderArgumentLiteralSource& rhs) + { + return !(lhs < rhs); + } } ShaderArgumentMaterialSource::ShaderArgumentMaterialSource()