diff options
author | marha <marha@users.sourceforge.net> | 2011-08-30 08:11:58 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-08-30 08:11:58 +0200 |
commit | ccddacee74b1f043b146265297c8abbde6317df7 (patch) | |
tree | d6ddca10b5d19de1f14e56d7013a8591f4bfe658 /mesalib/src/mesa/state_tracker | |
parent | 52a690f156b6388c2219610d4e9cd88b79d24203 (diff) | |
parent | 82ce0534a7bc89f1ed93b4b952b30ceb3d94210d (diff) | |
download | vcxsrv-ccddacee74b1f043b146265297c8abbde6317df7.tar.gz vcxsrv-ccddacee74b1f043b146265297c8abbde6317df7.tar.bz2 vcxsrv-ccddacee74b1f043b146265297c8abbde6317df7.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/mesa/SConscript
mesalib/src/mesa/drivers/common/driverfuncs.c
mesalib/src/mesa/drivers/dri/common/texmem.c
mesalib/src/mesa/main/context.c
mesalib/src/mesa/main/dd.h
mesalib/src/mesa/main/debug.h
mesalib/src/mesa/main/fbobject.c
mesalib/src/mesa/main/formats.c
mesalib/src/mesa/main/formats.h
mesalib/src/mesa/main/teximage.c
mesalib/src/mesa/sources.mak
mesalib/src/mesa/state_tracker/st_cb_texture.c
Diffstat (limited to 'mesalib/src/mesa/state_tracker')
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_cb_texture.c | 51 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_gen_mipmap.c | 3 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 1 |
3 files changed, 50 insertions, 5 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c index 82a1079a2..726f185b4 100644 --- a/mesalib/src/mesa/state_tracker/st_cb_texture.c +++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c @@ -142,9 +142,9 @@ st_DeleteTextureObject(struct gl_context *ctx, }
-/** called via ctx->Driver.FreeTexImageData() */
+/** called via ctx->Driver.FreeTextureImageBuffer() */
static void
-st_FreeTextureImageData(struct gl_context * ctx, struct gl_texture_image *texImage)
+st_FreeTextureImageBuffer(struct gl_context * ctx, struct gl_texture_image *texImage)
{
struct st_texture_image *stImage = st_texture_image(texImage);
@@ -161,6 +161,49 @@ st_FreeTextureImageData(struct gl_context * ctx, struct gl_texture_image *texIma }
+/** called via ctx->Driver.MapTextureImage() */
+static void
+st_MapTextureImage(struct gl_context *ctx,
+ struct gl_texture_image *texImage,
+ GLuint slice, GLuint x, GLuint y, GLuint w, GLuint h,
+ GLbitfield mode,
+ GLubyte **mapOut, GLint *rowStrideOut)
+{
+ struct st_context *st = st_context(ctx);
+ struct st_texture_image *stImage = st_texture_image(texImage);
+ unsigned pipeMode;
+ GLubyte *map;
+
+ pipeMode = 0x0;
+ if (mode & GL_MAP_READ_BIT)
+ pipeMode |= PIPE_TRANSFER_READ;
+ if (mode & GL_MAP_WRITE_BIT)
+ pipeMode |= PIPE_TRANSFER_WRITE;
+
+ map = st_texture_image_map(st, stImage, slice, pipeMode, x, y, w, h);
+ if (map) {
+ *mapOut = map;
+ *rowStrideOut = stImage->transfer->stride;
+ }
+ else {
+ *mapOut = NULL;
+ *rowStrideOut = 0;
+ }
+}
+
+
+/** called via ctx->Driver.UnmapTextureImage() */
+static void
+st_UnmapTextureImage(struct gl_context *ctx,
+ struct gl_texture_image *texImage,
+ GLuint slice)
+{
+ struct st_context *st = st_context(ctx);
+ struct st_texture_image *stImage = st_texture_image(texImage);
+ st_texture_image_unmap(st, stImage);
+}
+
+
/**
* From linux kernel i386 header files, copes with odd sizes better
* than COPY_DWORDS would:
@@ -1880,7 +1923,9 @@ st_init_texture_functions(struct dd_function_table *functions) functions->NewTextureObject = st_NewTextureObject;
functions->NewTextureImage = st_NewTextureImage;
functions->DeleteTexture = st_DeleteTextureObject;
- functions->FreeTexImageData = st_FreeTextureImageData;
+ functions->FreeTextureImageBuffer = st_FreeTextureImageBuffer;
+ functions->MapTextureImage = st_MapTextureImage;
+ functions->UnmapTextureImage = st_UnmapTextureImage;
functions->TextureMemCpy = do_memcpy;
diff --git a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c index 82ca4af7f..e53da5fd4 100644 --- a/mesalib/src/mesa/state_tracker/st_gen_mipmap.c +++ b/mesalib/src/mesa/state_tracker/st_gen_mipmap.c @@ -444,8 +444,7 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target, } /* Free old image data */ - if (dstImage->Data) - ctx->Driver.FreeTexImageData(ctx, dstImage); + ctx->Driver.FreeTextureImageBuffer(ctx, dstImage); /* initialize new image */ _mesa_init_teximage_fields(ctx, target, dstImage, dstWidth, dstHeight, diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp index 22660830a..3fbb0cdd2 100644 --- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp +++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp @@ -5050,6 +5050,7 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog) break; } if (!ok) { + _mesa_reference_program(ctx, &linked_prog, NULL); return GL_FALSE; } } |