feat: ConstantBuffers are now all pooled. D3D11Texture is loaded into staging memory and finally into IMMUTABLE texture#417
Open
kirides wants to merge 6 commits into
Open
feat: ConstantBuffers are now all pooled. D3D11Texture is loaded into staging memory and finally into IMMUTABLE texture#417kirides wants to merge 6 commits into
kirides wants to merge 6 commits into
Conversation
55dc2a6 to
9f5e6dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reworks how the engine allocates GPU constant buffers and uploads texture data, cutting down on descriptor/VA churn and enabling immutable textures.
Constant buffers: Introduces
ConstantBufferPool, a per-frame ring-buffer pool for constant buffers, and migrates every shader stage (V/G/P/H/CS) plus all the ad-hoc CB owners (forward+ renderer, point lights, shadow maps, TAA, vegetation boxes, PFX passes) off individually-owned D3D11ConstantBuffer instances and onto pooled, ring-backed buffers.D3D11ConstantBufferis removed entirely. Net effect: far fewer live CB allocations, less 32-bit VA space pressure, one consistent update path.Texture uploads: Textures are no longer built mip-by-mip via
UpdateSubresourceinto aDEFAULTtexture. Mip data is now staged into a CPU-side buffer as it streams in, and once the full chain has arrived the final texture is created directly asIMMUTABLEfrom the assembled mip chain (skipping the staging step entirely when there's only one mip).