Skip to content

Determine shader output type - #3098

Open
cykoder wants to merge 3 commits into
bkaradzic:masterfrom
cykoder:shaderc-output-type
Open

cykoder wants to merge 3 commits into
bkaradzic:masterfrom
cykoder:shaderc-output-type

Conversation

@cykoder

@cykoder cykoder commented May 15, 2023

Copy link
Copy Markdown
Contributor

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

@bkaradzic bkaradzic left a comment

Copy link
Copy Markdown
Owner

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

cykoder commented May 15, 2023

Copy link
Copy Markdown
Contributor Author

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

bkaradzic commented May 15, 2023

Copy link
Copy Markdown
Owner

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 <sshellawell@gmail.com>
@cykoder
cykoder force-pushed the shaderc-output-type branch from 9982b4b to 64b10e5 Compare November 12, 2023 23:37
Signed-off-by: Sam Hellawell <sshellawell@gmail.com>
@cykoder
cykoder force-pushed the shaderc-output-type branch from 64b10e5 to 7e94a9f Compare November 13, 2023 01:42

This branch has not been deployed

No deployments
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