Skip to content

fix(rendering): GBuffer pipeline, second-launch asset reload, HashMap rewrite - #638

Merged
JeanPhilippeKernel merged 1 commit into
developfrom
fix/rendergraph-gbuffer-pass
Aug 21, 2026
Merged

fix(rendering): GBuffer pipeline, second-launch asset reload, HashMap rewrite#638
JeanPhilippeKernel merged 1 commit into
developfrom
fix/rendergraph-gbuffer-pass

Conversation

@JeanPhilippeKernel

@JeanPhilippeKernel JeanPhilippeKernel commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • GBuffer pipeline: registered GbufferPass in render graph; fixed magenta background (clear color, shaderInt64, texture binding conflicts); split shader files to avoid Int64/sampler pollution in geometry-only stages
  • RenderPass API: redesigned from scratch — binding-number reflection lookup, BindingsByName O(1) map, dangling-pointer-safe SetName/SetPipelineName, better error messages
  • Second-launch asset reload: fixed four missing pieces — IsAssetExtension didn't include .zemesh/.zematerial, InferTypeFromExtension mapped .zematerialMESH, VFSScanner.m_registry was never set, and no startup scan or reload path existed; also fixed a pre-existing sizeof(AssetNodeHierarchy) vs sizeof(NodeHierarchy) buffer overflow in IngestMesh that corrupted the NodeNames hash map on reload
  • HashMap/UnorderedHashMap rewrite: power-of-2 capacity, linear probing with bitmask, Array::init(cap,cap) + zero-init, guard_load assertion; same fixes for ordered HashMap
  • Dead code / style: removed LightingPass commented-out bodies, stale TODOs, section separators

Test plan

  • Engine starts with clean project: dark background, grid, no errors
  • Import GLB → mesh visible in viewport
  • Close engine, relaunch → mesh reloads from disk without crash
  • 55 HashMap/UnorderedHashMap edge-case tests pass (--gtest_filter="*HashMap*")
  • .zemesh drag-and-drop in content browser spawns actor in scene

@JeanPhilippeKernel
JeanPhilippeKernel force-pushed the fix/rendergraph-gbuffer-pass branch from 7f28813 to 1e7691c Compare August 21, 2026 03:06
@JeanPhilippeKernel
JeanPhilippeKernel changed the base branch from main to develop August 21, 2026 03:08
@JeanPhilippeKernel
JeanPhilippeKernel force-pushed the fix/rendergraph-gbuffer-pass branch from 1e7691c to 3613332 Compare August 21, 2026 03:14
@JeanPhilippeKernel JeanPhilippeKernel self-assigned this Aug 21, 2026
@JeanPhilippeKernel JeanPhilippeKernel added area-rendering area-linux Work on Linux system area-window Work on Window system area-macOS Work on macOS system labels Aug 21, 2026
… rewrite

Rendering:
- Register GbufferPass in render graph; was outputting black via dead BasePass
- Fix magenta background: shaderInt64 device feature not enabled, GbufferPass
  Execute was returning before BeginRenderPass when no mesh in scene
- Split vertex_common.glsl / fragment_common.glsl into geometry_bindings.glsl,
  texture_bindings.glsl, material.glsl, draw.glsl, draw_types.glsl, surface.glsl
  to stop Int64/sampler extensions leaking into geometry-only shader stages
- Redesign RenderPass API: binding-number reflection, BindingsByName O(1) map,
  arena-safe SetName/SetPipelineName, pipeline+shader name in error messages
- Fix ImGUIRenderer: remove stale SetSampler("LinearWrapSampler") call

Asset reload (second launch):
- IsAssetExtension: add .zemesh and .zematerial so VFSScanner processes them
- InferTypeFromExtension: map .zematerial -> MATERIAL (was falling through to MESH)
- ImguiLayer: set Scanner.SetAssetRegistry and post startup TriggerScan
- Add AssetManager::ReloadFromDisk — deserializes each unloaded MATERIAL/MESH
  record from disk and calls IngestMaterial/IngestMesh
- Fix pre-existing buffer overflow in IngestMesh: sizeof(AssetNodeHierarchy)
  used instead of sizeof(NodeHierarchy) for the Hierarchies memcpy, overflowing
  308 KB past the allocated block and corrupting the NodeNames hash map

Containers:
- Rewrite UnorderedHashMap: power-of-2 capacity, linear probing with bitmask,
  Array::init(cap,cap) + secure_memset(0), guard_load assertion at 75%
- Fix secure_memset arg order: (dst, value, count, dst_size) was swapped,
  leaving all entry state bytes as garbage instead of EntryState::Empty
- Rewrite HashMap (ordered): same fixes; per-slot default construction since
  prev/next must be size_type(-1), not 0
- 55 edge-case tests: power-of-2, tombstone reuse, collision cluster, large
  batch, ordered insertion invariants, sort_keys idempotent
@JeanPhilippeKernel
JeanPhilippeKernel force-pushed the fix/rendergraph-gbuffer-pass branch from 3613332 to d47af7e Compare August 21, 2026 03:33
@JeanPhilippeKernel
JeanPhilippeKernel merged commit 26be907 into develop Aug 21, 2026
17 checks passed
@JeanPhilippeKernel
JeanPhilippeKernel deleted the fix/rendergraph-gbuffer-pass branch August 21, 2026 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-linux Work on Linux system area-macOS Work on macOS system area-rendering area-window Work on Window system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant