Don't use stage bit as index, convert to array index

This commit is contained in:
baldurk
2016-02-07 18:48:45 +01:00
parent cf0537d055
commit ae2584b7d6
+8 -1
View File
@@ -73,7 +73,14 @@ void VulkanCreationInfo::Pipeline::Init(VulkanResourceManager *resourceMan, Vulk
for(uint32_t i=0; i < pCreateInfo->stageCount; i++)
{
ResourceId id = resourceMan->GetNonDispWrapper(pCreateInfo->pStages[i].module)->id;
Shader &shad = shaders[ pCreateInfo->pStages[i].stage ];
// convert shader bit to shader index
int s=0;
for(; s < 6; s++)
if(pCreateInfo->pStages[i].stage == (1<<s))
break;
Shader &shad = shaders[s];
shad.module = id;
shad.name = pCreateInfo->pStages[i].pName;