mirror of
https://github.com/ocornut/imgui.git
synced 2025-12-22 06:15:37 +00:00
Merge branch 'master' into docking
# Conflicts: # backends/imgui_impl_sdlgpu3.cpp # backends/imgui_impl_win32.cpp
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
// CHANGELOG
|
||||
// 2025-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
|
||||
// 2025-11-26: macOS version can use MSL shaders in order to support macOS 10.14+ (vs Metallib shaders requiring macOS 14+). Requires calling SDL_CreateGPUDevice() with SDL_GPU_SHADERFORMAT_MSL.
|
||||
// 2025-09-18: Call platform_io.ClearRendererHandlers() on shutdown.
|
||||
// 2025-08-20: Added ImGui_ImplSDLGPU3_InitInfo::SwapchainComposition and ImGui_ImplSDLGPU3_InitInfo::PresentMode to configure how secondary viewports are created.
|
||||
// 2025-08-08: *BREAKING* Changed ImTextureID type from SDL_GPUTextureSamplerBinding* to SDL_GPUTexture*, which is more natural and easier for user to manage. If you need to change the current sampler, you can access the ImGui_ImplSDLGPU3_RenderState struct. (#8866, #8163, #7998, #7988)
|
||||
@@ -454,14 +455,31 @@ static void ImGui_ImplSDLGPU3_CreateShaders()
|
||||
#ifdef __APPLE__
|
||||
else
|
||||
{
|
||||
vertex_shader_info.entrypoint = "main0";
|
||||
vertex_shader_info.format = SDL_GPU_SHADERFORMAT_METALLIB;
|
||||
vertex_shader_info.code = metallib_vertex;
|
||||
vertex_shader_info.code_size = sizeof(metallib_vertex);
|
||||
fragment_shader_info.entrypoint = "main0";
|
||||
fragment_shader_info.format = SDL_GPU_SHADERFORMAT_METALLIB;
|
||||
fragment_shader_info.code = metallib_fragment;
|
||||
fragment_shader_info.code_size = sizeof(metallib_fragment);
|
||||
SDL_GPUShaderFormat supported_formats = SDL_GetGPUShaderFormats(v->Device);
|
||||
if (supported_formats & SDL_GPU_SHADERFORMAT_METALLIB)
|
||||
{
|
||||
// Using metallib blobs (macOS 14+, iOS)
|
||||
vertex_shader_info.entrypoint = "main0";
|
||||
vertex_shader_info.format = SDL_GPU_SHADERFORMAT_METALLIB;
|
||||
vertex_shader_info.code = metallib_vertex;
|
||||
vertex_shader_info.code_size = sizeof(metallib_vertex);
|
||||
fragment_shader_info.entrypoint = "main0";
|
||||
fragment_shader_info.format = SDL_GPU_SHADERFORMAT_METALLIB;
|
||||
fragment_shader_info.code = metallib_fragment;
|
||||
fragment_shader_info.code_size = sizeof(metallib_fragment);
|
||||
}
|
||||
else if (supported_formats & SDL_GPU_SHADERFORMAT_MSL)
|
||||
{
|
||||
// macOS: using MSL source
|
||||
vertex_shader_info.entrypoint = "main0";
|
||||
vertex_shader_info.format = SDL_GPU_SHADERFORMAT_MSL;
|
||||
vertex_shader_info.code = msl_vertex;
|
||||
vertex_shader_info.code_size = sizeof(msl_vertex);
|
||||
fragment_shader_info.entrypoint = "main0";
|
||||
fragment_shader_info.format = SDL_GPU_SHADERFORMAT_MSL;
|
||||
fragment_shader_info.code = msl_fragment;
|
||||
fragment_shader_info.code_size = sizeof(msl_fragment);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
bd->VertexShader = SDL_CreateGPUShader(v->Device, &vertex_shader_info);
|
||||
|
||||
Reference in New Issue
Block a user