Skip to content

Commit

Permalink
Simplify the test vertex shader a little for now
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Aug 13, 2024
1 parent b521228 commit b1dc72f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Sources/backends/spirv.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ static void write_function(instructions_buffer *instructions, function *f, spirv

check(parameter_id != 0, context, "Parameter not found");

// create variable for the input variable
// create variable for the input parameter
spirv_id spirv_parameter_id = convert_kong_index_to_spirv_id(parameter_id);
write_op_variable_preallocated(instructions, convert_pointer_type_to_spirv_id(parameter_type, STORAGE_CLASS_FUNCTION), spirv_parameter_id,
STORAGE_CLASS_FUNCTION);
Expand Down Expand Up @@ -887,7 +887,7 @@ static void write_function(instructions_buffer *instructions, function *f, spirv
}
write_return(instructions);
}
else {
else if (stage == SHADER_STAGE_FRAGMENT && main) {
spirv_id object =
write_op_load(instructions, convert_type_to_spirv_id(o->op_return.var.type.type), convert_kong_index_to_spirv_id(o->op_return.var.index));
write_op_store(instructions, output_var, object);
Expand Down
5 changes: 3 additions & 2 deletions tests/in/test.kong
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ struct FragmentIn {
#[vertex]
fun pos(input: VertexIn): FragmentIn {
var output: FragmentIn;
output.position.xyz = input.position.xyz;
output.position.z = 1.0;
output.position.x = input.position.x;
output.position.y = input.position.y;
output.position.z = 0.5;
output.position.w = 1.0;
return output;
}
Expand Down

0 comments on commit b1dc72f

Please sign in to comment.