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

Determine shader output type #3098

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cykoder
Copy link
Contributor

@cykoder cykoder commented May 15, 2023

EG:

#pragma BGFX_FRAG_OUTPUT_TYPE uvec2

void main() {
  gl_FragData[0] = uvec2(1u, 1u);
}

Perhaps not the best way of doing it - happy to implement suggestions

@cykoder cykoder requested a review from bkaradzic as a code owner May 15, 2023 03:00
Copy link
Owner

@bkaradzic bkaradzic left a comment

Choose a reason for hiding this comment

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

You should come up with solution that works with all shader backends.

@cykoder
Copy link
Contributor Author

cykoder commented May 15, 2023

could you elaborate on what you'd expect? are you referring to ensuring it compiles and outputs in every backend or that this is too gl/vulkan specific? i've tested it with hlsl, spirv, gl and gles - seems to compile atleast. Was intending to create an example once the "how" was decided

@bkaradzic
Copy link
Owner

bkaradzic commented May 15, 2023

Was intending to create an example once the "how" was decided

I would suggest creating example first... This hack is sufficient to create example. Example will let you test that everything works everywhere as expected. This will allow you to explore all issues with all backends without worrying to much how it will look at the end. Then afterwards we can come up with solution which will most likely present itself once you solve those issues you discovered.

Also keep in mind that gl_FragColor is just alias for gl_FragData[0] in case of MRT.

@cykoder cykoder force-pushed the shaderc-output-type branch from 34e2c28 to 9982b4b Compare June 11, 2023 23:57
Signed-off-by: Sam Hellawell <[email protected]>
@cykoder cykoder force-pushed the shaderc-output-type branch from 9982b4b to 64b10e5 Compare November 12, 2023 23:37
Signed-off-by: Sam Hellawell <[email protected]>
@cykoder cykoder force-pushed the shaderc-output-type branch from 64b10e5 to 7e94a9f Compare November 13, 2023 01:42
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