Skip to content

[rlgl] Use defines in default shaders#5925

Open
floopfloopfloopfloopfloop wants to merge 1 commit into
raysan5:masterfrom
floopfloopfloopfloopfloop:master
Open

[rlgl] Use defines in default shaders#5925
floopfloopfloopfloopfloop wants to merge 1 commit into
raysan5:masterfrom
floopfloopfloopfloopfloop:master

Conversation

@floopfloopfloopfloopfloop

@floopfloopfloopfloopfloop floopfloopfloopfloopfloop commented Jun 19, 2026

Copy link
Copy Markdown

The #ifndef RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION et all in rlgl.h imply the names can be redefined, but the default shader sources use hardcoded names, resulting in name mismatches and nothing drawing if one attempts. This PR changes the shaders to use the defines, which seems to fix the issue.

@floopfloopfloopfloopfloop

floopfloopfloopfloopfloop commented Jun 19, 2026

Copy link
Copy Markdown
Author
image

what in tarnation Apparently you can unwittingly use other people's emails in git commits, and github will just say it was made by them. Amazing.

@raysan5 raysan5 changed the title Use defines in default shaders [rlgl] Use defines in default shaders Jun 22, 2026
@raysan5

raysan5 commented Jun 22, 2026

Copy link
Copy Markdown
Owner

@floopfloopfloopfloopfloop this change reduces default shaders readability and actually makes me question if shader names should be allowed to be changed, nobody requested it in the last 12 years. Most probably not merging it but probably making some changes in consequence.

@floopfloopfloopfloopfloop

floopfloopfloopfloopfloop commented Jun 24, 2026

Copy link
Copy Markdown
Author

12 years is a long time, I'm surprised. Readability could be easily fixed with temporarily redefining the attribute names?

#define RL_VERTEX_POSITION RL_DEFAULT_SHADER_ATTRIB_NAME_POSITION
//...
"attribute vec3 "RL_VERTEX_POSITION";     \n"
//...
#undef RL_VERTEX_POSITION

Being able to avoid mismatched variable name style conventions without forking is admittedly an unusual and rather aesthetic feature I was quite happy to see.

@raysan5 raysan5 added the on hold issue or PR waiting for further review/approval label Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

on hold issue or PR waiting for further review/approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants