Explorar o código

Snake compile fix

Karl Zylinski hai 4 meses
pai
achega
1b2b648d8c
Modificáronse 2 ficheiros con 3 adicións e 3 borrados
  1. 2 2
      examples/snake/shader.hlsl
  2. 1 1
      examples/snake/snake.odin

+ 2 - 2
examples/snake/shader.hlsl

@@ -2,7 +2,7 @@ cbuffer constants : register(b0) {
 	float4x4 mvp;
 }
 struct vs_in {
-	float2 position : POS;
+	float3 position : POS;
 	float2 uv       : UV;
 	float4 color    : COL;
 	float2 wobble   : WAA;
@@ -16,7 +16,7 @@ Texture2D    tex : register(t0);
 SamplerState smp : register(s0);
 vs_out vs_main(vs_in input) {
 	vs_out output;
-	output.position = mul(mvp, float4(input.position + input.wobble, 0, 1.0f));
+	output.position = mul(mvp, float4(input.position + float3(input.wobble, 0), 1.0f));
 	output.uv = input.uv;
 	output.color = input.color;
 	return output;

+ 1 - 1
examples/snake/snake.odin

@@ -84,7 +84,7 @@ main :: proc() {
 
 	SHADER_SOURCE :: #load("shader.hlsl")
 
-	shader := k2.load_shader(string(SHADER_SOURCE), {
+	shader := k2.load_shader(string(SHADER_SOURCE), string(SHADER_SOURCE), {
 		.RG_32_Float,
 		.RG_32_Float,
 		.RGBA_8_Norm,