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 memory leak for KHR-GL46.compute_shader.resources-max #477

Open
letidealsfly opened this issue Aug 8, 2024 · 0 comments
Open

Fix memory leak for KHR-GL46.compute_shader.resources-max #477

letidealsfly opened this issue Aug 8, 2024 · 0 comments

Comments

@letidealsfly
Copy link
Contributor

letidealsfly commented Aug 8, 2024

Hi,

There is a memory leak issue when run KHR-GL46.compute_shader.resources-max.

Init: GLuint m_storage_buffer[8];
Line: https://github.com/KhronosGroup/VK-GL-CTS/blob/main/external/openglcts/modules/gl/gl4cComputeShaderTests.cpp#L5172

Gen: glGenBuffers(16, m_storage_buffer);
Line: https://github.com/KhronosGroup/VK-GL-CTS/blob/main/external/openglcts/modules/gl/gl4cComputeShaderTests.cpp#L5301

Delete: glDeleteBuffers(16, m_storage_buffer);
Line: https://github.com/KhronosGroup/VK-GL-CTS/blob/main/external/openglcts/modules/gl/gl4cComputeShaderTests.cpp#L5322

Actually m_storage_buffer here only use 8 data and storage of this array is 8, but glGenBuffers generates 16 which will write more data after memory of m_storage_buffer[8].

I think both GenBuffers and DeleteBuffers should use 8.
Spec do not have this check, just applications need to ensure correctness.

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

No branches or pull requests

1 participant