Fix warnings: Extra semi - macro usage (#15015)

This commit is contained in:
RaceTheMaSe
2026-02-09 01:58:53 +01:00
committed by GitHub
parent 6feb0e1333
commit f1a7a64eb4
16 changed files with 79 additions and 79 deletions

View File

@@ -943,7 +943,7 @@ bool SDL_GPUTextureSupportsFormat(
CHECK_DEVICE_MAGIC(device, false);
if (device->debug_mode) {
CHECK_TEXTUREFORMAT_ENUM_INVALID(format, false)
CHECK_TEXTUREFORMAT_ENUM_INVALID(format, false);
}
if ((usage & SDL_GPU_TEXTUREUSAGE_COMPUTE_STORAGE_WRITE) ||
@@ -968,7 +968,7 @@ bool SDL_GPUTextureSupportsSampleCount(
CHECK_DEVICE_MAGIC(device, 0);
if (device->debug_mode) {
CHECK_TEXTUREFORMAT_ENUM_INVALID(format, 0)
CHECK_TEXTUREFORMAT_ENUM_INVALID(format, 0);
}
return device->SupportsSampleCount(
@@ -1078,12 +1078,12 @@ SDL_GPUGraphicsPipeline *SDL_CreateGPUGraphicsPipeline(
}
if (graphicsPipelineCreateInfo->target_info.color_target_descriptions[i].blend_state.enable_blend) {
const SDL_GPUColorTargetBlendState *blend_state = &graphicsPipelineCreateInfo->target_info.color_target_descriptions[i].blend_state;
CHECK_BLENDFACTOR_ENUM_INVALID(blend_state->src_color_blendfactor, NULL)
CHECK_BLENDFACTOR_ENUM_INVALID(blend_state->dst_color_blendfactor, NULL)
CHECK_BLENDOP_ENUM_INVALID(blend_state->color_blend_op, NULL)
CHECK_BLENDFACTOR_ENUM_INVALID(blend_state->src_alpha_blendfactor, NULL)
CHECK_BLENDFACTOR_ENUM_INVALID(blend_state->dst_alpha_blendfactor, NULL)
CHECK_BLENDOP_ENUM_INVALID(blend_state->alpha_blend_op, NULL)
CHECK_BLENDFACTOR_ENUM_INVALID(blend_state->src_color_blendfactor, NULL);
CHECK_BLENDFACTOR_ENUM_INVALID(blend_state->dst_color_blendfactor, NULL);
CHECK_BLENDOP_ENUM_INVALID(blend_state->color_blend_op, NULL);
CHECK_BLENDFACTOR_ENUM_INVALID(blend_state->src_alpha_blendfactor, NULL);
CHECK_BLENDFACTOR_ENUM_INVALID(blend_state->dst_alpha_blendfactor, NULL);
CHECK_BLENDOP_ENUM_INVALID(blend_state->alpha_blend_op, NULL);
// TODO: validate that format support blending?
}
@@ -1156,14 +1156,14 @@ SDL_GPUGraphicsPipeline *SDL_CreateGPUGraphicsPipeline(
return NULL;
}
if (graphicsPipelineCreateInfo->depth_stencil_state.enable_depth_test) {
CHECK_COMPAREOP_ENUM_INVALID(graphicsPipelineCreateInfo->depth_stencil_state.compare_op, NULL)
CHECK_COMPAREOP_ENUM_INVALID(graphicsPipelineCreateInfo->depth_stencil_state.compare_op, NULL);
}
if (graphicsPipelineCreateInfo->depth_stencil_state.enable_stencil_test) {
const SDL_GPUStencilOpState *stencil_state = &graphicsPipelineCreateInfo->depth_stencil_state.back_stencil_state;
CHECK_COMPAREOP_ENUM_INVALID(stencil_state->compare_op, NULL)
CHECK_STENCILOP_ENUM_INVALID(stencil_state->fail_op, NULL)
CHECK_STENCILOP_ENUM_INVALID(stencil_state->pass_op, NULL)
CHECK_STENCILOP_ENUM_INVALID(stencil_state->depth_fail_op, NULL)
CHECK_COMPAREOP_ENUM_INVALID(stencil_state->compare_op, NULL);
CHECK_STENCILOP_ENUM_INVALID(stencil_state->fail_op, NULL);
CHECK_STENCILOP_ENUM_INVALID(stencil_state->pass_op, NULL);
CHECK_STENCILOP_ENUM_INVALID(stencil_state->depth_fail_op, NULL);
}
if (device->validate_feature_depth_clamp_disabled &&
@@ -1267,7 +1267,7 @@ SDL_GPUTexture *SDL_CreateGPUTexture(
const Uint32 MAX_3D_DIMENSION = 2048;
// Common checks for all texture types
CHECK_TEXTUREFORMAT_ENUM_INVALID(createinfo->format, NULL)
CHECK_TEXTUREFORMAT_ENUM_INVALID(createinfo->format, NULL);
if (createinfo->width <= 0 || createinfo->height <= 0 || createinfo->layer_count_or_depth <= 0) {
SDL_assert_release(!"For any texture: width, height, and layer_count_or_depth must be >= 1");
@@ -1815,7 +1815,7 @@ SDL_GPURenderPass *SDL_BeginGPURenderPass(
if (COMMAND_BUFFER_DEVICE->debug_mode) {
CHECK_COMMAND_BUFFER_RETURN_NULL
CHECK_ANY_PASS_IN_PROGRESS("Cannot begin render pass during another pass!", NULL)
CHECK_ANY_PASS_IN_PROGRESS("Cannot begin render pass during another pass!", NULL);
for (Uint32 i = 0; i < num_color_targets; i += 1) {
TextureCommonHeader *textureHeader = (TextureCommonHeader *)color_target_infos[i].texture;
@@ -2464,7 +2464,7 @@ SDL_GPUComputePass *SDL_BeginGPUComputePass(
if (COMMAND_BUFFER_DEVICE->debug_mode) {
CHECK_COMMAND_BUFFER_RETURN_NULL
CHECK_ANY_PASS_IN_PROGRESS("Cannot begin compute pass during another pass!", NULL)
CHECK_ANY_PASS_IN_PROGRESS("Cannot begin compute pass during another pass!", NULL);
for (Uint32 i = 0; i < num_storage_texture_bindings; i += 1) {
TextureCommonHeader *header = (TextureCommonHeader *)storage_texture_bindings[i].texture;
@@ -2765,7 +2765,7 @@ SDL_GPUCopyPass *SDL_BeginGPUCopyPass(
if (COMMAND_BUFFER_DEVICE->debug_mode) {
CHECK_COMMAND_BUFFER_RETURN_NULL
CHECK_ANY_PASS_IN_PROGRESS("Cannot begin copy pass during another pass!", NULL)
CHECK_ANY_PASS_IN_PROGRESS("Cannot begin copy pass during another pass!", NULL);
}
COMMAND_BUFFER_DEVICE->BeginCopyPass(
@@ -3054,7 +3054,7 @@ void SDL_GenerateMipmapsForGPUTexture(
if (COMMAND_BUFFER_DEVICE->debug_mode) {
CHECK_COMMAND_BUFFER
CHECK_ANY_PASS_IN_PROGRESS("Cannot generate mipmaps during a pass!", )
CHECK_ANY_PASS_IN_PROGRESS("Cannot generate mipmaps during a pass!", );
TextureCommonHeader *header = (TextureCommonHeader *)texture;
if (header->info.num_levels <= 1) {
@@ -3096,7 +3096,7 @@ void SDL_BlitGPUTexture(
if (COMMAND_BUFFER_DEVICE->debug_mode) {
CHECK_COMMAND_BUFFER
CHECK_ANY_PASS_IN_PROGRESS("Cannot blit during a pass!", )
CHECK_ANY_PASS_IN_PROGRESS("Cannot blit during a pass!", );
// Validation
bool failed = false;
@@ -3157,7 +3157,7 @@ bool SDL_WindowSupportsGPUSwapchainComposition(
}
if (device->debug_mode) {
CHECK_SWAPCHAINCOMPOSITION_ENUM_INVALID(swapchain_composition, false)
CHECK_SWAPCHAINCOMPOSITION_ENUM_INVALID(swapchain_composition, false);
}
return device->SupportsSwapchainComposition(
@@ -3179,7 +3179,7 @@ bool SDL_WindowSupportsGPUPresentMode(
}
if (device->debug_mode) {
CHECK_PRESENTMODE_ENUM_INVALID(present_mode, false)
CHECK_PRESENTMODE_ENUM_INVALID(present_mode, false);
}
return device->SupportsPresentMode(
@@ -3237,8 +3237,8 @@ bool SDL_SetGPUSwapchainParameters(
}
if (device->debug_mode) {
CHECK_SWAPCHAINCOMPOSITION_ENUM_INVALID(swapchain_composition, false)
CHECK_PRESENTMODE_ENUM_INVALID(present_mode, false)
CHECK_SWAPCHAINCOMPOSITION_ENUM_INVALID(swapchain_composition, false);
CHECK_PRESENTMODE_ENUM_INVALID(present_mode, false);
}
return device->SetSwapchainParameters(
@@ -3305,7 +3305,7 @@ bool SDL_AcquireGPUSwapchainTexture(
if (COMMAND_BUFFER_DEVICE->debug_mode) {
CHECK_COMMAND_BUFFER_RETURN_FALSE
CHECK_ANY_PASS_IN_PROGRESS("Cannot acquire a swapchain texture during a pass!", false)
CHECK_ANY_PASS_IN_PROGRESS("Cannot acquire a swapchain texture during a pass!", false);
}
bool result = COMMAND_BUFFER_DEVICE->AcquireSwapchainTexture(
@@ -3358,7 +3358,7 @@ bool SDL_WaitAndAcquireGPUSwapchainTexture(
if (COMMAND_BUFFER_DEVICE->debug_mode) {
CHECK_COMMAND_BUFFER_RETURN_FALSE
CHECK_ANY_PASS_IN_PROGRESS("Cannot acquire a swapchain texture during a pass!", false)
CHECK_ANY_PASS_IN_PROGRESS("Cannot acquire a swapchain texture during a pass!", false);
}
bool result = COMMAND_BUFFER_DEVICE->WaitAndAcquireSwapchainTexture(

View File

@@ -2434,7 +2434,7 @@ static Uint8 VULKAN_INTERNAL_BindMemoryForBuffer(
} \
commandBuffer->array[commandBuffer->count] = resource; \
commandBuffer->count += 1; \
SDL_AtomicIncRef(&resource->referenceCount);
SDL_AtomicIncRef(&resource->referenceCount)
static void VULKAN_INTERNAL_TrackBuffer(
VulkanCommandBuffer *commandBuffer,
@@ -2445,7 +2445,7 @@ static void VULKAN_INTERNAL_TrackBuffer(
VulkanBuffer *,
usedBuffers,
usedBufferCount,
usedBufferCapacity)
usedBufferCapacity);
}
static void VULKAN_INTERNAL_TrackTexture(
@@ -2457,7 +2457,7 @@ static void VULKAN_INTERNAL_TrackTexture(
VulkanTexture *,
usedTextures,
usedTextureCount,
usedTextureCapacity)
usedTextureCapacity);
}
static void VULKAN_INTERNAL_TrackSampler(
@@ -2469,7 +2469,7 @@ static void VULKAN_INTERNAL_TrackSampler(
VulkanSampler *,
usedSamplers,
usedSamplerCount,
usedSamplerCapacity)
usedSamplerCapacity);
}
static void VULKAN_INTERNAL_TrackGraphicsPipeline(
@@ -2481,7 +2481,7 @@ static void VULKAN_INTERNAL_TrackGraphicsPipeline(
VulkanGraphicsPipeline *,
usedGraphicsPipelines,
usedGraphicsPipelineCount,
usedGraphicsPipelineCapacity)
usedGraphicsPipelineCapacity);
}
static void VULKAN_INTERNAL_TrackComputePipeline(
@@ -2493,7 +2493,7 @@ static void VULKAN_INTERNAL_TrackComputePipeline(
VulkanComputePipeline *,
usedComputePipelines,
usedComputePipelineCount,
usedComputePipelineCapacity)
usedComputePipelineCapacity);
}
static void VULKAN_INTERNAL_TrackFramebuffer(