Flutter Impeller
pipeline_vk.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
6 
7 #include "flutter/fml/make_copyable.h"
8 #include "flutter/fml/trace_event.h"
9 #include "impeller/base/timing.h"
17 
18 namespace impeller {
19 
20 static vk::PipelineCreationFeedbackEXT EmptyFeedback() {
21  vk::PipelineCreationFeedbackEXT feedback;
22  // If the VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT is not set in flags, an
23  // implementation must not set any other bits in flags, and the values of all
24  // other VkPipelineCreationFeedback data members are undefined.
25  feedback.flags = vk::PipelineCreationFeedbackFlagBits::eValid;
26  return feedback;
27 }
28 
29 constexpr vk::FrontFace ToVKFrontFace(WindingOrder order) {
30  switch (order) {
32  return vk::FrontFace::eClockwise;
34  return vk::FrontFace::eCounterClockwise;
35  }
36  FML_UNREACHABLE();
37 }
38 
40  std::stringstream& stream,
41  const vk::PipelineCreationFeedbackEXT& feedback) {
42  const auto pipeline_cache_hit =
43  feedback.flags &
44  vk::PipelineCreationFeedbackFlagBits::eApplicationPipelineCacheHit;
45  const auto base_pipeline_accl =
46  feedback.flags &
47  vk::PipelineCreationFeedbackFlagBits::eBasePipelineAcceleration;
48  auto duration = std::chrono::duration_cast<MillisecondsF>(
49  std::chrono::nanoseconds{feedback.duration});
50  stream << "Time: " << duration.count() << "ms"
51  << " Cache Hit: " << static_cast<bool>(pipeline_cache_hit)
52  << " Base Accel: " << static_cast<bool>(base_pipeline_accl)
53  << " Thread: " << std::this_thread::get_id();
54 }
55 
57  const PipelineDescriptor& desc,
58  const vk::PipelineCreationFeedbackCreateInfoEXT& feedback) {
59  std::stringstream stream;
60  stream << std::fixed << std::showpoint << std::setprecision(2);
61  stream << std::endl << ">>>>>>" << std::endl;
62  stream << "Pipeline '" << desc.GetLabel() << "' ";
64  *feedback.pPipelineCreationFeedback);
65  if (feedback.pipelineStageCreationFeedbackCount != 0) {
66  stream << std::endl;
67  }
68  for (size_t i = 0, count = feedback.pipelineStageCreationFeedbackCount;
69  i < count; i++) {
70  stream << "\tStage " << i + 1 << ": ";
72  stream, feedback.pPipelineStageCreationFeedbacks[i]);
73  if (i != count - 1) {
74  stream << std::endl;
75  }
76  }
77  stream << std::endl << "<<<<<<" << std::endl;
78  FML_LOG(ERROR) << stream.str();
79 }
80 
82  const PipelineDescriptor& desc,
83  const vk::PipelineCreationFeedbackCreateInfoEXT& feedback) {
84  static int64_t gPipelineCacheHits = 0;
85  static int64_t gPipelineCacheMisses = 0;
86  static int64_t gPipelines = 0;
87  if (feedback.pPipelineCreationFeedback->flags &
88  vk::PipelineCreationFeedbackFlagBits::eApplicationPipelineCacheHit) {
89  gPipelineCacheHits++;
90  } else {
91  gPipelineCacheMisses++;
92  }
93  gPipelines++;
94  static constexpr int64_t kImpellerPipelineTraceID = 1988;
95  FML_TRACE_COUNTER("impeller", //
96  "PipelineCache", // series name
97  kImpellerPipelineTraceID, // series ID
98  "PipelineCacheHits", gPipelineCacheHits, //
99  "PipelineCacheMisses", gPipelineCacheMisses, //
100  "TotalPipelines", gPipelines //
101  );
102 }
103 
105  const PipelineDescriptor& desc,
106  const vk::PipelineCreationFeedbackCreateInfoEXT& feedback) {
107  constexpr bool kReportPipelineCreationFeedbackToLogs = false;
108  constexpr bool kReportPipelineCreationFeedbackToTraces = true;
109  if (kReportPipelineCreationFeedbackToLogs) {
110  ReportPipelineCreationFeedbackToLog(desc, feedback);
111  }
112  if (kReportPipelineCreationFeedbackToTraces) {
114  }
115 }
116 
117 //----------------------------------------------------------------------------
118 /// Render Pass
119 /// We are NOT going to use the same render pass with the framebuffer (later)
120 /// and the graphics pipeline (here). Instead, we are going to ensure that the
121 /// sub-passes are compatible. To see the compatibility rules, see the Vulkan
122 /// spec:
123 /// https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/chap8.html#renderpass-compatibility
124 ///
125 static vk::UniqueRenderPass CreateCompatRenderPassForPipeline(
126  const vk::Device& device,
127  const PipelineDescriptor& desc) {
128  RenderPassBuilderVK builder;
129 
130  for (const auto& [bind_point, color] : desc.GetColorAttachmentDescriptors()) {
131  builder.SetColorAttachment(bind_point, //
132  color.format, //
133  desc.GetSampleCount(), //
136  );
137  }
138 
139  if (auto depth = desc.GetDepthStencilAttachmentDescriptor();
140  depth.has_value()) {
142  desc.GetSampleCount(), //
145  );
146  } else if (desc.HasStencilAttachmentDescriptors()) {
148  desc.GetSampleCount(), //
151  );
152  }
153 
154  auto pass = builder.Build(device);
155  if (!pass) {
156  VALIDATION_LOG << "Failed to create render pass for pipeline: "
157  << desc.GetLabel();
158  return {};
159  }
160 
161  ContextVK::SetDebugName(device, pass.get(),
162  "Compat Render Pass: " + desc.GetLabel());
163 
164  return pass;
165 }
166 
167 std::unique_ptr<PipelineVK> PipelineVK::Create(
168  const PipelineDescriptor& desc,
169  const std::shared_ptr<DeviceHolderVK>& device_holder,
170  const std::weak_ptr<PipelineLibrary>& weak_library,
171  std::shared_ptr<SamplerVK> immutable_sampler) {
172  TRACE_EVENT0("flutter", "PipelineVK::Create");
173 
174  auto library = weak_library.lock();
175 
176  if (!device_holder || !library) {
177  return nullptr;
178  }
179 
180  const auto& pso_cache = PipelineLibraryVK::Cast(*library).GetPSOCache();
181 
182  vk::StructureChain<vk::GraphicsPipelineCreateInfo,
183  vk::PipelineCreationFeedbackCreateInfoEXT>
184  chain;
185 
186  const auto* caps = pso_cache->GetCapabilities();
187 
188  const auto supports_pipeline_creation_feedback = caps->HasExtension(
190  if (!supports_pipeline_creation_feedback) {
191  chain.unlink<vk::PipelineCreationFeedbackCreateInfoEXT>();
192  }
193 
194  auto& pipeline_info = chain.get<vk::GraphicsPipelineCreateInfo>();
195 
196  //----------------------------------------------------------------------------
197  /// Dynamic States
198  ///
199  vk::PipelineDynamicStateCreateInfo dynamic_create_state_info;
200  std::vector<vk::DynamicState> dynamic_states = {
201  vk::DynamicState::eViewport,
202  vk::DynamicState::eScissor,
203  vk::DynamicState::eStencilReference,
204  };
205  dynamic_create_state_info.setDynamicStates(dynamic_states);
206  pipeline_info.setPDynamicState(&dynamic_create_state_info);
207 
208  //----------------------------------------------------------------------------
209  /// Viewport State
210  ///
211  vk::PipelineViewportStateCreateInfo viewport_state;
212  viewport_state.setViewportCount(1u);
213  viewport_state.setScissorCount(1u);
214  // The actual viewport and scissor rects are not set here since they are
215  // dynamic as mentioned above in the dynamic state info.
216  pipeline_info.setPViewportState(&viewport_state);
217 
218  //----------------------------------------------------------------------------
219  /// Shader Stages
220  ///
221  const auto& constants = desc.GetSpecializationConstants();
222 
223  std::vector<std::vector<vk::SpecializationMapEntry>> map_entries(
224  desc.GetStageEntrypoints().size());
225  std::vector<vk::SpecializationInfo> specialization_infos(
226  desc.GetStageEntrypoints().size());
227  std::vector<vk::PipelineShaderStageCreateInfo> shader_stages;
228 
229  size_t entrypoint_count = 0;
230  for (const auto& entrypoint : desc.GetStageEntrypoints()) {
231  auto stage = ToVKShaderStageFlagBits(entrypoint.first);
232  if (!stage.has_value()) {
233  VALIDATION_LOG << "Unsupported shader type in pipeline: "
234  << desc.GetLabel();
235  return nullptr;
236  }
237 
238  std::vector<vk::SpecializationMapEntry>& entries =
239  map_entries[entrypoint_count];
240  for (auto i = 0u; i < constants.size(); i++) {
241  vk::SpecializationMapEntry entry;
242  entry.offset = (i * sizeof(Scalar));
243  entry.size = sizeof(Scalar);
244  entry.constantID = i;
245  entries.emplace_back(entry);
246  }
247 
248  vk::SpecializationInfo& specialization_info =
249  specialization_infos[entrypoint_count];
250  specialization_info.setMapEntries(map_entries[entrypoint_count]);
251  specialization_info.setPData(constants.data());
252  specialization_info.setDataSize(sizeof(Scalar) * constants.size());
253 
254  vk::PipelineShaderStageCreateInfo info;
255  info.setStage(stage.value());
256  info.setPName("main");
257  info.setModule(
258  ShaderFunctionVK::Cast(entrypoint.second.get())->GetModule());
259  info.setPSpecializationInfo(&specialization_info);
260  shader_stages.push_back(info);
261  entrypoint_count++;
262  }
263  pipeline_info.setStages(shader_stages);
264 
265  //----------------------------------------------------------------------------
266  /// Rasterization State
267  ///
268  vk::PipelineRasterizationStateCreateInfo rasterization_state;
269  rasterization_state.setFrontFace(ToVKFrontFace(desc.GetWindingOrder()));
270  rasterization_state.setCullMode(ToVKCullModeFlags(desc.GetCullMode()));
271  rasterization_state.setPolygonMode(ToVKPolygonMode(desc.GetPolygonMode()));
272  rasterization_state.setLineWidth(1.0f);
273  rasterization_state.setDepthClampEnable(false);
274  rasterization_state.setRasterizerDiscardEnable(false);
275  pipeline_info.setPRasterizationState(&rasterization_state);
276 
277  //----------------------------------------------------------------------------
278  /// Multi-sample State
279  ///
280  vk::PipelineMultisampleStateCreateInfo multisample_state;
281  multisample_state.setRasterizationSamples(
283  pipeline_info.setPMultisampleState(&multisample_state);
284 
285  //----------------------------------------------------------------------------
286  /// Primitive Input Assembly State
287  vk::PipelineInputAssemblyStateCreateInfo input_assembly;
288  const auto topology = ToVKPrimitiveTopology(desc.GetPrimitiveType());
289  input_assembly.setTopology(topology);
290  pipeline_info.setPInputAssemblyState(&input_assembly);
291 
292  //----------------------------------------------------------------------------
293  /// Color Blend State
294  std::vector<vk::PipelineColorBlendAttachmentState> attachment_blend_state;
295  for (const auto& color_desc : desc.GetColorAttachmentDescriptors()) {
296  // TODO(csg): The blend states are per color attachment. But it isn't clear
297  // how the color attachment indices are specified in the pipeline create
298  // info. But, this should always work for one color attachment.
299  attachment_blend_state.push_back(
300  ToVKPipelineColorBlendAttachmentState(color_desc.second));
301  }
302  vk::PipelineColorBlendStateCreateInfo blend_state;
303  blend_state.setAttachments(attachment_blend_state);
304  pipeline_info.setPColorBlendState(&blend_state);
305 
306  auto render_pass =
307  CreateCompatRenderPassForPipeline(device_holder->GetDevice(), //
308  desc //
309  );
310 
311  if (!render_pass) {
312  VALIDATION_LOG << "Could not create render pass for pipeline.";
313  return nullptr;
314  }
315 
316  // Convention wisdom says that the base acceleration pipelines are never used
317  // by drivers for cache hits. Instead, the PSO cache is the preferred
318  // mechanism.
319  pipeline_info.setBasePipelineHandle(VK_NULL_HANDLE);
320  pipeline_info.setSubpass(0u);
321  pipeline_info.setRenderPass(render_pass.get());
322 
323  //----------------------------------------------------------------------------
324  /// Vertex Input Setup
325  ///
326  std::vector<vk::VertexInputAttributeDescription> attr_descs;
327  std::vector<vk::VertexInputBindingDescription> buffer_descs;
328 
329  const auto& stage_inputs = desc.GetVertexDescriptor()->GetStageInputs();
330  const auto& stage_buffer_layouts =
331  desc.GetVertexDescriptor()->GetStageLayouts();
332  for (const ShaderStageIOSlot& stage_in : stage_inputs) {
333  vk::VertexInputAttributeDescription attr_desc;
334  attr_desc.setBinding(stage_in.binding);
335  attr_desc.setLocation(stage_in.location);
336  attr_desc.setFormat(ToVertexDescriptorFormat(stage_in));
337  attr_desc.setOffset(stage_in.offset);
338  attr_descs.push_back(attr_desc);
339  }
340  for (const ShaderStageBufferLayout& layout : stage_buffer_layouts) {
341  vk::VertexInputBindingDescription binding_description;
342  binding_description.setBinding(layout.binding);
343  binding_description.setInputRate(vk::VertexInputRate::eVertex);
344  binding_description.setStride(layout.stride);
345  buffer_descs.push_back(binding_description);
346  }
347 
348  vk::PipelineVertexInputStateCreateInfo vertex_input_state;
349  vertex_input_state.setVertexAttributeDescriptions(attr_descs);
350  vertex_input_state.setVertexBindingDescriptions(buffer_descs);
351 
352  pipeline_info.setPVertexInputState(&vertex_input_state);
353 
354  //----------------------------------------------------------------------------
355  /// Pipeline Layout a.k.a the descriptor sets and uniforms.
356  ///
357  std::vector<vk::DescriptorSetLayoutBinding> set_bindings;
358 
359  vk::Sampler vk_immutable_sampler =
360  immutable_sampler ? immutable_sampler->GetSampler()
361  : static_cast<vk::Sampler>(VK_NULL_HANDLE);
362 
363  for (auto layout : desc.GetVertexDescriptor()->GetDescriptorSetLayouts()) {
364  vk::DescriptorSetLayoutBinding set_binding;
365  set_binding.binding = layout.binding;
366  set_binding.descriptorCount = 1u;
367  set_binding.descriptorType = ToVKDescriptorType(layout.descriptor_type);
368  set_binding.stageFlags = ToVkShaderStage(layout.shader_stage);
369  // TODO(143719): This specifies the immutable sampler for all sampled
370  // images. This is incorrect. In cases where the shader samples from the
371  // multiple images, there is currently no way to tell which sampler needs to
372  // be immutable and which one needs a binding set in the render pass. Expect
373  // errors if the shader has more than on sampled image. The sampling from
374  // the one that is expected to be non-immutable will be incorrect.
375  if (vk_immutable_sampler &&
376  layout.descriptor_type == DescriptorType::kSampledImage) {
377  set_binding.setImmutableSamplers(vk_immutable_sampler);
378  }
379  set_bindings.push_back(set_binding);
380  }
381 
382  vk::DescriptorSetLayoutCreateInfo desc_set_layout_info;
383  desc_set_layout_info.setBindings(set_bindings);
384 
385  auto [descs_result, descs_layout] =
386  device_holder->GetDevice().createDescriptorSetLayoutUnique(
387  desc_set_layout_info);
388  if (descs_result != vk::Result::eSuccess) {
389  VALIDATION_LOG << "unable to create uniform descriptors";
390  return nullptr;
391  }
392 
393  ContextVK::SetDebugName(device_holder->GetDevice(), descs_layout.get(),
394  "Descriptor Set Layout " + desc.GetLabel());
395 
396  //----------------------------------------------------------------------------
397  /// Create the pipeline layout.
398  ///
399  vk::PipelineLayoutCreateInfo pipeline_layout_info;
400  pipeline_layout_info.setSetLayouts(descs_layout.get());
401  auto pipeline_layout = device_holder->GetDevice().createPipelineLayoutUnique(
402  pipeline_layout_info);
403  if (pipeline_layout.result != vk::Result::eSuccess) {
404  VALIDATION_LOG << "Could not create pipeline layout for pipeline "
405  << desc.GetLabel() << ": "
406  << vk::to_string(pipeline_layout.result);
407  return nullptr;
408  }
409  pipeline_info.setLayout(pipeline_layout.value.get());
410 
411  //----------------------------------------------------------------------------
412  /// Create the depth stencil state.
413  ///
414  auto depth_stencil_state = ToVKPipelineDepthStencilStateCreateInfo(
418  pipeline_info.setPDepthStencilState(&depth_stencil_state);
419 
420  //----------------------------------------------------------------------------
421  /// Setup the optional pipeline creation feedback struct so we can understand
422  /// how Vulkan created the PSO.
423  ///
424  auto& feedback = chain.get<vk::PipelineCreationFeedbackCreateInfoEXT>();
425  auto pipeline_feedback = EmptyFeedback();
426  std::vector<vk::PipelineCreationFeedbackEXT> stage_feedbacks(
427  pipeline_info.stageCount, EmptyFeedback());
428  feedback.setPPipelineCreationFeedback(&pipeline_feedback);
429  feedback.setPipelineStageCreationFeedbacks(stage_feedbacks);
430 
431  //----------------------------------------------------------------------------
432  /// Finally, all done with the setup info. Create the pipeline itself.
433  ///
434  auto pipeline = pso_cache->CreatePipeline(pipeline_info);
435  if (!pipeline) {
436  VALIDATION_LOG << "Could not create graphics pipeline: " << desc.GetLabel();
437  return nullptr;
438  }
439 
440  if (supports_pipeline_creation_feedback) {
441  ReportPipelineCreationFeedback(desc, feedback);
442  }
443 
444  ContextVK::SetDebugName(device_holder->GetDevice(), *pipeline_layout.value,
445  "Pipeline Layout " + desc.GetLabel());
446  ContextVK::SetDebugName(device_holder->GetDevice(), *pipeline,
447  "Pipeline " + desc.GetLabel());
448 
449  auto pipeline_vk = std::unique_ptr<PipelineVK>(new PipelineVK(
450  device_holder, //
451  library, //
452  desc, //
453  std::move(pipeline), //
454  std::move(render_pass), //
455  std::move(pipeline_layout.value), //
456  std::move(descs_layout), //
457  std::move(immutable_sampler) //
458  ));
459  if (!pipeline_vk->IsValid()) {
460  VALIDATION_LOG << "Could not create a valid pipeline.";
461  return nullptr;
462  }
463  return pipeline_vk;
464 }
465 
466 PipelineVK::PipelineVK(std::weak_ptr<DeviceHolderVK> device_holder,
467  std::weak_ptr<PipelineLibrary> library,
468  const PipelineDescriptor& desc,
469  vk::UniquePipeline pipeline,
470  vk::UniqueRenderPass render_pass,
471  vk::UniquePipelineLayout layout,
472  vk::UniqueDescriptorSetLayout descriptor_set_layout,
473  std::shared_ptr<SamplerVK> immutable_sampler)
474  : Pipeline(std::move(library), desc),
475  device_holder_(std::move(device_holder)),
476  pipeline_(std::move(pipeline)),
477  render_pass_(std::move(render_pass)),
478  layout_(std::move(layout)),
479  descriptor_set_layout_(std::move(descriptor_set_layout)),
480  immutable_sampler_(std::move(immutable_sampler)) {
481  is_valid_ = pipeline_ && render_pass_ && layout_ && descriptor_set_layout_;
482 }
483 
485  if (auto device = device_holder_.lock(); !device) {
486  descriptor_set_layout_.release();
487  layout_.release();
488  render_pass_.release();
489  pipeline_.release();
490  }
491 }
492 
493 bool PipelineVK::IsValid() const {
494  return is_valid_;
495 }
496 
497 vk::Pipeline PipelineVK::GetPipeline() const {
498  return *pipeline_;
499 }
500 
501 const vk::PipelineLayout& PipelineVK::GetPipelineLayout() const {
502  return *layout_;
503 }
504 
505 const vk::DescriptorSetLayout& PipelineVK::GetDescriptorSetLayout() const {
506  return *descriptor_set_layout_;
507 }
508 
510  const std::shared_ptr<SamplerVK>& immutable_sampler) const {
511  if (!immutable_sampler) {
512  return nullptr;
513  }
514  auto cache_key = ImmutableSamplerKeyVK{*immutable_sampler};
515  Lock lock(immutable_sampler_variants_mutex_);
516  auto found = immutable_sampler_variants_.find(cache_key);
517  if (found != immutable_sampler_variants_.end()) {
518  return found->second;
519  }
520  auto device_holder = device_holder_.lock();
521  if (!device_holder) {
522  return nullptr;
523  }
524  return (immutable_sampler_variants_[cache_key] =
525  Create(desc_, device_holder, library_, immutable_sampler));
526 }
527 
528 } // namespace impeller
impeller::PipelineDescriptor
Definition: pipeline_descriptor.h:24
timing.h
impeller::Pipeline
Describes the fixed function and programmable aspects of rendering and compute operations performed b...
Definition: compute_pipeline_descriptor.h:28
impeller::PipelineDescriptor::GetSpecializationConstants
const std::vector< Scalar > & GetSpecializationConstants() const
Definition: pipeline_descriptor.cc:289
impeller::ShaderStageIOSlot
Definition: shader_types.h:112
impeller::CreateCompatRenderPassForPipeline
static vk::UniqueRenderPass CreateCompatRenderPassForPipeline(const vk::Device &device, const PipelineDescriptor &desc)
Definition: pipeline_vk.cc:125
impeller::ImmutableSamplerKeyVK
Definition: yuv_conversion_vk.h:94
impeller::PipelineDescriptor::GetBackStencilAttachmentDescriptor
std::optional< StencilAttachmentDescriptor > GetBackStencilAttachmentDescriptor() const
Definition: pipeline_descriptor.cc:243
impeller::ReportPipelineCreationFeedbackToLog
static void ReportPipelineCreationFeedbackToLog(std::stringstream &stream, const vk::PipelineCreationFeedbackEXT &feedback)
Definition: pipeline_vk.cc:39
impeller::ToVKPipelineDepthStencilStateCreateInfo
vk::PipelineDepthStencilStateCreateInfo ToVKPipelineDepthStencilStateCreateInfo(std::optional< DepthAttachmentDescriptor > depth, std::optional< StencilAttachmentDescriptor > front, std::optional< StencilAttachmentDescriptor > back)
Definition: formats_vk.cc:9
impeller::Scalar
float Scalar
Definition: scalar.h:18
impeller::PipelineDescriptor::GetCullMode
CullMode GetCullMode() const
Definition: pipeline_descriptor.cc:256
impeller::ReportPipelineCreationFeedbackToTrace
static void ReportPipelineCreationFeedbackToTrace(const PipelineDescriptor &desc, const vk::PipelineCreationFeedbackCreateInfoEXT &feedback)
Definition: pipeline_vk.cc:81
impeller::PipelineDescriptor::GetLabel
const std::string & GetLabel() const
Definition: pipeline_descriptor.cc:234
impeller::PipelineVK::~PipelineVK
~PipelineVK() override
Definition: pipeline_vk.cc:484
impeller::RenderPassBuilderVK::SetStencilAttachment
RenderPassBuilderVK & SetStencilAttachment(PixelFormat format, SampleCount sample_count, LoadAction load_action, StoreAction store_action)
Definition: render_pass_builder_vk.cc:74
impeller::ToVKPolygonMode
constexpr vk::PolygonMode ToVKPolygonMode(PolygonMode mode)
Definition: formats_vk.h:365
impeller::ToVKPipelineColorBlendAttachmentState
constexpr vk::PipelineColorBlendAttachmentState ToVKPipelineColorBlendAttachmentState(const ColorAttachmentDescriptor &desc)
Definition: formats_vk.h:102
impeller::PipelineVK::GetPipelineLayout
const vk::PipelineLayout & GetPipelineLayout() const
Definition: pipeline_vk.cc:501
impeller::ToVKDescriptorType
constexpr vk::DescriptorType ToVKDescriptorType(DescriptorType type)
Definition: formats_vk.h:267
impeller::PipelineVK::CreateVariantForImmutableSamplers
std::shared_ptr< PipelineVK > CreateVariantForImmutableSamplers(const std::shared_ptr< SamplerVK > &immutable_sampler) const
Definition: pipeline_vk.cc:509
impeller::PipelineVK::GetPipeline
vk::Pipeline GetPipeline() const
Definition: pipeline_vk.cc:497
impeller::Lock
Definition: thread.h:75
impeller::PipelineVK
Definition: pipeline_vk.h:28
impeller::PipelineVK::Create
static std::unique_ptr< PipelineVK > Create(const PipelineDescriptor &desc, const std::shared_ptr< DeviceHolderVK > &device_holder, const std::weak_ptr< PipelineLibrary > &weak_library, std::shared_ptr< SamplerVK > immutable_sampler={})
Definition: pipeline_vk.cc:167
impeller::ToVKCullModeFlags
constexpr vk::CullModeFlags ToVKCullModeFlags(CullMode mode)
Definition: formats_vk.h:419
impeller::PipelineDescriptor::GetSampleCount
SampleCount GetSampleCount() const
Definition: pipeline_descriptor.h:36
impeller::StoreAction::kDontCare
@ kDontCare
impeller::PipelineDescriptor::GetVertexDescriptor
const std::shared_ptr< VertexDescriptor > & GetVertexDescriptor() const
Definition: pipeline_descriptor.cc:217
impeller::RenderPassBuilderVK
Definition: render_pass_builder_vk.h:17
impeller::EmptyFeedback
static vk::PipelineCreationFeedbackEXT EmptyFeedback()
Definition: pipeline_vk.cc:20
impeller::WindingOrder::kClockwise
@ kClockwise
impeller::ShaderStageBufferLayout
Definition: shader_types.h:141
formats_vk.h
impeller::OptionalDeviceExtensionVK::kEXTPipelineCreationFeedback
@ kEXTPipelineCreationFeedback
pipeline_vk.h
impeller::WindingOrder
WindingOrder
Definition: formats.h:23
impeller::PipelineLibraryVK::GetPSOCache
const std::shared_ptr< PipelineCacheVK > & GetPSOCache() const
Definition: pipeline_library_vk.cc:274
capabilities_vk.h
impeller::RenderPassBuilderVK::SetDepthStencilAttachment
RenderPassBuilderVK & SetDepthStencilAttachment(PixelFormat format, SampleCount sample_count, LoadAction load_action, StoreAction store_action)
Definition: render_pass_builder_vk.cc:56
impeller::PipelineDescriptor::HasStencilAttachmentDescriptors
bool HasStencilAttachmentDescriptors() const
Definition: pipeline_descriptor.cc:247
impeller::ToVKPrimitiveTopology
constexpr vk::PrimitiveTopology ToVKPrimitiveTopology(PrimitiveType primitive)
Definition: formats_vk.h:375
impeller::RenderPassBuilderVK::SetColorAttachment
RenderPassBuilderVK & SetColorAttachment(size_t index, PixelFormat format, SampleCount sample_count, LoadAction load_action, StoreAction store_action)
Definition: render_pass_builder_vk.cc:29
impeller::ToVertexDescriptorFormat
vk::Format ToVertexDescriptorFormat(const ShaderStageIOSlot &input)
Definition: vertex_descriptor_vk.cc:11
render_pass_builder_vk.h
impeller::PipelineDescriptor::GetPrimitiveType
PrimitiveType GetPrimitiveType() const
Definition: pipeline_descriptor.cc:272
impeller::WindingOrder::kCounterClockwise
@ kCounterClockwise
impeller::ToVKSampleCountFlagBits
constexpr vk::SampleCountFlagBits ToVKSampleCountFlagBits(SampleCount count)
Definition: formats_vk.h:21
impeller::PipelineDescriptor::GetWindingOrder
WindingOrder GetWindingOrder() const
Definition: pipeline_descriptor.cc:264
impeller::ToVkShaderStage
constexpr vk::ShaderStageFlags ToVkShaderStage(ShaderStage stage)
Definition: formats_vk.h:252
impeller::ContextVK::SetDebugName
bool SetDebugName(T handle, std::string_view label) const
Definition: context_vk.h:106
impeller::PipelineDescriptor::GetStencilPixelFormat
PixelFormat GetStencilPixelFormat() const
Definition: pipeline_descriptor.cc:197
impeller::DescriptorType::kSampledImage
@ kSampledImage
impeller::PipelineDescriptor::GetPolygonMode
PolygonMode GetPolygonMode() const
Definition: pipeline_descriptor.cc:280
impeller::Pipeline< PipelineDescriptor >::desc_
const PipelineDescriptor desc_
Definition: pipeline.h:69
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:73
impeller::PipelineDescriptor::GetFrontStencilAttachmentDescriptor
std::optional< StencilAttachmentDescriptor > GetFrontStencilAttachmentDescriptor() const
Definition: pipeline_descriptor.cc:202
impeller::PipelineDescriptor::GetDepthPixelFormat
PixelFormat GetDepthPixelFormat() const
Definition: pipeline_descriptor.cc:238
std
Definition: comparable.h:95
impeller::LoadAction::kDontCare
@ kDontCare
impeller::PipelineDescriptor::GetColorAttachmentDescriptors
const std::map< size_t, ColorAttachmentDescriptor > & GetColorAttachmentDescriptors() const
Definition: pipeline_descriptor.cc:212
impeller::BackendCast< PipelineLibraryVK, PipelineLibrary >::Cast
static PipelineLibraryVK & Cast(PipelineLibrary &base)
Definition: backend_cast.h:13
impeller::PipelineDescriptor::GetDepthStencilAttachmentDescriptor
std::optional< DepthAttachmentDescriptor > GetDepthStencilAttachmentDescriptor() const
Definition: pipeline_descriptor.cc:207
vertex_descriptor_vk.h
impeller::PipelineDescriptor::GetStageEntrypoints
const std::map< ShaderStage, std::shared_ptr< const ShaderFunction > > & GetStageEntrypoints() const
Definition: pipeline_descriptor.cc:222
sampler_vk.h
impeller::ToVKFrontFace
constexpr vk::FrontFace ToVKFrontFace(WindingOrder order)
Definition: pipeline_vk.cc:29
impeller::RenderPassBuilderVK::Build
vk::UniqueRenderPass Build(const vk::Device &device) const
Definition: render_pass_builder_vk.cc:92
context_vk.h
impeller::ToVKShaderStageFlagBits
constexpr std::optional< vk::ShaderStageFlagBits > ToVKShaderStageFlagBits(ShaderStage stage)
Definition: formats_vk.h:120
shader_function_vk.h
impeller::PipelineVK::GetDescriptorSetLayout
const vk::DescriptorSetLayout & GetDescriptorSetLayout() const
Definition: pipeline_vk.cc:505
impeller::ReportPipelineCreationFeedback
static void ReportPipelineCreationFeedback(const PipelineDescriptor &desc, const vk::PipelineCreationFeedbackCreateInfoEXT &feedback)
Definition: pipeline_vk.cc:104
impeller
Definition: aiks_blur_unittests.cc:20
impeller::Pipeline< PipelineDescriptor >::library_
const std::weak_ptr< PipelineLibrary > library_
Definition: pipeline.h:67