refactor(renderer): route Buffer/VAO + CustomGeometry through GfxDevice (RC5 Batch 4)#44
Merged
Merged
Conversation
…ough GfxDevice (RC5) The last resource classes come off raw GL. VertexBuffer/IndexBuffer/VertexArray and CustomGeometry now hold a GfxDevice* and delegate create/upload/bind/destroy and vertex-attribute setup to the device — zero gl, zero GL includes. - Buffer factories take GfxDevice& (createRaw/create, IndexBuffer::create, VertexArray::create). The VAO no longer calls glGenVertexArrays in its ctor — create() allocates via the device. bind/setData/attribute-setup route through the device too. - CustomGeometry::init takes GfxDevice& and stores it for setIndices. - Callers updated: RenderContext quad, ResourceManager vertex/index buffers, GeometryBindings::geometry_init, and (transitionally) the legacy BatchRenderer2D. - Test: extend MockGfxDevice + new test_buffer_device CTest harness (Buffer + CustomGeometry vs the mock) — linking proves GL-decoupling; 21 asserts pass. Raw gl* outside GLDevice: 41 -> 10 (only RendererBindings diagnostics/ glClearStencil and one Engine.cpp call remain — Batch 5/6).
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.
Stacked on #42 (RC5 phase 1). Review/merge #42 first; this re-targets to
masteronce #42 lands.What
The last resource classes come off raw GL.
VertexBuffer/IndexBuffer/VertexArrayandCustomGeometrynow hold aGfxDevice*and delegate create / upload / bind / destroy + vertex-attribute setup to the device — zerogl, zero GL includes.GfxDevice&(createRaw/create,IndexBuffer::create,VertexArray::create). The VAO no longer callsglGenVertexArraysin its ctor —create()allocates via the device.bind/setData/ attribute-setup route through the device.CustomGeometry::inittakesGfxDevice&and stores it forsetIndices.GeometryBindings::geometry_init, and (transitionally) the legacyBatchRenderer2D.Verification
MockGfxDevice+ newtest_buffer_deviceCTest harness compiles the convertedBuffer.cpp+CustomGeometry.cppagainst the mock — linking proves GL-decoupling; 21 asserts pass. All four renderer harnesses (state_tracker, shader_device, texture_fb, buffer_device) green locally.Raw
gl*outsideGLDevice: 41 → 10 (only RendererBindings diagnostics/glClearStenciland one Engine.cpp call remain — Batch 5/6).Next (Batch 5/6)
Retire
Renderer/BatchRenderer2Dand rebaseImmediateDrawonTransientBufferPool; flip the transitional device-routed binds toStateTracker; route the last RendererBindingsgl*through the device; then a CI guard failing the build on anygl*outsideGLDevice.