@@ -257,15 +257,6 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
257257 // a bind group for use to use for drawing
258258 ptAppData -> tColorTextureBg = gptDraw -> create_bind_group_for_texture (ptAppData -> tColorTexture );
259259
260- // begin blit pass, copy buffer, end pass
261- plBlitEncoder * ptEncoder = gptStarter -> get_blit_encoder ();
262-
263- // set the initial texture usage (this is a no-op in metal but does layout transition for vulkan)
264- gptGfx -> set_texture_usage (ptEncoder , ptAppData -> tColorTexture , PL_TEXTURE_USAGE_SAMPLED , 0 );
265- gptGfx -> set_texture_usage (ptEncoder , ptAppData -> tDepthTexture , PL_TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT , 0 );
266-
267- gptStarter -> return_blit_encoder (ptEncoder );
268-
269260 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~render pass stuff~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
270261
271262 // NOTE: even if you don't need to double buffer a texture, the number of
@@ -295,24 +286,6 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
295286 .uRenderTargetCount = 2 ,
296287 .auRenderTargets = {0 , 1 }, // these are indices into the render targets above (depth/resolve must be before colors)
297288 },
298- },
299- .atSubpassDependencies = { // this map directly in Vulkan
300- {
301- .uSourceSubpass = UINT32_MAX ,
302- .uDestinationSubpass = 0 ,
303- .tSourceStageMask = PL_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT | PL_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS | PL_PIPELINE_STAGE_LATE_FRAGMENT_TESTS | PL_PIPELINE_STAGE_COMPUTE_SHADER ,
304- .tDestinationStageMask = PL_PIPELINE_STAGE_FRAGMENT_SHADER | PL_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT | PL_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS | PL_PIPELINE_STAGE_LATE_FRAGMENT_TESTS ,
305- .tSourceAccessMask = PL_ACCESS_COLOR_ATTACHMENT_WRITE | PL_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE | PL_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ ,
306- .tDestinationAccessMask = PL_ACCESS_SHADER_READ | PL_ACCESS_COLOR_ATTACHMENT_WRITE | PL_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE | PL_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ ,
307- },
308- {
309- .uSourceSubpass = 0 ,
310- .uDestinationSubpass = UINT32_MAX ,
311- .tSourceStageMask = PL_PIPELINE_STAGE_FRAGMENT_SHADER | PL_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT | PL_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS | PL_PIPELINE_STAGE_LATE_FRAGMENT_TESTS ,
312- .tDestinationStageMask = PL_PIPELINE_STAGE_FRAGMENT_SHADER | PL_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT | PL_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS | PL_PIPELINE_STAGE_LATE_FRAGMENT_TESTS | PL_PIPELINE_STAGE_COMPUTE_SHADER ,
313- .tSourceAccessMask = PL_ACCESS_SHADER_READ | PL_ACCESS_COLOR_ATTACHMENT_WRITE | PL_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE | PL_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ ,
314- .tDestinationAccessMask = PL_ACCESS_SHADER_READ | PL_ACCESS_COLOR_ATTACHMENT_WRITE | PL_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE | PL_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ ,
315- },
316289 }
317290 };
318291
@@ -324,17 +297,17 @@ pl_app_load(plApiRegistryI* ptApiRegistry, plAppData* ptAppData)
324297 .tStoreOp = PL_STORE_OP_DONT_CARE ,
325298 .tStencilLoadOp = PL_LOAD_OP_CLEAR ,
326299 .tStencilStoreOp = PL_STORE_OP_DONT_CARE ,
327- .tCurrentUsage = PL_TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT ,
300+ .tPreviousUsage = PL_TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT ,
328301 .tNextUsage = PL_TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT ,
329302 .fClearZ = 1.0f
330303 },
331304 .atColorTargets = {
332305 {
333- .tLoadOp = PL_LOAD_OP_CLEAR ,
334- .tStoreOp = PL_STORE_OP_STORE ,
335- .tCurrentUsage = PL_TEXTURE_USAGE_SAMPLED ,
336- .tNextUsage = PL_TEXTURE_USAGE_SAMPLED ,
337- .tClearColor = {0.0f , 0.0f , 0.0f , 1.0f }
306+ .tLoadOp = PL_LOAD_OP_CLEAR ,
307+ .tStoreOp = PL_STORE_OP_STORE ,
308+ .tPreviousUsage = PL_TEXTURE_USAGE_SAMPLED ,
309+ .tNextUsage = PL_TEXTURE_USAGE_SAMPLED ,
310+ .tClearColor = {0.0f , 0.0f , 0.0f , 1.0f }
338311 }
339312 },
340313 .tDimensions = {.x = ptAppData -> tOffscreenSize .x , .y = ptAppData -> tOffscreenSize .y }
@@ -515,8 +488,6 @@ resize_offscreen_resources(plAppData* ptAppData)
515488{
516489 plDevice * ptDevice = gptStarter -> get_device ();
517490
518- plBlitEncoder * ptEncoder = gptStarter -> get_blit_encoder ();
519-
520491 const plTextureDesc tColorTextureDesc = {
521492 .tDimensions = {ptAppData -> tOffscreenSize .x , ptAppData -> tOffscreenSize .y , 1 },
522493 .tFormat = PL_FORMAT_R32G32B32A32_FLOAT ,
@@ -565,9 +536,6 @@ resize_offscreen_resources(plAppData* ptAppData)
565536 gptGfx -> bind_texture_to_memory (ptDevice , ptAppData -> tColorTexture , & tColorAllocation );
566537 gptGfx -> bind_texture_to_memory (ptDevice , ptAppData -> tDepthTexture , & tDepthAllocation );
567538
568- // set initialial usage
569- gptGfx -> set_texture_usage (ptEncoder , ptAppData -> tColorTexture , PL_TEXTURE_USAGE_SAMPLED , 0 );
570- gptGfx -> set_texture_usage (ptEncoder , ptAppData -> tDepthTexture , PL_TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT , 0 );
571539
572540 // update our previous allocated bind group
573541 const plBindGroupUpdateTextureData atBGTextureData [] = {
@@ -592,8 +560,6 @@ resize_offscreen_resources(plAppData* ptAppData)
592560 atAttachmentSets [i ].atViewAttachments [1 ] = ptAppData -> tColorTexture ;
593561 }
594562
595- gptStarter -> return_blit_encoder (ptEncoder );
596-
597563 // don't create new render pass, just update the attachments
598564 gptGfx -> update_render_pass_attachments (ptDevice , ptAppData -> tOffscreenRenderPass , ptAppData -> tOffscreenSize , atAttachmentSets );
599565}
0 commit comments