-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[gpu.vulkan] fixed a bug where set/wait events would not match their …
…srcStages, causing a validation error if you ever had dependencies. the imgui renderer is very broken and will almost certainly require multi draw via draw indirect buffer
- Loading branch information
Showing
5 changed files
with
99 additions
and
12 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
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
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,6 +1,17 @@ | ||
shader(type = fragment); | ||
|
||
input(id = 0) vec2 uv; | ||
input(id = 1) vec4 col; | ||
input(id = 2, flat) uint texid; | ||
|
||
output(id = 0) vec4 out::colour; | ||
|
||
void main() | ||
{ | ||
|
||
float texa = sample(texid, uv).a; | ||
out::colour = col.rgba * texa; | ||
if(texa < 0.1f) | ||
{ | ||
discard; | ||
} | ||
} |
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,6 +1,47 @@ | ||
shader(type = vertex); | ||
|
||
struct ImGuiVertex | ||
{ | ||
float px, py; | ||
float uvx, uvy; | ||
uint col; | ||
}; | ||
|
||
resource(id = 0) const buffer vertex | ||
{ | ||
ImGuiVertex data[]; | ||
}; | ||
|
||
resource(id = 1) const buffer index | ||
{ | ||
uint data[]; | ||
}; | ||
|
||
resource(id = 2) const buffer render | ||
{ | ||
mat4 vp; | ||
uint index_offset; | ||
uint vertex_offset; | ||
uint texture_id; | ||
}; | ||
|
||
output(id = 0) vec2 vtx_uv; | ||
output(id = 1) vec4 vtx_col; | ||
output(id = 2) uint vtx_texid; | ||
|
||
void main() | ||
{ | ||
|
||
uint index = index.data[in::vertex_id + render.index_offset]; | ||
ImGuiVertex vtx = vertex.data[index + render.vertex_offset]; | ||
out::position = render.vp * vec4(vtx.px, vtx.py, 0.0f, 1.0f); | ||
|
||
vtx_uv = vec2(vtx.uvx, vtx.uvy); | ||
|
||
vtx_col = vec4(0.0); | ||
vtx_col.a = ((vtx.col >> 24) & 0xFF) / 255.0f; | ||
vtx_col.b = ((vtx.col >> 16) & 0xFF) / 255.0f; | ||
vtx_col.g = ((vtx.col >> 8) & 0xFF) / 255.0f; | ||
vtx_col.r = ((vtx.col) & 0xFF) / 255.0f; | ||
|
||
vtx_texid = render.texture_id; | ||
} |