summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast/s_texture.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-09-21 18:54:53 -0600
committerBrian Paul <[email protected]>2011-09-22 10:44:57 -0600
commit980f6f1b37ca88529b3e000235156eab93254fac (patch)
treeaa35b265eb89284d160ca6211322204efebb3e5c /src/mesa/swrast/s_texture.c
parenteaf376ba354db11f7729452060570b48a029c9a0 (diff)
mesa: move gl_texture_image::Width/Height/DepthScale fields to swrast
These fields were only used for swrast so move them into swrast_texture_image. Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/swrast/s_texture.c')
-rw-r--r--src/mesa/swrast/s_texture.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c
index 14ee0ebc600..1dcb08c0a1b 100644
--- a/src/mesa/swrast/s_texture.c
+++ b/src/mesa/swrast/s_texture.c
@@ -85,6 +85,19 @@ _swrast_alloc_texture_image_buffer(struct gl_context *ctx,
else
swImg->_IsPowerOfTwo = GL_FALSE;
+ /* Compute Width/Height/DepthScale for mipmap lod computation */
+ if (texImage->TexObject->Target == GL_TEXTURE_RECTANGLE_NV) {
+ /* scale = 1.0 since texture coords directly map to texels */
+ swImg->WidthScale = 1.0;
+ swImg->HeightScale = 1.0;
+ swImg->DepthScale = 1.0;
+ }
+ else {
+ swImg->WidthScale = (GLfloat) texImage->Width;
+ swImg->HeightScale = (GLfloat) texImage->Height;
+ swImg->DepthScale = (GLfloat) texImage->Depth;
+ }
+
return texImage->Data != NULL;
}