Skip to content

Commit

Permalink
named resource binding union
Browse files Browse the repository at this point in the history
  • Loading branch information
thatcosmonaut committed Apr 25, 2024
1 parent f5368ae commit 2e29508
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/FNA3D_Driver_SDL.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ static inline SDL_GpuTextureFormat XNAToSDL_DepthFormat(

/* Statics */

static SDL_GpuBackend preferredBackends[2] = { SDL_GPU_BACKEND_VULKAN, SDL_GPU_BACKEND_D3D11 };
static SDL_GpuBackend preferredBackends[2] = { SDL_GPU_BACKEND_D3D11, SDL_GPU_BACKEND_VULKAN };
static FNA3D_PresentationParameters requestedPresentationParameters;

/* Submission / Presentation */
Expand Down Expand Up @@ -2173,7 +2173,7 @@ static void SDLGPU_INTERNAL_BindVertexSamplers(
for (i = 0; i < resourceBindingCount; i += 1)
{
resourceBindings[i].resourceType = SDL_GPU_RESOURCETYPE_TEXTURE_SAMPLER;
resourceBindings[i].textureSampler = renderer->vertexTextureSamplerBindings[i];
resourceBindings[i].resource.textureSampler = renderer->vertexTextureSamplerBindings[i];
}

SDL_GpuBindGraphicsResourceSet(
Expand Down Expand Up @@ -2203,7 +2203,7 @@ static void SDLGPU_INTERNAL_BindFragmentSamplers(
for (i = 0; i < resourceBindingCount; i += 1)
{
resourceBindings[i].resourceType = SDL_GPU_RESOURCETYPE_TEXTURE_SAMPLER;
resourceBindings[i].textureSampler = renderer->fragmentTextureSamplerBindings[i];
resourceBindings[i].resource.textureSampler = renderer->fragmentTextureSamplerBindings[i];
}

SDL_GpuBindGraphicsResourceSet(
Expand Down
8 changes: 4 additions & 4 deletions src/mojoshader_sdlgpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,8 @@ static void update_uniform_buffer(
if (shader->parseData->shader_type == MOJOSHADER_TYPE_VERTEX)
{
uniformBinding.resourceType = SDL_GPU_RESOURCETYPE_UNIFORM_BUFFER;
uniformBinding.uniformBuffer.uniformBuffer = ctx->vertex_uniform_buffer;
uniformBinding.uniformBuffer.uniformDataSizeInBytes = MOJOSHADER_sdlGetUniformBufferSize(shader);
uniformBinding.resource.uniformBuffer.uniformBuffer = ctx->vertex_uniform_buffer;
uniformBinding.resource.uniformBuffer.uniformDataSizeInBytes = MOJOSHADER_sdlGetUniformBufferSize(shader);

/* FIXME: is there some way we can avoid repeatedly binding? */
SDL_GpuBindGraphicsResourceSet(
Expand All @@ -484,8 +484,8 @@ static void update_uniform_buffer(
else
{
uniformBinding.resourceType = SDL_GPU_RESOURCETYPE_UNIFORM_BUFFER;
uniformBinding.uniformBuffer.uniformBuffer = ctx->fragment_uniform_buffer;
uniformBinding.uniformBuffer.uniformDataSizeInBytes = MOJOSHADER_sdlGetUniformBufferSize(shader);
uniformBinding.resource.uniformBuffer.uniformBuffer = ctx->fragment_uniform_buffer;
uniformBinding.resource.uniformBuffer.uniformDataSizeInBytes = MOJOSHADER_sdlGetUniformBufferSize(shader);

/* FIXME: is there some way we can avoid repeatedly binding? */
SDL_GpuBindGraphicsResourceSet(
Expand Down

0 comments on commit 2e29508

Please sign in to comment.