summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-05-19 14:16:56 +0200
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>2017-05-22 09:50:50 +0200
commit4a4ef79d305f078a3f796ec9d6c40216748eeb7e (patch)
treea879c8d76b4acee21c1dd070c72463f94d885b32 /tests
parenta99bcaf9aafc469ca910b084df661ab272a54914 (diff)
shader_runner: only clear handles that are resident
To avoid potential INVALID_OPERATION errors reported by glMake{Texture,Image}HandleNonResidentARB(). Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/shaders/shader_runner.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 933f97fac..625521cc0 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -202,10 +202,13 @@ clear_resident_handle(unsigned idx)
if (resident_handles[idx].handle) {
GLuint64 handle = resident_handles[idx].handle;
- if (resident_handles[idx].is_tex)
- glMakeTextureHandleNonResidentARB(handle);
- else
- glMakeImageHandleNonResidentARB(handle);
+ if (resident_handles[idx].is_tex) {
+ if (glIsTextureHandleResidentARB(handle))
+ glMakeTextureHandleNonResidentARB(handle);
+ } else {
+ if (glIsImageHandleResidentARB(handle))
+ glMakeImageHandleNonResidentARB(handle);
+ }
resident_handles[idx].handle = 0;
}
}