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

"Target doesn't match the texture's target." plus GL_INVALID_VALUE #1461

Closed
stolk opened this issue Jul 16, 2019 · 10 comments

Comments

@stolk
Copy link

commented Jul 16, 2019

Description

GL_INVALID_VALUE generated by app, but only if running through renderdoc.

Renderdoc will also report:

Log     - Got a Debug message from GL_DEBUG_SOURCE_API, type GL_DEBUG_TYPE_ERROR, ID 1282, severity GL_DEBUG_SEVERITY_HIGH:
'GL_INVALID_OPERATION error generated. Target doesn't match the texture's target.'

Repro steps

Run through renderdoc: gl error is generated.

Run stand alone: no gl error.

Isolation

I tried to isolate the issue, and from what I can tell, it seems to be triggered by binding a GL_UNIFORM_BUFFER with glBindBuffer().

I've used renderdoc quite a bit, and never saw this behaviour before. I'm trying to find out what changed.

Environment

  • RenderDoc build: 1.4 (tried 1.3 as well: same issue.)
  • Operating System: Ubuntu LTS.
  • API: OpenGL
@stolk

This comment has been minimized.

Copy link
Author

commented Jul 16, 2019

I think it may actually be triggered by glBindBufferBase( GL_UNIFORM_BUFFER, ...) instead of glBindBuffer( GL_UNIFORM_BUFFER, ...).

@baldurk

This comment has been minimized.

Copy link
Owner

commented Jul 22, 2019

I can't investigate this without more information, ideally a repro case that shows the problem. I don't think that binding a uniform buffer with glBindBufferBase is sufficient on its own to show the problem.

If you can provide a sample either here or privately please get in touch. Otherwise it would be useful to know for example what the callstack is when the debug message is produced, or exactly what is happening when you detect GL_INVALID_VALUE.

@stolk

This comment has been minimized.

Copy link
Author

commented Jul 22, 2019

GL_INVALID_VALUE.zip

Here's the zipped .rdc file.
I am pretty sure the GL error is created in the renderdoc code, because I see it the first thing when I draw a new frame.

@stolk

This comment has been minimized.

Copy link
Author

commented Jul 22, 2019

As soon as you load that capture file into renderdoc, you get:

Log     - Got a Debug message from GL_DEBUG_SOURCE_API, type GL_DEBUG_TYPE_ERROR, ID 1282, severity GL_DEBUG_SEVERITY_HIGH:
'GL_INVALID_OPERATION error generated. Target doesn't match the texture's target.'
Log     - Got a Debug message from GL_DEBUG_SOURCE_API, type GL_DEBUG_TYPE_ERROR, ID 1282, severity GL_DEBUG_SEVERITY_HIGH:
'GL_INVALID_OPERATION error generated. Target doesn't match the texture's target.'
Log     - Got a Debug message from GL_DEBUG_SOURCE_API, type GL_DEBUG_TYPE_ERROR, ID 1282, severity GL_DEBUG_SEVERITY_HIGH:
'GL_INVALID_OPERATION error generated. Target doesn't match the texture's target.'
Log     - Got a Debug message from GL_DEBUG_SOURCE_API, type GL_DEBUG_TYPE_ERROR, ID 1282, severity GL_DEBUG_SEVERITY_HIGH:
'GL_INVALID_OPERATION error generated. Target doesn't match the texture's target.'

Which I think is the cause of the GL error each frame, when the app runs in renderdoc.

This error, and the GL_INVALID_VALUE error are probably related.

@baldurk

This comment has been minimized.

Copy link
Owner

commented Jul 22, 2019

In that capture there's a texture render1msaa which looks like it's generated and first initialised as GL_TEXTURE_2D_MULTISAMPLE, but then it has some parameters set via GL_TEXTURE_2D before eventually having storage allocated with glTexImage2DMultisample. The texture parameters being set via GL_TEXTURE_2D seem to be the source of the errors.

Does that make sense with what your application is doing? It might be a mistaken capture, though to debug that I'd need to be able debug the application at capture time, or give you a build with extra logging enabled.

From the capture I can't tell where or when the GL_INVALID_VALUE is happening. I don't ever call glGetError() myself and I rely on modern drivers to have debug output callbacks, I didn't get anything that would suggest a GL_INVALID_VALUE error.

@stolk

This comment has been minimized.

Copy link
Author

commented Jul 22, 2019

Thank you for catching that. I removed the glTexParameter calls for the MSAA texture.

The GL_INVALID_OPERATION error is now gone.
Thanks!

The GL_INVALID_VALUE is still there. I will zip up my build, if you want to take a look at it.
The build runs without gl errors when running stand alone.

@stolk

This comment has been minimized.

Copy link
Author

commented Jul 22, 2019

Although, I am on linux, which may be a hassle for you. Maybe I should try a build with more logging instead?

@baldurk

This comment has been minimized.

Copy link
Owner

commented Jul 22, 2019

I've got a Ubuntu box I can run programs on, that's no problem, as long as I can get the right required dependencies etc.

@stolk

This comment has been minimized.

Copy link
Author

commented Jul 22, 2019

The tar ball is here, and has everything you need to run it:
http://stolk.org/tmp/train.tgz

run 'Train' in the 'Train/' directory.

After launch, select NEW GAME, and the GL ERRORs will start.

@baldurk baldurk closed this in 7478bda Jul 22, 2019

@baldurk

This comment has been minimized.

Copy link
Owner

commented Jul 22, 2019

The issue seems to be a weird non-reflexive query on GL. If you bind a uniform buffer with glBindBufferBase then the queried size of the binding comes back as zero, which is then invalid to pass into glBindBufferRange. I've fixed it with an if() and a check, it's just a shame that glBindBufferBase isn't a simple subset of glBindBufferRange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.