mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-12-02 19:21:30 +00:00
Check for unbound texture before registering with CUDA
This commit is contained in:
1 parent
aa54ba2a05
commit
a6276aa846
1 file changed
+5
@@ -111,6 +111,11 @@ bool CUDAGLInteropHelper::registerBoundTextures()
|
|||||||
// Get the ID of this plane's texture
|
// Get the ID of this plane's texture
|
||||||
glActiveTexture(GL_TEXTURE0 + i);
|
glActiveTexture(GL_TEXTURE0 + i);
|
||||||
glGetIntegerv(GL_TEXTURE_BINDING_2D, &tex);
|
glGetIntegerv(GL_TEXTURE_BINDING_2D, &tex);
|
||||||
|
if (tex == 0) {
|
||||||
|
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "No GL texture bound to slot %d", i);
|
||||||
|
err = 211; // CUDA_ERROR_NOT_MAPPED
|
||||||
|
goto Exit;
|
||||||
|
}
|
||||||
|
|
||||||
// Register it with CUDA
|
// Register it with CUDA
|
||||||
err = m_Funcs->cuGraphicsGLRegisterImage(&m_Resources[i], tex, GL_TEXTURE_2D, CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD);
|
err = m_Funcs->cuGraphicsGLRegisterImage(&m_Resources[i], tex, GL_TEXTURE_2D, CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD);
|
||||||
|
|||||||
Reference in new issue
Block a user