Skip to content

Commit

Permalink
ABI updates
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Jul 4, 2024
1 parent 79e0a33 commit 6e9f4a8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
9 changes: 5 additions & 4 deletions src/FNA3D_Driver_SDL.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ static inline uint32_t SDLGPU_INTERNAL_RoundToAlignment(
static SDL_GpuTextureFormat XNAToSDL_SurfaceFormat[] =
{
SDL_GPU_TEXTUREFORMAT_R8G8B8A8, /* SurfaceFormat.Color */
SDL_GPU_TEXTUREFORMAT_R5G6B5, /* SurfaceFormat.Bgr565 */
SDL_GPU_TEXTUREFORMAT_A1R5G5B5, /* SurfaceFormat.Bgra5551 */
SDL_GPU_TEXTUREFORMAT_B5G6R5, /* SurfaceFormat.Bgr565 */
SDL_GPU_TEXTUREFORMAT_B5G5R5A1, /* SurfaceFormat.Bgra5551 */
SDL_GPU_TEXTUREFORMAT_B4G4R4A4, /* SurfaceFormat.Bgra4444 */
SDL_GPU_TEXTUREFORMAT_BC1, /* SurfaceFormat.Dxt1 */
SDL_GPU_TEXTUREFORMAT_BC2, /* SurfaceFormat.Dxt3 */
SDL_GPU_TEXTUREFORMAT_BC3, /* SurfaceFormat.Dxt5 */
SDL_GPU_TEXTUREFORMAT_R8G8_SNORM, /* SurfaceFormat.NormalizedByte2 */
SDL_GPU_TEXTUREFORMAT_R8G8B8A8_SNORM, /* SurfaceFormat.NormalizedByte4 */
SDL_GPU_TEXTUREFORMAT_A2R10G10B10, /* SurfaceFormat.Rgba1010102 */
SDL_GPU_TEXTUREFORMAT_R10G10B10A2, /* SurfaceFormat.Rgba1010102 */
SDL_GPU_TEXTUREFORMAT_R16G16, /* SurfaceFormat.Rg32 */
SDL_GPU_TEXTUREFORMAT_R16G16B16A16, /* SurfaceFormat.Rgba64 */
SDL_GPU_TEXTUREFORMAT_A8, /* SurfaceFormat.Alpha8 */
Expand Down Expand Up @@ -3950,7 +3950,8 @@ static FNA3D_Device* SDLGPU_CreateDevice(
requestedPresentationParameters = *presentationParameters;
device = SDL_GpuCreateDevice(
SDL_GPU_BACKEND_VULKAN,
debugMode
debugMode,
SDL_FALSE
);

if (device == NULL)
Expand Down
16 changes: 8 additions & 8 deletions src/mojoshader_sdlgpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ typedef struct MOJOSHADER_sdlProgram MOJOSHADER_sdlProgram;
#ifndef SDL_GPU_H
typedef struct SDL_GpuDevice SDL_GpuDevice;
typedef struct SDL_GpuShaderModule SDL_GpuShaderModule;
typedef struct SDL_GpuRenderPass SDL_GpuRenderPass;
typedef struct SDL_GpuCommandBuffer SDL_GpuCommandBuffer;
#endif /* SDL_GPU_H */

/*
Expand Down Expand Up @@ -216,7 +216,7 @@ DECLSPEC int MOJOSHADER_sdlGetUniformBufferSize(MOJOSHADER_sdlShaderData *shader
* passed command buffer.
*/
DECLSPEC void MOJOSHADER_sdlUpdateUniformBuffers(MOJOSHADER_sdlContext *ctx,
SDL_GpuRenderPass *cb);
SDL_GpuCommandBuffer *cb);

/*
* Return the location of a vertex attribute for the given shader.
Expand Down Expand Up @@ -356,7 +356,7 @@ static void nuke_shaders(

static void update_uniform_buffer(
MOJOSHADER_sdlContext *ctx,
SDL_GpuRenderPass *renderPass,
SDL_GpuCommandBuffer *cb,
MOJOSHADER_sdlShaderData *shader
) {
int32_t i, j;
Expand Down Expand Up @@ -437,7 +437,7 @@ static void update_uniform_buffer(
if (shader->parseData->shader_type == MOJOSHADER_TYPE_VERTEX)
{
SDL_GpuPushVertexUniformData(
renderPass,
cb,
0,
contents,
content_size
Expand All @@ -446,7 +446,7 @@ static void update_uniform_buffer(
else
{
SDL_GpuPushFragmentUniformData(
renderPass,
cb,
0,
contents,
content_size
Expand Down Expand Up @@ -816,12 +816,12 @@ int MOJOSHADER_sdlGetUniformBufferSize(MOJOSHADER_sdlShaderData *shader)
} // MOJOSHADER_sdlGetUniformBufferSize

void MOJOSHADER_sdlUpdateUniformBuffers(MOJOSHADER_sdlContext *ctx,
SDL_GpuRenderPass *renderPass)
SDL_GpuCommandBuffer *cb)
{
if (MOJOSHADER_sdlGetUniformBufferSize(ctx->bound_program->vertexShaderData) > 0)
update_uniform_buffer(ctx, renderPass, ctx->bound_program->vertexShaderData);
update_uniform_buffer(ctx, cb, ctx->bound_program->vertexShaderData);
if (MOJOSHADER_sdlGetUniformBufferSize(ctx->bound_program->pixelShaderData) > 0)
update_uniform_buffer(ctx, renderPass, ctx->bound_program->pixelShaderData);
update_uniform_buffer(ctx, cb, ctx->bound_program->pixelShaderData);
} // MOJOSHADER_sdlUpdateUniformBuffers

int MOJOSHADER_sdlGetVertexAttribLocation(
Expand Down

0 comments on commit 6e9f4a8

Please sign in to comment.