123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165 |
- #pragma once
- #include "Array.h"
- struct ID3D10Blob;
- struct ID3D11PixelShader;
- struct ID3D11VertexShader;
- struct ID3D11Device;
- struct ID3D11DeviceContext;
- struct D3D11_INPUT_ELEMENT_DESC;
- struct ID3D11Buffer;
- struct ID3D11InputLayout;
- namespace Framework
- {
- class Text;
- class DXBuffer;
- class DX12CopyCommandQueue;
- class DX12DirectCommandQueue;
- enum ShaderType
- {
- UNBEKANNT,
- VERTEX,
- PIXEL
- };
-
- class Shader : public virtual ReferenceCounter
- {
- protected:
- ShaderType type;
- RCArray<DXBuffer>* constBuffers;
- public:
-
- DLLEXPORT Shader();
-
- DLLEXPORT virtual ~Shader();
-
-
-
-
-
-
- virtual bool setCompiledByteArray(unsigned char* bytes, int length) = 0;
-
-
-
-
- virtual void benutzeShader() = 0;
-
-
-
-
-
-
-
- virtual bool erstelleConstBuffer(int size, int index) = 0;
-
-
-
- DLLEXPORT bool removeConstBuffer(int index);
-
-
-
-
-
-
-
- DLLEXPORT bool füllConstBuffer(char* data, int index, int len = -1);
-
-
- DLLEXPORT int getConstBufferLänge(int index) const;
-
- DLLEXPORT ShaderType getType() const;
-
- DLLEXPORT int getFirstUninitializedBufferIndex() const;
- };
- class DX11Shader : public Shader
- {
- protected:
- ID3D11Device* device;
- ID3D11DeviceContext* context;
- public:
- DLLEXPORT DX11Shader(
- ID3D11Device* device, ID3D11DeviceContext* context);
- DLLEXPORT virtual ~DX11Shader();
-
-
-
-
-
-
-
- DLLEXPORT virtual bool erstelleConstBuffer(
- int size, int index) override;
- };
-
- class DX11PixelShader : public DX11Shader
- {
- private:
- ID3D11PixelShader* pixelShader;
- public:
-
- DLLEXPORT DX11PixelShader(
- ID3D11Device* device, ID3D11DeviceContext* context);
-
- DLLEXPORT ~DX11PixelShader();
-
-
-
-
-
-
- DLLEXPORT bool setCompiledByteArray(
- unsigned char* bytes, int length) override;
-
-
-
-
- DLLEXPORT void benutzeShader() override;
- };
-
- class DX11VertexShader : public DX11Shader
- {
- private:
- ID3D11VertexShader* vertexShader;
- ID3D11InputLayout* inputLayout;
- unsigned char* shaderByteBuffer;
- int byteBufferSize;
- public:
-
- DLLEXPORT DX11VertexShader(
- ID3D11Device* device, ID3D11DeviceContext* context);
-
- DLLEXPORT ~DX11VertexShader();
-
-
-
-
-
-
- DLLEXPORT bool setCompiledByteArray(
- unsigned char* bytes, int length) override;
-
-
-
-
-
- DLLEXPORT bool erstelleInputLayout(
- D3D11_INPUT_ELEMENT_DESC* descArray, int anz);
-
-
-
-
- DLLEXPORT void benutzeShader() override;
- };
- }
|