MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / CreateFromNamedSource

Method CreateFromNamedSource

GTE/Graphics/DX11/HLSLProgramFactory.cpp:89–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89std::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
109std::shared_ptr<VisualProgram> HLSLProgramFactory::CreateFromNamedSources(
110 std::string const& vsName, std::string const& vsSource,

Callers

nothing calls this directly

Calls 2

SetComputeShaderMethod · 0.80
IsValidMethod · 0.45

Tested by

no test coverage detected