st/xorg: lots of fixes
fixes blending binding and copy coordinates
This commit is contained in:
parent
f9574e05c2
commit
8adcad0c70
|
@ -12,9 +12,9 @@ struct xorg_composite_blend {
|
||||||
int op:8;
|
int op:8;
|
||||||
|
|
||||||
unsigned rgb_src_factor:5; /**< PIPE_BLENDFACTOR_x */
|
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 alpha_src_factor:5; /**< PIPE_BLENDFACTOR_x */
|
||||||
|
|
||||||
|
unsigned rgb_dst_factor:5; /**< PIPE_BLENDFACTOR_x */
|
||||||
unsigned alpha_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->width[0] != 0);
|
||||||
assert(dst->height[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
|
#if 1
|
||||||
s0 = sx1 / src->width[0];
|
s0 = sx1 / src->width[0];
|
||||||
s1 = sx2 / src->width[0];
|
s1 = sx2 / src->width[0];
|
||||||
|
@ -853,6 +848,12 @@ static void renderer_copy_texture(struct exa_context *exa,
|
||||||
t1 = 1;
|
t1 = 1;
|
||||||
#endif
|
#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,
|
assert(screen->is_format_supported(screen, dst_surf->format,
|
||||||
PIPE_TEXTURE_2D,
|
PIPE_TEXTURE_2D,
|
||||||
PIPE_TEXTURE_USAGE_RENDER_TARGET,
|
PIPE_TEXTURE_USAGE_RENDER_TARGET,
|
||||||
|
@ -920,6 +921,8 @@ static void renderer_copy_texture(struct exa_context *exa,
|
||||||
fb.cbufs[i] = 0;
|
fb.cbufs[i] = 0;
|
||||||
}
|
}
|
||||||
cso_set_framebuffer(exa->cso, &fb);
|
cso_set_framebuffer(exa->cso, &fb);
|
||||||
|
setup_vs_constant_buffer(exa, fb.width, fb.height);
|
||||||
|
setup_fs_constant_buffer(exa);
|
||||||
|
|
||||||
/* draw quad */
|
/* draw quad */
|
||||||
buf = setup_vertex_data_tex(exa,
|
buf = setup_vertex_data_tex(exa,
|
||||||
|
@ -1002,14 +1005,14 @@ void xorg_copy_pixmap(struct exa_context *ctx,
|
||||||
renderer_copy_texture(ctx,
|
renderer_copy_texture(ctx,
|
||||||
src,
|
src,
|
||||||
src_loc[0],
|
src_loc[0],
|
||||||
src_loc[1] + src_loc[3],
|
|
||||||
src_loc[0] + src_loc[2],
|
|
||||||
src_loc[1],
|
src_loc[1],
|
||||||
|
src_loc[0] + src_loc[2],
|
||||||
|
src_loc[1] + src_loc[3],
|
||||||
dst,
|
dst,
|
||||||
dst_loc[0],
|
dst_loc[0],
|
||||||
dst_loc[1] + dst_loc[3],
|
dst_loc[1],
|
||||||
dst_loc[0] + dst_loc[2],
|
dst_loc[0] + dst_loc[2],
|
||||||
dst_loc[1]);
|
dst_loc[1] + dst_loc[3]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -309,6 +309,7 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg)
|
||||||
#if 1
|
#if 1
|
||||||
debug_printf(" ExaPrepareSolid(0x%x)\n", fg);
|
debug_printf(" ExaPrepareSolid(0x%x)\n", fg);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return xorg_solid_bind_state(exa, priv, fg);
|
return xorg_solid_bind_state(exa, priv, fg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -332,6 +333,15 @@ ExaSolid(PixmapPtr pPixmap, int x0, int y0, int x1, int y1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if DEBUG_SOLID
|
#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, 0, 0, 300, 300);
|
||||||
xorg_solid(exa, priv, 300, 300, 350, 350);
|
xorg_solid(exa, priv, 300, 300, 350, 350);
|
||||||
xorg_solid(exa, priv, 350, 350, 500, 500);
|
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->height[0] - 10,
|
||||||
priv->tex->width[0],
|
priv->tex->width[0],
|
||||||
priv->tex->height[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
|
#else
|
||||||
xorg_solid(exa, priv, x0, y0, x1, y1) ;
|
xorg_solid(exa, priv, x0, y0, x1, y1) ;
|
||||||
#endif
|
#endif
|
||||||
|
@ -613,8 +629,8 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height,
|
||||||
struct pipe_surface *dst_surf;
|
struct pipe_surface *dst_surf;
|
||||||
struct pipe_surface *src_surf;
|
struct pipe_surface *src_surf;
|
||||||
|
|
||||||
dst_surf = exa->scrn->get_tex_surface(exa->scrn, texture, 0, 0, 0,
|
dst_surf = exa->scrn->get_tex_surface(
|
||||||
PIPE_BUFFER_USAGE_GPU_WRITE);
|
exa->scrn, texture, 0, 0, 0, PIPE_BUFFER_USAGE_GPU_WRITE);
|
||||||
src_surf = exa_gpu_surface(exa, priv);
|
src_surf = exa_gpu_surface(exa, priv);
|
||||||
exa->pipe->surface_copy(exa->pipe, dst_surf, 0, 0, src_surf,
|
exa->pipe->surface_copy(exa->pipe, dst_surf, 0, 0, src_surf,
|
||||||
0, 0, min(width, texture->width[0]),
|
0, 0, min(width, texture->width[0]),
|
||||||
|
|
Loading…
Reference in New Issue