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

Fix replay issue of glGetTextureHandle and glProgramUniformHandle: #923

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

baozholu
Copy link

@baozholu baozholu commented Jun 28, 2024

The return handle of glGetTextureHandleARB will differ between different vender/ASIC GPUs, current apitrace uses a _textureHandle_map and _imageHandle_map to store the original handle (Obtained during trace) and the new handle (Obtained during replay), but apitrace still uses the original handle when replaying the glUniformHandleui64ARB call, it should find the new handle through the _textureHandle_map and _imageHandle_map, then use it in glUniformHandleui64ARB.

Extension: GL_ARB_bindless_texture

All of the following APIs have this issue.
glUniformHandle*
glProgramUniformHandle*

For other APIs in the GL_ARB_bindless_texture extension, they used the _textureHandle_map/_imageHandle_map to store/get the real handle during replay
glGetTextureHandle*
glGetTextureSamplerHandle*
glGetImageHandle*
glMakeTextureHandle*
glMakeImageHandle*

So we should find the new handle through the _textureHandle_map/_imageHandle_map and use it in glUniformHandle and glProgramUniformHandle, just like glMakeTextureHandle and glMakeImageHandle does

#911

	The return handle of glGetTextureHandleARB will differ between
	different vender/ASIC GPUs, current apitrace uses a
	_textureHandle_map and _imageHandle_map to store the original
	handle (Obtained during trace) and the new handle (Obtained
	during replay), but apitrace still uses the original handle when
	replaying the glUniformHandleui64ARB call, it should find the
	new handle through the _textureHandle_map and _imageHandle_map,
	then use it in glUniformHandleui64ARB.
	    For other APIs in the GL_ARB_bindless_texture extension,
	    they used the _textureHandle_map/_imageHandle_map to
	    store/get the real handle during replay, so we should find
	    the new handle through the
	    _textureHandle_map/_imageHandle_map and use it in
	    glUniformHandle and glProgramUniformHandle, just like
	    glMakeTextureHandle and glMakeImageHandle does All of the
	    following APIs have this issue: glUniformHandle*,
	    glProgramUniformHandle*
@lubaozho
Copy link

lubaozho commented Sep 3, 2024

@jrfonseca could you help to review it ?

@jrfonseca
Copy link
Member

Sorry, I need to find a bit of spare time to actually test this PR. Because I still don't fully understand the problem and fear this change might interfere with other things.

@lubaozho
Copy link

Simplified this PR description:
glUniformHandle* and glProgramUniformHandle* should use the _textureHandle_map/_imageHandle_map to store/get the real handle during replay, just like glMakeTextureHandle and glMakeImageHandle does. All of these API belong to the GL_ARB_bindless_texture extension.

@jrfonseca can this PR be merged?

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

Successfully merging this pull request may close these issues.

3 participants