Skip to content

fix(renderer): make each unit has multiple texture bindings per target#215

Merged
yorkie merged 2 commits intomainfrom
fix/renderer-texture-bindings
Aug 15, 2025
Merged

fix(renderer): make each unit has multiple texture bindings per target#215
yorkie merged 2 commits intomainfrom
fix/renderer-texture-bindings

Conversation

@yorkie
Copy link
Copy Markdown
Collaborator

@yorkie yorkie commented Aug 15, 2025

This pull request refactors how texture bindings are managed in the OpenGL renderer codebase. The main change is introducing the new GLTextureUnitBinding class to handle multiple texture targets per texture unit, replacing the previous approach that stored only one binding per unit. This makes the texture binding logic more robust and extensible, and also updates the logic to only record up to 16 texture units for performance reasons.

@yorkie yorkie requested a review from Copilot August 15, 2025 09:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request refactors the OpenGL texture binding management system to support multiple texture targets per texture unit instead of the previous single-binding approach. The changes introduce a new GLTextureUnitBinding class that can handle multiple texture types (2D, 2D array, 3D, cube map) simultaneously within each texture unit.

  • Introduces GLTextureUnitBinding class to manage multiple texture bindings per unit
  • Updates texture recording logic to capture all texture types bound to each unit
  • Reduces the number of recorded texture units from 32 to 17 for performance optimization

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/renderer/gles/context_storage.hpp Adds new GLTextureUnitBinding class and updates storage data structures
src/renderer/gles/context_storage.cpp Updates texture restoration logic to use new binding system
src/renderer/gles/context_host.cpp Modifies texture recording to capture multiple bindings per unit and reduces unit count
src/renderer/gles/context_app.cpp Updates texture binding change handler to work with new multi-binding system

Comment thread src/renderer/gles/context_host.cpp
Comment thread src/renderer/gles/context_storage.hpp
Comment thread src/renderer/gles/context_storage.hpp Outdated
Comment thread src/renderer/gles/context_storage.hpp
@yorkie yorkie merged commit e50b6ce into main Aug 15, 2025
2 checks passed
@yorkie yorkie deleted the fix/renderer-texture-bindings branch August 15, 2025 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants