diff options
author | Zack Rusin <zackr@vmware.com> | 2009-09-15 09:02:20 -0400 |
---|---|---|
committer | Zack Rusin <zackr@vmware.com> | 2009-09-15 19:50:34 -0400 |
commit | 8adcad0c703a9d339b6630ceaba5f96981c524d9 (patch) | |
tree | f4c74360f0120c6fc2dd08637789259d0a8acbc6 /src | |
parent | f9574e05c22a643499d3c589d681fd0e1faef1a5 (diff) |
st/xorg: lots of fixes
fixes blending binding and copy coordinates
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/state_trackers/xorg/xorg_composite.c | 25 | ||||
-rw-r--r-- | src/gallium/state_trackers/xorg/xorg_exa.c | 20 |
2 files changed, 32 insertions, 13 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_composite.c b/src/gallium/state_trackers/xorg/xorg_composite.c index e45a82944b..edb7620f12 100644 --- a/src/gallium/state_trackers/xorg/xorg_composite.c +++ b/src/gallium/state_trackers/xorg/xorg_composite.c @@ -12,9 +12,9 @@ struct xorg_composite_blend { int op:8; unsigned rgb_src_factor:5; /**< PIPE_BLENDFACTOR_x */ - unsigned rgb_dst_factor:5; /**< PIPE_BLENDFACTOR_x */ - unsigned alpha_src_factor:5; /**< PIPE_BLENDFACTOR_x */ + + unsigned rgb_dst_factor:5; /**< PIPE_BLENDFACTOR_x */ unsigned alpha_dst_factor:5; /**< PIPE_BLENDFACTOR_x */ }; @@ -836,11 +836,6 @@ static void renderer_copy_texture(struct exa_context *exa, assert(dst->width[0] != 0); assert(dst->height[0] != 0); -#if 0 - debug_printf("copy texture [%f, %f, %f, %f], [%f, %f, %f, %f]\n", - sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); -#endif - #if 1 s0 = sx1 / src->width[0]; s1 = sx2 / src->width[0]; @@ -853,6 +848,12 @@ static void renderer_copy_texture(struct exa_context *exa, t1 = 1; #endif +#if 1 + debug_printf("copy texture src=[%f, %f, %f, %f], dst=[%f, %f, %f, %f], tex=[%f, %f, %f, %f]\n", + sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2, + s0, t0, s1, t1); +#endif + assert(screen->is_format_supported(screen, dst_surf->format, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_RENDER_TARGET, @@ -920,6 +921,8 @@ static void renderer_copy_texture(struct exa_context *exa, fb.cbufs[i] = 0; } cso_set_framebuffer(exa->cso, &fb); + setup_vs_constant_buffer(exa, fb.width, fb.height); + setup_fs_constant_buffer(exa); /* draw quad */ buf = setup_vertex_data_tex(exa, @@ -1002,14 +1005,14 @@ void xorg_copy_pixmap(struct exa_context *ctx, renderer_copy_texture(ctx, src, src_loc[0], - src_loc[1] + src_loc[3], - src_loc[0] + src_loc[2], src_loc[1], + src_loc[0] + src_loc[2], + src_loc[1] + src_loc[3], dst, dst_loc[0], - dst_loc[1] + dst_loc[3], + dst_loc[1], dst_loc[0] + dst_loc[2], - dst_loc[1]); + dst_loc[1] + dst_loc[3]); } } diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index 75524891f7..3c2639e7d9 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -309,6 +309,7 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg) #if 1 debug_printf(" ExaPrepareSolid(0x%x)\n", fg); #endif + return xorg_solid_bind_state(exa, priv, fg); } @@ -332,6 +333,15 @@ ExaSolid(PixmapPtr pPixmap, int x0, int y0, int x1, int y1) #endif #if DEBUG_SOLID + exa->solid_color[0] = 0.f; + exa->solid_color[1] = 1.f; + exa->solid_color[2] = 0.f; + exa->solid_color[3] = 1.f; + xorg_solid(exa, priv, 0, 0, 1024, 768); + exa->solid_color[0] = 1.f; + exa->solid_color[1] = 0.f; + exa->solid_color[2] = 0.f; + exa->solid_color[3] = 1.f; xorg_solid(exa, priv, 0, 0, 300, 300); xorg_solid(exa, priv, 300, 300, 350, 350); xorg_solid(exa, priv, 350, 350, 500, 500); @@ -340,6 +350,12 @@ ExaSolid(PixmapPtr pPixmap, int x0, int y0, int x1, int y1) priv->tex->height[0] - 10, priv->tex->width[0], priv->tex->height[0]); + + ExaPrepareCopy(pPixmap, pPixmap, 0, 0, GXcopy, 0xffffffff); + ExaCopy(pPixmap, 350, 350, 510, 350, 150, 150); + ExaCopy(pPixmap, 350, 350, 510, 190, 150, 150); + xorg_exa_finish(exa); + ExaCopy(pPixmap, 0, 0, 0, 0, 1024, 768); #else xorg_solid(exa, priv, x0, y0, x1, y1) ; #endif @@ -613,8 +629,8 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, struct pipe_surface *dst_surf; struct pipe_surface *src_surf; - dst_surf = exa->scrn->get_tex_surface(exa->scrn, texture, 0, 0, 0, - PIPE_BUFFER_USAGE_GPU_WRITE); + dst_surf = exa->scrn->get_tex_surface( + exa->scrn, texture, 0, 0, 0, PIPE_BUFFER_USAGE_GPU_WRITE); src_surf = exa_gpu_surface(exa, priv); exa->pipe->surface_copy(exa->pipe, dst_surf, 0, 0, src_surf, 0, 0, min(width, texture->width[0]), |