Skip to content

Conversation

@bqc0n
Copy link
Member

@bqc0n bqc0n commented Oct 4, 2025

What

Fixes this:

 ########## GL ERROR ##########
 @ Post render
 1280: Invalid enum

Implementation Details

This is caused in the logic for getting GL11.GL_SHADE_MODEL in CRenderUtils. The buffer version is bit shifted to the left by 8 bits, leading to the invalid enum. If actual value is GL11.GL_FLAT (0x0x1D00), then shadeModel variable will be 0x1D0000.

Therefore, you should use GL11.glGetInteger(GL11.GL_SHADE_MODEL) instead of buffer version.

Outcome

No more GL ERROR spam.

@bqc0n bqc0n requested review from Copilot and soramame0256 October 4, 2025 12:09
@github-actions github-actions bot added the bug Something isn't working label Oct 4, 2025
Copy link
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 PR fixes an OpenGL error "Invalid enum" caused by incorrect bit shifting when retrieving GL state values using buffer-based OpenGL calls. The issue was causing GL ERROR spam during rendering.

Key changes:

  • Replace buffer-based GL state retrieval with direct glGetInteger calls
  • Remove unnecessary buffer allocations and imports
  • Add explanatory comment about the bit shifting issue

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Member

@soramame0256 soramame0256 left a comment

Choose a reason for hiding this comment

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

lgtm

@bqc0n bqc0n merged commit 6052280 into develop Oct 4, 2025
3 checks passed
@bqc0n bqc0n deleted the fix-gl-error branch October 4, 2025 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants