All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@freedesktop.org
To: dri-devel@lists.freedesktop.org
Subject: [Bug 30007] Regression in r300g
Date: Sun, 12 Sep 2010 19:46:10 -0700 (PDT)	[thread overview]
Message-ID: <20100913024610.AF35213007E@annarchy.freedesktop.org> (raw)
In-Reply-To: <bug-30007-502@http.bugs.freedesktop.org/>

https://bugs.freedesktop.org/show_bug.cgi?id=30007

--- Comment #24 from Tom Stellard <tstellar@gmail.com> 2010-09-12 19:46:10 PDT ---

> uniform sampler2D texUnit;
> uniform vec2 offsets[25];
> uniform vec4 kernel[25];
> uniform int kernelSize;
> 
> void main(void)
> {
>     vec4 sum = texture2D(texUnit, gl_TexCoord[0].st) * kernel[0];
>     for (int i = 1; i < 25; i++) {
> 
> sum += texture2D(texUnit, gl_TexCoord[0].st - offsets[i]) * kernel[i];
>         sum += texture2D(texUnit, gl_TexCoord[0].st + offsets[i]) * kernel[i];
>     }
>     gl_FragColor = sum;
> }

Oops, I submitted before I was done.  This shader would be better, because the
loop could be unrolled even if kernelSize is different in each execution:

uniform sampler2D texUnit;
uniform vec2 offsets[25];
uniform vec4 kernel[25];
uniform int kernelSize;

void main(void)
{
    vec4 sum = texture2D(texUnit, gl_TexCoord[0].st) * kernel[0];
    for (int i = 1; i < 25; i++) {
        if ( i < kernelSize) {
            sum += texture2D(texUnit, gl_TexCoord[0].st - offsets[i]) *
kernel[i];
            sum += texture2D(texUnit, gl_TexCoord[0].st + offsets[i]) *
kernel[i];
        }
    }
    gl_FragColor = sum;
}

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

  parent reply	other threads:[~2010-09-13  2:46 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-04  3:33 [Bug 30007] New: Regression in r300g bugzilla-daemon
2010-09-10 22:08 ` [Bug 30007] " bugzilla-daemon
2010-09-11 13:12 ` bugzilla-daemon
2010-09-11 15:52 ` bugzilla-daemon
2010-09-11 17:30 ` bugzilla-daemon
2010-09-11 17:30 ` bugzilla-daemon
2010-09-11 19:34 ` bugzilla-daemon
2010-09-11 21:04 ` bugzilla-daemon
2010-09-11 21:18 ` bugzilla-daemon
2010-09-11 21:27 ` bugzilla-daemon
2010-09-11 21:34 ` bugzilla-daemon
2010-09-11 21:37 ` bugzilla-daemon
2010-09-11 21:56 ` bugzilla-daemon
2010-09-11 22:00 ` bugzilla-daemon
2010-09-11 22:00 ` bugzilla-daemon
2010-09-11 23:41 ` bugzilla-daemon
2010-09-11 23:42 ` bugzilla-daemon
2010-09-12  0:24 ` bugzilla-daemon
2010-09-12  0:26 ` bugzilla-daemon
2010-09-12  0:55 ` bugzilla-daemon
2010-09-12 20:18 ` bugzilla-daemon
2010-09-12 20:24 ` bugzilla-daemon
2010-09-12 20:38 ` bugzilla-daemon
2010-09-12 21:45 ` bugzilla-daemon
2010-09-12 22:51 ` bugzilla-daemon
2010-09-12 22:55 ` bugzilla-daemon
2010-09-13  2:42 ` bugzilla-daemon
2010-09-13  2:46 ` bugzilla-daemon [this message]
2010-09-13  4:37 ` bugzilla-daemon
2010-09-13  4:44 ` bugzilla-daemon
2010-09-13 22:15 ` bugzilla-daemon
2010-09-13 23:39 ` bugzilla-daemon
2010-09-14  0:05 ` bugzilla-daemon
2010-09-14  0:27 ` bugzilla-daemon
2010-09-14  1:14 ` bugzilla-daemon
2010-09-14  1:36 ` bugzilla-daemon
2010-09-26 13:04 ` bugzilla-daemon
2010-11-07  2:29 ` bugzilla-daemon
2010-11-12 12:33 ` bugzilla-daemon
2010-12-14 17:50 ` [Bug 30007] [r300g] kwin blur effect broken bugzilla-daemon
2010-12-14 19:24 ` [Bug 30007] [r300g] kwin thumbnails broken bugzilla-daemon
2010-12-17 12:30 ` bugzilla-daemon
2011-01-04 21:31 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100913024610.AF35213007E@annarchy.freedesktop.org \
    --to=bugzilla-daemon@freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.