examples: templated WebSocket echo server and browser client#156
Draft
examples: templated WebSocket echo server and browser client#156
Conversation
r_forwardPlusShade changes PBR fragment specialization on world draw pipelines only. vk_destroy_pipelines() also destroyed gamma, overlay compose, bloom, SMAA, and other post paths unrelated to Forward+, which could leave the swapchain with no valid gamma blit (black screen with audio). Add vk_destroy_world_graphics_pipelines() (same slice as vk_release_resources: indices >= vk.pipelines_world_base) and use it for r_forwardPlusShade invalidation. Persistent pipelines (skybox, fog, etc.) stay valid; PBR world pipelines are recreated lazily via vk_gen_pipeline as before. Co-authored-by: Tim Fox <timfox@outlook.com>
vk_destroy_world_graphics_pipelines() must not shrink vk.pipelines_count or zero Vk_Pipeline_Def rows: shader_t stores uint32_t indices into the table; dropping the tail reuses slots and breaks cached indices (wrong draws or vk_gen_pipeline ERR_FATAL). Destroy only VkPipeline handles; lazy recreation picks up the new r_forwardPlusShade specialization. Co-authored-by: Tim Fox <timfox@outlook.com>
- r_forwardPlus default 1 (latched): prioritize clustered tile cull + PBR path - Light records: pack to host staging, vkCmdCopyBuffer to DEVICE_LOCAL SSBO each frame so compute cull and fragment shaders read VRAM (not host-mapped SSBO) - vk_forward_plus_upload_refdef after RB_BeginDrawingView: transfer barriers - Tile cull light buffer barrier updated for device-local read path - docs/FORWARD_PLUS_PIPELINE_AUDIT.md: ordering and sync notes Startup log: [VK][Forward+] r_forwardPlus=1 device-local light SSBO + staging... Co-authored-by: Tim Fox <timfox@outlook.com>
Move record/demo/stoprecord commands, demo file I/O, and net-packet demowriting from cl_main.c into cl_demo.c. cl_main calls CL_Demo_InitCommands/Shutdown and CL_Demo_WriteServerPacket for live recording. Public entry points (CL_ReadDemoMessage, CL_StopRecord_f) remain in cl_demo.c for cl_parse and cgame. Co-authored-by: Tim Fox <timfox@outlook.com>
Co-authored-by: Tim Fox <timfox@outlook.com>
Add examples/websocket with a Node ws echo server (JSON ping/pong), a single-file HTML client, an engine WS_* API snippet, and README notes on ws:// vs TLS and how the client integrates with WS_Frame(). Co-authored-by: Tim Fox <timfox@outlook.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change adds
examples/websocket/with self-contained templates for demonstrating WebSockets alongside the engine client:wsserver (server/node/echo_server.mjs): echo text; responds to JSON{"type":"ping"}with a pong and timestamp.npm installandnode echo_server.mjs(default port 8765).client/browser/echo_client.html) with connect, send, JSON ping, and a log.engine_snippet.c) showingWS_Connect/WS_SendText/ callbacks; documents thatWS_Frameis already driven fromcl_main.cand that the built-in client isws://(TLS at reverse proxy forwss://).package-lock.jsonis included so the Node example is reproducible without re-runningnpm installin CI context.