summaryrefslogtreecommitdiff
path: root/src/mesa/main/texrender.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-01-06 08:15:54 -0700
committerBrian Paul <brianp@vmware.com>2009-01-06 08:15:54 -0700
commit374cf77b2f0f13f9380fb0c9d804222a83bdc2e0 (patch)
tree39cfbbcbbbdc9b2d64e4ad134472cf747101dc7b /src/mesa/main/texrender.c
parent52d5d25537a9291f7d247211d2881ed56edaca94 (diff)
parenta8ee35c1c59c23938e0a18b163515acc892ed407 (diff)
Merge commit 'origin/master' into gallium-0.2
Conflicts: src/mesa/drivers/dri/common/dri_util.c
Diffstat (limited to 'src/mesa/main/texrender.c')
-rw-r--r--src/mesa/main/texrender.c52
1 files changed, 50 insertions, 2 deletions
diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c
index 163bda4501..4ae13a7b9b 100644
--- a/src/mesa/main/texrender.c
+++ b/src/mesa/main/texrender.c
@@ -49,6 +49,14 @@ texture_get_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
trb->TexImage->FetchTexelc(trb->TexImage, x + i, y, z, rgbaOut + 4 * i);
}
}
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ GLushort *zValues = (GLushort *) values;
+ for (i = 0; i < count; i++) {
+ GLfloat flt;
+ trb->TexImage->FetchTexelf(trb->TexImage, x + i, y, z, &flt);
+ zValues[i] = (GLushort) (flt * 0xffff);
+ }
+ }
else if (rb->DataType == GL_UNSIGNED_INT) {
GLuint *zValues = (GLuint *) values;
/*
@@ -96,6 +104,15 @@ texture_get_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
z, rgbaOut + 4 * i);
}
}
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ GLushort *zValues = (GLushort *) values;
+ for (i = 0; i < count; i++) {
+ GLfloat flt;
+ trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i] + trb->Yoffset,
+ z, &flt);
+ zValues[i] = (GLushort) (flt * 0xffff);
+ }
+ }
else if (rb->DataType == GL_UNSIGNED_INT) {
GLuint *zValues = (GLuint *) values;
for (i = 0; i < count; i++) {
@@ -147,6 +164,14 @@ texture_put_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
rgba += 4;
}
}
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ const GLushort *zValues = (const GLushort *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, zValues + i);
+ }
+ }
+ }
else if (rb->DataType == GL_UNSIGNED_INT) {
const GLuint *zValues = (const GLuint *) values;
for (i = 0; i < count; i++) {
@@ -189,6 +214,14 @@ texture_put_mono_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
}
}
}
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ const GLushort zValue = *((const GLushort *) value);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, &zValue);
+ }
+ }
+ }
else if (rb->DataType == GL_UNSIGNED_INT) {
const GLuint zValue = *((const GLuint *) value);
for (i = 0; i < count; i++) {
@@ -231,12 +264,19 @@ texture_put_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
rgba += 4;
}
}
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ const GLushort *zValues = (const GLushort *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, zValues + i);
+ }
+ }
+ }
else if (rb->DataType == GL_UNSIGNED_INT) {
const GLuint *zValues = (const GLuint *) values;
for (i = 0; i < count; i++) {
if (!mask || mask[i]) {
- trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z,
- zValues + i);
+ trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, zValues + i);
}
}
}
@@ -281,6 +321,14 @@ texture_put_mono_values(GLcontext *ctx, struct gl_renderbuffer *rb,
}
}
}
+ else if (rb->DataType == GL_UNSIGNED_SHORT) {
+ const GLushort zValue = *((const GLushort *) value);
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &zValue);
+ }
+ }
+ }
else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) {
const GLuint zValue = *((const GLuint *) value);
const GLfloat flt = (GLfloat) ((zValue >> 8) * (1.0 / 0xffffff));