Skip to content

Commit ecc2d53

Browse files
committed
Merge remote-tracking branch 'origin/master' into ImPlot_ImNodes_ImGuizmo_Integration
2 parents 9d7c2dc + 817d35a commit ecc2d53

File tree

10 files changed

+121
-340
lines changed

10 files changed

+121
-340
lines changed

src/CodeGenerator/TypeInfo.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ public class TypeInfo
138138
public static readonly HashSet<string> SkippedFunctions = new HashSet<string>()
139139
{
140140
"igInputText",
141-
"igInputTextMultiline"
141+
"igInputTextMultiline",
142+
"igCalcTextSize",
143+
"igInputTextWithHint"
142144
};
143145
}
144146
}

src/ImGui.NET.SampleProgram/ImGuiController.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ public void CreateDeviceResources(GraphicsDevice gd, OutputDescription outputDes
9999

100100
byte[] vertexShaderBytes = LoadEmbeddedShaderCode(gd.ResourceFactory, "imgui-vertex", ShaderStages.Vertex);
101101
byte[] fragmentShaderBytes = LoadEmbeddedShaderCode(gd.ResourceFactory, "imgui-frag", ShaderStages.Fragment);
102-
_vertexShader = factory.CreateShader(new ShaderDescription(ShaderStages.Vertex, vertexShaderBytes, "VS"));
103-
_fragmentShader = factory.CreateShader(new ShaderDescription(ShaderStages.Fragment, fragmentShaderBytes, "FS"));
102+
_vertexShader = factory.CreateShader(new ShaderDescription(ShaderStages.Vertex, vertexShaderBytes, gd.BackendType == GraphicsBackend.Metal ? "VS" : "main"));
103+
_fragmentShader = factory.CreateShader(new ShaderDescription(ShaderStages.Fragment, fragmentShaderBytes, gd.BackendType == GraphicsBackend.Metal ? "FS" : "main"));
104104

105105
VertexLayoutDescription[] vertexLayouts = new VertexLayoutDescription[]
106106
{
@@ -123,7 +123,8 @@ public void CreateDeviceResources(GraphicsDevice gd, OutputDescription outputDes
123123
PrimitiveTopology.TriangleList,
124124
new ShaderSetDescription(vertexLayouts, new[] { _vertexShader, _fragmentShader }),
125125
new ResourceLayout[] { _layout, _textureLayout },
126-
outputDescription);
126+
outputDescription,
127+
ResourceBindingModel.Default);
127128
_pipeline = factory.CreateGraphicsPipeline(ref pd);
128129

129130
_mainResourceSet = factory.CreateResourceSet(new ResourceSetDescription(_layout,

src/ImGui.NET.SampleProgram/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static void Main(string[] args)
3838
// Create window, GraphicsDevice, and all resources necessary for the demo.
3939
VeldridStartup.CreateWindowAndGraphicsDevice(
4040
new WindowCreateInfo(50, 50, 1280, 720, WindowState.Normal, "ImGui.NET Sample Program"),
41-
new GraphicsDeviceOptions(true, null, true),
41+
new GraphicsDeviceOptions(true, null, true, ResourceBindingModel.Improved, true, true),
4242
out _window,
4343
out _gd);
4444
_window.Resized += () =>

src/ImGui.NET.SampleProgram/Shaders/SPIR-V/imgui-frag.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ layout (location = 0) out vec4 outputColor;
1313
void main()
1414
{
1515
outputColor = color * texture(sampler2D(FontTexture, FontSampler), texCoord);
16-
}
16+
}
0 Bytes
Binary file not shown.

src/ImGui.NET.SampleProgram/Shaders/SPIR-V/imgui-vertex.glsl

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,26 @@
33
#extension GL_ARB_separate_shader_objects : enable
44
#extension GL_ARB_shading_language_420pack : enable
55

6-
layout (location = 0) in vec2 vsin_position;
7-
layout (location = 1) in vec2 vsin_texCoord;
8-
layout (location = 2) in vec4 vsin_color;
6+
layout (location = 0) in vec2 in_position;
7+
layout (location = 1) in vec2 in_texCoord;
8+
layout (location = 2) in vec4 in_color;
99

10-
layout (binding = 0) uniform Projection
10+
layout (binding = 0) uniform ProjectionMatrixBuffer
1111
{
12-
mat4 projection;
12+
mat4 projection_matrix;
1313
};
1414

15-
layout (location = 0) out vec4 vsout_color;
16-
layout (location = 1) out vec2 vsout_texCoord;
15+
layout (location = 0) out vec4 color;
16+
layout (location = 1) out vec2 texCoord;
1717

18-
out gl_PerVertex
18+
out gl_PerVertex
1919
{
2020
vec4 gl_Position;
2121
};
2222

2323
void main()
2424
{
25-
gl_Position = projection * vec4(vsin_position, 0, 1);
26-
vsout_color = vsin_color;
27-
vsout_texCoord = vsin_texCoord;
28-
gl_Position.y = -gl_Position.y;
25+
gl_Position = projection_matrix * vec4(in_position, 0, 1);
26+
color = in_color;
27+
texCoord = in_texCoord;
2928
}
-136 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)