Linker.cpp 928 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2022, Stephan Unverwerth <s.unverwerth@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibGLSL/Linker.h>
  7. namespace GLSL {
  8. ErrorOr<NonnullOwnPtr<LinkedShader>> Linker::link(Vector<ObjectFile const*> const&)
  9. {
  10. // FIXME: implement this function
  11. m_messages = {};
  12. GPU::IR::Shader shader;
  13. auto input_name = TRY(String::from_utf8("input0"sv));
  14. auto output_name = TRY(String::from_utf8("output0"sv));
  15. TRY(shader.inputs.try_append({ move(input_name), GPU::IR::StorageType::Vector4 }));
  16. TRY(shader.outputs.try_append({ move(output_name), GPU::IR::StorageType::Vector4 }));
  17. GPU::IR::Instruction instruction {
  18. GPU::IR::Opcode::Move,
  19. { { GPU::IR::StorageLocation::Input, 0 } },
  20. { GPU::IR::StorageLocation::Output, 0 }
  21. };
  22. TRY(shader.instructions.try_append(instruction));
  23. return adopt_own(*new LinkedShader(shader));
  24. }
  25. }