On 02.03.2012 15:00, Michel Dänzer wrote:
Hi Christian,
On Fre, 2012-03-02 at 04:42 -0800, Christian KXXnig wrote:
Module: Mesa
Branch: master
Commit: b90727bb241e4a04158d34aad078cb18e478fea7
URL:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b90727bb241e4a04158d34aad078cb18e478fea7
Author: Christian König<deathsim...@vodafone.de>
Date: Mon Feb 27 16:07:51 2012 +0100
vl/compositor: add per vertex color suport
Used in subtitles, for example.
[...]
diff --git a/src/gallium/auxiliary/vl/vl_compositor.c
b/src/gallium/auxiliary/vl/vl_compositor.c
index b030298..1e8d37f 100644
--- a/src/gallium/auxiliary/vl/vl_compositor.c
+++ b/src/gallium/auxiliary/vl/vl_compositor.c
@@ -47,6 +47,7 @@ enum VS_OUTPUT
{
VS_O_VPOS,
VS_O_VTEX,
+ VS_O_COLOR,
VS_O_VTOP,
VS_O_VBOTTOM,
};
This breaks r300g:
mplayer: r300_vs.c:62: r300_shader_read_vs_outputs: Assertion `index< 2'
failed.
Looking at the r300_shader_read_vs_outputs and ureg_DECL_output_masked
code, they interpret the indices per semantic, whereas the vl code seems
to use a single index namespace. The latter can only work as long as all
the indices happen to fit within the per-semantic limits supported by
the driver/hardware.
Possibly related: As of the vl/vdpau changes you pushed today, mplayer
-vo vdpau only displays a small band at the top of the screen anymore
here with r300g. It looks like the whole picture is compressed into the
height of a single line of the video. I don't have time to investigate
this more right now, but maybe it'll clear up anyway once the above is
resolved.
Hi Michel,
Oh yeah, the assumption of a global index space indeed seems to be
incorrect. I haven't noticed earlier since it doesn't matter for r600g.
Please give the attached patch a try with your r300, does it fix the
problem?
If yes I should go over my code once more, since I probably made that
wrong assumption a couple of times.
Thanks,
Christian.
>From a9073e34863977f24ade27c0f332fe044495a09b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <deathsim...@vodafone.de>
Date: Fri, 2 Mar 2012 16:07:18 +0100
Subject: [PATCH] vl/compositor: fix shader in/out numbering
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Michel pointed out that my assumption of a global
index namespace is incorrect and breaks r300g.
Signed-off-by: Christian König <deathsim...@vodafone.de>
---
src/gallium/auxiliary/vl/vl_compositor.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c
index 3595836..cc213b7 100644
--- a/src/gallium/auxiliary/vl/vl_compositor.c
+++ b/src/gallium/auxiliary/vl/vl_compositor.c
@@ -45,9 +45,9 @@
enum VS_OUTPUT
{
- VS_O_VPOS,
- VS_O_VTEX,
- VS_O_COLOR,
+ VS_O_VPOS = 0,
+ VS_O_COLOR = 0,
+ VS_O_VTEX = 0,
VS_O_VTOP,
VS_O_VBOTTOM,
};
@@ -70,8 +70,8 @@ create_vert_shader(struct vl_compositor *c)
color = ureg_DECL_vs_input(shader, 2);
tmp = ureg_DECL_temporary(shader);
o_vpos = ureg_DECL_output(shader, TGSI_SEMANTIC_POSITION, VS_O_VPOS);
- o_vtex = ureg_DECL_output(shader, TGSI_SEMANTIC_GENERIC, VS_O_VTEX);
o_color = ureg_DECL_output(shader, TGSI_SEMANTIC_COLOR, VS_O_COLOR);
+ o_vtex = ureg_DECL_output(shader, TGSI_SEMANTIC_GENERIC, VS_O_VTEX);
o_vtop = ureg_DECL_output(shader, TGSI_SEMANTIC_GENERIC, VS_O_VTOP);
o_vbottom = ureg_DECL_output(shader, TGSI_SEMANTIC_GENERIC, VS_O_VBOTTOM);
@@ -139,7 +139,7 @@ create_frag_shader_video_buffer(struct vl_compositor *c)
if (!shader)
return false;
- tc = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, 1, TGSI_INTERPOLATE_LINEAR);
+ tc = ureg_DECL_fs_input(shader, TGSI_SEMANTIC_GENERIC, VS_O_VTEX, TGSI_INTERPOLATE_LINEAR);
for (i = 0; i < 3; ++i) {
csc[i] = ureg_DECL_constant(shader, i);
sampler[i] = ureg_DECL_sampler(shader, i);
--
1.7.5.4
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev