diff options
author | ReinUsesLisp <[email protected]> | 2018-11-01 05:13:30 -0300 |
---|---|---|
committer | ReinUsesLisp <[email protected]> | 2018-11-01 05:13:30 -0300 |
commit | 91e0769db5af3f53ec8b0d20a6d74d9097d3a86b (patch) | |
tree | fff95d1d0b6b1a4a6aaece69d6a40ef1eb24d5b8 /tests | |
parent | f3a63aa55f4989d6806b2faa8086bd2f23752b01 (diff) | |
download | sirit-91e0769db5af3f53ec8b0d20a6d74d9097d3a86b.tar.gz sirit-91e0769db5af3f53ec8b0d20a6d74d9097d3a86b.zip |
Fixup build issues
Diffstat (limited to 'tests')
-rw-r--r-- | tests/main.cpp | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/tests/main.cpp b/tests/main.cpp index 5258920..29c91f1 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -19,48 +19,49 @@ public: AddCapability(spv::Capability::Shader); SetMemoryModel(spv::AddressingModel::Logical, spv::MemoryModel::GLSL450); - const auto t_void = OpName(OpTypeVoid(), "void"); - const auto t_uint = OpName(OpTypeInt(32, false), "uint"); - const auto t_float = OpName(OpTypeFloat(32), "float"); + const auto t_void = Name(OpTypeVoid(), "void"); + const auto t_uint = Name(OpTypeInt(32, false), "uint"); + const auto t_float = Name(OpTypeFloat(32), "float"); - const auto float4 = OpName(OpTypeVector(t_float, 4), "float4"); - const auto in_float = OpName(OpTypePointer(spv::StorageClass::Input, t_float), "in_float"); - const auto in_float4 = OpName(OpTypePointer(spv::StorageClass::Input, float4), "in_float4"); - const auto out_float4 = OpName(OpTypePointer(spv::StorageClass::Output, float4), "out_float4"); + const auto float4 = Name(OpTypeVector(t_float, 4), "float4"); + const auto in_float = Name(OpTypePointer(spv::StorageClass::Input, t_float), "in_float"); + const auto in_float4 = Name(OpTypePointer(spv::StorageClass::Input, float4), "in_float4"); + const auto out_float4 = Name(OpTypePointer(spv::StorageClass::Output, float4), "out_float4"); - const auto gl_per_vertex = OpName(OpTypeStruct({float4}), "gl_PerVertex"); - const auto gl_per_vertex_ptr = OpName(OpTypePointer(spv::StorageClass::Output, gl_per_vertex), "out_gl_PerVertex"); + const auto gl_per_vertex = Name(OpTypeStruct({float4}), "gl_PerVertex"); + const auto gl_per_vertex_ptr = Name(OpTypePointer(spv::StorageClass::Output, gl_per_vertex), "out_gl_PerVertex"); - const auto in_pos = OpName(OpVariable(in_float4, spv::StorageClass::Input), "in_pos"); - const auto per_vertex = OpName(OpVariable(gl_per_vertex_ptr, spv::StorageClass::Output), "per_vertex"); + const auto in_pos = Name(OpVariable(in_float4, spv::StorageClass::Input), "in_pos"); + const auto per_vertex = Name(OpVariable(gl_per_vertex_ptr, spv::StorageClass::Output), "per_vertex"); Decorate(in_pos, spv::Decoration::Location, {0}); Decorate(gl_per_vertex, spv::Decoration::Block); + Decorate(gl_per_vertex, spv::Decoration::Block); MemberDecorate(gl_per_vertex, 0, spv::Decoration::BuiltIn, {static_cast<u32>(spv::BuiltIn::Position)}); AddGlobalVariable(in_pos); AddGlobalVariable(per_vertex); - const auto main_func = Emit(OpName(OpFunction(t_void, spv::FunctionControlMask::MaskNone, TypeFunction(t_void)), "main")); - Emit(Label()); + const auto main_func = Emit(Name(OpFunction(t_void, spv::FunctionControlMask::MaskNone, OpTypeFunction(t_void)), "main")); + Emit(OpLabel()); const auto ptr_pos_x = Emit(OpAccessChain(in_float, in_pos, {OpConstant(t_uint, 0u)})); const auto ptr_pos_y = Emit(OpAccessChain(in_float, in_pos, {OpConstant(t_uint, 1u)})); - const auto pos_x = Emit(Load(t_float, ptr_pos_x)); - const auto pos_y = Emit(Load(t_float, ptr_pos_y)); + const auto pos_x = Emit(OpLoad(t_float, ptr_pos_x)); + const auto pos_y = Emit(OpLoad(t_float, ptr_pos_y)); - auto tmp_position = Emit(Undef(float4)); + auto tmp_position = Emit(OpUndef(float4)); tmp_position = Emit(OpCompositeInsert(float4, pos_x, tmp_position, {0})); tmp_position = Emit(OpCompositeInsert(float4, pos_y, tmp_position, {1})); tmp_position = Emit(OpCompositeInsert(float4, OpConstant(t_float, 0.f), tmp_position, {2})); tmp_position = Emit(OpCompositeInsert(float4, OpConstant(t_float, 1.f), tmp_position, {3})); const auto gl_position = Emit(OpAccessChain(out_float4, per_vertex, {OpConstant(t_uint, 0u)})); - Emit(Store(gl_position, tmp_position)); + Emit(OpStore(gl_position, tmp_position)); - Emit(Return()); - Emit(FunctionEnd()); + Emit(OpReturn()); + Emit(OpFunctionEnd()); AddEntryPoint(spv::ExecutionModel::Vertex, main_func, "main", {in_pos, per_vertex}); } |