Just learned that there is no way for a GLSL shader to send data to the CPU side program.
-
@kertinker You should be able to write into SSBOs.
@landelare Oh, I hadn't learned about those. Thanks!
-
@kertinker You should be able to write into SSBOs.
@landelare Oh... sorry, I can't use storage buffer objects. GLEW_ARB_shader_storage_buffer_object is 0.
-
Just learned that there is no way for a GLSL shader to send data to the CPU side program. I think, at least. No way to emit debugging information at all, not even a puts.
At least if I understand, "Uniforms are so named because they do not change from one shader invocation to the next within a particular rendering call thus their value is uniform among all invocations."
Thought I could define a uniform, then set that to some debugging value in the shader.
@kertinker There is an extension for Vulkan that lets you use printf in GLSL shaders.
-
@landelare Oh... sorry, I can't use storage buffer objects. GLEW_ARB_shader_storage_buffer_object is 0.
-
@aeva @landelare Looks interesting! Hm...
printf("%d\n", GLEW_ARB_shader_image_load_store);
0
Looks like not that one either. GL_OES_mapbuffer maybe...? I might be hosed. -
@aeva @landelare Looks interesting! Hm...
printf("%d\n", GLEW_ARB_shader_image_load_store);
0
Looks like not that one either. GL_OES_mapbuffer maybe...? I might be hosed.@kertinker @aeva You don't printf into these. Use imageStore() if you want to use ARB_shader_image_load_store.
-
@kertinker @aeva You don't printf into these. Use imageStore() if you want to use ARB_shader_image_load_store.
@landelare @aeva I was using printf in a CPU side program, to print the "GLEW_ARB_shader_image_load_store" variable, which I think the OpenGL Extension Wrangler would set to 1, if ARB_shader_image_load_store was supported by my graphics card.
I made sure to call glewInit and have a valid context and all.
-
@landelare @aeva I was using printf in a CPU side program, to print the "GLEW_ARB_shader_image_load_store" variable, which I think the OpenGL Extension Wrangler would set to 1, if ARB_shader_image_load_store was supported by my graphics card.
I made sure to call glewInit and have a valid context and all.
@landelare as of version 1.1.0, GLEW signals extension availability with variables containing boolean values, so while the examples KT is posting look like name constants, they're mutable binary values that the initialization code sets up. relevant docs: https://glew.sourceforge.net/basic.html
@kertinker what GL version are you targeting and what platform? for a sanity check, could you post what GLEW_ARB_vertex_program is after init?
-
@landelare as of version 1.1.0, GLEW signals extension availability with variables containing boolean values, so while the examples KT is posting look like name constants, they're mutable binary values that the initialization code sets up. relevant docs: https://glew.sourceforge.net/basic.html
@kertinker what GL version are you targeting and what platform? for a sanity check, could you post what GLEW_ARB_vertex_program is after init?
@kertinker @landelare also if you happen to be on linux could you paste the output of glxinfo to a pastebin somewhere and link it here?
-
@landelare as of version 1.1.0, GLEW signals extension availability with variables containing boolean values, so while the examples KT is posting look like name constants, they're mutable binary values that the initialization code sets up. relevant docs: https://glew.sourceforge.net/basic.html
@kertinker what GL version are you targeting and what platform? for a sanity check, could you post what GLEW_ARB_vertex_program is after init?
This post is deleted! -
@kertinker @landelare also if you happen to be on linux could you paste the output of glxinfo to a pastebin somewhere and link it here?
@aeva @landelare Oh, sure. I don't have a "glxinfo" command, but visualinfo produces this: https://nopaste.net/l92XzrU5kr which... oddly includes GL_EXT_shader_image_load_store.
I'm clearly doing something wrong. Not sure how I could get a working OpenGL program running, without it saying extensions that are supported, are supported. Maybe you have to set a specific... mode, before they get supported?
-
@aeva @landelare Oh, sure. I don't have a "glxinfo" command, but visualinfo produces this: https://nopaste.net/l92XzrU5kr which... oddly includes GL_EXT_shader_image_load_store.
I'm clearly doing something wrong. Not sure how I could get a working OpenGL program running, without it saying extensions that are supported, are supported. Maybe you have to set a specific... mode, before they get supported?
@kertinker @landelare if you can, post your GL initialization code
-
@kertinker @landelare if you can, post your GL initialization code
@aeva @landelare https://nopaste.net/aTFTXWDVRU
Other than that just the usual gtk init and creating a GtkGlArea.
-
@aeva @landelare https://nopaste.net/aTFTXWDVRU
Other than that just the usual gtk init and creating a GtkGlArea.
@kertinker @aeva Are you running on some kind of retro system? These features are ancient, we're talking 2009 hardware.
-
@aeva @landelare https://nopaste.net/aTFTXWDVRU
Other than that just the usual gtk init and creating a GtkGlArea.
@kertinker @landelare what is the GL major and minor version reported by your program?
-
@kertinker @landelare what is the GL major and minor version reported by your program?
@kertinker @landelare I'm not familiar with GtkGlArea, but I spotted this in the docs https://docs.gtk.org/gtk4/method.GLArea.set_required_version.html
You have to call gtk_gl_area_set_required_version before the widget's rendering context is created, but I imagine if you set it to 4.6 (based on your earlier visualinfo paste) then you should be able to see the extensions you are missing. Ideally you'll want to set it to the lowest required version you need, but 4.6 is fine for debugging.