forked from doitsujin/dxvk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdxbc_common.cpp
32 lines (25 loc) · 1.42 KB
/
dxbc_common.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
#include "dxbc_common.h"
namespace dxvk {
VkShaderStageFlagBits DxbcProgramVersion::shaderStage() const {
switch (m_type) {
case DxbcProgramType::PixelShader : return VK_SHADER_STAGE_FRAGMENT_BIT;
case DxbcProgramType::VertexShader : return VK_SHADER_STAGE_VERTEX_BIT;
case DxbcProgramType::GeometryShader : return VK_SHADER_STAGE_GEOMETRY_BIT;
case DxbcProgramType::HullShader : return VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT;
case DxbcProgramType::DomainShader : return VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT;
case DxbcProgramType::ComputeShader : return VK_SHADER_STAGE_COMPUTE_BIT;
}
throw DxvkError("DxbcProgramVersion::shaderStage: Unsupported program type");
}
spv::ExecutionModel DxbcProgramVersion::executionModel() const {
switch (m_type) {
case DxbcProgramType::PixelShader : return spv::ExecutionModelFragment;
case DxbcProgramType::VertexShader : return spv::ExecutionModelVertex;
case DxbcProgramType::GeometryShader : return spv::ExecutionModelGeometry;
case DxbcProgramType::HullShader : return spv::ExecutionModelTessellationControl;
case DxbcProgramType::DomainShader : return spv::ExecutionModelTessellationEvaluation;
case DxbcProgramType::ComputeShader : return spv::ExecutionModelGLCompute;
}
throw DxvkError("DxbcProgramVersion::executionModel: Unsupported program type");
}
}