MCPcopy Create free account
hub / github.com/crownengine/crown / createEmbeddedShader

Function createEmbeddedShader

3rdparty/bgfx/src/bgfx.cpp:476–501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

474 };
475
476 ShaderHandle createEmbeddedShader(const EmbeddedShader* _es, RendererType::Enum _type, const char* _name)
477 {
478 for (const EmbeddedShader* es = _es; NULL != es->name; ++es)
479 {
480 if (0 == bx::strCmp(_name, es->name) )
481 {
482 for (const EmbeddedShader::Data* esd = es->data; RendererType::Count != esd->type; ++esd)
483 {
484 if (_type == esd->type
485 && 1 < esd->size)
486 {
487 ShaderHandle handle = createShader(makeRef(esd->data, esd->size) );
488 if (isValid(handle) )
489 {
490 setName(handle, _name);
491 }
492
493 return handle;
494 }
495 }
496 }
497 }
498
499 ShaderHandle handle = BGFX_INVALID_HANDLE;
500 return handle;
501 }
502
503 void dump(const VertexLayout& _layout)
504 {

Callers 1

initMethod · 0.85

Calls 5

strCmpFunction · 0.85
createShaderFunction · 0.85
makeRefFunction · 0.85
setNameFunction · 0.85
isValidFunction · 0.70

Tested by

no test coverage detected