Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __SP_DIRECT3D11_SHADERCLASS_H__
00009 #define __SP_DIRECT3D11_SHADERCLASS_H__
00010
00011
00012 #include "Base/spStandard.hpp"
00013
00014 #if defined(SP_COMPILE_WITH_DIRECT3D11)
00015
00016
00017 #include "RenderSystem/spShaderProgram.hpp"
00018
00019 #include <d3d11.h>
00020 #include <d3d11Shader.h>
00021 #include <d3dcompiler.h>
00022 #include <map>
00023
00024
00025 namespace sp
00026 {
00027 namespace video
00028 {
00029
00030
00031 class SP_EXPORT Direct3D11ComputeShaderIO : public ComputeShaderIO
00032 {
00033
00034 public:
00035
00036 Direct3D11ComputeShaderIO();
00037 ~Direct3D11ComputeShaderIO();
00038
00039
00040
00041 u32 addInputBuffer(u32 BufferSize, u32 Count, void* InitData = 0);
00042 u32 addOutputBuffer(u32 BufferSize, u32 Count);
00043
00044 void setBuffer(const u32 Index, const void* InputBuffer);
00045 bool getBuffer(const u32 Index, void* OutputBuffer);
00046
00047 private:
00048
00049 friend class Direct3D11RenderSystem;
00050
00051
00052
00053 std::vector<ID3D11ShaderResourceView*> InputBuffers_;
00054 std::vector<ID3D11UnorderedAccessView*> OutputBuffers_;
00055 std::vector<ID3D11Buffer*> StructuredBuffers_;
00056
00057 };
00058
00059
00060 class SP_EXPORT Direct3D11ShaderClass : public ShaderClass
00061 {
00062
00063 public:
00064
00065 Direct3D11ShaderClass(VertexFormat* VertexInputLayout = 0);
00066 ~Direct3D11ShaderClass();
00067
00068 void bind(const scene::MaterialNode* Object = 0);
00069 void unbind();
00070
00071 bool link();
00072
00073 private:
00074
00075 friend class Direct3D11Shader;
00076 friend class Direct3D11RenderSystem;
00077
00078
00079
00080 ID3D11DeviceContext* D3DDeviceContext_;
00081
00082 ID3D11VertexShader* VertexShaderObject_;
00083 ID3D11PixelShader* PixelShaderObject_;
00084 ID3D11GeometryShader* GeometryShaderObject_;
00085 ID3D11HullShader* HullShaderObject_;
00086 ID3D11DomainShader* DomainShaderObject_;
00087 ID3D11ComputeShader* ComputeShaderObject_;
00088
00089 std::vector<ID3D11Buffer*>* VertexConstantBuffers_;
00090 std::vector<ID3D11Buffer*>* PixelConstantBuffers_;
00091 std::vector<ID3D11Buffer*>* GeometryConstantBuffers_;
00092 std::vector<ID3D11Buffer*>* HullConstantBuffers_;
00093 std::vector<ID3D11Buffer*>* DomainConstantBuffers_;
00094 std::vector<ID3D11Buffer*>* ComputeConstantBuffers_;
00095
00096 ID3D11InputLayout* InputVertexLayout_;
00097 VertexFormat* VertexFormat_;
00098
00099 };
00100
00101
00102 }
00103
00104 }
00105
00106
00107 #endif
00108
00109 #endif
00110
00111
00112
00113