-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
karm-gpu: Sketching out more of the GPU stack.
- Loading branch information
1 parent
3960d59
commit 46dfc50
Showing
11 changed files
with
121 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
], | ||
"subdirs": [ | ||
"mixbox", | ||
"cpu" | ||
"cpu", | ||
"gpu" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#pragma once | ||
|
||
#include <karm-base/rc.h> | ||
#include <karm-base/res.h> | ||
|
||
namespace Karm::Gpu { | ||
|
||
struct Device { | ||
static Res<Strong<Device>> open(); | ||
|
||
virtual ~Device() = default; | ||
}; | ||
|
||
struct Shader { | ||
virtual ~Shader() = default; | ||
}; | ||
|
||
struct CommandBuffer { | ||
virtual ~CommandBuffer() = default; | ||
}; | ||
|
||
struct RenderPass { | ||
virtual ~RenderPass() = default; | ||
}; | ||
|
||
struct Pipeline { | ||
virtual ~Pipeline() = default; | ||
}; | ||
|
||
struct Buffer { | ||
virtual ~Buffer() = default; | ||
}; | ||
|
||
struct Texture { | ||
virtual ~Texture() = default; | ||
}; | ||
|
||
} // namespace Karm::Gpu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"description": "GPU acceleration", | ||
"requires": [ | ||
"karm-io", | ||
"karm-math" | ||
"karm-math", | ||
"karm-shader" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#pragma once | ||
|
||
namespace Karm::Jit::Arm {} // namespace Karm::Jit::Arm | ||
namespace Karm::Jit::Arm { | ||
|
||
} // namespace Karm::Jit::Arm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
|
||
#include <karm-base/base.h> | ||
#include <karm-base/vec.h> | ||
|
||
namespace Karm::Jit { | ||
|
||
enum struct Op : u8 { | ||
}; | ||
|
||
struct Ref { | ||
enum struct _Type : u8 { | ||
|
||
}; | ||
|
||
using enum _Type; | ||
|
||
_Type type; | ||
}; | ||
|
||
struct Inst { | ||
Op op; | ||
Ref out; | ||
Ref lhs; | ||
Ref rhs; | ||
}; | ||
|
||
struct Block { | ||
Vec<Inst> insts; | ||
}; | ||
|
||
} // namespace Karm::Jit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
namespace Karm::Jit::Spirv { | ||
|
||
} // namespace Karm::Jit::Spirv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#pragma once | ||
|
||
#include <karm-sys/context.h> | ||
#include <karm-sys/socket.h> | ||
|
||
struct ChannelHook : public Sys::Service { | ||
Sys::IpcConnection con; | ||
|
||
ChannelHook(Sys::IpcConnection con) | ||
: con(std::move(con)) {} | ||
}; | ||
|
||
inline ChannelHook &useChannel(Sys::Context &ctx = Sys::globalContext()) { | ||
return ctx.use<ChannelHook>(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
|
||
namespace Karm::Shader { | ||
|
||
struct Expr {}; | ||
|
||
} // namespace Karm::Shader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <karm-jit/ir.h> | ||
|
||
#include "ast.h" | ||
|
||
namespace Karm::Shader { | ||
|
||
} // namespace Karm::Shader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"$schema": "https://schemas.cute.engineering/stable/cutekit.manifest.component.v1", | ||
"id": "karm-shader", | ||
"type": "lib", | ||
"description": "Shader language & compiler", | ||
"requires": [ | ||
"karm-jit" | ||
] | ||
} |