mirror of
https://github.com/ocornut/imgui.git
synced 2026-09-28 04:03:28 +03:00
This will resolve runtime errors identified by XCode's Metal Shader Validator.
This commit is contained in:
parent
520a29dd51
commit
481f2cea17
1 changed files with 4 additions and 3 deletions
|
|
@ -239,9 +239,6 @@ void ImGui_ImplMetal4_RenderDrawData(ImDrawData* draw_data, id<MTL4CommandBuffer
|
||||||
ImVec2 clip_off = draw_data->DisplayPos; // (0,0) unless using multi-viewports
|
ImVec2 clip_off = draw_data->DisplayPos; // (0,0) unless using multi-viewports
|
||||||
ImVec2 clip_scale = draw_data->FramebufferScale; // (1,1) unless using retina display which are often (2,2)
|
ImVec2 clip_scale = draw_data->FramebufferScale; // (1,1) unless using retina display which are often (2,2)
|
||||||
|
|
||||||
// Before rendering command lists, commit residency set
|
|
||||||
[bd->SharedMetalContext.residencySet commit];
|
|
||||||
|
|
||||||
// Render command lists
|
// Render command lists
|
||||||
size_t vertexBufferOffset = 0;
|
size_t vertexBufferOffset = 0;
|
||||||
size_t indexBufferOffset = 0;
|
size_t indexBufferOffset = 0;
|
||||||
|
|
@ -292,6 +289,7 @@ void ImGui_ImplMetal4_RenderDrawData(ImDrawData* draw_data, id<MTL4CommandBuffer
|
||||||
if (tex_id != ImTextureID_Invalid)
|
if (tex_id != ImTextureID_Invalid)
|
||||||
{
|
{
|
||||||
id<MTLTexture> texture = (__bridge id<MTLTexture>)(void*)(intptr_t)tex_id;
|
id<MTLTexture> texture = (__bridge id<MTLTexture>)(void*)(intptr_t)tex_id;
|
||||||
|
[bd->SharedMetalContext.residencySet addAllocation:texture];
|
||||||
[bd->SharedMetalContext.argumentTable setTexture:texture.gpuResourceID atIndex:0];
|
[bd->SharedMetalContext.argumentTable setTexture:texture.gpuResourceID atIndex:0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -317,6 +315,9 @@ void ImGui_ImplMetal4_RenderDrawData(ImDrawData* draw_data, id<MTL4CommandBuffer
|
||||||
[slotCache addObject:vertexBuffer];
|
[slotCache addObject:vertexBuffer];
|
||||||
[slotCache addObject:indexBuffer];
|
[slotCache addObject:indexBuffer];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Commit residency set
|
||||||
|
[bd->SharedMetalContext.residencySet commit];
|
||||||
bd->RenderCommandEncoder = nil;
|
bd->RenderCommandEncoder = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue