mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
gpu: Metal depth write should behave like Vulkan/D3D12
This commit is contained in:
@@ -1135,7 +1135,8 @@ static SDL_GPUGraphicsPipeline *METAL_CreateGraphicsPipeline(
|
||||
|
||||
depthStencilDescriptor = [MTLDepthStencilDescriptor new];
|
||||
depthStencilDescriptor.depthCompareFunction = createinfo->depth_stencil_state.enable_depth_test ? SDLToMetal_CompareOp[createinfo->depth_stencil_state.compare_op] : MTLCompareFunctionAlways;
|
||||
depthStencilDescriptor.depthWriteEnabled = createinfo->depth_stencil_state.enable_depth_write;
|
||||
// Disable write when test is disabled, to match other APIs' behavior
|
||||
depthStencilDescriptor.depthWriteEnabled = createinfo->depth_stencil_state.enable_depth_write && createinfo->depth_stencil_state.enable_depth_test;
|
||||
depthStencilDescriptor.frontFaceStencil = frontStencilDescriptor;
|
||||
depthStencilDescriptor.backFaceStencil = backStencilDescriptor;
|
||||
|
||||
|
Reference in New Issue
Block a user