summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i915tex
diff options
context:
space:
mode:
authorBrian <brian@i915.localnet.net>2007-07-30 14:00:27 -0600
committerBrian <brian@i915.localnet.net>2007-07-30 14:00:27 -0600
commit09574bee850edec46d967b7cdbc2073f92b8223d (patch)
tree542c6ed80df73190371e4f23179c41c5c696e996 /src/mesa/drivers/dri/i915tex
parent3a35ce336458352653329426c550bfce1ffc3f66 (diff)
implement read_quad_f_swz()
Diffstat (limited to 'src/mesa/drivers/dri/i915tex')
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_surface.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i915tex/intel_surface.c b/src/mesa/drivers/dri/i915tex/intel_surface.c
index 29b640e58e..3be902cf9c 100644
--- a/src/mesa/drivers/dri/i915tex/intel_surface.c
+++ b/src/mesa/drivers/dri/i915tex/intel_surface.c
@@ -23,17 +23,28 @@
* XXX a lof of this is a temporary kludge
*/
-extern void
-intel_map_unmap_buffers(struct intel_context *intel, GLboolean map);
-
static void
-read_quad_f_swz(struct softpipe_surface *gs, GLint x, GLint y,
+read_quad_f_swz(struct softpipe_surface *sps, GLint x, GLint y,
GLfloat (*rrrr)[QUAD_SIZE])
{
+ struct intel_surface *is = (struct intel_surface *) sps;
+ struct intel_renderbuffer *irb = is->rb;
+ const GLubyte *src = (const GLubyte *) irb->region->map
+ + (y * irb->region->pitch + x) * irb->region->cpp;
+ GLfloat *dst = (GLfloat *) rrrr;
+ GLubyte temp[16];
+ GLuint i, j;
+ memcpy(temp, src, 8);
+ memcpy(temp + 8, src + irb->region->pitch * irb->region->cpp, 8);
+ for (i = 0; i < 4; i++) {
+ for (j = 0; j < 4; j++) {
+ dst[j * 4 + i] = UBYTE_TO_FLOAT(temp[i * 4 + j]);
+ }
+ }
}
@@ -55,8 +66,6 @@ write_quad_f_swz(struct softpipe_surface *sps, GLint x, GLint y,
}
}
- printf("intel_surface::write_quad\n");
-
memcpy(dst, temp, 8);
memcpy(dst + irb->region->pitch * irb->region->cpp, temp + 8, 8);
}