3#include <d3d11shader.h>
22 void Set(
const std::string& name,
const void* data,
size_t bytes);
23 template<
class T>
void Set(
const std::string& name,
const T& value) {
Set(name, &value,
sizeof(value)); }
28 const auto found=
values.find(name);
if(found==
values.end())
return true;
29 for(
unsigned char byte:found->second.data)
if(
byte)
return false;
32 void Texture(
const std::string& name, ID3D11ShaderResourceView* value);
33 ID3D11ShaderResourceView*
Texture(
const std::string& name)
const
34 {
const auto found=
textures.find(name);
return found==
textures.end() ? nullptr : found->second.resource.Get(); }
35 void Sampler(
const std::string& name, ID3D11SamplerState* value);
42 Microsoft::WRL::ComPtr<ID3D11ShaderResourceView>
resource;
43 D3D11_SRV_DIMENSION
dimension = D3D11_SRV_DIMENSION_UNKNOWN;
52 std::map<std::string, Microsoft::WRL::ComPtr<ID3D11SamplerState>>
samplers;
58 HRESULT Create(ID3D11Device* device,
const void* vertexCode,
size_t vertexSize,
59 const void* pixelCode,
size_t pixelSize,
60 const D3D11_INPUT_ELEMENT_DESC* elements =
nullptr, UINT elementCount = 0,
75 D3D_SHADER_VARIABLE_CLASS
typeClass = D3D_SVC_SCALAR;
85 Microsoft::WRL::ComPtr<ID3D11Buffer>
buffer;
91 D3D_SRV_DIMENSION
dimension = D3D_SRV_DIMENSION_UNKNOWN;
93 const Microsoft::WRL::ComPtr<ID3D11SamplerState>*
sampler =
nullptr;
106 Microsoft::WRL::ComPtr<ID3D11VertexShader>
vertex;
107 Microsoft::WRL::ComPtr<ID3D11PixelShader>
pixel;
108 Microsoft::WRL::ComPtr<ID3D11InputLayout>
layout;
HRESULT(WINAPI *CUniBuffer::_ScriptApplyDigitSubstitution)(const SCRIPT_DIGITSUBSTITUTE *
Parameters11 & operator=(const Parameters11 &other)
std::map< std::string, Value > values
void Set(const std::string &name, const void *data, size_t bytes)
std::map< std::string, Microsoft::WRL::ComPtr< ID3D11SamplerState > > samplers
ID3D11ShaderResourceView * Texture(const std::string &name) const
std::map< std::string, TextureValue > textures
void Set(const std::string &name, const T &value)
void Texture(const std::string &name, ID3D11ShaderResourceView *value)
bool ZeroOrUnset(const std::string &name) const
void Sampler(const std::string &name, ID3D11SamplerState *value)
HRESULT Create(ID3D11Device *device, const void *vertexCode, size_t vertexSize, const void *pixelCode, size_t pixelSize, const D3D11_INPUT_ELEMENT_DESC *elements=nullptr, UINT elementCount=0, UINT bgraColorMask=0)
Microsoft::WRL::ComPtr< ID3D11InputLayout > layout
HRESULT Reflect(ID3D11Device *device, const void *code, size_t size, Stage &stage)
HRESULT BindStage(ID3D11DeviceContext *context, const Parameters11 ¶meters, Stage &stage, bool vertexStage)
Microsoft::WRL::ComPtr< ID3D11VertexShader > vertex
Microsoft::WRL::ComPtr< ID3D11PixelShader > pixel
const std::string & Status() const
HRESULT Bind(ID3D11DeviceContext *context, const Parameters11 ¶meters)
HRESULT Error(const std::string &message, HRESULT hr)
D3D11_SRV_DIMENSION dimension
Microsoft::WRL::ComPtr< ID3D11ShaderResourceView > resource
std::vector< unsigned char > data
std::vector< unsigned char > data
Microsoft::WRL::ComPtr< ID3D11Buffer > buffer
std::vector< Variable > variables
std::vector< unsigned char > defaults
std::vector< unsigned char > packed
D3D_SRV_DIMENSION dimension
const Microsoft::WRL::ComPtr< ID3D11SamplerState > * sampler
const Parameters11::TextureValue * texture
std::vector< ConstantBuffer > constants
std::vector< Resource > samplers
std::vector< Resource > textures
const Parameters11::Value * source
D3D_SHADER_VARIABLE_CLASS typeClass