D3D12: Fix HDR rendering pipeline, resource states, and overlay support#18692
Conversation
|
Hi @hizzlekizzle sorry we've been treading on each others feet a bit. I presume you reverted the mip map changes in an attempt to fix all the flashing issues? I've just hopefully fixed all those issues so shall we put the mipmap changes back in or was there another reason for reverting those changes? |
|
@hizzlekizzle I just reverted your mip map changes revert (ie I brought the original changes back in) locally to fix my build so just let me know if it was just for test purposes and I can push them back into fix this PR. |
|
hey man, sorry, i never saw those notifications for some reason. If your changes fix everything even with the mip changes, go for it! I only reverted them because it started happening with my changes, but I wasn’t able to determine what was actually wrong, so if your work fixes the root cause, I would love to have working mipmaps lol |
|
@MajorPainTheCactus Can you look at the CI build errors? |
|
Great stuff, thanks, Ill resubmit the mip map stuff and a few other fixes, sorry for causing the confusion. There were a lot of bugs I squished so dx12 should be a lot better. Ill submit the changes in a few hours. |
Add separate HDR pipeline states (pipe_blend_hdr, pipe_noblend_hdr, pipe_font_hdr) for R10G10B10A2 render targets and select the correct pipeline based on the current render target format, tracked via a new current_rt_format field. Fix resource state management: create render target textures in RENDER_TARGET state instead of PIXEL_SHADER_RESOURCE, add mipmap generation with zero-size level guards, move resource transitions to correct positions in the frame loop, and add missing back buffer transitions after HDR compositing. Fix HDR compositing: always use R8G8B8A8_UNORM for the intermediate back buffer regardless of shader preset format, set root signature before descriptor table binds, populate source/output size in the HDR UBO, and set the blend pipeline after menu texture upload. Extend HDR back buffer compositing to handle overlays in addition to the menu (D3D12_ST_FLAG_OVERLAYS_ENABLE). Only request GPU descriptor handle for shader-visible descriptor heaps to avoid D3D12 validation errors.
cad23ab to
b316f4b
Compare
|
RGUI flashing is indeed gone now, but Explore menu still crashes with Ozone and XMB.. |
Summary
pipe_blend_hdr,pipe_noblend_hdr, andpipe_font_hdrfor R10G10B10A2 render targets, with runtime pipeline selection based on the current render target format tracked via a newcurrent_rt_formatfieldRENDER_TARGETstate instead ofPIXEL_SHADER_RESOURCE, adds mipmap generation with zero-size level guards, and moves resource transitions to correct positions in the frame loop with missing back buffer transitions added after HDR compositingd3d12_generate_mipmapsfunction, proper mip level calculation, andMipLevels = 0initialization for render targets to enable automatic mipmap generation (reverting the revert in revert mipmap changes from 66a7657 #18686)R8G8B8A8_UNORMfor the intermediate back buffer regardless of shader preset format, sets root signature before descriptor table binds, populates source/output size in the HDR UBO, and sets the blend pipeline after menu texture uploadD3D12_ST_FLAG_OVERLAYS_ENABLE)