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:42:14 -0700 (PDT)	[thread overview]
Message-ID: <20100913024214.829C513009C@annarchy.freedesktop.org> (raw)
In-Reply-To: <bug-30007-502@http.bugs.freedesktop.org/>

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

--- Comment #23 from Tom Stellard <tstellar@gmail.com> 2010-09-12 19:42:14 PDT ---
I've created a new bug for kwin blur effect:
https://bugs.freedesktop.org/show_bug.cgi?id=30152

(In reply to comment #21)
> 
> The shader used for scaling the thumbnails is indeed indexing with a loop
> counter. That shader looks like this:
> 
> 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 < kernelSize; 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;
> }
> 
> That's why I think it's this shader that failed to compile. But this is not the
> shader that's used by the blur effect (which this bug report was about). So I
> believe we're looking at two separate issues here.


The r500 should be able to execute this, but there are two things that are
currently preventing correct executions:
1. Relative addressing in loops is not yet supported.
2. The frontend declares the variable "i" as a regular constant and not an
immediate, so the r300 compiler has no idea what its initial value is, or what
is incremented by, so  even with relative addressing in loops, this would still
fail

Does kernelSize have to be a uniform?  If it is always the same then adding it
as a constant would allow the loop to be unrolled which would get around both
of the above issue.  Even something like this would be better:

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;
}

-- 
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:42 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 [this message]
2010-09-13  2:46 ` bugzilla-daemon
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=20100913024214.829C513009C@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.