Repository navigation
Render: move the methods to a static vtable, call them through render_* helpers - #33
Merged
Merged
Conversation
Owner
Author
|
Independent review of head Verdict: approve. One P3 (naming nit).
Build: clean CMake+Ninja (Release, |
Owner
Author
|
Review follow-up: renamed the remaining rend_ identifiers to render_ in 4552fd4 |
resetius
force-pushed
the
objmodel-render
branch
from
November 7, 2026 16:01
4552fd4 to
b8661e0
Compare
Owner
Author
|
Restacked onto master eff69ca after PR 29 |
resetius
force-pushed
the
objmodel-render
branch
from
November 7, 2026 16:06
b8661e0 to
0fdcdd1
Compare
Owner
Author
|
Restacked onto master b76fe0a after PR 30. |
resetius
force-pushed
the
objmodel-render
branch
from
November 7, 2026 16:26
0fdcdd1 to
9d841b9
Compare
Owner
Author
|
Restacked onto master a33ca6c after PR 31. |
resetius
force-pushed
the
objmodel-render
branch
from
November 7, 2026 16:29
9d841b9 to
00f27d8
Compare
Owner
Author
|
Restacked onto master 4a501de after PRs 31–32. |
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.
PRs 31–32 are merged; review only the last commit.
Part of the object model change from the tracker task: one
vtblpointer per object to a static const method table, like a C++ vptr.What changed:
render/render.h: newstruct RenderVtblwith the same 14 methods.struct Rendernow holds onlyconst struct RenderVtbl* vtbl.render_prefix for every method:render_pipeline,render_buffer_manager,render_draw_begin,render_counter_submitand so on.render_freekeeps the NULL check of the oldrend_free.rend_free,rend_tex_newandrend_char_newbecame these helpers, sorender/render.cis empty and is removed (CMakeLists.txt and Makefile updated).rend_opengl_new→render_opengl_new,rend_vulkan_new→render_vulkan_new.opengl/render.candvulkan/render.c: onestatic const struct RenderVtbl render_vtblbefore the constructor, with exactly the fields of the oldbaseliteral. The constructor setsr->base.vtbl = &render_vtbl.main.c,font/font.cand the 10 models. No direct->method(calls of Render are left.Size of the
struct Renderpart on 64-bit: 112 bytes before, 8 bytes after (one object per run, so this is about the style, not memory).No behavior change.
Verification (macOS, AppleClang, CMake + Ninja):
ctest: 3/3 passed.VK_LAYER_KHRONOS_validation(layer load confirmed withVK_LOADER_DEBUG=layer), 10 s each: particles3, mandelbrot, stl, 0 validation messages.main.c(not in this PR): at frame 30 it sends key presses and releases for LEFT, RIGHT, UP, DOWN, A, Z, TAB and two mouse moves through the normal GLFW callbacks, then leaves the main loop after 8 s, so all free functions run. Vulkan particles3, mandelbrot, stl, gltf, triangle, torus, mandelbulb, particles, particles2 and OpenGL mandelbrot, stl, torus, triangle, mandelbulb, particles2: all exit with code 0. The logs are the same as on master after removing timings, FPS and pointer values (same buffer allocations, same validation output). On master, stl, gltf and triangle already report leaked objects atvkDestroyDevice(one message each); nothing else is reported.