mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Add standalone testbed
This commit is contained in:
parent
5ddf473450
commit
b8ce2d4001
21 changed files with 948 additions and 2 deletions
13
imgui/StandaloneImGuiTestbed/Shaders/GLSL/imgui-frag.glsl
Normal file
13
imgui/StandaloneImGuiTestbed/Shaders/GLSL/imgui-frag.glsl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#version 330 core
|
||||
|
||||
uniform sampler2D FontTexture;
|
||||
|
||||
in vec4 color;
|
||||
in vec2 texCoord;
|
||||
|
||||
out vec4 outputColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
outputColor = color * texture(FontTexture, texCoord);
|
||||
}
|
||||
20
imgui/StandaloneImGuiTestbed/Shaders/GLSL/imgui-vertex.glsl
Normal file
20
imgui/StandaloneImGuiTestbed/Shaders/GLSL/imgui-vertex.glsl
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#version 330 core
|
||||
|
||||
uniform ProjectionMatrixBuffer
|
||||
{
|
||||
mat4 projection_matrix;
|
||||
};
|
||||
|
||||
in vec2 in_position;
|
||||
in vec2 in_texCoord;
|
||||
in vec4 in_color;
|
||||
|
||||
out vec4 color;
|
||||
out vec2 texCoord;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projection_matrix * vec4(in_position, 0, 1);
|
||||
color = in_color;
|
||||
texCoord = in_texCoord;
|
||||
}
|
||||
15
imgui/StandaloneImGuiTestbed/Shaders/HLSL/imgui-frag.hlsl
Normal file
15
imgui/StandaloneImGuiTestbed/Shaders/HLSL/imgui-frag.hlsl
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
struct PS_INPUT
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float4 col : COLOR0;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
Texture2D FontTexture : register(t0);
|
||||
sampler FontSampler : register(s0);
|
||||
|
||||
float4 FS(PS_INPUT input) : SV_Target
|
||||
{
|
||||
float4 out_col = input.col * FontTexture.Sample(FontSampler, input.uv);
|
||||
return out_col;
|
||||
}
|
||||
BIN
imgui/StandaloneImGuiTestbed/Shaders/HLSL/imgui-frag.hlsl.bytes
Normal file
BIN
imgui/StandaloneImGuiTestbed/Shaders/HLSL/imgui-frag.hlsl.bytes
Normal file
Binary file not shown.
27
imgui/StandaloneImGuiTestbed/Shaders/HLSL/imgui-vertex.hlsl
Normal file
27
imgui/StandaloneImGuiTestbed/Shaders/HLSL/imgui-vertex.hlsl
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
cbuffer ProjectionMatrixBuffer : register(b0)
|
||||
{
|
||||
float4x4 ProjectionMatrix;
|
||||
};
|
||||
|
||||
struct VS_INPUT
|
||||
{
|
||||
float2 pos : POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 col : COLOR0;
|
||||
};
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float4 pos : SV_POSITION;
|
||||
float4 col : COLOR0;
|
||||
float2 uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
PS_INPUT VS(VS_INPUT input)
|
||||
{
|
||||
PS_INPUT output;
|
||||
output.pos = mul(ProjectionMatrix, float4(input.pos.xy, 0.f, 1.f));
|
||||
output.col = input.col;
|
||||
output.uv = input.uv;
|
||||
return output;
|
||||
}
|
||||
Binary file not shown.
18
imgui/StandaloneImGuiTestbed/Shaders/Metal/imgui-frag.metal
Normal file
18
imgui/StandaloneImGuiTestbed/Shaders/Metal/imgui-frag.metal
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include <metal_stdlib>
|
||||
using namespace metal;
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float4 pos [[ position ]];
|
||||
float4 col;
|
||||
float2 uv;
|
||||
};
|
||||
|
||||
fragment float4 FS(
|
||||
PS_INPUT input [[ stage_in ]],
|
||||
texture2d<float> FontTexture [[ texture(0) ]],
|
||||
sampler FontSampler [[ sampler(0) ]])
|
||||
{
|
||||
float4 out_col = input.col * FontTexture.sample(FontSampler, input.uv);
|
||||
return out_col;
|
||||
}
|
||||
BIN
imgui/StandaloneImGuiTestbed/Shaders/Metal/imgui-frag.metallib
Normal file
BIN
imgui/StandaloneImGuiTestbed/Shaders/Metal/imgui-frag.metallib
Normal file
Binary file not shown.
|
|
@ -0,0 +1,27 @@
|
|||
#include <metal_stdlib>
|
||||
using namespace metal;
|
||||
|
||||
struct VS_INPUT
|
||||
{
|
||||
float2 pos [[ attribute(0) ]];
|
||||
float2 uv [[ attribute(1) ]];
|
||||
float4 col [[ attribute(2) ]];
|
||||
};
|
||||
|
||||
struct PS_INPUT
|
||||
{
|
||||
float4 pos [[ position ]];
|
||||
float4 col;
|
||||
float2 uv;
|
||||
};
|
||||
|
||||
vertex PS_INPUT VS(
|
||||
VS_INPUT input [[ stage_in ]],
|
||||
constant float4x4 &ProjectionMatrix [[ buffer(1) ]])
|
||||
{
|
||||
PS_INPUT output;
|
||||
output.pos = ProjectionMatrix * float4(input.pos.xy, 0.f, 1.f);
|
||||
output.col = input.col;
|
||||
output.uv = input.uv;
|
||||
return output;
|
||||
}
|
||||
BIN
imgui/StandaloneImGuiTestbed/Shaders/Metal/imgui-vertex.metallib
Normal file
BIN
imgui/StandaloneImGuiTestbed/Shaders/Metal/imgui-vertex.metallib
Normal file
Binary file not shown.
|
|
@ -0,0 +1,2 @@
|
|||
glslangvalidator -V imgui-vertex.glsl -o imgui-vertex.spv -S vert
|
||||
glslangvalidator -V imgui-frag.glsl -o imgui-frag.spv -S frag
|
||||
16
imgui/StandaloneImGuiTestbed/Shaders/SPIR-V/imgui-frag.glsl
Normal file
16
imgui/StandaloneImGuiTestbed/Shaders/SPIR-V/imgui-frag.glsl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#version 450
|
||||
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
#extension GL_ARB_shading_language_420pack : enable
|
||||
|
||||
layout(set = 1, binding = 0) uniform texture2D FontTexture;
|
||||
layout(set = 0, binding = 1) uniform sampler FontSampler;
|
||||
|
||||
layout (location = 0) in vec4 color;
|
||||
layout (location = 1) in vec2 texCoord;
|
||||
layout (location = 0) out vec4 outputColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
outputColor = color * texture(sampler2D(FontTexture, FontSampler), texCoord);
|
||||
}
|
||||
BIN
imgui/StandaloneImGuiTestbed/Shaders/SPIR-V/imgui-frag.spv
Normal file
BIN
imgui/StandaloneImGuiTestbed/Shaders/SPIR-V/imgui-frag.spv
Normal file
Binary file not shown.
|
|
@ -0,0 +1,28 @@
|
|||
#version 450
|
||||
|
||||
#extension GL_ARB_separate_shader_objects : enable
|
||||
#extension GL_ARB_shading_language_420pack : enable
|
||||
|
||||
layout (location = 0) in vec2 in_position;
|
||||
layout (location = 1) in vec2 in_texCoord;
|
||||
layout (location = 2) in vec4 in_color;
|
||||
|
||||
layout (binding = 0) uniform ProjectionMatrixBuffer
|
||||
{
|
||||
mat4 projection_matrix;
|
||||
};
|
||||
|
||||
layout (location = 0) out vec4 color;
|
||||
layout (location = 1) out vec2 texCoord;
|
||||
|
||||
out gl_PerVertex
|
||||
{
|
||||
vec4 gl_Position;
|
||||
};
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = projection_matrix * vec4(in_position, 0, 1);
|
||||
color = in_color;
|
||||
texCoord = in_texCoord;
|
||||
}
|
||||
BIN
imgui/StandaloneImGuiTestbed/Shaders/SPIR-V/imgui-vertex.spv
Normal file
BIN
imgui/StandaloneImGuiTestbed/Shaders/SPIR-V/imgui-vertex.spv
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue