| 87 | } |
| 88 | |
| 89 | std::shared_ptr<ComputeProgram> HLSLProgramFactory::CreateFromNamedSource( |
| 90 | std::string const& csName, std::string const& csSource) |
| 91 | { |
| 92 | LogAssert(csSource != "", "A program must have a compute shader."); |
| 93 | |
| 94 | HLSLReflection hlslCShader = HLSLShaderFactory::CreateFromString(csName, |
| 95 | csSource, csEntry, std::string("cs_") + version, defines, flags); |
| 96 | if (hlslCShader.IsValid()) |
| 97 | { |
| 98 | auto cshader = std::make_shared<HLSLShader>(hlslCShader, GT_COMPUTE_SHADER); |
| 99 | auto program = std::make_shared<HLSLComputeProgram>(); |
| 100 | program->SetComputeShader(cshader); |
| 101 | return program; |
| 102 | } |
| 103 | else |
| 104 | { |
| 105 | return nullptr; |
| 106 | } |
| 107 | } |
| 108 | |
| 109 | std::shared_ptr<VisualProgram> HLSLProgramFactory::CreateFromNamedSources( |
| 110 | std::string const& vsName, std::string const& vsSource, |
nothing calls this directly
no test coverage detected