mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-11 13:38:35 +00:00
Cleanup
This commit is contained in:
parent
fdc8a6a4e2
commit
e89375b39a
@ -34,6 +34,9 @@ mod hlsl_build {
|
||||
|
||||
let src_data = fs::read_to_string(&source_path).unwrap();
|
||||
|
||||
if vertex_destination.exists() {
|
||||
fs::remove_file(vertex_destination).unwrap();
|
||||
}
|
||||
fs::write(
|
||||
vertex_destination,
|
||||
compile_shader(&src_data, &source_path, "VertexMain", "vs_4_0").unwrap_or_else(
|
||||
@ -45,6 +48,9 @@ mod hlsl_build {
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
if pixel_destination.exists() {
|
||||
fs::remove_file(pixel_destination).unwrap();
|
||||
}
|
||||
fs::write(
|
||||
pixel_destination,
|
||||
compile_shader(&src_data, &source_path, "PixelMain", "ps_4_0").unwrap_or_else(
|
||||
|
||||
@ -168,8 +168,8 @@ impl Shaders {
|
||||
include_bytes!("shader/glsles_100.frag"),
|
||||
),
|
||||
HlslSm40 => (
|
||||
include_bytes!("data/pixel.fx"),
|
||||
include_bytes!("data/vertex.fx"),
|
||||
include_bytes!("data/pixel.fx"),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,34 +1,34 @@
|
||||
cbuffer Constants : register(b0) {
|
||||
float4x4 matrix_;
|
||||
float4x4 matrix_;
|
||||
}
|
||||
|
||||
Texture2D tex;
|
||||
SamplerState tex_;
|
||||
|
||||
struct VIn {
|
||||
float2 position : pos;
|
||||
float2 uv : uv;
|
||||
float4 color : col;
|
||||
float2 position : pos;
|
||||
float2 uv : uv;
|
||||
float4 color : col;
|
||||
};
|
||||
|
||||
struct VOut
|
||||
{
|
||||
float4 position : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 color : COLOR;
|
||||
float4 position : SV_POSITION;
|
||||
float2 uv : TEXCOORD0;
|
||||
float4 color : COLOR;
|
||||
};
|
||||
|
||||
VOut VertexMain(VIn vertex)
|
||||
{
|
||||
VOut output;
|
||||
output.position = mul(matrix_, float4(vertex.position, 0.0, 1.0));
|
||||
output.uv = vertex.uv;
|
||||
output.color = vertex.color;
|
||||
VOut output;
|
||||
output.position = mul(matrix_, float4(vertex.position, 0.0, 1.0));
|
||||
output.uv = vertex.uv;
|
||||
output.color = vertex.color;
|
||||
|
||||
return output;
|
||||
return output;
|
||||
}
|
||||
|
||||
float4 PixelMain(VOut vout) : SV_TARGET
|
||||
{
|
||||
return vout.color * tex.Sample(tex_, vout.uv);
|
||||
return vout.color * tex.Sample(tex_, vout.uv);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user