Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shader generator: Move FS_TEX_ALPHA to a uniform bool. #16763

Merged
merged 5 commits into from
Jan 10, 2023

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Jan 9, 2023

Part of #16567, the effort to reduce the number of unique shaders/pipelines we generate. This does make a difference and I can't see any performance difference otherwise.

This is the first time we use uniform bools. If needed, can easily switch it to a float. If we were only targeting modern APIs I'd just make a uint bitfield of course.

For some reason, this doesn't work with D3D9 yet. works now!

Had to expand the uniform buffer again, but will optimize it down again later, though I think it doesn't matter too much.

Needs some testing on older OpenGL before merge.

@hrydgard hrydgard added this to the v1.15.0 milestone Jan 9, 2023
@hrydgard hrydgard added the GE emulation Backend-independent GPU issues label Jan 9, 2023
@hrydgard hrydgard marked this pull request as ready for review January 9, 2023 11:51
@hrydgard
Copy link
Owner Author

hrydgard commented Jan 9, 2023

Hm, first thought bool registers had some strange behaviors in D3D9, like getting locked at the first use or something. But tried switching to float locally, and it's still just as broken. Hm.

EDIT: Argh, just forgot to add to psUniforms...

No clue why the test errors :( It all works fine at runtime..

@unknownbrackets
Copy link
Collaborator

https://social.msdn.microsoft.com/Forums/vstudio/en-US/ff6328b5-a627-422c-956a-67eba9a54b4a/wpf-effect-creation?forum=wpf

Maybe it's something with the emulated D3D 9 running here, maybe it only supports 2.0?

-[Unknown]

@hrydgard
Copy link
Owner Author

Ah, likely something like that.

I'm just gonna change it to a float, easier for old bad shader compilers to deal with...

@hrydgard hrydgard merged commit bef50f9 into master Jan 10, 2023
@hrydgard hrydgard deleted the texalpha-shaderflag branch January 10, 2023 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GE emulation Backend-independent GPU issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants