17 #include <ht_platform.h> 18 #include <ht_directx.h> 19 #include <ht_d3d11types.h> 20 #include <ht_shader.h> 21 #include <unordered_map> 31 typedef std::unordered_map<std::string, ConstantBuffer*> ConstantBufferTable;
32 typedef std::unordered_map<std::string, uint32_t> TextureTable;
33 typedef std::unordered_map<std::string, uint32_t> SampleTable;
34 typedef std::unordered_map<std::string, ConstantBufferVariable> ConstantBufferVariableTable;
36 D3D11Shader(ID3D11Device* device, ID3D11DeviceContext* context);
40 bool VInitFromFile(Core::File* file)
override;
42 void VOnLoaded()
override;
44 bool VSetData(std::string name,
const void* data,
size_t size)
override;
45 bool VSetInt(std::string name,
int data)
override;
46 bool VSetFloat(std::string name,
float data)
override;
47 bool VSetFloat2(std::string name, Math::Vector2 data)
override;
48 bool VSetFloat3(std::string name, Math::Vector3 data)
override;
49 bool VSetFloat4(std::string name, Math::Vector4 data)
override;
50 bool VSetMatrix3(std::string name, Math::Matrix3 data)
override;
51 bool VSetMatrix4(std::string name, Math::Matrix4 data)
override;
58 uint32_t m_constantBufferCount;
60 ConstantBufferVariableTable m_constantBufferVarTable;
61 SampleTable m_sampleTable;
62 TextureTable m_textureTable;
64 ID3D11Device* m_device;
65 ID3D11DeviceContext* m_context;
67 ID3D11ShaderReflection* m_reflection;
74 int32_t FindTextureBindIndex(std::string name);
75 int32_t FindSampleBindIndex(std::string name);
77 void UpdateAllBuffers();
80 virtual void VBind() = 0;
81 virtual void VUnbind() = 0;
82 virtual bool VInitShader() = 0;
84 virtual bool VSetShaderResourceView(std::string name, ID3D11ShaderResourceView* rv) = 0;
85 virtual bool VSetSamplerState(std::string name, ID3D11SamplerState* ss) = 0;
Definition: ht_d3d11types.h:28
Hatchit Engine Copyright(c) 2015-2016 Third-Degree.
Hatchit Engine Copyright(c) 2015-2016 Third-Degree.
Definition: ht_color.h:19
Definition: ht_d3d11shader.h:29
Definition: ht_d3d11types.h:36