18 ID3D11ClassLinkage* linkage =
nullptr;
19 ID3D11VertexShader* dxShader =
nullptr;
20 HRESULT hr = device->CreateVertexShader(&code[0], code.size(), linkage, &dxShader);
30 return std::make_shared<DX11VertexShader>(
31 reinterpret_cast<ID3D11Device*
>(device),
32 static_cast<Shader const*>(
object));
43 ID3D11ClassInstance* instances[1] = {
nullptr };
44 UINT numInstances = 0;
45 ID3D11VertexShader* dxShader =
static_cast<ID3D11VertexShader*
>(
mDXObject);
46 context->VSSetShader(dxShader, instances, numInstances);
54 ID3D11ClassInstance* instances[1] = {
nullptr };
55 UINT numInstances = 0;
56 ID3D11VertexShader* dxShader =
nullptr;
57 context->VSSetShader(dxShader, instances, numInstances);
62 unsigned int bindPoint, ID3D11Buffer*
buffer)
66 ID3D11Buffer*
buffers[1] = { buffer };
67 context->VSSetConstantBuffers(bindPoint, 1, buffers);
72 unsigned int bindPoint)
76 ID3D11Buffer*
buffers[1] = {
nullptr };
77 context->VSSetConstantBuffers(bindPoint, 1, buffers);
82 unsigned int bindPoint, ID3D11ShaderResourceView* srView)
86 ID3D11ShaderResourceView* views[1] = { srView };
87 context->VSSetShaderResources(bindPoint, 1, views);
92 unsigned int bindPoint)
96 ID3D11ShaderResourceView* views[1] = {
nullptr };
97 context->VSSetShaderResources(bindPoint, 1, views);
102 unsigned int bindPoint, ID3D11UnorderedAccessView* uaView,
103 unsigned int initialCount)
107 ID3D11Device* device =
nullptr;
108 context->GetDevice(&device);
111 LogError(
"Cannot access device of context.");
115 if (device->GetFeatureLevel() == D3D_FEATURE_LEVEL_11_1)
117 ID3D11UnorderedAccessView* uaViews[1] = { uaView };
118 unsigned int initialCounts[1] = { initialCount };
119 context->OMSetRenderTargetsAndUnorderedAccessViews(
120 D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL,
nullptr,
121 nullptr, bindPoint, 1, uaViews, initialCounts);
125 LogError(
"D3D11.1 is required for UAVs in vertex shaders.");
132 unsigned int bindPoint)
136 ID3D11Device* device =
nullptr;
137 context->GetDevice(&device);
140 LogError(
"Cannot access device of context.");
144 if (device->GetFeatureLevel() == D3D_FEATURE_LEVEL_11_1)
146 ID3D11UnorderedAccessView* uaViews[1] = {
nullptr };
147 unsigned int initialCounts[1] = { 0xFFFFFFFFu };
148 context->OMSetRenderTargetsAndUnorderedAccessViews(
149 D3D11_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL,
nullptr,
150 nullptr, bindPoint, 1, uaViews, initialCounts);
154 LogError(
"D3D11.1 is required for UAVs in vertex shaders.");
161 unsigned int bindPoint, ID3D11SamplerState* state)
165 ID3D11SamplerState* states[1] = { state };
166 context->VSSetSamplers(bindPoint, 1, states);
171 unsigned int bindPoint)
175 ID3D11SamplerState* states[1] = {
nullptr };
176 context->VSSetSamplers(bindPoint, 1, states);
virtual void EnableSampler(ID3D11DeviceContext *context, unsigned int bindPoint, ID3D11SamplerState *state) override
virtual void Enable(ID3D11DeviceContext *context) override
virtual void Disable(ID3D11DeviceContext *context) override
#define CHECK_HR_RETURN_NONE(msg)
virtual void EnableUAView(ID3D11DeviceContext *context, unsigned int bindPoint, ID3D11UnorderedAccessView *uaView, unsigned int initialCount) override
GraphicsObjectType GetType() const
virtual void EnableSRView(ID3D11DeviceContext *context, unsigned int bindPoint, ID3D11ShaderResourceView *srView) override
static std::shared_ptr< GEObject > Create(void *device, GraphicsObject const *object)
virtual void DisableSRView(ID3D11DeviceContext *context, unsigned int bindPoint) override
virtual void DisableSampler(ID3D11DeviceContext *context, unsigned int bindPoint) override
#define LogError(message)
DX11VertexShader(ID3D11Device *device, Shader const *shader)
ID3D11DeviceChild * mDXObject
virtual void DisableCBuffer(ID3D11DeviceContext *context, unsigned int bindPoint) override
virtual void DisableUAView(ID3D11DeviceContext *context, unsigned int bindPoint) override
virtual void EnableCBuffer(ID3D11DeviceContext *context, unsigned int bindPoint, ID3D11Buffer *buffer) override
typedef UINT(WINAPI *PFNWGLGETGPUIDSAMDPROC)(UINT maxCount
std::vector< unsigned char > const & GetCompiledCode() const