Skip to content

Commit

Permalink
Don't acquire new command buffers on DestroyDevice
Browse files Browse the repository at this point in the history
  • Loading branch information
thatcosmonaut committed Oct 9, 2024
1 parent 93cc347 commit d34eecf
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/FNA3D_Driver_SDL.c
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,7 @@ static void SDLGPU_VerifyVertexSampler(
{
renderer->vertexTextureSamplerBindings[index].texture = renderer->dummyTextureCube;
}
}
}
else
{
renderer->vertexTextureSamplerBindings[index].texture = renderer->dummyTexture2D;
Expand Down Expand Up @@ -1787,7 +1787,7 @@ static void SDLGPU_VerifySampler(
{
renderer->fragmentTextureSamplerBindings[index].sampler = renderer->dummySampler;

if (fragShader)
if (fragShader)
{
samplerType = MOJOSHADER_sdlGetShaderParseData(fragShader)->samplers[index].type;
if (samplerType == MOJOSHADER_SAMPLER_2D)
Expand Down Expand Up @@ -3927,7 +3927,11 @@ static void SDLGPU_DestroyDevice(FNA3D_Device *device)
SDLGPU_Renderer *renderer = (SDLGPU_Renderer*) device->driverData;
int32_t i, j;

SDLGPU_INTERNAL_FlushCommandsAndStall(renderer);
// Completely flush command buffers and stall
SDLGPU_INTERNAL_FlushCommands(renderer);
SDL_SubmitGPUCommandBuffer(renderer->uploadCommandBuffer);
SDL_SubmitGPUCommandBuffer(renderer->renderCommandBuffer);
SDL_WaitForGPUIdle(renderer->device);

if (renderer->textureDownloadBuffer != NULL)
{
Expand Down

0 comments on commit d34eecf

Please sign in to comment.