diff options
author | Stephan Unverwerth <s.unverwerth@serenityos.org> | 2022-09-18 16:18:12 +0200 |
---|---|---|
committer | Andrew Kaster <andrewdkaster@gmail.com> | 2022-12-17 22:39:09 -0700 |
commit | 5bab17596d71e2bdbecce7eff288279e41e34539 (patch) | |
tree | 490de3d283084887177793b3c8ad273d25fa22ed /Userland/Libraries/LibGLSL/Linker.cpp | |
parent | c88bc74afd5e40d60c10d87920b28adbe7a13fe4 (diff) | |
download | serenity-5bab17596d71e2bdbecce7eff288279e41e34539.zip |
LibGLSL: Fill LinkedShaders with dummy IR code
Diffstat (limited to 'Userland/Libraries/LibGLSL/Linker.cpp')
-rw-r--r-- | Userland/Libraries/LibGLSL/Linker.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGLSL/Linker.cpp b/Userland/Libraries/LibGLSL/Linker.cpp index 367bf93e05..b418840912 100644 --- a/Userland/Libraries/LibGLSL/Linker.cpp +++ b/Userland/Libraries/LibGLSL/Linker.cpp @@ -12,7 +12,21 @@ ErrorOr<NonnullOwnPtr<LinkedShader>> Linker::link(Vector<ObjectFile const*> cons { // FIXME: implement this function m_messages = TRY(String::from_utf8(""sv)); - return adopt_own(*new LinkedShader()); + + GPU::IR::Shader shader; + + auto input_name = TRY(String::from_utf8("input0"sv)); + auto output_name = TRY(String::from_utf8("output0"sv)); + TRY(shader.inputs.try_append({ move(input_name), GPU::IR::StorageType::Vector4 })); + TRY(shader.outputs.try_append({ move(output_name), GPU::IR::StorageType::Vector4 })); + GPU::IR::Instruction instruction { + GPU::IR::Opcode::Move, + { { GPU::IR::StorageLocation::Input, 0 } }, + { GPU::IR::StorageLocation::Output, 0 } + }; + TRY(shader.instructions.try_append(instruction)); + + return adopt_own(*new LinkedShader(shader)); } } |