Repository navigation
Support MSAA: multisampled textures and resolve targets - #627
Merged
Merged
Conversation
|
📦 Development package |
|
✅ Development package validation passed on all platforms. |
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.
Closes #626.
Changes
GpuDevice.CreateTexture,CreateColorTargetTextureandCreateDepthBufferTexturetake an optionalSampleCount.GpuDevice.IsSampleCountSupportedchecks a count for a format. A multisampled texture can only be a color or depth-stencil target, soCreateColorTargetTexturedrops the sampler usage for it, andCreateDepthBufferTexturethrows withsampler: true.TexturehasSampleCountandUsage. Memory stats count every sample.SubmitAndDownloadTexturerefuses a multisampled texture.RenderPassBuilder.AddColorTarget(texture, resolveTexture[, settings])names the texture a color target resolves into.CommandBuffer.CreateRenderPasstakes an optional span of resolve textures.ColorTargetusage), and when a depth-stencil buffer's store operation resolves.GraphicsPipelineBuilder.Build()throws for a sample count the device does not support with a target format.RenderPass.BindGraphicsPipelinethrows when the pipeline's sample count differs from the pass's.SampleCountmoved to its own file.docs/multisampling.md, linked fromAGENTS.md,render-pass-flow.mdandpipeline-configuration.md. It covers what each backend supports and the matching depth-stencil buffer.Pixely.Tutorials.Multisamplingdraws a triangle with 4 samples and resolves it into the swapchain texture.Known limits
Depth24Stencil8: D3D12: MSAA gets disabled because it checks the wrong depth format libsdl-org/SDL#16124, fixed in a later SDL. Commented inGpuDevice.IsSampleCountSupported.CreateRenderPassgained optional parameters instead of new overloads, so code compiled against the old signatures needs a rebuild.EnableMultiSampling'smaskmust stay null: SDL reserves the sample mask.Testing
Pixely.Tests(469) andPixely.Ui.Tests(490) pass.