mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48:12 +00:00
LibGLSL: Fill LinkedShaders with dummy IR code
This commit is contained in:
parent
c88bc74afd
commit
5bab17596d
2 changed files with 26 additions and 1 deletions
|
@ -11,12 +11,23 @@
|
||||||
#include <AK/String.h>
|
#include <AK/String.h>
|
||||||
#include <AK/Vector.h>
|
#include <AK/Vector.h>
|
||||||
#include <LibGLSL/ObjectFile.h>
|
#include <LibGLSL/ObjectFile.h>
|
||||||
|
#include <LibGPU/IR.h>
|
||||||
|
|
||||||
namespace GLSL {
|
namespace GLSL {
|
||||||
|
|
||||||
// FIXME: Implement this class
|
// FIXME: Implement this class
|
||||||
|
|
||||||
class LinkedShader final {
|
class LinkedShader final {
|
||||||
|
public:
|
||||||
|
LinkedShader(const GPU::IR::Shader& intermediate_shader_representation)
|
||||||
|
: m_intermediate_shader_representation { intermediate_shader_representation }
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
GPU::IR::Shader const& intermediate_shader_representation() const { return m_intermediate_shader_representation; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
GPU::IR::Shader m_intermediate_shader_representation;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,21 @@ ErrorOr<NonnullOwnPtr<LinkedShader>> Linker::link(Vector<ObjectFile const*> cons
|
||||||
{
|
{
|
||||||
// FIXME: implement this function
|
// FIXME: implement this function
|
||||||
m_messages = TRY(String::from_utf8(""sv));
|
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue