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

[OpenGL] Replay issue with glUniformHandleui64ARB #911

Open
baozholu opened this issue Mar 28, 2024 · 2 comments
Open

[OpenGL] Replay issue with glUniformHandleui64ARB #911

baozholu opened this issue Mar 28, 2024 · 2 comments

Comments

@baozholu
Copy link

baozholu commented Mar 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

@baozholu
Copy link
Author

baozholu commented Mar 28, 2024

Example of how to reproduce this issue:
(1) run an app/test that use the GL_ARB_bindless_texture extension
(2) trace this app on AMD GPU
(3) replay the trace on NV GPU

I directly modified glretrace_gl.cpp file, which can solve this issue, but the glretrace_gl.cpp file was automatically generated and seems to be related to the retrace.py file.
image

@baozholu baozholu changed the title Replay issue with glUniformHandleui64ARB [OpenGL] Replay issue with glUniformHandleui64ARB Mar 28, 2024
@baozholu
Copy link
Author

I captured a trace using AMD Radeon RX 7900, if using current apitrace to replay this trace on NV GPU or old ASIC AMD GPU, will observe a black window. if modify the apitrace with above patch, then replay, will observe a blue square inside the black window.
ARB_bindless_texture.zip

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

No branches or pull requests

2 participants