Fix Metal rendering.

internals
Eric Mellino 4 years ago
parent f7d49bcc38
commit 817d35a425
  1. 6
      NuGet.Config
  2. 7
      src/ImGui.NET.SampleProgram/ImGuiController.cs

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="dotnet-myget dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
</packageSources>
</configuration>

@ -99,8 +99,8 @@ namespace ImGuiNET
byte[] vertexShaderBytes = LoadEmbeddedShaderCode(gd.ResourceFactory, "imgui-vertex", ShaderStages.Vertex);
byte[] fragmentShaderBytes = LoadEmbeddedShaderCode(gd.ResourceFactory, "imgui-frag", ShaderStages.Fragment);
_vertexShader = factory.CreateShader(new ShaderDescription(ShaderStages.Vertex, vertexShaderBytes, "main"));
_fragmentShader = factory.CreateShader(new ShaderDescription(ShaderStages.Fragment, fragmentShaderBytes, "main"));
_vertexShader = factory.CreateShader(new ShaderDescription(ShaderStages.Vertex, vertexShaderBytes, gd.BackendType == GraphicsBackend.Metal ? "VS" : "main"));
_fragmentShader = factory.CreateShader(new ShaderDescription(ShaderStages.Fragment, fragmentShaderBytes, gd.BackendType == GraphicsBackend.Metal ? "FS" : "main"));
VertexLayoutDescription[] vertexLayouts = new VertexLayoutDescription[]
{
@ -123,7 +123,8 @@ namespace ImGuiNET
PrimitiveTopology.TriangleList,
new ShaderSetDescription(vertexLayouts, new[] { _vertexShader, _fragmentShader }),
new ResourceLayout[] { _layout, _textureLayout },
outputDescription);
outputDescription,
ResourceBindingModel.Default);
_pipeline = factory.CreateGraphicsPipeline(ref pd);
_mainResourceSet = factory.CreateResourceSet(new ResourceSetDescription(_layout,

Loading…
Cancel
Save