summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-04-01 00:16:05 -0700
committerroot <root@debian-t61.sh.intel.com>2008-04-07 17:18:05 +0800
commit6809ac3f309364778fcdd46629a16b7b92e0b953 (patch)
tree2a997bef9fe94ad5921aa284c650c9717f49bcf3
parenta5264efc7f36971aa06869feed9980a154cdddbe (diff)
Add projective versions of the PS kernels
(cherry picked from commit 0836373dc6e2f8612f120074980561f7ac11f6f7)
-rw-r--r--src/i965_render.c89
1 files changed, 66 insertions, 23 deletions
diff --git a/src/i965_render.c b/src/i965_render.c
index dc5bd5e7..921ea800 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -348,7 +348,7 @@ static const uint32_t ps_kernel_static_nomask_projective [][4] = {
#include "exa_wm_write.g4b"
};
-static const uint32_t ps_kernel_static_maskca [][4] = {
+static const uint32_t ps_kernel_static_maskca_affine [][4] = {
#include "exa_wm_xy.g4b"
#include "exa_wm_src_affine.g4b"
#include "exa_wm_src_sample_argb.g4b"
@@ -358,7 +358,17 @@ static const uint32_t ps_kernel_static_maskca [][4] = {
#include "exa_wm_write.g4b"
};
-static const uint32_t ps_kernel_static_maskca_srcalpha [][4] = {
+static const uint32_t ps_kernel_static_maskca_projective [][4] = {
+#include "exa_wm_xy.g4b"
+#include "exa_wm_src_projective.g4b"
+#include "exa_wm_src_sample_argb.g4b"
+#include "exa_wm_mask_projective.g4b"
+#include "exa_wm_mask_sample_argb.g4b"
+#include "exa_wm_ca.g4b"
+#include "exa_wm_write.g4b"
+};
+
+static const uint32_t ps_kernel_static_maskca_srcalpha_affine [][4] = {
#include "exa_wm_xy.g4b"
#include "exa_wm_src_affine.g4b"
#include "exa_wm_src_sample_a.g4b"
@@ -368,7 +378,17 @@ static const uint32_t ps_kernel_static_maskca_srcalpha [][4] = {
#include "exa_wm_write.g4b"
};
-static const uint32_t ps_kernel_static_masknoca [][4] = {
+static const uint32_t ps_kernel_static_maskca_srcalpha_projective [][4] = {
+#include "exa_wm_xy.g4b"
+#include "exa_wm_src_projective.g4b"
+#include "exa_wm_src_sample_a.g4b"
+#include "exa_wm_mask_projective.g4b"
+#include "exa_wm_mask_sample_argb.g4b"
+#include "exa_wm_ca_srcalpha.g4b"
+#include "exa_wm_write.g4b"
+};
+
+static const uint32_t ps_kernel_static_masknoca_affine [][4] = {
#include "exa_wm_xy.g4b"
#include "exa_wm_src_affine.g4b"
#include "exa_wm_src_sample_argb.g4b"
@@ -378,6 +398,16 @@ static const uint32_t ps_kernel_static_masknoca [][4] = {
#include "exa_wm_write.g4b"
};
+static const uint32_t ps_kernel_static_masknoca_projective [][4] = {
+#include "exa_wm_xy.g4b"
+#include "exa_wm_src_projective.g4b"
+#include "exa_wm_src_sample_argb.g4b"
+#include "exa_wm_mask_projective.g4b"
+#include "exa_wm_mask_sample_a.g4b"
+#include "exa_wm_noca.g4b"
+#include "exa_wm_write.g4b"
+};
+
static uint32_t
i965_get_card_format(PicturePtr pPict)
{
@@ -484,15 +514,22 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture,
if (pMaskPicture->componentAlpha &&
PICT_FORMAT_RGB(pMaskPicture->format)) {
if (i965_blend_op[op].src_alpha) {
- next_offset = ps_kernel_offset +
- sizeof(ps_kernel_static_maskca_srcalpha);
+ if (is_affine)
+ next_offset = ps_kernel_offset + sizeof(ps_kernel_static_maskca_srcalpha_affine);
+ else
+ next_offset = ps_kernel_offset + sizeof(ps_kernel_static_maskca_srcalpha_projective);
} else {
- next_offset = ps_kernel_offset +
- sizeof(ps_kernel_static_maskca);
+ if (is_affine)
+ next_offset = ps_kernel_offset + sizeof(ps_kernel_static_maskca_affine);
+ else
+ next_offset = ps_kernel_offset + sizeof(ps_kernel_static_maskca_projective);
}
- } else
- next_offset = ps_kernel_offset +
- sizeof(ps_kernel_static_masknoca);
+ } else {
+ if (is_affine)
+ next_offset = ps_kernel_offset + sizeof(ps_kernel_static_masknoca_affine);
+ else
+ next_offset = ps_kernel_offset + sizeof(ps_kernel_static_masknoca_projective);
+ }
} else {
if (is_affine)
next_offset = ps_kernel_offset + sizeof (ps_kernel_static_nomask_affine);
@@ -865,22 +902,28 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture,
if (pMask) {
if (pMaskPicture->componentAlpha &&
PICT_FORMAT_RGB(pMaskPicture->format)) {
- if (i965_blend_op[op].src_alpha)
- memcpy(ps_kernel, ps_kernel_static_maskca_srcalpha,
- sizeof (ps_kernel_static_maskca_srcalpha));
- else
- memcpy(ps_kernel, ps_kernel_static_maskca,
- sizeof (ps_kernel_static_maskca));
- } else
- memcpy(ps_kernel, ps_kernel_static_masknoca,
- sizeof (ps_kernel_static_masknoca));
+ if (i965_blend_op[op].src_alpha) {
+ if (is_affine)
+ memcpy(ps_kernel, ps_kernel_static_maskca_srcalpha_affine, sizeof (ps_kernel_static_maskca_srcalpha_affine));
+ else
+ memcpy(ps_kernel, ps_kernel_static_maskca_srcalpha_projective, sizeof (ps_kernel_static_maskca_srcalpha_projective));
+ } else {
+ if (is_affine)
+ memcpy(ps_kernel, ps_kernel_static_maskca_affine, sizeof (ps_kernel_static_maskca_affine));
+ else
+ memcpy(ps_kernel, ps_kernel_static_maskca_projective, sizeof (ps_kernel_static_maskca_projective));
+ }
+ } else {
+ if (is_affine)
+ memcpy(ps_kernel, ps_kernel_static_masknoca_affine, sizeof (ps_kernel_static_masknoca_affine));
+ else
+ memcpy(ps_kernel, ps_kernel_static_masknoca_projective, sizeof (ps_kernel_static_masknoca_projective));
+ }
} else {
if (is_affine)
- memcpy(ps_kernel, ps_kernel_static_nomask_affine,
- sizeof (ps_kernel_static_nomask_affine));
+ memcpy(ps_kernel, ps_kernel_static_nomask_affine, sizeof (ps_kernel_static_nomask_affine));
else
- memcpy(ps_kernel, ps_kernel_static_nomask_projective,
- sizeof (ps_kernel_static_nomask_projective));
+ memcpy(ps_kernel, ps_kernel_static_nomask_projective, sizeof (ps_kernel_static_nomask_projective));
}
wm_state = &wm_state_local;