2.0 KiB
2.0 KiB
Session Log — 2026-07-12
RHI Global Context Refactor
Reviewed the user's staged changes to the Vulkan RHI backend. The changes encompassed:
Global Context Adoption
- RHI functions no longer take allocator parameters
_G_RHI_CONTEXTprovidesallocator(user-facing objects) andtmp(short-lived temporaries)prRhiInit(void)/prRhiDestroy(void)manage the global context
KTX Texture Bug Fix
- Original implementation only copied mip level 0
- Fixed to iterate all mip levels using
ktxTexture_GetImageOffset() - Final layout changed from
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMALtoVK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL
Frame-by-Frame Command Batching Pattern
- Commands that run every frame avoid arena allocation
- Use stack arrays with while-loop to batch operations in fixed-size chunks
- Applied to:
prRhiCmdBindDescriptorSets,prRhiCmdBindVertexBuffers,prRhiCmdCopyBufferToImage
API Simplifications
prRhiCreateCommandPool: removed desc parameter, usesdevice->queue_family_indexprRhiFreeCommandBuffers: removed count parameter, useswpArrayCountprRhiAllocateDescriptorSet: changedu32 variable_counttoWpU32Array variable_descriptor_countsprRhiCmdBindVertexBuffers: changed raw pointer + count toWpU64Array
New Pipeline Configuration
- Added
polygon_mode,cull_mode,front_faceto rasterization - Added
depth_test_enable,depth_write_enable,depth_compare_op - Added
vertex_shader_entry_point,fragment_shader_entry_point(not hardcoded to "main") - Added
line_width,multisample_count
Code Style Updates
- All Vulkan info structs use C99 designated initializers
- Removed unnecessary type casts on opaque struct handles
- Added braces to all single-line if statements
- Braces rule moved from prism-rhi skill to AGENTS.md formatting section
Documentation Updates
- Updated
prism-rhiskill with all new conventions - Updated
AGENTS.mdwith frame-by-frame batching pattern - Moved braces rule to
AGENTS.md(not RHI-specific)