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

GLSL Error - Different sampler types for same sample texture unit in fragment shader. #77

Closed
Eric-P7 opened this issue Jan 26, 2022 · 6 comments
Labels

Comments

@Eric-P7
Copy link

Eric-P7 commented Jan 26, 2022

Your latest change to make stb_image optional allowed me to resolve the linking errors in #74, but I now get a runtime glsl error:

Warning: no "settings.conf" found
Image loader: dlib.image
Warning: no "input.conf" found
Validation warning! - Sampler value diffuseTexture has not been set.
Validation successful.
Validation warning! - Sampler value diffuseTexture has not been set.
Validation successful.
Validation warning! - Sampler value diffuseTexture has not been set.
Validation successful.
Validation warning! - Sampler value diffuseTexture has not been set.
Validation successful.
Validation warning! - Sampler value diffuseTexture has not been set.
Validation successful.
Validation warning! - Sampler value diffuseTexture has not been set.
Validation successful.
Validation warning! - Sampler value diffuseTexture has not been set.
Validation successful.
Validation warning! - Sampler value diffuseTexture has not been set.
Validation successful.
Validation successful.
Validation successful.
Validation failed! - Different sampler types for same sample texture unit in fragment shader.

core.exception.AssertError@C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\graphics\shader.d(528): Shader program validation failed
----------------
0x000000014003B25F in d_assert_msg
0x0000000140089E2F in dagon.graphics.shader.Shader.validate at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\graphics\shader.d(528)
0x0000000140089B5C in dagon.graphics.shader.Shader.bindParameters at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\graphics\shader.d(498)
0x00000001400F457F in dagon.render.shaders.environment.EnvironmentShader.bindParameters at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\render\shaders\environment.d(170)
0x00000001400ED45E in dagon.render.deferred.environmentpass.DeferredEnvironmentPass.render at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\render\deferred\environmentpass.d(83)
0x000000014008FDAF in dagon.render.pipeline.RenderPipeline.render at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\render\pipeline.d(83)
0x000000014007B91B in dagon.game.renderer.Renderer.render at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\game\renderer.d(79)
0x000000014002D2DF in dagon.game.game.Game.onRender at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\game\game.d(138)
0x000000014002C13D in dagon.core.application.Application.onAnimationFrame at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\core\application.d(304)
0x0000000140077D09 in dagon.core.time.Cadencer.update at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\core\time.d(64)
0x000000014002C41D in dagon.core.application.Application.run at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\core\application.d(326)
0x000000014000113C in D main at C:\home\projects\game4\source\app.d(18)
0x0000000140059003 in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll().__lambda2()
0x0000000140058E7F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x0000000140058F6B in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll()
0x0000000140058E7F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x0000000140058DA6 in d_run_main2
0x000000014003B801 in d_run_main
0x0000000140001352 in main._d_cmain!().main at C:\dev\dmd\dmd2\windows\bin\..\..\src\druntime\import\core\internal\entrypoint.d(29)
0x00000001402583BE in mainCRTStartup
0x00007FF80E537034 in BaseThreadInitThunk
0x00007FF810402651 in RtlUserThreadStart

I have a Radeon 5700 XT on Win 10 64bit. I can try updating to a newer driver if you'd like.

image

I also have machines with an Nvidia GTX 1050 and GTX 1650 I can test, if you need me to.

@Eric-P7 Eric-P7 changed the title Validation failed! - Different sampler types for same sample texture unit in fragment shader. GLSL Error - Different sampler types for same sample texture unit in fragment shader. Jan 26, 2022
@gecko0307
Copy link
Owner

gecko0307 commented Jan 26, 2022

Nvidia driver doesn't complain about this, weird.

Possibly this should also fix #72

@Eric-P7
Copy link
Author

Eric-P7 commented Jan 26, 2022

That commit fixed the Sampler value diffuseTexture has not been set warnings but not the validation failure:

C:\home\projects\game4>game4
Warning: no "settings.conf" found
Image loader: dlib.image
Warning: no "input.conf" found
Validation failed! - Different sampler types for same sample texture unit in fragment shader.

core.exception.AssertError@C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\graphics\shader.d(530): Shader program validation failed
----------------
0x000000014003B25F in d_assert_msg
0x0000000140089E3C in dagon.graphics.shader.Shader.validate at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\graphics\shader.d(530)
0x0000000140089B5C in dagon.graphics.shader.Shader.bindParameters at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\graphics\shader.d(498)
0x00000001400F45BC in dagon.render.shaders.environment.EnvironmentShader.bindParameters at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\render\shaders\environment.d(172)
0x00000001400ED46E in dagon.render.deferred.environmentpass.DeferredEnvironmentPass.render at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\render\deferred\environmentpass.d(83)
0x000000014008FDBF in dagon.render.pipeline.RenderPipeline.render at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\render\pipeline.d(83)
0x000000014007B91B in dagon.game.renderer.Renderer.render at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\game\renderer.d(79)
0x000000014002D2DF in dagon.game.game.Game.onRender at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\game\game.d(138)
0x000000014002C13D in dagon.core.application.Application.onAnimationFrame at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\core\application.d(304)
0x0000000140077D09 in dagon.core.time.Cadencer.update at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\core\time.d(64)
0x000000014002C41D in dagon.core.application.Application.run at C:\Users\eric\AppData\Local\dub\packages\dagon-master\dagon\src\dagon\core\application.d(326)
0x000000014000113C in D main at C:\home\projects\game4\source\app.d(18)
0x0000000140059003 in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll().__lambda2()
0x0000000140058E7F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x0000000140058F6B in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).runAll()
0x0000000140058E7F in void rt.dmain2._d_run_main2(char[][], ulong, extern (C) int function(char[][])*).tryExec(scope void delegate())
0x0000000140058DA6 in d_run_main2
0x000000014003B801 in d_run_main
0x0000000140001352 in main._d_cmain!().main at C:\dev\dmd\dmd2\windows\bin\..\..\src\druntime\import\core\internal\entrypoint.d(29)
0x000000014025848E in mainCRTStartup
0x00007FF80E537034 in BaseThreadInitThunk
0x00007FF810402651 in RtlUserThreadStart

@Eric-P7
Copy link
Author

Eric-P7 commented Jan 27, 2022

I forgot to add, ElectronVolt and the Dagon Sandbox both run fine on my pc with the Radeon 5700 XT.

@gecko0307
Copy link
Owner

gecko0307 commented Jan 27, 2022

My guess is that it is because some execution paths didn't set sampler uniforms, and they were 0 by default which is illegal for cubemaps in this case, but ok for 2D textures.

Sandbox and other older demos work because I've only recently added state validation. I think apps should run fine with validation turned off (when compiled in release mode) despite invalid sampler setup - if the cubemap isn't set, it is never sampled. It should be fixed anyway, but unfortunately I don't have an AMD card to test on, so it's tricky for me.

@Eric-P7
Copy link
Author

Eric-P7 commented Jan 27, 2022

With the latest commit, it actually runs on My Radeon 5700 XT! Can you confirm it renders correctly? It appears to according to the code generated by dub init --type=dagon

image

@gecko0307
Copy link
Owner

Yes, the screenshot looks correct. Cool, glad to hear!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants