feat: Vulkan renderer with instanced rendering (Phase 4)
VulkanRenderer using ash 0.38 + winit:
- Instance with KHR_surface + xlib + wayland extensions
- Physical device selection (first GPU with graphics+present)
- Swapchain (FIFO present mode, B8G8R8A8_UNORM)
- Render pass with color attachment
- Graphics pipeline with instanced rendering:
- Vertex buffer: unit quad (4 verts, 6 indices)
- Instance buffer: 8000 CellInstance structs (32 bytes each)
- 2 vertex bindings: per-vertex (quad pos) + per-instance (grid pos,
atlas UV, fg/bg colors)
- Push constants: screen size + cell size
- Glyph atlas: R8_UNORM texture, uploaded via staging buffer
- fontdue rasterizes DejaVu Sans Mono at startup
- Linear filtering sampler
- Descriptor set: combined image sampler for atlas
- 2 frames in flight with semaphores + fences
- Persistent mapped instance buffer (zero-copy per frame)
Shaders (pre-compiled SPIR-V):
- cell.vert: positions quad from instance data, maps to clip space
- cell.frag: samples atlas alpha, blends fg/bg
--mode vulkan: tries Vulkan, falls back to softbuffer window mode
109 tests, 0 failures
This commit is contained in:
+183
-183
@@ -1,4 +1,4 @@
|
||||
=== Verbatim Headless Run: 20 ticks ===
|
||||
=== Verbatim Headless Run: 60 ticks ===
|
||||
|
||||
World: 250x250
|
||||
Player start: (125.0, 242.0)
|
||||
@@ -33,66 +33,6 @@ Camera: (85, 230)
|
||||
Player: "Player hp=100.0/100.0 pos=(125.0,242.0) bodies=27/27 on_fire=false"
|
||||
Entities: 1
|
||||
|
||||
=== Tick 2 ===
|
||||
30
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36
|
||||
37 TTTTT
|
||||
38 T T
|
||||
39 T T .
|
||||
40 T T @@@@@ ...
|
||||
41 T T ## @@@@@@ .....
|
||||
42 T T ## @@@@@@ .......
|
||||
43 T T ## @@@@@ """"""""""""" .........
|
||||
44""" T T ## @@@@@ "":::::::::::::""" ..........
|
||||
45:::""" ## """::::::::::::::::::"" ...........
|
||||
46::::::"" ## "":::::::::::::::::::::::""".........
|
||||
47::::::::"""""""""""""""""""""""""""""""""""::::::::::::::::::::::::::::"""""""""
|
||||
48::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
49################################################################################
|
||||
50????????????????????????????????????????????????????????????????????????????????
|
||||
51????????????????????????????????????????????????????????????????????????????????
|
||||
52????????????????????????????????????????????????????????????????????????????????
|
||||
53????????????????????????????????????????????????????????????????????????????????
|
||||
54????????????????????????????????????????????????????????????????????????????????
|
||||
Player: "Player hp=100.0/100.0 pos=(125.0,242.1) bodies=27/27 on_fire=false"
|
||||
Entities: 1
|
||||
Alive entities: Player(hp=100, pos=(125.0, 242.11879))
|
||||
|
||||
=== Tick 4 ===
|
||||
30
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36
|
||||
37 TTTTT
|
||||
38 T T
|
||||
39 T T .
|
||||
40 T T @@@@@ ...
|
||||
41 T T ## @@@@@@ .....
|
||||
42 T T ## @@@@@@ .......
|
||||
43 T T ## @@@@@ """"""""""""" .........
|
||||
44""" T T ## @@@@@ "":::::::::::::""" ..........
|
||||
45:::""" ## """::::::::::::::::::"" ...........
|
||||
46::::::"" ## "":::::::::::::::::::::::""".........
|
||||
47::::::::"""""""""""""""""""""""""""""""""""::::::::::::::::::::::::::::"""""""""
|
||||
48::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
49################################################################################
|
||||
50????????????????????????????????????????????????????????????????????????????????
|
||||
51????????????????????????????????????????????????????????????????????????????????
|
||||
52????????????????????????????????????????????????????????????????????????????????
|
||||
53????????????????????????????????????????????????????????????????????????????????
|
||||
54????????????????????????????????????????????????????????????????????????????????
|
||||
Player: "Player hp=100.0/100.0 pos=(125.0,242.4) bodies=27/27 on_fire=false"
|
||||
Entities: 1
|
||||
Alive entities: Player(hp=100, pos=(125.0, 242.38817))
|
||||
|
||||
=== Tick 6 ===
|
||||
30
|
||||
31
|
||||
@@ -121,67 +61,7 @@ Alive entities: Player(hp=100, pos=(125.0, 242.38817))
|
||||
54????????????????????????????????????????????????????????????????????????????????
|
||||
Player: "Player hp=100.0/100.0 pos=(125.0,242.8) bodies=27/27 on_fire=false"
|
||||
Entities: 1
|
||||
Alive entities: Player(hp=100, pos=(125.0, 242.79922))
|
||||
|
||||
=== Tick 8 ===
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36
|
||||
37 TTTTT
|
||||
38 T T
|
||||
39 T T .
|
||||
40 T T ...
|
||||
41 T T ## @@@@@ .....
|
||||
42 T T ## @@@@@@ .......
|
||||
43 T T ## @@@@@@ """"""""""""" .........
|
||||
44""" T T ## @@@@@ "":::::::::::::""" ..........
|
||||
45:::""" ## @@@@@ """::::::::::::::::::"" ...........
|
||||
46::::::"" ## "":::::::::::::::::::::::""".........
|
||||
47::::::::"""""""""""""""""""""""""""""""""""::::::::::::::::::::::::::::"""""""""
|
||||
48::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
49################################################################################
|
||||
50????????????????????????????????????????????????????????????????????????????????
|
||||
51????????????????????????????????????????????????????????????????????????????????
|
||||
52????????????????????????????????????????????????????????????????????????????????
|
||||
53????????????????????????????????????????????????????????????????????????????????
|
||||
54????????????????????????????????????????????????????????????????????????????????
|
||||
55????????????????????????????????????????????????????????????????????????????????
|
||||
Player: "Player hp=100.0/100.0 pos=(125.0,243.3) bodies=27/27 on_fire=false"
|
||||
Entities: 1
|
||||
Alive entities: Player(hp=100, pos=(125.0, 243.3436))
|
||||
|
||||
=== Tick 10 ===
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36
|
||||
37 TTTTT
|
||||
38 T T
|
||||
39 T T .
|
||||
40 T T ...
|
||||
41 T T ## @@@@@ .....
|
||||
42 T T ## @@@@@@ .......
|
||||
43 T T ## @@@@@@ """"""""""""" .........
|
||||
44""" T T ## @@@@@ "":::::::::::::""" ..........
|
||||
45:::""" ## @@@@@ """::::::::::::::::::"" ...........
|
||||
46::::::"" ## "":::::::::::::::::::::::""".........
|
||||
47::::::::"""""""""""""""""""""""""""""""""""::::::::::::::::::::::::::::"""""""""
|
||||
48::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
49################################################################################
|
||||
50????????????????????????????????????????????????????????????????????????????????
|
||||
51????????????????????????????????????????????????????????????????????????????????
|
||||
52????????????????????????????????????????????????????????????????????????????????
|
||||
53????????????????????????????????????????????????????????????????????????????????
|
||||
54????????????????????????????????????????????????????????????????????????????????
|
||||
55????????????????????????????????????????????????????????????????????????????????
|
||||
Player: "Player hp=100.0/100.0 pos=(125.0,243.5) bodies=27/27 on_fire=false"
|
||||
Entities: 1
|
||||
Alive entities: Player(hp=100, pos=(125.0, 243.5))
|
||||
Alive entities: Player(hp=100, pos=(125.0, 242.82616))
|
||||
|
||||
=== Tick 12 ===
|
||||
31
|
||||
@@ -213,66 +93,6 @@ Player: "Player hp=100.0/100.0 pos=(125.0,243.5) bodies=27/27 on_fire=false"
|
||||
Entities: 1
|
||||
Alive entities: Player(hp=100, pos=(125.0, 243.5))
|
||||
|
||||
=== Tick 14 ===
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36
|
||||
37 TTTTT
|
||||
38 T T
|
||||
39 T T .
|
||||
40 T T ...
|
||||
41 T T ## @@@@@ .....
|
||||
42 T T ## @@@@@@ .......
|
||||
43 T T ## @@@@@@ """"""""""""" .........
|
||||
44""" T T ## @@@@@ "":::::::::::::""" ..........
|
||||
45:::""" ## @@@@@ """::::::::::::::::::"" ...........
|
||||
46::::::"" ## "":::::::::::::::::::::::""".........
|
||||
47::::::::"""""""""""""""""""""""""""""""""""::::::::::::::::::::::::::::"""""""""
|
||||
48::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
49################################################################################
|
||||
50????????????????????????????????????????????????????????????????????????????????
|
||||
51????????????????????????????????????????????????????????????????????????????????
|
||||
52????????????????????????????????????????????????????????????????????????????????
|
||||
53????????????????????????????????????????????????????????????????????????????????
|
||||
54????????????????????????????????????????????????????????????????????????????????
|
||||
55????????????????????????????????????????????????????????????????????????????????
|
||||
Player: "Player hp=100.0/100.0 pos=(125.0,243.5) bodies=27/27 on_fire=false"
|
||||
Entities: 1
|
||||
Alive entities: Player(hp=100, pos=(125.0, 243.5))
|
||||
|
||||
=== Tick 16 ===
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36
|
||||
37 TTTTT
|
||||
38 T T
|
||||
39 T T .
|
||||
40 T T ...
|
||||
41 T T ## @@@@@ .....
|
||||
42 T T ## @@@@@@ .......
|
||||
43 T T ## @@@@@@ """"""""""""" .........
|
||||
44""" T T ## @@@@@ "":::::::::::::""" ..........
|
||||
45:::""" ## @@@@@ """::::::::::::::::::"" ...........
|
||||
46::::::"" ## "":::::::::::::::::::::::""".........
|
||||
47::::::::"""""""""""""""""""""""""""""""""""::::::::::::::::::::::::::::"""""""""
|
||||
48::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
49################################################################################
|
||||
50????????????????????????????????????????????????????????????????????????????????
|
||||
51????????????????????????????????????????????????????????????????????????????????
|
||||
52????????????????????????????????????????????????????????????????????????????????
|
||||
53????????????????????????????????????????????????????????????????????????????????
|
||||
54????????????????????????????????????????????????????????????????????????????????
|
||||
55????????????????????????????????????????????????????????????????????????????????
|
||||
Player: "Player hp=100.0/100.0 pos=(125.0,243.5) bodies=27/27 on_fire=false"
|
||||
Entities: 1
|
||||
Alive entities: Player(hp=100, pos=(125.0, 243.5))
|
||||
|
||||
=== Tick 18 ===
|
||||
31
|
||||
32
|
||||
@@ -303,7 +123,7 @@ Player: "Player hp=100.0/100.0 pos=(125.0,243.5) bodies=27/27 on_fire=false"
|
||||
Entities: 1
|
||||
Alive entities: Player(hp=100, pos=(125.0, 243.5))
|
||||
|
||||
=== Tick 20 ===
|
||||
=== Tick 24 ===
|
||||
31
|
||||
32
|
||||
33
|
||||
@@ -333,3 +153,183 @@ Player: "Player hp=100.0/100.0 pos=(125.0,243.5) bodies=27/27 on_fire=false"
|
||||
Entities: 1
|
||||
Alive entities: Player(hp=100, pos=(125.0, 243.5))
|
||||
|
||||
=== Tick 30 ===
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36
|
||||
37 TTTTT
|
||||
38 T T
|
||||
39 T T .
|
||||
40 T T ggggg ...
|
||||
41 T T gggggg @@@@@ .....
|
||||
42 T T gggggg @@@@@@ .......
|
||||
43 T T ggggg @@@@@@ """"""""""""" .........
|
||||
44""" T T ggggg @@@@@ "":::::::::::::""" ..........
|
||||
45:::""" ## @@@@@ """::::::::::::::::::"" ...........
|
||||
46::::::"" ## "":::::::::::::::::::::::""".........
|
||||
47::::::::"""""""""""""""""""""""""""""""""""::::::::::::::::::::::::::::"""""""""
|
||||
48::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
49################################################################################
|
||||
50????????????????????????????????????????????????????????????????????????????????
|
||||
51????????????????????????????????????????????????????????????????????????????????
|
||||
52????????????????????????????????????????????????????????????????????????????????
|
||||
53????????????????????????????????????????????????????????????????????????????????
|
||||
54????????????????????????????????????????????????????????????????????????????????
|
||||
55????????????????????????????????????????????????????????????????????????????????
|
||||
Player: "Player hp=100.0/100.0 pos=(125.0,243.5) bodies=27/27 on_fire=false"
|
||||
Entities: 2
|
||||
Alive entities: Player(hp=100, pos=(125.0, 243.5)), Goblin(hp=40, pos=(110.0, 242.0))
|
||||
|
||||
=== Tick 36 ===
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36 ggggg
|
||||
37 TTTTT gggggg
|
||||
38 T T gggggg
|
||||
39 T T ggggg .
|
||||
40 T T ggggg ...
|
||||
41 T T ## @@@@@ .....
|
||||
42 T T ## @@@@@@ .......
|
||||
43 T T ## @@@@@@ """"""""""""" .........
|
||||
44""" T T ## @@@@@ "":::::::::::::""" ..........
|
||||
45:::""" ## @@@@@ """::::::::::::::::::"" ...........
|
||||
46::::::"" ## "":::::::::::::::::::::::""".........
|
||||
47::::::::"""""""""""""""""""""""""""""""""""::::::::::::::::::::::::::::"""""""""
|
||||
48::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
49################################################################################
|
||||
50????????????????????????????????????????????????????????????????????????????????
|
||||
51????????????????????????????????????????????????????????????????????????????????
|
||||
52????????????????????????????????????????????????????????????????????????????????
|
||||
53????????????????????????????????????????????????????????????????????????????????
|
||||
54????????????????????????????????????????????????????????????????????????????????
|
||||
55????????????????????????????????????????????????????????????????????????????????
|
||||
Player: "Player hp=100.0/100.0 pos=(125.0,243.5) bodies=27/27 on_fire=false"
|
||||
Entities: 2
|
||||
Alive entities: Player(hp=100, pos=(125.0, 243.5)), Goblin(hp=40, pos=(110.0, 238.5))
|
||||
|
||||
=== Tick 42 ===
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36 ggggg
|
||||
37 TTTTT gggggg
|
||||
38 T T gggggg
|
||||
39 T T ggggg .
|
||||
40 T T ggggg ...
|
||||
41 T T ## @@@@@ .....
|
||||
42 T T ## @@@@@@ .......
|
||||
43 T T ## @@@@@@ """"""""""""" .........
|
||||
44""" T T ## @@@@@ "":::::::::::::""" ..........
|
||||
45:::""" ## @@@@@ """::::::::::::::::::"" ...........
|
||||
46::::::"" ## "":::::::::::::::::::::::""".........
|
||||
47::::::::"""""""""""""""""""""""""""""""""""::::::::::::::::::::::::::::"""""""""
|
||||
48::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
49################################################################################
|
||||
50????????????????????????????????????????????????????????????????????????????????
|
||||
51????????????????????????????????????????????????????????????????????????????????
|
||||
52????????????????????????????????????????????????????????????????????????????????
|
||||
53????????????????????????????????????????????????????????????????????????????????
|
||||
54????????????????????????????????????????????????????????????????????????????????
|
||||
55????????????????????????????????????????????????????????????????????????????????
|
||||
Player: "Player hp=100.0/100.0 pos=(125.0,243.5) bodies=27/27 on_fire=false"
|
||||
Entities: 2
|
||||
Alive entities: Player(hp=100, pos=(125.0, 243.5)), Goblin(hp=40, pos=(110.0, 238.5))
|
||||
|
||||
=== Tick 48 ===
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36 ggggg
|
||||
37 TTTTT gggggg
|
||||
38 T T gggggg
|
||||
39 T T ggggg .
|
||||
40 T T ggggg ...
|
||||
41 T T ## @@@@@ .....
|
||||
42 T T ## @@@@@@ .......
|
||||
43 T T ## @@@@@@ """"""""""""" .........
|
||||
44""" T T ## @@@@@ "":::::::::::::""" ..........
|
||||
45:::""" ## @@@@@ """::::::::::::::::::"" ...........
|
||||
46::::::"" ## "":::::::::::::::::::::::""".........
|
||||
47::::::::"""""""""""""""""""""""""""""""""""::::::::::::::::::::::::::::"""""""""
|
||||
48::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
49################################################################################
|
||||
50????????????????????????????????????????????????????????????????????????????????
|
||||
51????????????????????????????????????????????????????????????????????????????????
|
||||
52????????????????????????????????????????????????????????????????????????????????
|
||||
53????????????????????????????????????????????????????????????????????????????????
|
||||
54????????????????????????????????????????????????????????????????????????????????
|
||||
55????????????????????????????????????????????????????????????????????????????????
|
||||
Player: "Player hp=100.0/100.0 pos=(125.0,243.5) bodies=27/27 on_fire=false"
|
||||
Entities: 2
|
||||
Alive entities: Player(hp=100, pos=(125.0, 243.5)), Goblin(hp=40, pos=(110.0, 238.5))
|
||||
|
||||
=== Tick 54 ===
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36 ggggg
|
||||
37 TTTTT gggggg
|
||||
38 T T gggggg
|
||||
39 T T ggggg .
|
||||
40 T T ggggg ...
|
||||
41 T T ## @@@@@ .....
|
||||
42 T T ## @@@@@@ .......
|
||||
43 T T ## @@@@@@ """"""""""""" .........
|
||||
44""" T T ## @@@@@ "":::::::::::::""" ..........
|
||||
45:::""" ## @@@@@ """::::::::::::::::::"" ...........
|
||||
46::::::"" ## "":::::::::::::::::::::::""".........
|
||||
47::::::::"""""""""""""""""""""""""""""""""""::::::::::::::::::::::::::::"""""""""
|
||||
48::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
49################################################################################
|
||||
50????????????????????????????????????????????????????????????????????????????????
|
||||
51????????????????????????????????????????????????????????????????????????????????
|
||||
52????????????????????????????????????????????????????????????????????????????????
|
||||
53????????????????????????????????????????????????????????????????????????????????
|
||||
54????????????????????????????????????????????????????????????????????????????????
|
||||
55????????????????????????????????????????????????????????????????????????????????
|
||||
Player: "Player hp=100.0/100.0 pos=(125.0,243.5) bodies=27/27 on_fire=false"
|
||||
Entities: 2
|
||||
Alive entities: Player(hp=100, pos=(125.0, 243.5)), Goblin(hp=40, pos=(110.0, 238.5))
|
||||
|
||||
=== Tick 60 ===
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36 ggggg
|
||||
37 TTTTT gggggg
|
||||
38 T T gggggg
|
||||
39 T T ggggg .
|
||||
40 T T ggggg ...
|
||||
41 T T gggggg @@@@@ .....
|
||||
42 T T gggggg @@@@@@ .......
|
||||
43 T T ggggg @@@@@@ """"""""""""" .........
|
||||
44""" T T ggggg @@@@@ "":::::::::::::""" ..........
|
||||
45:::""" ## @@@@@ """::::::::::::::::::"" ...........
|
||||
46::::::"" ## "":::::::::::::::::::::::""".........
|
||||
47::::::::"""""""""""""""""""""""""""""""""""::::::::::::::::::::::::::::"""""""""
|
||||
48::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
49################################################################################
|
||||
50????????????????????????????????????????????????????????????????????????????????
|
||||
51????????????????????????????????????????????????????????????????????????????????
|
||||
52????????????????????????????????????????????????????????????????????????????????
|
||||
53????????????????????????????????????????????????????????????????????????????????
|
||||
54????????????????????????????????????????????????????????????????????????????????
|
||||
55????????????????????????????????????????????????????????????????????????????????
|
||||
Player: "Player hp=100.0/100.0 pos=(125.0,243.5) bodies=27/27 on_fire=false"
|
||||
Entities: 3
|
||||
Alive entities: Player(hp=100, pos=(125.0, 243.5)), Goblin(hp=40, pos=(110.0, 238.5)), Goblin(hp=40, pos=(110.0, 242.0))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user