--------------------------------- ShaderAsset::GetAttributes Extract the vertex attributes from a program, provided it has a vertex shader
| 538 | // Extract the vertex attributes from a program, provided it has a vertex shader |
| 539 | // |
| 540 | void 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 |
no test coverage detected