The depth stencil attachment isn't really needed to draw the triangle and doesn't really affect the render result. But having one should give us a slightly better test coverage for the compile of the depth stencil descriptor.
| 153 | // and doesn't really affect the render result. |
| 154 | // But having one should give us a slightly better test coverage for the compile of the depth stencil descriptor. |
| 155 | void render(wgpu::TextureView view, wgpu::TextureView depthStencilView) { |
| 156 | wgpu::RenderPassColorAttachment attachment{}; |
| 157 | attachment.view = view; |
| 158 | attachment.loadOp = wgpu::LoadOp::Clear; |
| 159 | attachment.storeOp = wgpu::StoreOp::Store; |
| 160 | attachment.clearValue = {0, 0, 0, 1}; |
| 161 | |
| 162 | wgpu::RenderPassDescriptor renderpass{}; |
| 163 | renderpass.colorAttachmentCount = 1; |
| 164 | renderpass.colorAttachments = &attachment; |
| 165 | |
| 166 | wgpu::RenderPassDepthStencilAttachment depthStencilAttachment = {}; |
| 167 | depthStencilAttachment.view = depthStencilView; |
| 168 | depthStencilAttachment.depthClearValue = 0; |
| 169 | depthStencilAttachment.depthLoadOp = wgpu::LoadOp::Clear; |
| 170 | depthStencilAttachment.depthStoreOp = wgpu::StoreOp::Store; |
| 171 | |
| 172 | renderpass.depthStencilAttachment = &depthStencilAttachment; |
| 173 | |
| 174 | wgpu::CommandBuffer commands; |
| 175 | { |
| 176 | wgpu::CommandEncoder encoder = device.CreateCommandEncoder(); |
| 177 | { |
| 178 | wgpu::RenderPassEncoder pass = encoder.BeginRenderPass(&renderpass); |
| 179 | pass.SetPipeline(pipeline); |
| 180 | pass.Draw(3); |
| 181 | pass.End(); |
| 182 | } |
| 183 | commands = encoder.Finish(); |
| 184 | } |
| 185 | |
| 186 | queue.Submit(1, &commands); |
| 187 | } |
| 188 | |
| 189 | void issueContentsCheck(ScopedCounter scope, std::string functionName, wgpu::Buffer readbackBuffer, uint32_t expectData) { |
| 190 | readbackBuffer.MapAsync( |
no test coverage detected