fix compilation issues

This commit is contained in:
Jan 2022-03-27 16:28:25 +02:00
parent 99d5caf1f2
commit 7c9805b4ba
3 changed files with 32 additions and 153 deletions

View File

@ -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);
}

View File

@ -1,70 +0,0 @@
#pragma once
#include <memory>
#include <string>
#include <vector>
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<std::string> 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<ShaderArgumentDefinition> 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<ShaderDefinition> m_vertex_shader;
std::unique_ptr<ShaderDefinition> m_pixel_shader;
std::vector<VertexStreamRoutingDefinition> m_vertex_stream_routing;
};
}

View File

@ -48,7 +48,9 @@ ShaderArgumentLiteralSource::ShaderArgumentLiteralSource(float value[4])
{
}
bool techset::operator<(const ShaderArgumentLiteralSource& lhs, const ShaderArgumentLiteralSource& rhs)
namespace techset
{
bool operator<(const ShaderArgumentLiteralSource& lhs, const ShaderArgumentLiteralSource& rhs)
{
if (lhs.m_value[0] < rhs.m_value[0])
return true;
@ -69,20 +71,21 @@ bool techset::operator<(const ShaderArgumentLiteralSource& lhs, const ShaderArgu
return false;
}
bool techset::operator<=(const ShaderArgumentLiteralSource& lhs, const ShaderArgumentLiteralSource& rhs)
bool operator<=(const ShaderArgumentLiteralSource& lhs, const ShaderArgumentLiteralSource& rhs)
{
return !(rhs < lhs);
}
bool techset::operator>(const ShaderArgumentLiteralSource& lhs, const ShaderArgumentLiteralSource& rhs)
bool operator>(const ShaderArgumentLiteralSource& lhs, const ShaderArgumentLiteralSource& rhs)
{
return rhs < lhs;
}
bool techset::operator>=(const ShaderArgumentLiteralSource& lhs, const ShaderArgumentLiteralSource& rhs)
bool operator>=(const ShaderArgumentLiteralSource& lhs, const ShaderArgumentLiteralSource& rhs)
{
return !(lhs < rhs);
}
}
ShaderArgumentMaterialSource::ShaderArgumentMaterialSource()
: m_is_hash(false),