[gtk+/wip/baedert/gl: 95/111] gl renderer: Ensure texture sizes arent 0
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/gl: 95/111] gl renderer: Ensure texture sizes arent 0
- Date: Thu, 21 Dec 2017 17:37:08 +0000 (UTC)
commit 56539b8524086d9368eb0d6083880854fedfc558
Author: Timm Bäder <mail baedert org>
Date: Sat Dec 9 14:31:10 2017 +0100
gl renderer: Ensure texture sizes arent 0
We already ceil() the given float texture sizes here, so if they are
valid, the result should definitely be > 0. Textures with size 0 can't
be properly used, especially not as render targets, where they will
trigger an assertion failure later in a glCheckFramebuffer call.
gsk/gl/gskgldriver.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gsk/gl/gskgldriver.c b/gsk/gl/gskgldriver.c
index 9b49ebe..999b3af 100644
--- a/gsk/gl/gskgldriver.c
+++ b/gsk/gl/gskgldriver.c
@@ -429,6 +429,9 @@ create_texture (GskGLDriver *self,
int width = ceilf (fwidth);
int height = ceilf (fheight);
+ g_assert (width > 0);
+ g_assert (height > 0);
+
if (width >= self->max_texture_size ||
height >= self->max_texture_size)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]