mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 09:26:25 +00:00
Use consistent style for pointer declarations and casts
This commit is contained in:
@@ -1954,7 +1954,7 @@ void SDL_BindGPUVertexSamplers(
|
||||
if (RENDERPASS_DEVICE->debug_mode) {
|
||||
CHECK_RENDERPASS
|
||||
|
||||
if (!((CommandBufferCommonHeader*)RENDERPASS_COMMAND_BUFFER)->ignore_render_pass_texture_validation)
|
||||
if (!((CommandBufferCommonHeader *)RENDERPASS_COMMAND_BUFFER)->ignore_render_pass_texture_validation)
|
||||
{
|
||||
CHECK_SAMPLER_TEXTURES
|
||||
}
|
||||
@@ -2050,7 +2050,7 @@ void SDL_BindGPUFragmentSamplers(
|
||||
if (RENDERPASS_DEVICE->debug_mode) {
|
||||
CHECK_RENDERPASS
|
||||
|
||||
if (!((CommandBufferCommonHeader*)RENDERPASS_COMMAND_BUFFER)->ignore_render_pass_texture_validation) {
|
||||
if (!((CommandBufferCommonHeader *)RENDERPASS_COMMAND_BUFFER)->ignore_render_pass_texture_validation) {
|
||||
CHECK_SAMPLER_TEXTURES
|
||||
}
|
||||
|
||||
|
@@ -1210,7 +1210,7 @@ static ID3D12CommandQueue *s_CommandQueue;
|
||||
|
||||
#if defined(SDL_PLATFORM_XBOXONE)
|
||||
// These are not defined in d3d12_x.h.
|
||||
typedef HRESULT (D3DAPI* PFN_D3D12_XBOX_CREATE_DEVICE)(_In_opt_ IGraphicsUnknown*, _In_ const D3D12XBOX_CREATE_DEVICE_PARAMETERS*, _In_ REFIID, _Outptr_opt_ void**);
|
||||
typedef HRESULT (D3DAPI* PFN_D3D12_XBOX_CREATE_DEVICE)(_In_opt_ IGraphicsUnknown *, _In_ const D3D12XBOX_CREATE_DEVICE_PARAMETERS*, _In_ REFIID, _Outptr_opt_ void **);
|
||||
#define D3D12_STANDARD_MULTISAMPLE_PATTERN DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN
|
||||
#endif
|
||||
|
||||
@@ -2212,15 +2212,15 @@ static D3D12StagingDescriptorPool *D3D12_INTERNAL_CreateStagingDescriptorPool(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
D3D12StagingDescriptorPool *pool = (D3D12StagingDescriptorPool*) SDL_calloc(1, sizeof(D3D12StagingDescriptorPool));
|
||||
D3D12StagingDescriptorPool *pool = (D3D12StagingDescriptorPool *)SDL_calloc(1, sizeof(D3D12StagingDescriptorPool));
|
||||
|
||||
pool->heapCount = 1;
|
||||
pool->heaps = (D3D12DescriptorHeap**) SDL_malloc(sizeof(D3D12DescriptorHeap*));
|
||||
pool->heaps = (D3D12DescriptorHeap **)SDL_malloc(sizeof(D3D12DescriptorHeap *));
|
||||
pool->heaps[0] = heap;
|
||||
|
||||
pool->freeDescriptorCapacity = STAGING_HEAP_DESCRIPTOR_COUNT;
|
||||
pool->freeDescriptorCount = STAGING_HEAP_DESCRIPTOR_COUNT;
|
||||
pool->freeDescriptors = (D3D12StagingDescriptor*) SDL_malloc(STAGING_HEAP_DESCRIPTOR_COUNT * sizeof(D3D12StagingDescriptor));
|
||||
pool->freeDescriptors = (D3D12StagingDescriptor *)SDL_malloc(STAGING_HEAP_DESCRIPTOR_COUNT * sizeof(D3D12StagingDescriptor));
|
||||
|
||||
for (Uint32 i = 0; i < STAGING_HEAP_DESCRIPTOR_COUNT; i += 1) {
|
||||
pool->freeDescriptors[i].pool = pool;
|
||||
@@ -2250,12 +2250,12 @@ static bool D3D12_INTERNAL_ExpandStagingDescriptorPool(
|
||||
}
|
||||
|
||||
pool->heapCount += 1;
|
||||
pool->heaps = (D3D12DescriptorHeap**) SDL_realloc(pool->heaps, pool->heapCount * sizeof(D3D12DescriptorHeap*));
|
||||
pool->heaps = (D3D12DescriptorHeap **)SDL_realloc(pool->heaps, pool->heapCount * sizeof(D3D12DescriptorHeap *));
|
||||
pool->heaps[pool->heapCount - 1] = heap;
|
||||
|
||||
pool->freeDescriptorCapacity += STAGING_HEAP_DESCRIPTOR_COUNT;
|
||||
pool->freeDescriptorCount += STAGING_HEAP_DESCRIPTOR_COUNT;
|
||||
pool->freeDescriptors = (D3D12StagingDescriptor*) SDL_realloc(pool->freeDescriptors, pool->freeDescriptorCapacity * sizeof(D3D12StagingDescriptor));
|
||||
pool->freeDescriptors = (D3D12StagingDescriptor *)SDL_realloc(pool->freeDescriptors, pool->freeDescriptorCapacity * sizeof(D3D12StagingDescriptor));
|
||||
|
||||
for (Uint32 i = 0; i < STAGING_HEAP_DESCRIPTOR_COUNT; i += 1) {
|
||||
pool->freeDescriptors[i].pool = pool;
|
||||
@@ -7521,7 +7521,7 @@ static bool D3D12_INTERNAL_AcquireSwapchainTexture(
|
||||
1,
|
||||
&barrierDesc);
|
||||
|
||||
*swapchainTexture = (SDL_GPUTexture*)&windowData->textureContainers[swapchainIndex];
|
||||
*swapchainTexture = (SDL_GPUTexture *)&windowData->textureContainers[swapchainIndex];
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -7933,7 +7933,7 @@ static bool D3D12_Submit(
|
||||
ID3D12Resource_Release(windowData->textureContainers[presentData->swapchainImageIndex].activeTexture->resource);
|
||||
#endif
|
||||
|
||||
windowData->inFlightFences[windowData->frameCounter] = (SDL_GPUFence*)d3d12CommandBuffer->inFlightFence;
|
||||
windowData->inFlightFences[windowData->frameCounter] = (SDL_GPUFence *)d3d12CommandBuffer->inFlightFence;
|
||||
(void)SDL_AtomicIncRef(&d3d12CommandBuffer->inFlightFence->referenceCount);
|
||||
windowData->frameCounter = (windowData->frameCounter + 1) % renderer->allowedFramesInFlight;
|
||||
}
|
||||
|
@@ -3297,7 +3297,7 @@ static void SDLCALL VULKAN_INTERNAL_GraphicsPipelineResourceLayoutHashDestroy(vo
|
||||
VulkanRenderer *renderer = (VulkanRenderer *)userdata;
|
||||
VulkanGraphicsPipelineResourceLayout *resourceLayout = (VulkanGraphicsPipelineResourceLayout *)value;
|
||||
VULKAN_INTERNAL_DestroyGraphicsPipelineResourceLayout(renderer, resourceLayout);
|
||||
SDL_free((void*)key);
|
||||
SDL_free((void *)key);
|
||||
}
|
||||
|
||||
static Uint32 SDLCALL VULKAN_INTERNAL_ComputePipelineResourceLayoutHashFunction(void *userdata, const void *key)
|
||||
@@ -3328,7 +3328,7 @@ static void SDLCALL VULKAN_INTERNAL_ComputePipelineResourceLayoutHashDestroy(voi
|
||||
VulkanRenderer *renderer = (VulkanRenderer *)userdata;
|
||||
VulkanComputePipelineResourceLayout *resourceLayout = (VulkanComputePipelineResourceLayout *)value;
|
||||
VULKAN_INTERNAL_DestroyComputePipelineResourceLayout(renderer, resourceLayout);
|
||||
SDL_free((void*)key);
|
||||
SDL_free((void *)key);
|
||||
}
|
||||
|
||||
static Uint32 SDLCALL VULKAN_INTERNAL_DescriptorSetLayoutHashFunction(void *userdata, const void *key)
|
||||
@@ -3361,7 +3361,7 @@ static void SDLCALL VULKAN_INTERNAL_DescriptorSetLayoutHashDestroy(void *userdat
|
||||
VulkanRenderer *renderer = (VulkanRenderer *)userdata;
|
||||
DescriptorSetLayout *layout = (DescriptorSetLayout *)value;
|
||||
VULKAN_INTERNAL_DestroyDescriptorSetLayout(renderer, layout);
|
||||
SDL_free((void*)key);
|
||||
SDL_free((void *)key);
|
||||
}
|
||||
|
||||
static Uint32 SDLCALL VULKAN_INTERNAL_CommandPoolHashFunction(void *userdata, const void *key)
|
||||
@@ -10111,7 +10111,7 @@ static SDL_GPUTextureFormat VULKAN_GetSwapchainTextureFormat(
|
||||
SDL_GPURenderer *driverData,
|
||||
SDL_Window *window)
|
||||
{
|
||||
VulkanRenderer *renderer = (VulkanRenderer*)driverData;
|
||||
VulkanRenderer *renderer = (VulkanRenderer *)driverData;
|
||||
WindowData *windowData = VULKAN_INTERNAL_FetchWindowData(window);
|
||||
|
||||
if (windowData == NULL) {
|
||||
@@ -10622,7 +10622,7 @@ static bool VULKAN_Submit(
|
||||
|
||||
if (presentResult == VK_SUCCESS || presentResult == VK_SUBOPTIMAL_KHR || presentResult == VK_ERROR_OUT_OF_DATE_KHR) {
|
||||
// If presenting, the swapchain is using the in-flight fence
|
||||
presentData->windowData->inFlightFences[presentData->windowData->frameCounter] = (SDL_GPUFence*)vulkanCommandBuffer->inFlightFence;
|
||||
presentData->windowData->inFlightFences[presentData->windowData->frameCounter] = (SDL_GPUFence *)vulkanCommandBuffer->inFlightFence;
|
||||
(void)SDL_AtomicIncRef(&vulkanCommandBuffer->inFlightFence->referenceCount);
|
||||
|
||||
if (presentResult == VK_SUBOPTIMAL_KHR || presentResult == VK_ERROR_OUT_OF_DATE_KHR) {
|
||||
|
Reference in New Issue
Block a user