diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-04-07 10:29:40 +0100 |
---|---|---|
committer | Owain G. Ainsworth <oga@openbsd.org> | 2011-05-29 23:47:10 +0100 |
commit | fde55b50c15ddc868a6bec5da37c50e61e6ffae7 (patch) | |
tree | ed64789e8a4ee7349c9bdb71ec6dd37976aa4045 /src/i915_render.c | |
parent | 0056e90499eb7d648828a87af76ae8cb6927b2de (diff) |
i965: Avoid transform overheads for vertex emit where possible
Minor improvement as the bottlenecks lie elsewhere. But it was annoying me.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit ad22003033eb502474ae538a97e3b42cf8f83880)
Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
Diffstat (limited to 'src/i915_render.c')
-rw-r--r-- | src/i915_render.c | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/src/i915_render.c b/src/i915_render.c index 0bf6496a..dbaf1968 100644 --- a/src/i915_render.c +++ b/src/i915_render.c @@ -383,15 +383,12 @@ static Bool i915_texture_setup(PicturePtr picture, PixmapPtr pixmap, int unit) } static void -i915_emit_composite_primitive_constant(PixmapPtr dest, +i915_emit_composite_primitive_constant(intel_screen_private *intel, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int w, int h) { - ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(scrn); - OUT_VERTEX(dstX + w); OUT_VERTEX(dstY + h); @@ -403,15 +400,12 @@ i915_emit_composite_primitive_constant(PixmapPtr dest, } static void -i915_emit_composite_primitive_identity_source(PixmapPtr dest, +i915_emit_composite_primitive_identity_source(intel_screen_private *intel, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int w, int h) { - ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(scrn); - OUT_VERTEX(dstX + w); OUT_VERTEX(dstY + h); OUT_VERTEX((srcX + w) * intel->scale_units[0][0]); @@ -429,14 +423,12 @@ i915_emit_composite_primitive_identity_source(PixmapPtr dest, } static void -i915_emit_composite_primitive_affine_source(PixmapPtr dest, +i915_emit_composite_primitive_affine_source(intel_screen_private *intel, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int w, int h) { - ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(scrn); float src_x[3], src_y[3]; if (!intel_get_transformed_coordinates(srcX, srcY, @@ -474,15 +466,12 @@ i915_emit_composite_primitive_affine_source(PixmapPtr dest, } static void -i915_emit_composite_primitive_constant_identity_mask(PixmapPtr dest, +i915_emit_composite_primitive_constant_identity_mask(intel_screen_private *intel, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int w, int h) { - ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(scrn); - OUT_VERTEX(dstX + w); OUT_VERTEX(dstY + h); OUT_VERTEX((maskX + w) * intel->scale_units[0][0]); @@ -500,15 +489,12 @@ i915_emit_composite_primitive_constant_identity_mask(PixmapPtr dest, } static void -i915_emit_composite_primitive_identity_source_mask(PixmapPtr dest, +i915_emit_composite_primitive_identity_source_mask(intel_screen_private *intel, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int w, int h) { - ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(scrn); - OUT_VERTEX(dstX + w); OUT_VERTEX(dstY + h); OUT_VERTEX((srcX + w) * intel->scale_units[0][0]); @@ -532,14 +518,12 @@ i915_emit_composite_primitive_identity_source_mask(PixmapPtr dest, } static void -i915_emit_composite_primitive(PixmapPtr dest, +i915_emit_composite_primitive(intel_screen_private *intel, int srcX, int srcY, int maskX, int maskY, int dstX, int dstY, int w, int h) { - ScrnInfoPtr scrn = xf86Screens[dest->drawable.pScreen->myNum]; - intel_screen_private *intel = intel_get_screen_private(scrn); Bool is_affine_src = TRUE, is_affine_mask = TRUE; int per_vertex; int tex_unit = 0; @@ -1156,7 +1140,7 @@ i915_composite(PixmapPtr dest, int srcX, int srcY, int maskX, int maskY, } intel->vertex_count += 3; - intel->prim_emit(dest, + intel->prim_emit(intel, srcX, srcY, maskX, maskY, dstX, dstY, |