Hello everyone,
I must have missed something but why isn't there a depthAttachmentPixelFormat
to the new Metal 4 MTL4RenderPipelineDescriptor
, unlike the old MTLRenderPipelineDescriptor?
So how do you set the depth pixel format?
Thanks in advance!
Hello,
For color attachments first create an unspecialized MTLRenderPipelineState and then compile a new specialized MTLRenderPipelineState with a specialized color attachment configuration:
// ... Set specialized values
// Create new specialized pipeline
id<MTLRenderPipelineState> specializedPipeline =
[compiler newRenderPipelineStateBySpecializationWithDescriptor:pipelineDescriptor
pipeline: unspecializedPipeline
error: &error];
For more details watch Explore Metal 4 games.