jvcleave / ofxImGui

Use ImGui in openFrameworks
296 stars 124 forks source link

opengl error #22

Closed o2co2 closed 8 years ago

o2co2 commented 8 years ago

int main() {

ofGLWindowSettings glWindowSettings;
glWindowSettings.width = 1280;
glWindowSettings.height = 720;
glWindowSettings.setGLVersion(4,1);
ofCreateWindow(glWindowSettings);

ofRunApp(new ofApp());

}

error: 0x0339FE7A exception thrown at (located Morphing Software debug.exe in): 0xC0000005: reading location 0x00000000 access violation occurs. If applicable for this exception handler, the program can continue to operate safely.

jvcleave commented 8 years ago

with glWindowSettings.setGLVersion(4,1); the example-demo works ok on Mac 10.11.2/AMD Radeon HD 6750M

o2co2 commented 8 years ago

@jvcleave Thank you! My computer is a macbook pro windows nvidia geforce gt 750m. Is there a solution to the problem?

jvcleave commented 8 years ago

I can't replicate it. Does the example-demo work with 4,1 for you?

o2co2 commented 8 years ago

@jvcleave Not run. @Geistyp As shown error error

Command line output. [verbose] GL Version:4.5.0 NVIDIA 361.43 [verbose] ofShader: checkAndCreateProgram(): creating GLSL program [verbose] ofShader: setupShaderFromSource(): GL_VERTEX_SHADER shader compiled [verbose] ofShader: checkAndCreateProgram(): creating GLSL program [verbose] ofShader: setupShaderFromSource(): GL_VERTEX_SHADER shader compiled [verbose] ofShader: checkAndCreateProgram(): creating GLSL program [verbose] ofShader: setupShaderFromSource(): GL_VERTEX_SHADER shader compiled [verbose] ofShader: checkAndCreateProgram(): creating GLSL program [verbose] ofShader: setupShaderFromSource(): GL_VERTEX_SHADER shader compiled [verbose] ofShader: checkAndCreateProgram(): creating GLSL program [verbose] ofShader: setupShaderFromSource(): GL_VERTEX_SHADER shader compiled [verbose] ofShader: checkAndCreateProgram(): creating GLSL program [verbose] ofShader: setupShaderFromSource(): GL_VERTEX_SHADER shader compiled [verbose] ofShader: checkAndCreateProgram(): creating GLSL program [verbose] ofShader: setupShaderFromSource(): GL_VERTEX_SHADER shader compiled [verbose] ofShader: checkAndCreateProgram(): creating GLSL program [verbose] ofShader: setupShaderFromSource(): GL_VERTEX_SHADER shader compiled [verbose] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader compiled [verbose] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader compiled [verbose] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader compiled [verbose] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader compiled [verbose] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader compiled [verbose] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader compiled [verbose] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader compiled [verbose] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader compiled [verbose] ofShader: checkAndCreateProgram(): creating GLSL program [verbose] ofShader: setupShaderFromSource(): GL_VERTEX_SHADER shader compiled [verbose] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader compiled [verbose] ofShader: linkProgram(): attaching GL_VERTEX_SHADER shader to program 1 [verbose] ofShader: linkProgram(): attaching GL_FRAGMENT_SHADER shader to progra m 1 [verbose] ofShader: checkProgramLinkStatus(): program 1 linked [verbose] ofShader: linkProgram(): attaching GL_VERTEX_SHADER shader to program 3 [verbose] ofShader: linkProgram(): attaching GL_FRAGMENT_SHADER shader to progra m 3 [verbose] ofShader: checkProgramLinkStatus(): program 3 linked [verbose] ofShader: linkProgram(): attaching GL_VERTEX_SHADER shader to program 5 [verbose] ofShader: linkProgram(): attaching GL_FRAGMENT_SHADER shader to progra m 5 [verbose] ofShader: checkProgramLinkStatus(): program 5 linked [verbose] ofShader: linkProgram(): attaching GL_VERTEX_SHADER shader to program 7 [verbose] ofShader: linkProgram(): attaching GL_FRAGMENT_SHADER shader to progra m 7 [verbose] ofShader: checkProgramLinkStatus(): program 7 linked [verbose] ofShader: linkProgram(): attaching GL_VERTEX_SHADER shader to program 9 [verbose] ofShader: linkProgram(): attaching GL_FRAGMENT_SHADER shader to progra m 9 [verbose] ofShader: checkProgramLinkStatus(): program 9 linked [verbose] ofShader: linkProgram(): attaching GL_VERTEX_SHADER shader to program 11 [verbose] ofShader: linkProgram(): attaching GL_FRAGMENT_SHADER shader to progra m 11 [verbose] ofShader: checkProgramLinkStatus(): program 11 linked [verbose] ofShader: linkProgram(): attaching GL_VERTEX_SHADER shader to program 13 [verbose] ofShader: linkProgram(): attaching GL_FRAGMENT_SHADER shader to progra m 13 [verbose] ofShader: checkProgramLinkStatus(): program 13 linked [verbose] ofShader: linkProgram(): attaching GL_VERTEX_SHADER shader to program 15 [verbose] ofShader: linkProgram(): attaching GL_FRAGMENT_SHADER shader to progra m 15 [verbose] ofShader: checkProgramLinkStatus(): program 15 linked [verbose] ofShader: linkProgram(): attaching GL_VERTEX_SHADER shader to program 25 [verbose] ofShader: linkProgram(): attaching GL_FRAGMENT_SHADER shader to progra m 25 [verbose] ofShader: checkProgramLinkStatus(): program 25 linked [verbose] ofShader: checkAndCreateProgram(): creating GLSL program [verbose] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader compiled [verbose] ofShader: setupShaderFromSource(): GL_VERTEX_SHADER shader compiled [verbose] ofShader: linkProgram(): attaching GL_FRAGMENT_SHADER shader to progra m 28 [verbose] ofShader: linkProgram(): attaching GL_VERTEX_SHADER shader to program 28 [verbose] ofShader: checkProgramLinkStatus(): program 28 linked [verbose] textureSourceID: 5

o2co2 commented 8 years ago

@jvcleave You can help me? My computer is a macbook pro windows8.1 nvidia geforce gt 750m. glWindowSettings.setGLVersion(4,1); Not run. glWindowSettings.setGLVersion(2,1); ok run.

jvcleave commented 8 years ago

@o2co2 I don't think I can

o2co2 commented 8 years ago

@jvcleave g.IO.RenderDrawListsFn(&data); Here throws an error.

o2co2 commented 8 years ago

As shown error

error1 error2

o2co2 commented 8 years ago

void EngineGLFW::programmableRendererDrawLists(ImDrawData * draw_data)

glDrawElements(GL_TRIANGLES, (GLsizei)pcmd->ElemCount, GL_UNSIGNED_INT, idx_buffer_offset);

Here breakpoint occurs.I do not know what is the reason?

@jvcleave https://github.com/ocornut/imgui/issues/350 http://stackoverflow.com/questions/15041120/crash-at-draw-call-in-nvoglv32-dll-on-new-video-card

prisonerjohn commented 8 years ago

Was this ever resolved? I'm getting a similar exception on Windows with the programmable renderer.

jvcleave commented 8 years ago

@prisonerjohn still unresolved - I really don't know what is going on as I don't have a Win Machine accessible to test on

prisonerjohn commented 8 years ago

The exception is definitely happening on the glDrawElements line, but I can't really figure out why. I checked the element counts uploaded vs drawn and it doesn't look like there's a buffer overrun. I have a feeling it's probably something similar to https://github.com/ocornut/imgui/pull/322

I wonder if converting all these GL objects to an ofVbo would solve it... Is there a reason why you didn't go that route? Otherwise I might try it out.

jvcleave commented 8 years ago

I tried it but the color conversation is slower and glScissor doesn't work.

jvcleave commented 8 years ago

If you guys want to try the old version that uses ofVboMesh - that is here

https://github.com/jvcleave/ofxImGui/releases/tag/OF_090_RC

prisonerjohn commented 8 years ago

Ok that one is running... at 3fps

jvcleave commented 8 years ago

Ha - it wasn't that bad before on a Mac https://vimeo.com/137275102

jvcleave commented 8 years ago

@prisonerjohn is the example-demo showing this exception for you? I am using Win10/OF 9.2 and VS2015 and not seeing anything.

Edit: I am using an AMD Radeon HD 6800

prisonerjohn commented 8 years ago

I think so, but only on the programmable pipeline... And I'm on NVIDIA (GTX 760 I think). I'm about to boot into my Windows machine and will try again in a little bit.

prisonerjohn commented 8 years ago

Confirming that example-demo is throwing the exception for me. I don't have a non-NVIDIA setup to test on unfortunately.

o2co2 commented 8 years ago

@jvcleave @procedural This error occurs only on NVIDIA GTX 750 760 series, On osx win will error. very strange.

I can not solve.

multiburst commented 8 years ago

Same here on Linux, hardware is a NVIDIA 580...crash occours as soon as opengl version is set to 3.

jvcleave commented 8 years ago

@multiburst are you able to use emptyExample with Linux/Nvidia? Mine crashes right away

Edit: emptyExample with the Programmable Renderer that is....

multiburst commented 8 years ago

@jvcleave Example doesn't work as well, same error. Only the version utilizing ofVboMesh runs, with an acceptable performance.

Drivers are legacy nvidia-340xx.... OF 0.9.2

o2co2 commented 8 years ago

@jvcleave @prisonerjohn @multiburst @hluisi https://github.com/xnamahx/ofxImGui/tree/gl3.1 Run the program. No errors, thanks! @xnamahx

prisonerjohn commented 8 years ago

Cool, that branch is working for me too.

wasawi commented 8 years ago

Same here. That branch is working with an Nvidia card. Will this be merged somewhere in this repo?

jvcleave commented 8 years ago

Master now has a similar patch and should be working

wasawi commented 8 years ago

Thanks! yes its working.

jvcleave commented 8 years ago

Great - closing then :) thanks for porting @prisonerjohn