本文整理汇总了C++中Shell::context方法的典型用法代码示例。如果您正苦于以下问题:C++ Shell::context方法的具体用法?C++ Shell::context怎么用?C++ Shell::context使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shell
的用法示例。
在下文中一共展示了Shell::context方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: attach_shell
void Smoke::attach_shell(Shell &sh)
{
Game::attach_shell(sh);
const Shell::Context &ctx = sh.context();
physical_dev_ = ctx.physical_dev;
dev_ = ctx.dev;
queue_ = ctx.game_queue;
queue_family_ = ctx.game_queue_family;
format_ = ctx.format.format;
vk::GetPhysicalDeviceProperties(physical_dev_, &physical_dev_props_);
if (use_push_constants_ &&
sizeof(ShaderParamBlock) > physical_dev_props_.limits.maxPushConstantsSize) {
shell_->log(Shell::LOG_WARN, "cannot enable push constants");
use_push_constants_ = false;
}
VkPhysicalDeviceMemoryProperties mem_props;
vk::GetPhysicalDeviceMemoryProperties(physical_dev_, &mem_props);
mem_flags_.reserve(mem_props.memoryTypeCount);
for (uint32_t i = 0; i < mem_props.memoryTypeCount; i++)
mem_flags_.push_back(mem_props.memoryTypes[i].propertyFlags);
meshes_ = new Meshes(dev_, mem_flags_);
create_render_pass();
create_shader_modules();
create_descriptor_set_layout();
create_pipeline_layout();
create_pipeline();
create_frame_data(2);
render_pass_begin_info_.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
render_pass_begin_info_.renderPass = render_pass_;
render_pass_begin_info_.clearValueCount = 1;
render_pass_begin_info_.pClearValues = &render_pass_clear_value_;
primary_cmd_begin_info_.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
primary_cmd_begin_info_.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
// we will render to the swapchain images
primary_cmd_submit_wait_stages_ = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
primary_cmd_submit_info_.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
primary_cmd_submit_info_.waitSemaphoreCount = 1;
primary_cmd_submit_info_.pWaitDstStageMask = &primary_cmd_submit_wait_stages_;
primary_cmd_submit_info_.commandBufferCount = 1;
primary_cmd_submit_info_.signalSemaphoreCount = 1;
if (multithread_) {
for (auto &worker : workers_)
worker->start();
}
}