Running sdl3 opengl example on my pc, question #1667

Closed
opened 2018-03-06 17:35:56 +00:00 by bjadamson · 8 comments
bjadamson commented 2018-03-06 17:35:56 +00:00 (Migrated from github.com)

Hello, I'm in the process of upgrading from 1.53 -> 1.60, and I'm getting rendering errors. To investigate I went to run the SDL opengl 3 example, and ran into some issues. I eventually tracked them down to needing the following two code changes:

  1. Request a 3.1 sdl_opengl context version, instead of currently the code requests a 3.2 version.
  2. Switch the GLSL version from 330 to 140 (or 330 es)

These changes allow the example code to continue to run on my pc. Looking at the shader code, it doesn't seem like there is anything fancy that version 140 can't support. I see in the changelog, the gl version was changed from 150 to 330. May I ask the reason for this trend of requiring newer versions of gl to run the examples?

Would you consider downgrading these back to 140? How about the 3.1 context instead of a 3.2 In my thinking, it would just allow the examples to run more places. Unless I'm missing a benefit of using a higher version.

Regardless thank you! Hopefully I can track down the issue I'm getting going from 1.53 -> 1.60 in my project, hoping its related but seems unlikely..

Hello, I'm in the process of upgrading from 1.53 -> 1.60, and I'm getting rendering errors. To investigate I went to run the SDL opengl 3 example, and ran into some issues. I eventually tracked them down to needing the following two code changes: 1. Request a 3.1 sdl_opengl context version, instead of currently the code requests a 3.2 version. 2. Switch the GLSL version from 330 to 140 (or 330 es) These changes allow the example code to continue to run on my pc. Looking at the shader code, it doesn't seem like there is anything fancy that version 140 can't support. I see in the changelog, the gl version was changed from 150 to 330. May I ask the reason for this trend of requiring newer versions of gl to run the examples? Would you consider downgrading these back to 140? How about the 3.1 context instead of a 3.2 In my thinking, it would just allow the examples to run more places. Unless I'm missing a benefit of using a higher version. Regardless thank you! Hopefully I can track down the issue I'm getting going from 1.53 -> 1.60 in my project, hoping its related but seems unlikely..
bjadamson commented 2018-03-06 17:37:37 +00:00 (Migrated from github.com)

edit: for clarity

edit: for clarity
ocornut commented 2018-03-06 17:44:29 +00:00 (Migrated from github.com)

Benjamin,

See #1466 for the discussion leading to that change and commit 7484c63449.

This has not changed since January 2016:

SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);

On January 7 in 7484c63449 we actually LOWERED the GLSL version from 330 to 150.

So everything you have written here looks backward to me. I am wrong? Otherwise could you investigate this more thoroughly? This is all super confusing now, and it's really hard to handle a report if half of the information in it are clearly erroneous.

Benjamin, See #1466 for the discussion leading to that change and commit 7484c6344991c91cbec90d439f5e386a4b0dbd2e. This has not changed since January 2016: ``` SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); ``` On January 7 in 7484c6344991c91cbec90d439f5e386a4b0dbd2e we actually LOWERED the GLSL version from 330 to 150. So everything you have written here looks backward to me. I am wrong? Otherwise could you investigate this more thoroughly? This is all super confusing now, and it's really hard to handle a report if half of the information in it are clearly erroneous.
bjadamson commented 2018-03-06 17:55:38 +00:00 (Migrated from github.com)

What the hell, I have NO idea. I just downloaded the repo earlier today. I was seeing 330 in that file, and it was telling me I had the latest master branch. Weird, whatever. I redownloaded the repo, and it matches what you pointed too. Sorry about that.

I still think it's a fair question though, would you take a patch lowing to GLSL version 140 and GL/SDL context version 3.1?

What the hell, I have NO idea. I just downloaded the repo earlier today. I was seeing 330 in that file, and it was telling me I had the latest master branch. Weird, whatever. I redownloaded the repo, and it matches what you pointed too. Sorry about that. I still think it's a fair question though, would you take a patch lowing to GLSL version 140 and GL/SDL context version 3.1?
ocornut commented 2018-03-06 17:59:41 +00:00 (Migrated from github.com)

I still think it's a fair question though, would you take a patch lowing to GLSL version 140 and GL/SDL context version 3.1?

I would if you can prove/testify increased compatibility on all major OSes given the complication discussed in #1466. If you have incomplete information (only some OS) still worth posting that information so it is recorded.

> I still think it's a fair question though, would you take a patch lowing to GLSL version 140 and GL/SDL context version 3.1? I would if you can prove/testify increased compatibility on all major OSes given the complication discussed in #1466. If you have incomplete information (only some OS) still worth posting that information so it is recorded.
bjadamson commented 2018-03-06 18:02:52 +00:00 (Migrated from github.com)

Turns out this was my issue, and my project now runs if I switch the SDL code I'm using (from the example code provided by this repo) to 140.

I would if you can prove/testify increased compatibility on all major OSes given the complication discussed in #1466. If you have incomplete information (only some OS) still worth posting that information so it is recorded.

I can't do that, but it is my understanding that higher opengl versions require more, so... 3.1 should be more compatible than 3.2?

Whatever I don't care that much, it's just annoying to have to remember that this is the cause (I had this issue last time I upgraded too, this time it took me 2 hours of mucking around with OpenGL debug callbacks to root cause again because I forgot entirely from last time. That's not your fault though, that's on me).

Turns out this was my issue, and my project now runs if I switch the SDL code I'm using (from the example code provided by this repo) to 140. > I would if you can prove/testify increased compatibility on all major OSes given the complication discussed in #1466. If you have incomplete information (only some OS) still worth posting that information so it is recorded. I can't do that, but it is my understanding that higher opengl versions require more, so... 3.1 should be more compatible than 3.2? Whatever I don't care that much, it's just annoying to have to remember that this is the cause (I had this issue last time I upgraded too, this time it took me 2 hours of mucking around with OpenGL debug callbacks to root cause again because I forgot entirely from last time. That's not your fault though, that's on me).
ocornut commented 2018-03-06 18:10:50 +00:00 (Migrated from github.com)

Could you provide some info?

  • OS, graphic card, driver version?
  • Which problem do you get?
  • Does the glfw+gl3 example (the one without SDL) has the same errors on your setup with 3.2 + glsl 150?
  • Does your problem get fixed just by changing glsl version to 140 or also gl version? Can you confirm on both SDL and GLFW examples?
  • Can you confirm this on vanilla unmodified example to make sure it’s not related to something in your code?
Could you provide some info? - OS, graphic card, driver version? - Which problem do you get? - Does the glfw+gl3 example (the one without SDL) has the same errors on your setup with 3.2 + glsl 150? - Does your problem get fixed just by changing glsl version to 140 or also gl version? Can you confirm on both SDL and GLFW examples? - Can you confirm this on vanilla unmodified example to make sure it’s not related to something in your code?
ocornut commented 2018-03-06 19:03:59 +00:00 (Migrated from github.com)

I added a parameter to ImGui_ImplSdlGL3_Init() to override the GLSL version, but I would very much like feedback on those points above if you can. Thank you.

I added a parameter to `ImGui_ImplSdlGL3_Init()` to override the GLSL version, but I would very much like feedback on those points above if you can. Thank you.
ocornut commented 2018-04-11 09:26:22 +00:00 (Migrated from github.com)

Closing as OP doesn't seem to want to clarify and original post was confused. Hopefully this is a non issue now that the init function can override the GLSL string.

Closing as OP doesn't seem to want to clarify and original post was confused. Hopefully this is a non issue now that the init function can override the GLSL string.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#1667
No description provided.