63 {
64
65 desc.SetLabel(std::format("{} Pipeline", FragmentShader::kLabel));
66
67
68 {
69 auto vertex_function = context.GetShaderLibrary()->GetFunction(
71 auto fragment_function = context.GetShaderLibrary()->GetFunction(
73
74 if (!vertex_function || !fragment_function) {
76 << VertexShader::kEntrypointName << "' and '"
77 << FragmentShader::kEntrypointName
78 << "' for pipeline named '" << VertexShader::kLabel
79 << "'.";
80 return false;
81 }
82
83 desc.AddStageEntrypoint(std::move(vertex_function));
84 desc.AddStageEntrypoint(std::move(fragment_function));
85 }
86
87
88 {
89 auto vertex_descriptor = std::make_shared<VertexDescriptor>();
90 vertex_descriptor->SetStageInputs(VertexShader::kAllShaderStageInputs,
91 VertexShader::kInterleavedBufferLayout);
92 vertex_descriptor->RegisterDescriptorSetLayouts(
93 VertexShader::kDescriptorSetLayouts);
94 vertex_descriptor->RegisterDescriptorSetLayouts(
95 FragmentShader::kDescriptorSetLayouts);
96 desc.SetVertexDescriptor(std::move(vertex_descriptor));
97 }
98
99
100 {
101
102
103 ColorAttachmentDescriptor color0;
104 color0.format = context.GetCapabilities()->GetDefaultColorFormat();
105 color0.blending_enabled = true;
106 desc.SetColorAttachmentDescriptor(0u, color0);
107 }
108
109
110 {
111 DepthAttachmentDescriptor depth0;
113 desc.SetDepthStencilAttachmentDescriptor(depth0);
114 desc.SetDepthPixelFormat(
115 context.GetCapabilities()->GetDefaultDepthStencilFormat());
116 }
117
118
119 {
120 StencilAttachmentDescriptor stencil0;
122 desc.SetStencilAttachmentDescriptors(stencil0);
123 desc.SetStencilPixelFormat(
124 context.GetCapabilities()->GetDefaultDepthStencilFormat());
125 }
126
127 return true;
128 }
@ kEqual
Comparison test passes if new_value == current_value.
@ kAlways
Comparison test passes always passes.