Commit 4054d2e6 authored by Gwenole Beauchesne's avatar Gwenole Beauchesne Committed by Xiang, Haihao

fix rendering of RGBA subpicture

parent 85f37a2c
......@@ -70,7 +70,7 @@ static const unsigned int ps_subpic_kernel_static[][4] =
{
#include "shaders/render/exa_wm_xy.g4b"
#include "shaders/render/exa_wm_src_affine.g4b"
#include "shaders/render/exa_wm_blend_subpicture.g4b"
#include "shaders/render/exa_wm_src_sample_argb.g4b"
#include "shaders/render/exa_wm_write.g4b"
};
......@@ -92,7 +92,7 @@ static const unsigned int ps_subpic_kernel_static_gen5[][4] =
{
#include "shaders/render/exa_wm_xy.g4b.gen5"
#include "shaders/render/exa_wm_src_affine.g4b.gen5"
#include "shaders/render/exa_wm_blend_subpicture.g4b.gen5"
#include "shaders/render/exa_wm_src_sample_argb.g4b.gen5"
#include "shaders/render/exa_wm_write.g4b.gen5"
};
......
......@@ -7,27 +7,27 @@ INTEL_G4A = \
exa_sf.g4a \
exa_wm_xy.g4a \
exa_wm_src_affine.g4a \
exa_wm_src_sample_argb.g4a \
exa_wm_src_sample_planar.g4a \
exa_wm_yuv_rgb.g4a \
exa_wm_blend_subpicture.g4a \
exa_wm_write.g4a
INTEL_G4B = \
exa_sf.g4b \
exa_wm_xy.g4b \
exa_wm_src_affine.g4b \
exa_wm_src_sample_argb.g4b \
exa_wm_src_sample_planar.g4b \
exa_wm_yuv_rgb.g4b \
exa_wm_blend_subpicture.g4b \
exa_wm_write.g4b
INTEL_G4B_GEN5 = \
exa_sf.g4b.gen5 \
exa_wm_xy.g4b.gen5 \
exa_wm_src_affine.g4b.gen5 \
exa_wm_src_sample_argb.g4b.gen5 \
exa_wm_src_sample_planar.g4b.gen5 \
exa_wm_yuv_rgb.g4b.gen5 \
exa_wm_blend_subpicture.g4b.gen5 \
exa_wm_write.g4b.gen5
EXTRA_DIST = $(INTEL_G4I) \
......
{ 0x00000201, 0x20080061, 0x00000000, 0x0000e000 },
{ 0x01800031, 0x22001d29, 0x008d0000, 0x02520001 },
{ 0x01800031, 0x21c01d29, 0x008d0000, 0x02520201 },
{ 0x01800031, 0x22401d29, 0x008d0000, 0x02520401 },
{ 0x00600001, 0x228003bd, 0x008d01c0, 0x00000000 },
{ 0x00600001, 0x22a003bd, 0x008d01e0, 0x00000000 },
{ 0x00600040, 0x21c07fbd, 0x008d01c0, 0x3f000000 },
{ 0x00600040, 0x21e07fbd, 0x008d01e0, 0x3f000000 },
{ 0x00600040, 0x22007fbd, 0x008d0200, 0x3f000000 },
{ 0x00600040, 0x22207fbd, 0x008d0220, 0x3f000000 },
{ 0x00600040, 0x22407fbd, 0x008d0240, 0x3f000000 },
{ 0x00600040, 0x22607fbd, 0x008d0260, 0x3f000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
{ 0x00000201, 0x20080061, 0x00000000, 0x0000e000 },
{ 0x01800031, 0x22001d29, 0x208d0000, 0x0a2a0001 },
{ 0x01800031, 0x21c01d29, 0x208d0000, 0x0a2a0201 },
{ 0x01800031, 0x22401d29, 0x208d0000, 0x0a2a0401 },
{ 0x00600001, 0x228003bd, 0x008d01c0, 0x00000000 },
{ 0x00600001, 0x22a003bd, 0x008d01e0, 0x00000000 },
{ 0x00600040, 0x21c07fbd, 0x008d01c0, 0x3f000000 },
{ 0x00600040, 0x21e07fbd, 0x008d01e0, 0x3f000000 },
{ 0x00600040, 0x22007fbd, 0x008d0200, 0x3f000000 },
{ 0x00600040, 0x22207fbd, 0x008d0220, 0x3f000000 },
{ 0x00600040, 0x22407fbd, 0x008d0240, 0x3f000000 },
{ 0x00600040, 0x22607fbd, 0x008d0260, 0x3f000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
......@@ -25,7 +25,8 @@
* Keith Packard <keithp@keithp.com>
*/
/* Sample the src surface in planar format */
/* Sample the src surface */
include(`exa_wm.g4i')
/* prepare sampler read back gX register, which would be written back to output */
......@@ -33,51 +34,14 @@ include(`exa_wm.g4i')
/* use simd16 sampler, param 0 is u, param 1 is v. */
/* 'payload' loading, assuming tex coord start from g4 */
/* load r */
mov (1) g0.8<1>UD 0x0000e000UD { align1 mask_disable };
/* load argb */
mov (1) g0.8<1>UD 0x00000000UD { align1 mask_disable };
/* src_msg will be copied with g0, as it contains send desc */
/* emit sampler 'send' cmd */
/* sample Y */
send (16) src_msg_ind /* msg reg index */
src_sample_g<1>UW /* readback */
g0<8,8,1>UW /* copy to msg start reg*/
sampler (1,0,F) /* sampler message description, (binding_table,sampler_index,datatype)*/
mlen 5 rlen 2 {align1};
/* sample U (Cr) */
send (16) src_msg_ind /* msg reg index */
src_sample_r<1>UW /* readback */
g0<8,8,1>UW /* copy to msg start reg*/
sampler (1,2,F) /* sampler message description, (binding_table,sampler_index,datatype)
/* here(src->dst) we should use src_sampler and src_surface */
mlen 5 rlen 2 { align1 }; /* required message len 5, readback len 8 */
/* sample V (Cb) */
send (16) src_msg_ind /* msg reg index */
src_sample_b<1>UW /* readback */
src_sample_base<1>UW /* readback */
g0<8,8,1>UW /* copy to msg start reg*/
sampler (1,4,F) /* sampler message description, (binding_table,sampler_index,datatype)
sampler (1,0,F) /* sampler message description, (binding_table,sampler_index,datatype)
/* here(src->dst) we should use src_sampler and src_surface */
mlen 5 rlen 2 { align1 }; /* required message len 5, readback len 8 */
/*extract alpha value, alpha value stores in one float with color value, because the color value is small,
we can neglect it when doing alpha blend*/
mov (8) src_sample_a<1>F g14<8,8,1>F { align1 };
mov (8) src_sample_a_23<1>F g15<8,8,1>F { align1 };
/*set subtitle color*/
add (8) g14<1>F g14<8,8,1>F 0.5F { align1 };
add (8) g15<1>F g15<8,8,1>F 0.5F { align1 };
add (8) g16<1>F g16<8,8,1>F 0.5F { align1 };
add (8) g17<1>F g17<8,8,1>F 0.5F { align1 };
add (8) g18<1>F g18<8,8,1>F 0.5F { align1 };
add (8) g19<1>F g19<8,8,1>F 0.5F { align1 };
nop;
nop;
nop;
mlen 5 rlen 8 { align1 }; /* required message len 5, readback len 8 */
{ 0x00000201, 0x20080061, 0x00000000, 0x00000000 },
{ 0x01800031, 0x21c01d29, 0x008d0000, 0x02580001 },
{ 0x00000201, 0x20080061, 0x00000000, 0x00000000 },
{ 0x01800031, 0x21c01d29, 0x208d0000, 0x0a8a0001 },
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment