From patchwork Wed Jun 12 17:58:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barker X-Patchwork-Id: 17857 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8391F25E4A for ; Wed, 12 Jun 2013 17:58:53 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id hu16sf988834qab.4 for ; Wed, 12 Jun 2013 10:58:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to :mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state:x-original-sender :x-original-authentication-results:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=KBKgQfPSt0fyu2Wr5WMVI920334jQvGvMFbCexAGj4A=; b=ByBqmJLeRJyr/qz3jPjwos2srwi1rj6Q/dILvOs2LtVVB7h0TGIwt8V+dQsND8Oh4j 8uP4EglpbItYpHr/drCJpVSSwS0qyx7lEsan1JpE3LcEjYQwDy3myUvrqTpardQYAr61 FJfR7PZdyjjU/gWbS8C+sCl7IGYtSFQ00DU89yyuUExAkWVgWe0/p702cXso4wHGUkhk +OnGKynbdyoeMD3dwyHXB1eAx/SRDUMclBTlJ9iwZpk6zxy0K0qyz37N+tNF6lY8OYvd VEsX206s+tdD1nisBmm/ouyWudJ2o8XOABP5qQFZnmnxMcHvjiEBIRS6SO89BPXwJ5PZ Lo0Q== X-Received: by 10.224.129.196 with SMTP id p4mr3292394qas.6.1371059896744; Wed, 12 Jun 2013 10:58:16 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.118.170 with SMTP id kn10ls2311825qeb.91.gmail; Wed, 12 Jun 2013 10:58:16 -0700 (PDT) X-Received: by 10.220.105.9 with SMTP id r9mr10126959vco.60.1371059896415; Wed, 12 Jun 2013 10:58:16 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id xb6si9025302vdb.133.2013.06.12.10.58.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Jun 2013 10:58:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hz11so2827818vcb.10 for ; Wed, 12 Jun 2013 10:58:16 -0700 (PDT) X-Received: by 10.220.215.73 with SMTP id hd9mr10268918vcb.19.1371059896202; Wed, 12 Jun 2013 10:58:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.191.99 with SMTP id gx3csp153726vec; Wed, 12 Jun 2013 10:58:15 -0700 (PDT) X-Received: by 10.194.85.129 with SMTP id h1mr2541234wjz.88.1371059894937; Wed, 12 Jun 2013 10:58:14 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id vx5si3132305wjc.116.2013.06.12.10.58.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 12 Jun 2013 10:58:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1UmpJG-0006PS-9r for ; Wed, 12 Jun 2013 17:58:14 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 387ADE02D3 for ; Wed, 12 Jun 2013 17:58:14 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: glmark2 X-Launchpad-Branch: ~glmark2-dev/glmark2/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 276 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~glmark2-dev/glmark2/trunk] Rev 276: Scene{Shadow, Refract}: When testing on Nexus 10, it was discovered that the Message-Id: <20130612175814.17380.30982.launchpad@ackee.canonical.com> Date: Wed, 12 Jun 2013 17:58:14 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16667"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 914b01d043b901fc62c371a6eb7a95f73cfc2833 X-Gm-Message-State: ALoCoQkyLXLLjaKNGcT/vOXsk4gm3aDkJtSJGAOq7gdjL2pwYlfgIZjQu2IsBfN3DExzHR0vKAQj X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , ------------------------------------------------------------ revno: 276 committer: Jesse Barker branch nick: trunk timestamp: Wed 2013-06-12 10:54:21 -0700 message: Scene{Shadow,Refract}: When testing on Nexus 10, it was discovered that the default texture allocation for these scenes can blow out the max texture size for an implementation (canvas size on that platform is 2560 x 1504, which makes us try to allocate textures at 5120 x 3008). So, clamp the texture dimensions while maintaining proper aspect ratio. modified: src/scene-refract.cpp src/scene-shadow.cpp --- lp:glmark2 https://code.launchpad.net/~glmark2-dev/glmark2/trunk You are subscribed to branch lp:glmark2. To unsubscribe from this branch go to https://code.launchpad.net/~glmark2-dev/glmark2/trunk/+edit-subscription === modified file 'src/scene-refract.cpp' --- src/scene-refract.cpp 2013-01-29 17:17:28 +0000 +++ src/scene-refract.cpp 2013-06-12 17:54:21 +0000 @@ -176,19 +176,32 @@ bool DistanceRenderTarget::setup(unsigned int width, unsigned int height) { + static const string vtx_shader_filename(GLMARK_DATA_PATH"/shaders/depth.vert"); + static const string frg_shader_filename(GLMARK_DATA_PATH"/shaders/depth.frag"); + + ShaderSource vtx_source(vtx_shader_filename); + ShaderSource frg_source(frg_shader_filename); + + if (!Scene::load_shaders_from_strings(program_, vtx_source.str(), frg_source.str())) { + return false; + } + canvas_width_ = width; canvas_height_ = height; width_ = canvas_width_ * 2; height_ = canvas_height_ * 2; - static const string vtx_shader_filename(GLMARK_DATA_PATH"/shaders/depth.vert"); - static const string frg_shader_filename(GLMARK_DATA_PATH"/shaders/depth.frag"); - - ShaderSource vtx_source(vtx_shader_filename); - ShaderSource frg_source(frg_shader_filename); - - if (!Scene::load_shaders_from_strings(program_, vtx_source.str(), frg_source.str())) { - return false; + // If the texture will be too large for the implemnetation, we need to + // clamp the dimensions but maintain the aspect ratio. + GLint tex_size(0); + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &tex_size); + unsigned int max_size = static_cast(tex_size); + if (max_size < width_ || max_size < height_) { + float aspect = static_cast(width) / static_cast(height); + width_ = max_size; + height_ = width_ / aspect; + Log::debug("DistanceRenderTarget::setup: original texture size (%u x %u), clamped to (%u x %u)\n", + canvas_width_ * 2, canvas_height_ * 2, width_, height_); } glGenTextures(2, &tex_[0]); @@ -217,7 +230,7 @@ tex_[COLOR], 0); unsigned int status = glCheckFramebufferStatus(GL_FRAMEBUFFER); if (status != GL_FRAMEBUFFER_COMPLETE) { - Log::error("DepthRenderState::setup: glCheckFramebufferStatus failed (0x%x)\n", status); + Log::error("DistanceRenderTarget::setup: glCheckFramebufferStatus failed (0x%x)\n", status); return false; } glBindFramebuffer(GL_FRAMEBUFFER, 0); === modified file 'src/scene-shadow.cpp' --- src/scene-shadow.cpp 2013-01-29 17:17:28 +0000 +++ src/scene-shadow.cpp 2013-06-12 17:54:21 +0000 @@ -73,19 +73,32 @@ bool DepthRenderTarget::setup(unsigned int width, unsigned int height) { + static const string vtx_shader_filename(GLMARK_DATA_PATH"/shaders/depth.vert"); + static const string frg_shader_filename(GLMARK_DATA_PATH"/shaders/depth.frag"); + + ShaderSource vtx_source(vtx_shader_filename); + ShaderSource frg_source(frg_shader_filename); + + if (!Scene::load_shaders_from_strings(program_, vtx_source.str(), frg_source.str())) { + return false; + } + canvas_width_ = width; canvas_height_ = height; width_ = canvas_width_ * 2; height_ = canvas_height_ * 2; - static const string vtx_shader_filename(GLMARK_DATA_PATH"/shaders/depth.vert"); - static const string frg_shader_filename(GLMARK_DATA_PATH"/shaders/depth.frag"); - - ShaderSource vtx_source(vtx_shader_filename); - ShaderSource frg_source(frg_shader_filename); - - if (!Scene::load_shaders_from_strings(program_, vtx_source.str(), frg_source.str())) { - return false; + // If the texture will be too large for the implemnetation, we need to + // clamp the dimensions but maintain the aspect ratio. + GLint tex_size(0); + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &tex_size); + unsigned int max_size = static_cast(tex_size); + if (max_size < width_ || max_size < height_) { + float aspect = static_cast(width) / static_cast(height); + width_ = max_size; + height_ = width_ / aspect; + Log::debug("DepthRenderTarget::setup: original texture size (%u x %u), clamped to (%u x %u)\n", + canvas_width_ * 2, canvas_height_ * 2, width_, height_); } glGenTextures(1, &tex_); @@ -104,7 +117,7 @@ tex_, 0); unsigned int status = glCheckFramebufferStatus(GL_FRAMEBUFFER); if (status != GL_FRAMEBUFFER_COMPLETE) { - Log::error("DepthRenderState::setup: glCheckFramebufferStatus failed (0x%x)\n", status); + Log::error("DepthRenderTarget::setup: glCheckFramebufferStatus failed (0x%x)\n", status); return false; } glBindFramebuffer(GL_FRAMEBUFFER, 0);