| 453 | } |
| 454 | |
| 455 | bool HLSLShaderFactory::GetVariables( |
| 456 | ID3DShaderReflectionConstantBuffer* cbuffer, |
| 457 | uint32_t numVariables, |
| 458 | std::vector<HLSLBaseBuffer::Member>& members) |
| 459 | { |
| 460 | for (UINT i = 0; i < numVariables; ++i) |
| 461 | { |
| 462 | ID3DShaderReflectionVariable* var = cbuffer->GetVariableByIndex(i); |
| 463 | ID3DShaderReflectionType* varType = var->GetType(); |
| 464 | |
| 465 | D3D_SHADER_VARIABLE_DESC varDesc; |
| 466 | DX11Log(var->GetDesc(&varDesc)); |
| 467 | |
| 468 | D3D_SHADER_TYPE_DESC varTypeDesc; |
| 469 | DX11Log(varType->GetDesc(&varTypeDesc)); |
| 470 | |
| 471 | // Get the top-level information about the shader variable. |
| 472 | HLSLShaderVariable svar; |
| 473 | svar.SetDescription(varDesc); |
| 474 | |
| 475 | // Get the type of the variable. If this is a struct type, the |
| 476 | // call recurses to build the type tree implied by the struct. |
| 477 | HLSLShaderType stype; |
| 478 | stype.SetName(svar.GetName()); |
| 479 | stype.SetDescription(varTypeDesc); |
| 480 | if (!GetTypes(varType, varTypeDesc.Members, stype)) |
| 481 | { |
| 482 | return false; |
| 483 | } |
| 484 | |
| 485 | members.push_back(std::make_pair(svar, stype)); |
| 486 | } |
| 487 | return true; |
| 488 | } |
| 489 | |
| 490 | bool HLSLShaderFactory::GetTypes(ID3DShaderReflectionType* rtype, |
| 491 | uint32_t numMembers, HLSLShaderType& stype) |
nothing calls this directly
no test coverage detected