Previously we'd end up with a VK_NULL_HANDLE -> junk PIPELINE_STATE
mapping, which confuses other things.
Signed-off-by: Chris Forbes <chrisforbes@google.com>
auto result = dev_data->dispatch_table.CreateGraphicsPipelines(device, pipelineCache, count, pCreateInfos, pAllocator, pPipelines);
lock.lock();
for (i = 0; i < count; i++) {
- pipe_state[i]->pipeline = pPipelines[i];
- dev_data->pipelineMap[pipe_state[i]->pipeline] = pipe_state[i];
+ if (pPipelines[i] == VK_NULL_HANDLE) {
+ delete pipe_state[i];
+ }
+ else {
+ pipe_state[i]->pipeline = pPipelines[i];
+ dev_data->pipelineMap[pipe_state[i]->pipeline] = pipe_state[i];
+ }
}
return result;