mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 03:18:13 +00:00
gpu: Initialize Metal stencil format even if stencil test is disabled
This commit is contained in:
@@ -1121,10 +1121,11 @@ static SDL_GPUGraphicsPipeline *METAL_CreateGraphicsPipeline(
|
|||||||
|
|
||||||
if (createinfo->target_info.has_depth_stencil_target) {
|
if (createinfo->target_info.has_depth_stencil_target) {
|
||||||
pipelineDescriptor.depthAttachmentPixelFormat = SDLToMetal_TextureFormat(createinfo->target_info.depth_stencil_format);
|
pipelineDescriptor.depthAttachmentPixelFormat = SDLToMetal_TextureFormat(createinfo->target_info.depth_stencil_format);
|
||||||
|
if (IsStencilFormat(createinfo->target_info.depth_stencil_format)) {
|
||||||
|
pipelineDescriptor.stencilAttachmentPixelFormat = SDLToMetal_TextureFormat(createinfo->target_info.depth_stencil_format);
|
||||||
|
}
|
||||||
|
|
||||||
if (createinfo->depth_stencil_state.enable_stencil_test) {
|
if (createinfo->depth_stencil_state.enable_stencil_test) {
|
||||||
pipelineDescriptor.stencilAttachmentPixelFormat = SDLToMetal_TextureFormat(createinfo->target_info.depth_stencil_format);
|
|
||||||
|
|
||||||
frontStencilDescriptor = [MTLStencilDescriptor new];
|
frontStencilDescriptor = [MTLStencilDescriptor new];
|
||||||
frontStencilDescriptor.stencilCompareFunction = SDLToMetal_CompareOp[createinfo->depth_stencil_state.front_stencil_state.compare_op];
|
frontStencilDescriptor.stencilCompareFunction = SDLToMetal_CompareOp[createinfo->depth_stencil_state.front_stencil_state.compare_op];
|
||||||
frontStencilDescriptor.stencilFailureOperation = SDLToMetal_StencilOp[createinfo->depth_stencil_state.front_stencil_state.fail_op];
|
frontStencilDescriptor.stencilFailureOperation = SDLToMetal_StencilOp[createinfo->depth_stencil_state.front_stencil_state.fail_op];
|
||||||
|
Reference in New Issue
Block a user