Remove SDL_GPUDepthStencilValue struct

This commit is contained in:
cosmonaut 2024-09-09 10:40:14 -07:00
parent 80e541d1fc
commit d3091b9538
6 changed files with 11 additions and 28 deletions

View file

@ -943,23 +943,6 @@ typedef enum SDL_GPUDriver
/* Structures */ /* Structures */
/**
* A structure specifying a depth-stencil clear value.
*
* \since This struct is available since SDL 3.0.0
*
* \sa SDL_GPUDepthStencilTargetInfo
* \sa SDL_BeginGPURenderPass
*/
typedef struct SDL_GPUDepthStencilValue
{
float depth; /**< The clear value for the depth aspect of the depth-stencil target. */
Uint8 stencil; /**< The clear value for the stencil aspect of the depth-stencil target. */
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
} SDL_GPUDepthStencilValue;
/** /**
* A structure specifying a viewport. * A structure specifying a viewport.
* *
@ -1592,15 +1575,15 @@ typedef struct SDL_GPUColorTargetInfo
typedef struct SDL_GPUDepthStencilTargetInfo typedef struct SDL_GPUDepthStencilTargetInfo
{ {
SDL_GPUTexture *texture; /**< The texture that will be used as the depth stencil target by the render pass. */ SDL_GPUTexture *texture; /**< The texture that will be used as the depth stencil target by the render pass. */
SDL_GPUDepthStencilValue clear_value; /**< The depth-stencil clear values. Can be ignored by the render pass if SDL_GPU_LOADOP_CLEAR is not used. */ float clear_depth; /**< The value to clear the depth component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. */
SDL_GPULoadOp load_op; /**< What is done with the depth contents at the beginning of the render pass. */ SDL_GPULoadOp load_op; /**< What is done with the depth contents at the beginning of the render pass. */
SDL_GPUStoreOp store_op; /**< What is done with the depth results of the render pass. */ SDL_GPUStoreOp store_op; /**< What is done with the depth results of the render pass. */
SDL_GPULoadOp stencil_load_op; /**< What is done with the stencil contents at the beginning of the render pass. */ SDL_GPULoadOp stencil_load_op; /**< What is done with the stencil contents at the beginning of the render pass. */
SDL_GPUStoreOp stencil_store_op; /**< What is done with the stencil results of the render pass. */ SDL_GPUStoreOp stencil_store_op; /**< What is done with the stencil results of the render pass. */
SDL_bool cycle; /**< SDL_TRUE cycles the texture if the texture is bound and any load ops are not LOAD */ SDL_bool cycle; /**< SDL_TRUE cycles the texture if the texture is bound and any load ops are not LOAD */
Uint8 clear_stencil; /**< The value to clear the stencil component to at the beginning of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used. */
Uint8 padding1; Uint8 padding1;
Uint8 padding2; Uint8 padding2;
Uint8 padding3;
} SDL_GPUDepthStencilTargetInfo; } SDL_GPUDepthStencilTargetInfo;
/** /**

View file

@ -3561,8 +3561,8 @@ static void D3D11_BeginRenderPass(
d3d11CommandBuffer->context, d3d11CommandBuffer->context,
dsv, dsv,
dsClearFlags, dsClearFlags,
depthStencilTargetInfo->clear_value.depth, depthStencilTargetInfo->clear_depth,
depthStencilTargetInfo->clear_value.stencil); depthStencilTargetInfo->clear_stencil);
} }
} }

View file

@ -3905,8 +3905,8 @@ static void D3D12_BeginRenderPass(
d3d12CommandBuffer->graphicsCommandList, d3d12CommandBuffer->graphicsCommandList,
subresource->dsvHandle.cpuHandle, subresource->dsvHandle.cpuHandle,
clearFlags, clearFlags,
depthStencilTargetInfo->clear_value.depth, depthStencilTargetInfo->clear_depth,
depthStencilTargetInfo->clear_value.stencil, depthStencilTargetInfo->clear_stencil,
0, 0,
NULL); NULL);
} }

View file

@ -2204,7 +2204,7 @@ static void METAL_BeginRenderPass(
passDescriptor.depthAttachment.storeAction = SDLToMetal_StoreOp( passDescriptor.depthAttachment.storeAction = SDLToMetal_StoreOp(
depthStencilTargetInfo->store_op, depthStencilTargetInfo->store_op,
texture->msaaHandle ? 1 : 0); texture->msaaHandle ? 1 : 0);
passDescriptor.depthAttachment.clearDepth = depthStencilTargetInfo->clear_value.depth; passDescriptor.depthAttachment.clearDepth = depthStencilTargetInfo->clear_depth;
if (IsStencilFormat(container->header.info.format)) { if (IsStencilFormat(container->header.info.format)) {
if (texture->msaaHandle) { if (texture->msaaHandle) {
@ -2217,7 +2217,7 @@ static void METAL_BeginRenderPass(
passDescriptor.stencilAttachment.storeAction = SDLToMetal_StoreOp( passDescriptor.stencilAttachment.storeAction = SDLToMetal_StoreOp(
depthStencilTargetInfo->store_op, depthStencilTargetInfo->store_op,
texture->msaaHandle ? 1 : 0); texture->msaaHandle ? 1 : 0);
passDescriptor.stencilAttachment.clearStencil = depthStencilTargetInfo->clear_value.stencil; passDescriptor.stencilAttachment.clearStencil = depthStencilTargetInfo->clear_stencil;
} }
METAL_INTERNAL_TrackTexture(metalCommandBuffer, texture); METAL_INTERNAL_TrackTexture(metalCommandBuffer, texture);

View file

@ -8011,9 +8011,9 @@ static void VULKAN_BeginRenderPass(
if (depthStencilTargetInfo != NULL) { if (depthStencilTargetInfo != NULL) {
clearValues[totalColorAttachmentCount].depthStencil.depth = clearValues[totalColorAttachmentCount].depthStencil.depth =
depthStencilTargetInfo->clear_value.depth; depthStencilTargetInfo->clear_depth;
clearValues[totalColorAttachmentCount].depthStencil.stencil = clearValues[totalColorAttachmentCount].depthStencil.stencil =
depthStencilTargetInfo->clear_value.stencil; depthStencilTargetInfo->clear_stencil;
} }
VkRenderPassBeginInfo renderPassBeginInfo; VkRenderPassBeginInfo renderPassBeginInfo;

View file

@ -369,7 +369,7 @@ Render(SDL_Window *window, const int windownum)
color_target.texture = winstate->tex_msaa ? winstate->tex_msaa : swapchain; color_target.texture = winstate->tex_msaa ? winstate->tex_msaa : swapchain;
SDL_zero(depth_target); SDL_zero(depth_target);
depth_target.clear_value.depth = 1.0f; depth_target.clear_depth = 1.0f;
depth_target.load_op = SDL_GPU_LOADOP_CLEAR; depth_target.load_op = SDL_GPU_LOADOP_CLEAR;
depth_target.store_op = SDL_GPU_STOREOP_DONT_CARE; depth_target.store_op = SDL_GPU_STOREOP_DONT_CARE;
depth_target.texture = winstate->tex_depth; depth_target.texture = winstate->tex_depth;