diff options
author | Nian Wu <[email protected]> | 2007-03-18 17:00:18 +0800 |
---|---|---|
committer | Nian Wu <[email protected]> | 2007-03-18 17:00:18 +0800 |
commit | fd1b1fce3faaf40af201a5b06a84df62c855fb12 (patch) | |
tree | 8060b408effd15e9171fc69b13c36a4d47dee01e /src/mesa | |
parent | 38889f5221821acf08365d3f332680707d4b9b5f (diff) | |
parent | cfe984dbd0c478906785dbf8a9430504173ae952 (diff) |
Merge git://proxy01.pd.intel.com:9419/git/mesa/mesa into crestline
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/main/texstore.c | 19 | ||||
-rw-r--r-- | src/mesa/shader/programopt.c | 3 |
2 files changed, 20 insertions, 2 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 994fb167306..2098bdddbf0 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3608,6 +3608,25 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, GLint col; for (col = 0; col < width; col++) { (*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]); + if (texImage->TexFormat->BaseFormat == GL_ALPHA) { + rgba[col][RCOMP] = 0.0; + rgba[col][GCOMP] = 0.0; + rgba[col][BCOMP] = 0.0; + } + else if (texImage->TexFormat->BaseFormat == GL_LUMINANCE) { + rgba[col][GCOMP] = 0.0; + rgba[col][BCOMP] = 0.0; + rgba[col][ACOMP] = 1.0; + } + else if (texImage->TexFormat->BaseFormat == GL_LUMINANCE_ALPHA) { + rgba[col][GCOMP] = 0.0; + rgba[col][BCOMP] = 0.0; + } + else if (texImage->TexFormat->BaseFormat == GL_INTENSITY) { + rgba[col][GCOMP] = 0.0; + rgba[col][BCOMP] = 0.0; + rgba[col][ACOMP] = 1.0; + } } _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, format, type, dest, diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index dca44c853d8..fed8e5b758b 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -100,8 +100,7 @@ _mesa_insert_mvp_code(GLcontext *ctx, struct gl_vertex_program *vprog) } /* Append original instructions after new instructions */ - _mesa_memcpy(newInst + 4, vprog->Base.Instructions, - origLen * sizeof(struct prog_instruction)); + _mesa_copy_instructions (newInst + 4, vprog->Base.Instructions, origLen); /* free old instructions */ _mesa_free(vprog->Base.Instructions); |