return n_writes;
}
-void VulkanPipelineState::apply(VkCommandBuffer command_buffer, const VulkanPipelineState *last, unsigned frame, bool negative_viewport) const
+void VulkanPipelineState::apply(const VulkanCommandRecorder &vkCmd, const VulkanPipelineState *last, unsigned frame, bool negative_viewport) const
{
const PipelineState &self = *static_cast<const PipelineState *>(this);
- const VulkanFunctions &vk = device.get_functions();
if(!last)
{
}
if(unapplied&PipelineState::SHPROG)
- vk.CmdBindPipeline(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, handle);
+ vkCmd.BindPipeline(VK_PIPELINE_BIND_POINT_GRAPHICS, handle);
if(unapplied&PipelineState::VERTEX_SETUP)
if(const VertexSetup *vs = self.vertex_setup)
{
- vk.CmdBindVertexBuffers(command_buffer, 0, vs->n_bindings, vs->buffers, vs->offsets);
+ vkCmd.BindVertexBuffers(0, vs->n_bindings, vs->buffers, vs->offsets);
VkIndexType index_type = static_cast<VkIndexType>(get_vulkan_index_type(vs->get_index_type()));
- vk.CmdBindIndexBuffer(command_buffer, vs->get_index_buffer()->handle, 0, index_type);
+ vkCmd.BindIndexBuffer(vs->get_index_buffer()->handle, 0, index_type);
}
if(!self.uniform_blocks.empty())
if(first_block.used && first_block.binding==ReflectData::PUSH_CONSTANT)
{
const UniformBlock &pc_block = *first_block.block;
- vk.CmdPushConstants(command_buffer, self.shprog->layout_handle, self.shprog->stage_flags,
+ vkCmd.PushConstants(self.shprog->layout_handle, self.shprog->stage_flags,
pc_block.get_offset(), pc_block.get_data_size(), pc_block.get_data_pointer());
}
}
descriptor_set_handles.push_back(device.get_descriptor_pool().get_descriptor_set(
self.descriptor_set_slots[i], self, i, frame));
- vk.CmdBindDescriptorSets(command_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, self.shprog->layout_handle,
+ vkCmd.BindDescriptorSets(VK_PIPELINE_BIND_POINT_GRAPHICS, self.shprog->layout_handle,
first_changed_desc_set, descriptor_set_handles.size(), descriptor_set_handles.data(), 0, 0);
}
}
viewport.minDepth = 0.0f;
viewport.maxDepth = 1.0f;
- vk.CmdSetViewport(command_buffer, 0, 1, &viewport);
+ vkCmd.SetViewport(0, 1, &viewport);
}
if(unapplied&PipelineState::SCISSOR)
scissor.offset.y = scissor_rect.bottom;
scissor.extent.width = scissor_rect.width;
scissor.extent.height = scissor_rect.height;
- vk.CmdSetScissor(command_buffer, 0, 1, &scissor);
+ vkCmd.SetScissor(0, 1, &scissor);
}
}