MCPcopy Create free account
hub / github.com/Illation/ETEngine / GetAttributes

Method GetAttributes

Engine/source/EtRendering/GraphicsTypes/Shader.cpp:540–552  ·  view source on GitHub ↗

--------------------------------- ShaderAsset::GetAttributes Extract the vertex attributes from a program, provided it has a vertex shader

Source from the content-addressed store, hash-verified

538// Extract the vertex attributes from a program, provided it has a vertex shader
539//
540void ShaderAsset::GetAttributes(T_ShaderLoc const shaderProgram, std::vector<ShaderData::T_AttributeLocation>& attributes)
541{
542 I_GraphicsApiContext* const api = Viewport::GetCurrentApiContext();
543
544 int32 const count = api->GetAttributeCount(shaderProgram);
545 for (int32 attribIdx = 0; attribIdx < count; ++attribIdx)
546 {
547 AttributeDescriptor info;
548 api->GetActiveAttribute(shaderProgram, static_cast<uint32>(attribIdx), info);
549
550 attributes.emplace_back(api->GetAttributeLocation(shaderProgram, info.name), info);
551 }
552}
553
554
555} // namespace render

Callers 1

MaterialMethod · 0.80

Calls 3

GetAttributeCountMethod · 0.80
GetActiveAttributeMethod · 0.80
GetAttributeLocationMethod · 0.80

Tested by

no test coverage detected