Fix ImGui.NET.SampleProgram to work with

Vulkan on the latest Vildrid releases
internals
Kaydax 4 years ago
parent 66f1afa9a2
commit 92b3afdf82
No known key found for this signature in database
GPG Key ID: 6D32EED87DE7F090
  1. 4
      src/ImGui.NET.SampleProgram/ImGuiController.cs
  2. BIN
      src/ImGui.NET.SampleProgram/Shaders/SPIR-V/imgui-frag.spv
  3. 21
      src/ImGui.NET.SampleProgram/Shaders/SPIR-V/imgui-vertex.glsl
  4. BIN
      src/ImGui.NET.SampleProgram/Shaders/SPIR-V/imgui-vertex.spv

@ -99,8 +99,8 @@ namespace ImGuiNET
byte[] vertexShaderBytes = LoadEmbeddedShaderCode(gd.ResourceFactory, "imgui-vertex", ShaderStages.Vertex); byte[] vertexShaderBytes = LoadEmbeddedShaderCode(gd.ResourceFactory, "imgui-vertex", ShaderStages.Vertex);
byte[] fragmentShaderBytes = LoadEmbeddedShaderCode(gd.ResourceFactory, "imgui-frag", ShaderStages.Fragment); byte[] fragmentShaderBytes = LoadEmbeddedShaderCode(gd.ResourceFactory, "imgui-frag", ShaderStages.Fragment);
_vertexShader = factory.CreateShader(new ShaderDescription(ShaderStages.Vertex, vertexShaderBytes, "VS")); _vertexShader = factory.CreateShader(new ShaderDescription(ShaderStages.Vertex, vertexShaderBytes, "main"));
_fragmentShader = factory.CreateShader(new ShaderDescription(ShaderStages.Fragment, fragmentShaderBytes, "FS")); _fragmentShader = factory.CreateShader(new ShaderDescription(ShaderStages.Fragment, fragmentShaderBytes, "main"));
VertexLayoutDescription[] vertexLayouts = new VertexLayoutDescription[] VertexLayoutDescription[] vertexLayouts = new VertexLayoutDescription[]
{ {

@ -3,17 +3,17 @@
#extension GL_ARB_separate_shader_objects : enable #extension GL_ARB_separate_shader_objects : enable
#extension GL_ARB_shading_language_420pack : enable #extension GL_ARB_shading_language_420pack : enable
layout (location = 0) in vec2 vsin_position; layout (location = 0) in vec2 in_position;
layout (location = 1) in vec2 vsin_texCoord; layout (location = 1) in vec2 in_texCoord;
layout (location = 2) in vec4 vsin_color; layout (location = 2) in vec4 in_color;
layout (binding = 0) uniform Projection layout (binding = 0) uniform ProjectionMatrixBuffer
{ {
mat4 projection; mat4 projection_matrix;
}; };
layout (location = 0) out vec4 vsout_color; layout (location = 0) out vec4 color;
layout (location = 1) out vec2 vsout_texCoord; layout (location = 1) out vec2 texCoord;
out gl_PerVertex out gl_PerVertex
{ {
@ -22,8 +22,7 @@ out gl_PerVertex
void main() void main()
{ {
gl_Position = projection * vec4(vsin_position, 0, 1); gl_Position = projection_matrix * vec4(in_position, 0, 1);
vsout_color = vsin_color; color = in_color;
vsout_texCoord = vsin_texCoord; texCoord = in_texCoord;
gl_Position.y = -gl_Position.y;
} }

Loading…
Cancel
Save