-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGeometryShaderStage.cpp
44 lines (35 loc) · 1.16 KB
/
GeometryShaderStage.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "GeometryShaderStage.h"
#include "GeometryShader.h"
GeometryShaderStage::GeometryShaderStage(ID3D11DeviceContext * context)
: ShaderStage(context)
{
}
bool GeometryShaderStage::BindShader(Shader * shader)
{
const auto geometry_shader = dynamic_cast<GeometryShader*>(shader);
if (geometry_shader == nullptr)
return false;
context_->GSSetShader(geometry_shader->GeometryShaderPtr(), nullptr, 0);
return true;
}
bool GeometryShaderStage::BindConstantBuffers(uint32_t start_slot, uint32_t count, ID3D11Buffer * const * buffers)
{
if (buffers == nullptr || count == 0)
return false;
context_->GSSetConstantBuffers(start_slot, count, buffers);
return true;
}
bool GeometryShaderStage::BindSamplers(uint32_t start_slot, uint32_t count, ID3D11SamplerState * const * samplers)
{
if (samplers == nullptr)
return false;
context_->GSSetSamplers(start_slot, count, samplers);
return true;
}
bool GeometryShaderStage::BindShaderResourceViews(uint32_t start_slot, uint32_t count, ID3D11ShaderResourceView * const * views)
{
if (views == nullptr)
return false;
context_->GSSetShaderResources(start_slot, count, views);
return true;
}