summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorCorbin Simpson <MostAwesomeDude@gmail.com>2009-10-17 21:32:56 -0700
committerCorbin Simpson <MostAwesomeDude@gmail.com>2009-10-17 21:32:56 -0700
commitbb567357bc1366df7115e0daa68c2470e3bf6ba6 (patch)
tree067805d996a91f632dcd083def6032e9c2ad7736 /src/mesa/state_tracker
parentbfd877e4705002d97ee8dba6fe0c1f8676582ab3 (diff)
gallium: Permit surface_copy and surface_fill to be NULL.
Uf. Lots of files touched. Would people with working vega, xorg, dri1, etc. please make sure you are not broken, and fix yourself up if you are. There were only two or three places where the code did not have painful fallbacks, so I would advise st maintainers to find less painful workarounds, or consider overhauling util_surface_copy and util_surface_fill. Per ymanton, darktama, and Dr_Jakob's suggestions, clear has been left as-is. I will not add PIPE_CAP_BLITTER unless it is deemed necessary.
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_framebuffer.c16
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c19
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c16
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c3
4 files changed, 40 insertions, 14 deletions
diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c
index 5209a6a0c9..e18c0f6e0a 100644
--- a/src/mesa/state_tracker/st_atom_framebuffer.c
+++ b/src/mesa/state_tracker/st_atom_framebuffer.c
@@ -39,6 +39,7 @@
#include "pipe/p_context.h"
#include "pipe/p_inlines.h"
#include "cso_cache/cso_context.h"
+#include "util/u_rect.h"
@@ -162,10 +163,17 @@ update_framebuffer_state( struct st_context *st )
(void) st_get_framebuffer_surface(stfb, ST_SURFACE_FRONT_LEFT, &surf_front);
(void) st_get_framebuffer_surface(stfb, ST_SURFACE_BACK_LEFT, &surf_back);
- st->pipe->surface_copy(st->pipe,
- surf_front, 0, 0, /* dest */
- surf_back, 0, 0, /* src */
- fb->Width, fb->Height);
+ if (st->pipe->surface_copy) {
+ st->pipe->surface_copy(st->pipe,
+ surf_front, 0, 0, /* dest */
+ surf_back, 0, 0, /* src */
+ fb->Width, fb->Height);
+ } else {
+ util_surface_copy(st->pipe, FALSE,
+ surf_front, 0, 0,
+ surf_back, 0, 0,
+ fb->Width, fb->Height);
+ }
}
/* we're assuming we'll really draw to the front buffer */
st->frontbuffer_status = FRONT_STATUS_DIRTY;
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 5c3413f905..be44577117 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -62,6 +62,7 @@
#include "util/u_tile.h"
#include "util/u_draw_quad.h"
#include "util/u_math.h"
+#include "util/u_rect.h"
#include "shader/prog_instruction.h"
#include "cso_cache/cso_context.h"
@@ -1075,11 +1076,19 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
PIPE_BUFFER_USAGE_GPU_READ);
struct pipe_surface *psTex = screen->get_tex_surface(screen, pt, 0, 0, 0,
PIPE_BUFFER_USAGE_GPU_WRITE );
- pipe->surface_copy(pipe,
- psTex, /* dest */
- 0, 0, /* destx/y */
- psRead,
- srcx, srcy, width, height);
+ if (pipe->surface_copy) {
+ pipe->surface_copy(pipe,
+ psTex, /* dest */
+ 0, 0, /* destx/y */
+ psRead,
+ srcx, srcy, width, height);
+ } else {
+ util_surface_copy(pipe, FALSE,
+ psTex,
+ 0, 0,
+ psRead,
+ srcx, srcy, width, height);
+ }
pipe_surface_reference(&psRead, NULL);
pipe_surface_reference(&psTex, NULL);
}
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 864f5d3ca3..73aa65955b 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -49,6 +49,7 @@
#include "st_public.h"
#include "st_texture.h"
+#include "util/u_rect.h"
/**
@@ -538,10 +539,17 @@ copy_back_to_front(struct st_context *st,
(void) st_get_framebuffer_surface(stfb, backIndex, &surf_back);
if (surf_front && surf_back) {
- st->pipe->surface_copy(st->pipe,
- surf_front, 0, 0, /* dest */
- surf_back, 0, 0, /* src */
- fb->Width, fb->Height);
+ if (st->pipe->surface_copy) {
+ st->pipe->surface_copy(st->pipe,
+ surf_front, 0, 0, /* dest */
+ surf_back, 0, 0, /* src */
+ fb->Width, fb->Height);
+ } else {
+ util_surface_copy(st->pipe, FALSE,
+ surf_front, 0, 0,
+ surf_back, 0, 0,
+ fb->Width, fb->Height);
+ }
}
}
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index b943787106..a1953342b4 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1546,7 +1546,8 @@ st_copy_texsubimage(GLcontext *ctx,
if (ctx->_ImageTransferState == 0x0) {
- if (matching_base_formats &&
+ if (pipe->surface_copy &&
+ matching_base_formats &&
src_format == dest_format &&
!do_flip)
{