aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-09-28 15:18:21 +0200
committermarha <marha@users.sourceforge.net>2011-09-28 15:18:21 +0200
commit18a8f9f6839dfd899814a76a971e720c1e622236 (patch)
tree42ad3d70bcbefe8f2c218468f7a1fd033b38428c /mesalib/src/mesa/state_tracker
parent183b7373f9919eeb5eb408f38578e01717b2cc10 (diff)
downloadvcxsrv-18a8f9f6839dfd899814a76a971e720c1e622236.tar.gz
vcxsrv-18a8f9f6839dfd899814a76a971e720c1e622236.tar.bz2
vcxsrv-18a8f9f6839dfd899814a76a971e720c1e622236.zip
mesa pixman xkeyboard-config git update 28 sep 2011
Diffstat (limited to 'mesalib/src/mesa/state_tracker')
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_sampler.c2
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_texture.c79
2 files changed, 9 insertions, 72 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_atom_sampler.c b/mesalib/src/mesa/state_tracker/st_atom_sampler.c
index 731338f9b..ad159c64d 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_sampler.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_sampler.c
@@ -176,7 +176,7 @@ convert_sampler(struct st_context *st,
st_translate_color(msamp->BorderColor.f,
teximg ? teximg->_BaseFormat : GL_RGBA,
- sampler->border_color);
+ sampler->border_color.f);
}
sampler->max_anisotropy = (msamp->MaxAnisotropy == 1.0 ?
diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c
index e744a9f0d..354e58de9 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c
@@ -926,10 +926,10 @@ decompress_with_blit(struct gl_context * ctx, GLenum target, GLint level,
* then unmap it.
*/
static void
-st_get_tex_image(struct gl_context * ctx, GLenum target, GLint level,
- GLenum format, GLenum type, GLvoid * pixels,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage, GLboolean compressed_dst)
+st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level,
+ GLenum format, GLenum type, GLvoid * pixels,
+ struct gl_texture_object *texObj,
+ struct gl_texture_image *texImage)
{
struct st_context *st = st_context(ctx);
struct st_texture_image *stImage = st_texture_image(texImage);
@@ -939,9 +939,7 @@ st_get_tex_image(struct gl_context * ctx, GLenum target, GLint level,
GLuint depth, i;
GLubyte *dest;
- if (stImage->pt &&
- util_format_is_s3tc(stImage->pt->format) &&
- !compressed_dst) {
+ if (stImage->pt && util_format_is_s3tc(stImage->pt->format)) {
/* Need to decompress the texture.
* We'll do this by rendering a textured quad.
* Note that we only expect RGBA formats (no Z/depth formats).
@@ -951,46 +949,14 @@ st_get_tex_image(struct gl_context * ctx, GLenum target, GLint level,
return;
}
- /* Map */
- if (stImage->pt) {
- /* Image is stored in hardware format in a buffer managed by the
- * kernel. Need to explicitly map and unmap it.
- */
- texImage->Data = st_texture_image_map(st, stImage, 0,
- PIPE_TRANSFER_READ, 0, 0,
- stImage->base.Width,
- stImage->base.Height);
- /* compute stride in texels from stride in bytes */
- texImage->RowStride = stImage->transfer->stride
- * util_format_get_blockwidth(stImage->pt->format)
- / util_format_get_blocksize(stImage->pt->format);
- }
- else {
- /* Otherwise, the image should actually be stored in
- * texImage->Data. This is pretty confusing for
- * everybody, I'd much prefer to separate the two functions of
- * texImage->Data - storage for texture images in main memory
- * and access (ie mappings) of images. In other words, we'd
- * create a new texImage->Map field and leave Data simply for
- * storage.
- */
- assert(texImage->Data);
- }
-
depth = texImage->Depth;
texImage->Depth = 1;
dest = (GLubyte *) pixels;
for (i = 0; i < depth; i++) {
- if (compressed_dst) {
- _mesa_get_compressed_teximage(ctx, target, level, dest,
- texObj, texImage);
- }
- else {
- _mesa_get_teximage(ctx, target, level, format, type, dest,
- texObj, texImage);
- }
+ _mesa_get_teximage(ctx, target, level, format, type, dest,
+ texObj, texImage);
if (stImage->pt && i + 1 < depth) {
/* unmap this slice */
@@ -1005,39 +971,10 @@ st_get_tex_image(struct gl_context * ctx, GLenum target, GLint level,
}
texImage->Depth = depth;
-
- /* Unmap */
- if (stImage->pt) {
- st_texture_image_unmap(st, stImage);
- texImage->Data = NULL;
- }
-}
-
-
-static void
-st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level,
- GLenum format, GLenum type, GLvoid * pixels,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- st_get_tex_image(ctx, target, level, format, type, pixels, texObj, texImage,
- GL_FALSE);
}
static void
-st_GetCompressedTexImage(struct gl_context *ctx, GLenum target, GLint level,
- GLvoid *pixels,
- struct gl_texture_object *texObj,
- struct gl_texture_image *texImage)
-{
- st_get_tex_image(ctx, target, level, 0, 0, pixels, texObj, texImage,
- GL_TRUE);
-}
-
-
-
-static void
st_TexSubimage(struct gl_context *ctx, GLint dims, GLenum target, GLint level,
GLint xoffset, GLint yoffset, GLint zoffset,
GLint width, GLint height, GLint depth,
@@ -1924,7 +1861,7 @@ st_init_texture_functions(struct dd_function_table *functions)
/* compressed texture functions */
functions->CompressedTexImage2D = st_CompressedTexImage2D;
- functions->GetCompressedTexImage = st_GetCompressedTexImage;
+ functions->GetCompressedTexImage = _mesa_get_compressed_teximage;
functions->NewTextureObject = st_NewTextureObject;
functions->NewTextureImage = st_NewTextureImage;