MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / AssertCreateShaderProgram

Method AssertCreateShaderProgram

deps/LLGL/sources/Renderer/RenderSystem.cpp:338–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

336}
337
338void RenderSystem::AssertCreateShaderProgram(const ShaderProgramDescriptor& desc)
339{
340 AssertShaderType(desc.vertexShader, "vertexShader", ShaderType::Vertex, "Vertex" );
341 AssertShaderType(desc.tessControlShader, "tessControlShader", ShaderType::TessControl, "TessControl" );
342 AssertShaderType(desc.tessEvaluationShader, "tessEvaluationShader", ShaderType::TessEvaluation, "TessEvaluation");
343 AssertShaderType(desc.geometryShader, "geometryShader", ShaderType::Geometry, "Geometry" );
344 AssertShaderType(desc.fragmentShader, "fragmentShader", ShaderType::Fragment, "Fragment" );
345 AssertShaderType(desc.computeShader, "computeShader", ShaderType::Compute, "Compute" );
346
347 if (desc.computeShader != nullptr)
348 {
349 if ( desc.vertexShader != nullptr ||
350 desc.tessControlShader != nullptr ||
351 desc.tessEvaluationShader != nullptr ||
352 desc.geometryShader != nullptr ||
353 desc.fragmentShader != nullptr )
354 {
355 throw std::invalid_argument(
356 "cannot create shader program with 'computeShader' in conjunction with any other shader"
357 );
358 }
359 }
360 else
361 {
362 if (desc.vertexShader == nullptr)
363 throw std::invalid_argument("cannot create shader program without vertex shader");
364
365 if ( ( desc.tessControlShader != nullptr && desc.tessEvaluationShader == nullptr ) ||
366 ( desc.tessControlShader == nullptr && desc.tessEvaluationShader != nullptr ) )
367 {
368 throw std::invalid_argument(
369 "cannot create shader program with 'tessControlShader' and 'tessEvaluationShader' being partially specified"
370 );
371 }
372 }
373}
374
375[[noreturn]]
376static void ErrTooManyColorAttachments(const char* contextInfo)

Callers

nothing calls this directly

Calls 1

AssertShaderTypeFunction · 0.85

Tested by

no test coverage detected