DrawEngineGLES already knows that every index it generates is below the
decoded/transformed vertex count, but only passed the count to
glDrawElements. Drivers that need the vertex range before vertex
shading, like Mesa's Panfrost, then scan the index data on the CPU for
every draw, and their min/max caches can't help since the index push
buffer is rewritten every frame.
Only used for single-instance draws on desktop GL or GLES3, and only
when the caller provides the range, so other DrawIndexed callers are
unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
imgui 1.92 hands the backend a list of dirty rectangles when its font atlas
grows, but thin3d could only replace a whole mip level, so every new glyph
re-uploaded the entire atlas.
Adds DrawContext::UpdateTextureRegions, taking a batch of regions so each
backend can submit them together:
- Vulkan: packs the regions into the push pool and issues a single
vkCmdCopyBufferToImage from the init command buffer, transitioning only
the level being written.
- OpenGL: new TEXTURE_SUBIMAGE init step. The existing sub-image path is a
render command needing an active render pass and a texture slot, which
doesn't fit here. Rows are packed caller-side since GLES2 lacks
GL_UNPACK_ROW_LENGTH.
- D3D11: UpdateSubresource with a box, no staging texture needed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Integrates the GLProfiler into GLQueueRunner to provide GPU timestamp
profiling for OpenGL render passes, similar to the Vulkan backend.
Profiled operations:
- RenderPass (with tag name for identification)
- Copy operations
- Blit operations
- Readback operations
- ReadbackImage operations
The profiler is initialized in CreateDeviceObjects() and shutdown in
DestroyDeviceObjects(). Timing results are logged each frame when the
GPU profile debug overlay is enabled.
Signed-off-by: Chris Healy <cphealy@gmail.com>
Turns out the VR work bloated it a bit, which can't be good.
Think it's fine to allocate these view matrices on the heap to get them
out of the way, there won't be that crazy many per frame usually.
[how]
1. use comment instead of unnecessary logic comparison
2. remove some useless code
3. move some implemention code from header to source
4. some more assert
Should make support for depth texturing quite easy.
Unfortunately, this extension does not exist on OpenGL ES. There we'll
have to use ugly tricks with gl_FragDepth if we want this.