diff options
author | Brian Paul <[email protected]> | 2011-04-10 12:44:46 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-04-10 13:12:49 -0600 |
commit | ecfaab88b2577bd0395bc05d75a036126806a9c4 (patch) | |
tree | 5abb78f767f546778d551a57f7f2cfe20c479f50 /src/mesa/drivers | |
parent | 1cbd3a1cc734df16610a59dc49cdb42c70dc3270 (diff) |
mesa: move sampler state into new gl_sampler_object type
gl_texture_object contains an instance of this type for the regular
texture object sampling state. glGenSamplers() generates new instances
of gl_sampler_object which can override that state with glBindSampler().
Diffstat (limited to 'src/mesa/drivers')
34 files changed, 222 insertions, 218 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 2b00e8979d2..c92bf29c30f 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -1124,12 +1124,12 @@ blitframebuffer_texture(struct gl_context *ctx, if (readAtt && readAtt->Texture) { const struct gl_texture_object *texObj = readAtt->Texture; const GLuint srcLevel = readAtt->TextureLevel; - const GLenum minFilterSave = texObj->MinFilter; - const GLenum magFilterSave = texObj->MagFilter; + const GLenum minFilterSave = texObj->Sampler.MinFilter; + const GLenum magFilterSave = texObj->Sampler.MagFilter; const GLint baseLevelSave = texObj->BaseLevel; const GLint maxLevelSave = texObj->MaxLevel; - const GLenum wrapSSave = texObj->WrapS; - const GLenum wrapTSave = texObj->WrapT; + const GLenum wrapSSave = texObj->Sampler.WrapS; + const GLenum wrapTSave = texObj->Sampler.WrapT; const GLenum target = texObj->Target; if (drawAtt->Texture == readAtt->Texture) { @@ -2259,13 +2259,13 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, struct vertex verts[4]; const GLuint baseLevel = texObj->BaseLevel; const GLuint maxLevel = texObj->MaxLevel; - const GLenum minFilterSave = texObj->MinFilter; - const GLenum magFilterSave = texObj->MagFilter; + const GLenum minFilterSave = texObj->Sampler.MinFilter; + const GLenum magFilterSave = texObj->Sampler.MagFilter; const GLint maxLevelSave = texObj->MaxLevel; const GLboolean genMipmapSave = texObj->GenerateMipmap; - const GLenum wrapSSave = texObj->WrapS; - const GLenum wrapTSave = texObj->WrapT; - const GLenum wrapRSave = texObj->WrapR; + const GLenum wrapSSave = texObj->Sampler.WrapS; + const GLenum wrapTSave = texObj->Sampler.WrapT; + const GLenum wrapRSave = texObj->Sampler.WrapR; const GLuint fboSave = ctx->DrawBuffer->Name; const GLuint original_active_unit = ctx->Texture.CurrentUnit; GLenum faceTarget; diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c index 8eec07d5bcc..e927cf0addd 100644 --- a/src/mesa/drivers/dri/common/texmem.c +++ b/src/mesa/drivers/dri/common/texmem.c @@ -1264,17 +1264,18 @@ driCalculateTextureFirstLastLevel( driTextureObject * t ) case GL_TEXTURE_2D: case GL_TEXTURE_3D: case GL_TEXTURE_CUBE_MAP: - if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) { + if (tObj->Sampler.MinFilter == GL_NEAREST || + tObj->Sampler.MinFilter == GL_LINEAR) { /* GL_NEAREST and GL_LINEAR only care about GL_TEXTURE_BASE_LEVEL. */ firstLevel = lastLevel = tObj->BaseLevel; } else { - firstLevel = tObj->BaseLevel + (GLint)(tObj->MinLod + 0.5); + firstLevel = tObj->BaseLevel + (GLint)(tObj->Sampler.MinLod + 0.5); firstLevel = MAX2(firstLevel, tObj->BaseLevel); firstLevel = MIN2(firstLevel, tObj->BaseLevel + baseImage->MaxLog2); - lastLevel = tObj->BaseLevel + (GLint)(tObj->MaxLod + 0.5); + lastLevel = tObj->BaseLevel + (GLint)(tObj->Sampler.MaxLod + 0.5); lastLevel = MAX2(lastLevel, t->tObj->BaseLevel); lastLevel = MIN2(lastLevel, t->tObj->BaseLevel + baseImage->MaxLog2); lastLevel = MIN2(lastLevel, t->tObj->MaxLevel); diff --git a/src/mesa/drivers/dri/i810/i810tex.c b/src/mesa/drivers/dri/i810/i810tex.c index 49364aeb225..dba4ebaa5c7 100644 --- a/src/mesa/drivers/dri/i810/i810tex.c +++ b/src/mesa/drivers/dri/i810/i810tex.c @@ -204,10 +204,10 @@ i810AllocTexObj( struct gl_context *ctx, struct gl_texture_object *texObj ) make_empty_list( & t->base ); - i810SetTexWrapping( t, texObj->WrapS, texObj->WrapT ); + i810SetTexWrapping( t, texObj->Sampler.WrapS, texObj->Sampler.WrapT ); /*i830SetTexMaxAnisotropy( t, texObj->MaxAnisotropy );*/ - i810SetTexFilter( imesa, t, texObj->MinFilter, texObj->MagFilter, bias ); - i810SetTexBorderColor( t, texObj->BorderColor.f ); + i810SetTexFilter( imesa, t, texObj->Sampler.MinFilter, texObj->Sampler.MagFilter, bias ); + i810SetTexBorderColor( t, texObj->Sampler.BorderColor.f ); } return t; @@ -238,17 +238,17 @@ static void i810TexParameter( struct gl_context *ctx, GLenum target, case GL_TEXTURE_MAG_FILTER: { GLfloat bias = ctx->Texture.Unit[ctx->Texture.CurrentUnit].LodBias; - i810SetTexFilter( imesa, t, tObj->MinFilter, tObj->MagFilter, bias ); + i810SetTexFilter( imesa, t, tObj->Sampler.MinFilter, tObj->Sampler.MagFilter, bias ); } break; case GL_TEXTURE_WRAP_S: case GL_TEXTURE_WRAP_T: - i810SetTexWrapping( t, tObj->WrapS, tObj->WrapT ); + i810SetTexWrapping( t, tObj->Sampler.WrapS, tObj->Sampler.WrapT ); break; case GL_TEXTURE_BORDER_COLOR: - i810SetTexBorderColor( t, tObj->BorderColor.f ); + i810SetTexBorderColor( t, tObj->Sampler.BorderColor.f ); break; case GL_TEXTURE_BASE_LEVEL: diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index c35b4b5ed06..7554bd5e7b9 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -193,7 +193,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) float maxlod; uint32_t minlod_fixed, maxlod_fixed; - switch (tObj->MinFilter) { + switch (tObj->Sampler.MinFilter) { case GL_NEAREST: minFilt = FILTER_NEAREST; mipFilt = MIPFILTER_NONE; @@ -222,12 +222,12 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) return GL_FALSE; } - if (tObj->MaxAnisotropy > 1.0) { + if (tObj->Sampler.MaxAnisotropy > 1.0) { minFilt = FILTER_ANISOTROPIC; magFilt = FILTER_ANISOTROPIC; } else { - switch (tObj->MagFilter) { + switch (tObj->Sampler.MagFilter) { case GL_NEAREST: magFilt = FILTER_NEAREST; break; @@ -239,7 +239,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) } } - lodbias = (int) ((tUnit->LodBias + tObj->LodBias) * 16.0); + lodbias = (int) ((tUnit->LodBias + tObj->Sampler.LodBias) * 16.0); if (lodbias < -64) lodbias = -64; if (lodbias > 63) @@ -259,8 +259,8 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) * addressable (smallest resolution) LOD. Use it to cover both * MAX_LEVEL and MAX_LOD. */ - minlod_fixed = U_FIXED(CLAMP(tObj->MinLod, 0.0, 11), 4); - maxlod = MIN2(tObj->MaxLod, tObj->_MaxLevel - tObj->BaseLevel); + minlod_fixed = U_FIXED(CLAMP(tObj->Sampler.MinLod, 0.0, 11), 4); + maxlod = MIN2(tObj->Sampler.MaxLod, tObj->_MaxLevel - tObj->BaseLevel); if (intel->intelScreen->deviceID == PCI_CHIP_I855_GM || intel->intelScreen->deviceID == PCI_CHIP_I865_G) { maxlod_fixed = U_FIXED(CLAMP(maxlod, 0.0, 11.75), 2); @@ -279,8 +279,8 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) } { - GLenum ws = tObj->WrapS; - GLenum wt = tObj->WrapT; + GLenum ws = tObj->Sampler.WrapS; + GLenum wt = tObj->Sampler.WrapT; /* 3D textures not available on i830 @@ -300,10 +300,10 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) } /* convert border color from float to ubyte */ - CLAMPED_FLOAT_TO_UBYTE(border[0], tObj->BorderColor.f[0]); - CLAMPED_FLOAT_TO_UBYTE(border[1], tObj->BorderColor.f[1]); - CLAMPED_FLOAT_TO_UBYTE(border[2], tObj->BorderColor.f[2]); - CLAMPED_FLOAT_TO_UBYTE(border[3], tObj->BorderColor.f[3]); + CLAMPED_FLOAT_TO_UBYTE(border[0], tObj->Sampler.BorderColor.f[0]); + CLAMPED_FLOAT_TO_UBYTE(border[1], tObj->Sampler.BorderColor.f[1]); + CLAMPED_FLOAT_TO_UBYTE(border[2], tObj->Sampler.BorderColor.f[2]); + CLAMPED_FLOAT_TO_UBYTE(border[3], tObj->Sampler.BorderColor.f[3]); state[I830_TEXREG_TM0S4] = PACK_COLOR_8888(border[3], border[0], diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index af140c85f50..742bb994adb 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -164,7 +164,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) format = translate_texture_format(firstImage->TexFormat, firstImage->InternalFormat, - tObj->DepthMode); + tObj->Sampler.DepthMode); pitch = intelObj->mt->region->pitch * intelObj->mt->cpp; state[I915_TEXREG_MS3] = @@ -181,7 +181,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) * (lowest resolution) LOD. Use it to cover both MAX_LEVEL and * MAX_LOD. */ - maxlod = MIN2(tObj->MaxLod, tObj->_MaxLevel - tObj->BaseLevel); + maxlod = MIN2(tObj->Sampler.MaxLod, tObj->_MaxLevel - tObj->BaseLevel); state[I915_TEXREG_MS4] = ((((pitch / 4) - 1) << MS4_PITCH_SHIFT) | MS4_CUBE_FACE_ENA_MASK | @@ -192,7 +192,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) { GLuint minFilt, mipFilt, magFilt; - switch (tObj->MinFilter) { + switch (tObj->Sampler.MinFilter) { case GL_NEAREST: minFilt = FILTER_NEAREST; mipFilt = MIPFILTER_NONE; @@ -221,16 +221,16 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) return GL_FALSE; } - if (tObj->MaxAnisotropy > 1.0) { + if (tObj->Sampler.MaxAnisotropy > 1.0) { minFilt = FILTER_ANISOTROPIC; magFilt = FILTER_ANISOTROPIC; - if (tObj->MaxAnisotropy > 2.0) + if (tObj->Sampler.MaxAnisotropy > 2.0) aniso = SS2_MAX_ANISO_4; else aniso = SS2_MAX_ANISO_2; } else { - switch (tObj->MagFilter) { + switch (tObj->Sampler.MagFilter) { case GL_NEAREST: magFilt = FILTER_NEAREST; break; @@ -242,7 +242,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) } } - lodbias = (int) ((tUnit->LodBias + tObj->LodBias) * 16.0); + lodbias = (int) ((tUnit->LodBias + tObj->Sampler.LodBias) * 16.0); if (lodbias < -256) lodbias = -256; if (lodbias > 255) @@ -258,14 +258,14 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) /* Shadow: */ - if (tObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB && + if (tObj->Sampler.CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB && tObj->Target != GL_TEXTURE_3D) { if (tObj->Target == GL_TEXTURE_1D) return GL_FALSE; state[I915_TEXREG_SS2] |= (SS2_SHADOW_ENABLE | - intel_translate_shadow_compare_func(tObj->CompareFunc)); + intel_translate_shadow_compare_func(tObj->Sampler.CompareFunc)); minFilt = FILTER_4X4_FLAT; magFilt = FILTER_4X4_FLAT; @@ -278,9 +278,9 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) } { - GLenum ws = tObj->WrapS; - GLenum wt = tObj->WrapT; - GLenum wr = tObj->WrapR; + GLenum ws = tObj->Sampler.WrapS; + GLenum wt = tObj->Sampler.WrapT; + GLenum wr = tObj->Sampler.WrapR; float minlod; /* We program 1D textures as 2D textures, so the 2D texcoord could @@ -298,8 +298,8 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) * clamp_to_border. */ if (tObj->Target == GL_TEXTURE_3D && - (tObj->MinFilter != GL_NEAREST || - tObj->MagFilter != GL_NEAREST) && + (tObj->Sampler.MinFilter != GL_NEAREST || + tObj->Sampler.MagFilter != GL_NEAREST) && (ws == GL_CLAMP || wt == GL_CLAMP || wr == GL_CLAMP || @@ -322,7 +322,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) (translate_wrap_mode(wt) << SS3_TCY_ADDR_MODE_SHIFT) | (translate_wrap_mode(wr) << SS3_TCZ_ADDR_MODE_SHIFT)); - minlod = MIN2(tObj->MinLod, tObj->_MaxLevel - tObj->BaseLevel); + minlod = MIN2(tObj->Sampler.MinLod, tObj->_MaxLevel - tObj->BaseLevel); state[I915_TEXREG_SS3] |= (unit << SS3_TEXTUREMAP_INDEX_SHIFT); state[I915_TEXREG_SS3] |= (U_FIXED(CLAMP(minlod, 0.0, 11.0), 4) << SS3_MIN_LOD_SHIFT); @@ -330,10 +330,10 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) } /* convert border color from float to ubyte */ - CLAMPED_FLOAT_TO_UBYTE(border[0], tObj->BorderColor.f[0]); - CLAMPED_FLOAT_TO_UBYTE(border[1], tObj->BorderColor.f[1]); - CLAMPED_FLOAT_TO_UBYTE(border[2], tObj->BorderColor.f[2]); - CLAMPED_FLOAT_TO_UBYTE(border[3], tObj->BorderColor.f[3]); + CLAMPED_FLOAT_TO_UBYTE(border[0], tObj->Sampler.BorderColor.f[0]); + CLAMPED_FLOAT_TO_UBYTE(border[1], tObj->Sampler.BorderColor.f[1]); + CLAMPED_FLOAT_TO_UBYTE(border[2], tObj->Sampler.BorderColor.f[2]); + CLAMPED_FLOAT_TO_UBYTE(border[3], tObj->Sampler.BorderColor.f[3]); if (firstImage->_BaseFormat == GL_DEPTH_COMPONENT) { /* GL specs that border color for depth textures is taken from the diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index f5abe021c43..63ae28f8575 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -271,20 +271,20 @@ static GLboolean check_fallbacks( struct brw_context *brw, struct gl_texture_unit *texUnit = &ctx->Texture.Unit[u]; if (texUnit->Enabled) { if (texUnit->Enabled & TEXTURE_1D_BIT) { - if (texUnit->CurrentTex[TEXTURE_1D_INDEX]->WrapS == GL_CLAMP) { + if (texUnit->CurrentTex[TEXTURE_1D_INDEX]->Sampler.WrapS == GL_CLAMP) { return GL_TRUE; } } if (texUnit->Enabled & TEXTURE_2D_BIT) { - if (texUnit->CurrentTex[TEXTURE_2D_INDEX]->WrapS == GL_CLAMP || - texUnit->CurrentTex[TEXTURE_2D_INDEX]->WrapT == GL_CLAMP) { + if (texUnit->CurrentTex[TEXTURE_2D_INDEX]->Sampler.WrapS == GL_CLAMP || + texUnit->CurrentTex[TEXTURE_2D_INDEX]->Sampler.WrapT == GL_CLAMP) { return GL_TRUE; } } if (texUnit->Enabled & TEXTURE_3D_BIT) { - if (texUnit->CurrentTex[TEXTURE_3D_INDEX]->WrapS == GL_CLAMP || - texUnit->CurrentTex[TEXTURE_3D_INDEX]->WrapT == GL_CLAMP || - texUnit->CurrentTex[TEXTURE_3D_INDEX]->WrapR == GL_CLAMP) { + if (texUnit->CurrentTex[TEXTURE_3D_INDEX]->Sampler.WrapS == GL_CLAMP || + texUnit->CurrentTex[TEXTURE_3D_INDEX]->Sampler.WrapT == GL_CLAMP || + texUnit->CurrentTex[TEXTURE_3D_INDEX]->Sampler.WrapR == GL_CLAMP) { return GL_TRUE; } } diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index ca51d1599a4..2dd28fd1c58 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -370,14 +370,14 @@ static void brw_wm_populate_key( struct brw_context *brw, * well and our shadow compares always return the result in * all 4 channels. */ - if (t->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) { - if (t->DepthMode == GL_ALPHA) { + if (t->Sampler.CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) { + if (t->Sampler.DepthMode == GL_ALPHA) { swizzles[0] = SWIZZLE_ZERO; swizzles[1] = SWIZZLE_ZERO; swizzles[2] = SWIZZLE_ZERO; - } else if (t->DepthMode == GL_LUMINANCE) { + } else if (t->Sampler.DepthMode == GL_LUMINANCE) { swizzles[3] = SWIZZLE_ONE; - } else if (t->DepthMode == GL_RED) { + } else if (t->Sampler.DepthMode == GL_RED) { /* See table 3.23 of the GL 3.0 spec. */ swizzles[1] = SWIZZLE_ZERO; swizzles[2] = SWIZZLE_ZERO; diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c index 30672b4251b..cfc30d8613f 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -288,26 +288,26 @@ brw_wm_sampler_populate_key(struct brw_context *brw, entry->seamless_cube_map = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? ctx->Texture.CubeMapSeamless : GL_FALSE; - entry->wrap_r = texObj->WrapR; - entry->wrap_s = texObj->WrapS; - entry->wrap_t = texObj->WrapT; - - entry->maxlod = texObj->MaxLod; - entry->minlod = texObj->MinLod; - entry->lod_bias = texUnit->LodBias + texObj->LodBias; - entry->max_aniso = texObj->MaxAnisotropy; - entry->minfilter = texObj->MinFilter; - entry->magfilter = texObj->MagFilter; - entry->comparemode = texObj->CompareMode; - entry->comparefunc = texObj->CompareFunc; + entry->wrap_r = texObj->Sampler.WrapR; + entry->wrap_s = texObj->Sampler.WrapS; + entry->wrap_t = texObj->Sampler.WrapT; + + entry->maxlod = texObj->Sampler.MaxLod; + entry->minlod = texObj->Sampler.MinLod; + entry->lod_bias = texUnit->LodBias + texObj->Sampler.LodBias; + entry->max_aniso = texObj->Sampler.MaxAnisotropy; + entry->minfilter = texObj->Sampler.MinFilter; + entry->magfilter = texObj->Sampler.MagFilter; + entry->comparemode = texObj->Sampler.CompareMode; + entry->comparefunc = texObj->Sampler.CompareFunc; drm_intel_bo_unreference(brw->wm.sdc_bo[unit]); if (firstImage->_BaseFormat == GL_DEPTH_COMPONENT) { float bordercolor[4] = { - texObj->BorderColor.f[0], - texObj->BorderColor.f[0], - texObj->BorderColor.f[0], - texObj->BorderColor.f[0] + texObj->Sampler.BorderColor.f[0], + texObj->Sampler.BorderColor.f[0], + texObj->Sampler.BorderColor.f[0], + texObj->Sampler.BorderColor.f[0] }; /* GL specs that border color for depth textures is taken from the * R channel, while the hardware uses A. Spam R into all the @@ -316,7 +316,7 @@ brw_wm_sampler_populate_key(struct brw_context *brw, brw->wm.sdc_bo[unit] = upload_default_color(brw, bordercolor); } else { brw->wm.sdc_bo[unit] = upload_default_color(brw, - texObj->BorderColor.f); + texObj->Sampler.BorderColor.f); } key->sampler_count = unit + 1; } diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index aeda4d5ce4e..5a478a76e5c 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -201,8 +201,9 @@ brw_update_texture_surface( struct gl_context *ctx, GLuint unit ) surf->ss0.mipmap_layout_mode = BRW_SURFACE_MIPMAPLAYOUT_BELOW; surf->ss0.surface_type = translate_tex_target(tObj->Target); surf->ss0.surface_format = translate_tex_format(firstImage->TexFormat, - firstImage->InternalFormat, - tObj->DepthMode, tObj->sRGBDecode); + firstImage->InternalFormat, + tObj->Sampler.DepthMode, + tObj->Sampler.sRGBDecode); /* This is ok for all textures with channel width 8bit or less: */ diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index b3a2b1b0c85..775fd1008f9 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -112,8 +112,8 @@ intel_miptree_create_for_teximage(struct intel_context *intel, * resizable buffers, or require that buffers implement lazy * pagetable arrangements. */ - if ((intelObj->base.MinFilter == GL_NEAREST || - intelObj->base.MinFilter == GL_LINEAR) && + if ((intelObj->base.Sampler.MinFilter == GL_NEAREST || + intelObj->base.Sampler.MinFilter == GL_LINEAR) && intelImage->level == firstLevel && (intel->gen < 4 || firstLevel == 0)) { lastLevel = firstLevel; diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index a11b07ed09d..5e705c93619 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -18,7 +18,7 @@ intel_update_max_level(struct intel_context *intel, { struct gl_texture_object *tObj = &intelObj->base; - if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) { + if (tObj->Sampler.MinFilter == GL_NEAREST || tObj->Sampler.MinFilter == GL_LINEAR) { intelObj->_MaxLevel = tObj->BaseLevel; } else { intelObj->_MaxLevel = tObj->_MaxLevel; diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c index 68d273a3e75..8e10b314b64 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tex.c +++ b/src/mesa/drivers/dri/mach64/mach64_tex.c @@ -123,9 +123,9 @@ mach64AllocTexObj( struct gl_texture_object *texObj ) make_empty_list( (driTextureObject *) t ); - mach64SetTexWrap( t, texObj->WrapS, texObj->WrapT ); - mach64SetTexFilter( t, texObj->MinFilter, texObj->MagFilter ); - mach64SetTexBorderColor( t, texObj->BorderColor.f ); + mach64SetTexWrap( t, texObj->Sampler.WrapS, texObj->Sampler.WrapT ); + mach64SetTexFilter( t, texObj->Sampler.MinFilter, texObj->Sampler.MagFilter ); + mach64SetTexBorderColor( t, texObj->Sampler.BorderColor.f ); return t; } @@ -454,18 +454,18 @@ static void mach64DDTexParameter( struct gl_context *ctx, GLenum target, case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_MAG_FILTER: if ( t->base.bound ) FLUSH_BATCH( mmesa ); - mach64SetTexFilter( t, tObj->MinFilter, tObj->MagFilter ); + mach64SetTexFilter( t, tObj->Sampler.MinFilter, tObj->Sampler.MagFilter ); break; case GL_TEXTURE_WRAP_S: case GL_TEXTURE_WRAP_T: if ( t->base.bound ) FLUSH_BATCH( mmesa ); - mach64SetTexWrap( t, tObj->WrapS, tObj->WrapT ); + mach64SetTexWrap( t, tObj->Sampler.WrapS, tObj->Sampler.WrapT ); break; case GL_TEXTURE_BORDER_COLOR: if ( t->base.bound ) FLUSH_BATCH( mmesa ); - mach64SetTexBorderColor( t, tObj->BorderColor.f ); + mach64SetTexBorderColor( t, tObj->Sampler.BorderColor.f ); break; case GL_TEXTURE_BASE_LEVEL: diff --git a/src/mesa/drivers/dri/mga/mgatex.c b/src/mesa/drivers/dri/mga/mgatex.c index 11ab9b6117d..ebbfec36556 100644 --- a/src/mesa/drivers/dri/mga/mgatex.c +++ b/src/mesa/drivers/dri/mga/mgatex.c @@ -327,9 +327,9 @@ mgaAllocTexObj( struct gl_texture_object *tObj ) make_empty_list( & t->base ); - mgaSetTexWrapping( t, tObj->WrapS, tObj->WrapT ); - mgaSetTexFilter( t, tObj->MinFilter, tObj->MagFilter ); - mgaSetTexBorderColor( t, tObj->BorderColor.f ); + mgaSetTexWrapping( t, tObj->Sampler.WrapS, tObj->Sampler.WrapT ); + mgaSetTexFilter( t, tObj->Sampler.MinFilter, tObj->Sampler.MagFilter ); + mgaSetTexBorderColor( t, tObj->Sampler.BorderColor.f ); } return( t ); @@ -447,18 +447,18 @@ mgaTexParameter( struct gl_context *ctx, GLenum target, /* FALLTHROUGH */ case GL_TEXTURE_MAG_FILTER: FLUSH_BATCH(mmesa); - mgaSetTexFilter( t, tObj->MinFilter, tObj->MagFilter ); + mgaSetTexFilter( t, tObj->Sampler.MinFilter, tObj->Sampler.MagFilter ); break; case GL_TEXTURE_WRAP_S: case GL_TEXTURE_WRAP_T: FLUSH_BATCH(mmesa); - mgaSetTexWrapping(t,tObj->WrapS,tObj->WrapT); + mgaSetTexWrapping(t,tObj->Sampler.WrapS,tObj->Sampler.WrapT); break; case GL_TEXTURE_BORDER_COLOR: FLUSH_BATCH(mmesa); - mgaSetTexBorderColor(t, tObj->BorderColor.f); + mgaSetTexBorderColor(t, tObj->Sampler.BorderColor.f); break; case GL_TEXTURE_BASE_LEVEL: diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c index 1a1e10e0b3a..36e68c99181 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c @@ -270,8 +270,8 @@ get_last_level(struct gl_texture_object *t) { struct gl_texture_image *base = t->Image[0][t->BaseLevel]; - if (t->MinFilter == GL_NEAREST || - t->MinFilter == GL_LINEAR || !base) + if (t->Sampler.MinFilter == GL_NEAREST || + t->Sampler.MinFilter == GL_LINEAR || !base) return t->BaseLevel; else return MIN2(t->BaseLevel + base->MaxLog2, t->MaxLevel); diff --git a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c index 5ed8b147559..6c96e580013 100644 --- a/src/mesa/drivers/dri/nouveau/nv04_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv04_state_tex.c @@ -80,8 +80,8 @@ nv04_emit_tex_obj(struct gl_context *ctx, int emit) s = &to_nouveau_texture(t)->surfaces[t->BaseLevel]; - if (t->MinFilter != GL_NEAREST && - t->MinFilter != GL_LINEAR) { + if (t->Sampler.MinFilter != GL_NEAREST && + t->Sampler.MinFilter != GL_LINEAR) { lod_max = CLAMP(MIN2(t->MaxLod, t->_MaxLambda), 0, 15) + 1; @@ -89,17 +89,17 @@ nv04_emit_tex_obj(struct gl_context *ctx, int emit) t->LodBias, -16, 15) * 8; } - format |= nvgl_wrap_mode(t->WrapT) << 28 | - nvgl_wrap_mode(t->WrapS) << 24 | + format |= nvgl_wrap_mode(t->Sampler.WrapT) << 28 | + nvgl_wrap_mode(t->Sampler.WrapS) << 24 | ti->HeightLog2 << 20 | ti->WidthLog2 << 16 | lod_max << 12 | get_tex_format(ti); filter |= log2i(t->MaxAnisotropy) << 31 | - nvgl_filter_mode(t->MagFilter) << 28 | + nvgl_filter_mode(t->Sampler.MagFilter) << 28 | log2i(t->MaxAnisotropy) << 27 | - nvgl_filter_mode(t->MinFilter) << 24 | + nvgl_filter_mode(t->Sampler.MinFilter) << 24 | (lod_bias & 0xff) << 16; } else { diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c index fda67b15073..1d98b1970ef 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c @@ -173,14 +173,14 @@ nv10_emit_tex_obj(struct gl_context *ctx, int emit) return; /* Recompute the texturing registers. */ - tx_format = nvgl_wrap_mode(t->WrapT) << 28 - | nvgl_wrap_mode(t->WrapS) << 24 + tx_format = nvgl_wrap_mode(t->Sampler.WrapT) << 28 + | nvgl_wrap_mode(t->Sampler.WrapS) << 24 | ti->HeightLog2 << 20 | ti->WidthLog2 << 16 | 5 << 4 | 1 << 12; - tx_filter = nvgl_filter_mode(t->MagFilter) << 28 - | nvgl_filter_mode(t->MinFilter) << 24; + tx_filter = nvgl_filter_mode(t->Sampler.MagFilter) << 28 + | nvgl_filter_mode(t->Sampler.MinFilter) << 24; tx_enable = NV10_3D_TEX_ENABLE_ENABLE | log2i(t->MaxAnisotropy) << 4; @@ -196,8 +196,8 @@ nv10_emit_tex_obj(struct gl_context *ctx, int emit) tx_format |= get_tex_format_pot(ti); } - if (t->MinFilter != GL_NEAREST && - t->MinFilter != GL_LINEAR) { + if (t->Sampler.MinFilter != GL_NEAREST && + t->Sampler.MinFilter != GL_LINEAR) { int lod_min = t->MinLod; int lod_max = MIN2(t->MaxLod, t->_MaxLambda); int lod_bias = t->LodBias diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c index c362aca0fdb..fdbfdf42595 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c @@ -186,12 +186,12 @@ nv20_emit_tex_obj(struct gl_context *ctx, int emit) | NV20_3D_TEX_FORMAT_NO_BORDER | 1 << 16; - tx_wrap = nvgl_wrap_mode(t->WrapR) << 16 - | nvgl_wrap_mode(t->WrapT) << 8 - | nvgl_wrap_mode(t->WrapS) << 0; + tx_wrap = nvgl_wrap_mode(t->Sampler.WrapR) << 16 + | nvgl_wrap_mode(t->Sampler.WrapT) << 8 + | nvgl_wrap_mode(t->Sampler.WrapS) << 0; - tx_filter = nvgl_filter_mode(t->MagFilter) << 24 - | nvgl_filter_mode(t->MinFilter) << 16 + tx_filter = nvgl_filter_mode(t->Sampler.MagFilter) << 24 + | nvgl_filter_mode(t->Sampler.MinFilter) << 16 | 2 << 12; tx_enable = NV20_3D_TEX_ENABLE_ENABLE @@ -208,8 +208,8 @@ nv20_emit_tex_obj(struct gl_context *ctx, int emit) tx_format |= get_tex_format_pot(ti); } - if (t->MinFilter != GL_NEAREST && - t->MinFilter != GL_LINEAR) { + if (t->Sampler.MinFilter != GL_NEAREST && + t->Sampler.MinFilter != GL_LINEAR) { int lod_min = t->MinLod; int lod_max = MIN2(t->MaxLod, t->_MaxLambda); int lod_bias = t->LodBias diff --git a/src/mesa/drivers/dri/r128/r128_tex.c b/src/mesa/drivers/dri/r128/r128_tex.c index ba3305e076e..a3f6ce8edeb 100644 --- a/src/mesa/drivers/dri/r128/r128_tex.c +++ b/src/mesa/drivers/dri/r128/r128_tex.c @@ -162,9 +162,9 @@ static r128TexObjPtr r128AllocTexObj( struct gl_texture_object *texObj ) make_empty_list( (driTextureObject *) t ); - r128SetTexWrap( t, texObj->WrapS, texObj->WrapT ); - r128SetTexFilter( t, texObj->MinFilter, texObj->MagFilter ); - r128SetTexBorderColor( t, texObj->BorderColor.f ); + r128SetTexWrap( t, texObj->Sampler.WrapS, texObj->Sampler.WrapT ); + r128SetTexFilter( t, texObj->Sampler.MinFilter, texObj->Sampler.MagFilter ); + r128SetTexBorderColor( t, texObj->Sampler.BorderColor.f ); } return t; @@ -519,18 +519,18 @@ static void r128TexParameter( struct gl_context *ctx, GLenum target, case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_MAG_FILTER: if ( t->base.bound ) FLUSH_BATCH( rmesa ); - r128SetTexFilter( t, tObj->MinFilter, tObj->MagFilter ); + r128SetTexFilter( t, tObj->Sampler.MinFilter, tObj->Sampler.MagFilter ); break; case GL_TEXTURE_WRAP_S: case GL_TEXTURE_WRAP_T: if ( t->base.bound ) FLUSH_BATCH( rmesa ); - r128SetTexWrap( t, tObj->WrapS, tObj->WrapT ); + r128SetTexWrap( t, tObj->Sampler.WrapS, tObj->Sampler.WrapT ); break; case GL_TEXTURE_BORDER_COLOR: if ( t->base.bound ) FLUSH_BATCH( rmesa ); - r128SetTexBorderColor( t, tObj->BorderColor.f ); + r128SetTexBorderColor( t, tObj->Sampler.BorderColor.f ); break; case GL_TEXTURE_BASE_LEVEL: diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c index 092b7575831..d42e8f12041 100644 --- a/src/mesa/drivers/dri/r200/r200_tex.c +++ b/src/mesa/drivers/dri/r200/r200_tex.c @@ -383,18 +383,18 @@ static void r200TexParameter( struct gl_context *ctx, GLenum target, case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_MAG_FILTER: case GL_TEXTURE_MAX_ANISOTROPY_EXT: - r200SetTexMaxAnisotropy( t, texObj->MaxAnisotropy ); - r200SetTexFilter( t, texObj->MinFilter, texObj->MagFilter ); + r200SetTexMaxAnisotropy( t, texObj->Sampler.MaxAnisotropy ); + r200SetTexFilter( t, texObj->Sampler.MinFilter, texObj->Sampler.MagFilter ); break; case GL_TEXTURE_WRAP_S: case GL_TEXTURE_WRAP_T: case GL_TEXTURE_WRAP_R: - r200SetTexWrap( t, texObj->WrapS, texObj->WrapT, texObj->WrapR ); + r200SetTexWrap( t, texObj->Sampler.WrapS, texObj->Sampler.WrapT, texObj->Sampler.WrapR ); break; case GL_TEXTURE_BORDER_COLOR: - r200SetTexBorderColor( t, texObj->BorderColor.f ); + r200SetTexBorderColor( t, texObj->Sampler.BorderColor.f ); break; case GL_TEXTURE_BASE_LEVEL: @@ -479,13 +479,13 @@ static struct gl_texture_object *r200NewTextureObject(struct gl_context * ctx, _mesa_lookup_enum_by_nr(target), t); _mesa_initialize_texture_object(&t->base, name, target); - t->base.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy; + t->base.Sampler.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy; /* Initialize hardware state */ - r200SetTexWrap( t, t->base.WrapS, t->base.WrapT, t->base.WrapR ); - r200SetTexMaxAnisotropy( t, t->base.MaxAnisotropy ); - r200SetTexFilter(t, t->base.MinFilter, t->base.MagFilter); - r200SetTexBorderColor(t, t->base.BorderColor.f); + r200SetTexWrap( t, t->base.Sampler.WrapS, t->base.Sampler.WrapT, t->base.Sampler.WrapR ); + r200SetTexMaxAnisotropy( t, t->base.Sampler.MaxAnisotropy ); + r200SetTexFilter(t, t->base.Sampler.MinFilter, t->base.Sampler.MagFilter); + r200SetTexBorderColor(t, t->base.Sampler.BorderColor.f); return &t->base; } diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c index 50cf8d6f9db..f0d960dca54 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c @@ -77,8 +77,8 @@ static void build_state( if (fp->Base.ShadowSamplers & (1 << unit)) { struct gl_texture_object* tex = r300->radeon.glCtx->Texture.Unit[unit]._Current; - state->unit[unit].texture_swizzle = build_dts(tex->DepthMode); - state->unit[unit].texture_compare_func = build_func(tex->CompareFunc); + state->unit[unit].texture_swizzle = build_dts(tex->Sampler.DepthMode); + state->unit[unit].texture_compare_func = build_func(tex->Sampler.CompareFunc); } } } diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 51989c6b224..da6c8b602e1 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1343,7 +1343,7 @@ static void r300SetupTextures(struct gl_context * ctx) */ r300->hw.tex.filter_1.cmd[R300_TEX_VALUE_0 + hw_tmu] = t->pp_txfilter_1 | - translate_lod_bias(ctx->Texture.Unit[i].LodBias + t->base.LodBias); + translate_lod_bias(ctx->Texture.Unit[i].LodBias + t->base.Sampler.LodBias); r300->hw.tex.size.cmd[R300_TEX_VALUE_0 + hw_tmu] = t->pp_txsize; r300->hw.tex.format.cmd[R300_TEX_VALUE_0 + @@ -2014,7 +2014,7 @@ static const GLfloat *get_fragmentprogram_constant(struct gl_context *ctx, GLuin buffer[0] = buffer[1] = buffer[2] = - buffer[3] = texObj->CompareFailValue; + buffer[3] = texObj->Sampler.CompareFailValue; } return buffer; } diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index f930b4d06bf..590d9afe14a 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -81,13 +81,13 @@ static void r300UpdateTexWrap(radeonTexObjPtr t) t->pp_txfilter &= ~(R300_TX_WRAP_S_MASK | R300_TX_WRAP_T_MASK | R300_TX_WRAP_R_MASK); - t->pp_txfilter |= translate_wrap_mode(tObj->WrapS) << R300_TX_WRAP_S_SHIFT; + t->pp_txfilter |= translate_wrap_mode(tObj->Sampler.WrapS) << R300_TX_WRAP_S_SHIFT; if (tObj->Target != GL_TEXTURE_1D) { - t->pp_txfilter |= translate_wrap_mode(tObj->WrapT) << R300_TX_WRAP_T_SHIFT; + t->pp_txfilter |= translate_wrap_mode(tObj->Sampler.WrapT) << R300_TX_WRAP_T_SHIFT; if (tObj->Target == GL_TEXTURE_3D) - t->pp_txfilter |= translate_wrap_mode(tObj->WrapR) << R300_TX_WRAP_R_SHIFT; + t->pp_txfilter |= translate_wrap_mode(tObj->Sampler.WrapR) << R300_TX_WRAP_R_SHIFT; } } @@ -202,7 +202,7 @@ static void r300TexParameter(struct gl_context * ctx, GLenum target, case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_MAG_FILTER: case GL_TEXTURE_MAX_ANISOTROPY_EXT: - r300SetTexFilter(t, texObj->MinFilter, texObj->MagFilter, texObj->MaxAnisotropy); + r300SetTexFilter(t, texObj->Sampler.MinFilter, texObj->Sampler.MagFilter, texObj->Sampler.MaxAnisotropy); break; case GL_TEXTURE_WRAP_S: @@ -212,7 +212,7 @@ static void r300TexParameter(struct gl_context * ctx, GLenum target, break; case GL_TEXTURE_BORDER_COLOR: - r300SetTexBorderColor(t, texObj->BorderColor.f); + r300SetTexBorderColor(t, texObj->Sampler.BorderColor.f); break; case GL_TEXTURE_BASE_LEVEL: @@ -299,12 +299,14 @@ static struct gl_texture_object *r300NewTextureObject(struct gl_context * ctx, } _mesa_initialize_texture_object(&t->base, name, target); - t->base.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy; + t->base.Sampler.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy; /* Initialize hardware state */ r300UpdateTexWrap(t); - r300SetTexFilter(t, t->base.MinFilter, t->base.MagFilter, t->base.MaxAnisotropy); - r300SetTexBorderColor(t, t->base.BorderColor.f); + r300SetTexFilter(t, t->base.Sampler.MinFilter, + t->base.Sampler.MagFilter, + t->base.Sampler.MaxAnisotropy); + r300SetTexBorderColor(t, t->base.Sampler.BorderColor.f); return &t->base; } diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index ed9955b05d8..e24ad6f088d 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -216,7 +216,7 @@ void r300SetDepthTexMode(struct gl_texture_object *tObj) return; } - switch (tObj->DepthMode) { + switch (tObj->Sampler.DepthMode) { case GL_LUMINANCE: t->pp_txformat = format[0]; break; diff --git a/src/mesa/drivers/dri/r600/evergreen_tex.c b/src/mesa/drivers/dri/r600/evergreen_tex.c index 3b5448a0e4e..5fdb91a63d1 100644 --- a/src/mesa/drivers/dri/r600/evergreen_tex.c +++ b/src/mesa/drivers/dri/r600/evergreen_tex.c @@ -699,18 +699,18 @@ static void evergreenUpdateTexWrap(radeonTexObjPtr t) { struct gl_texture_object *tObj = &t->base; - SETfield(t->SQ_TEX_SAMPLER0, evergreen_translate_wrap_mode(tObj->WrapS), + SETfield(t->SQ_TEX_SAMPLER0, evergreen_translate_wrap_mode(tObj->Sampler.WrapS), EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_X_shift, EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_X_mask); if (tObj->Target != GL_TEXTURE_1D) { - SETfield(t->SQ_TEX_SAMPLER0, evergreen_translate_wrap_mode(tObj->WrapT), + SETfield(t->SQ_TEX_SAMPLER0, evergreen_translate_wrap_mode(tObj->Sampler.WrapT), EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_Y_shift, EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_Y_mask); if (tObj->Target == GL_TEXTURE_3D) - SETfield(t->SQ_TEX_SAMPLER0, evergreen_translate_wrap_mode(tObj->WrapR), + SETfield(t->SQ_TEX_SAMPLER0, evergreen_translate_wrap_mode(tObj->Sampler.WrapR), EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_Z_shift, EG_SQ_TEX_SAMPLER_WORD0_0__CLAMP_Z_mask); } @@ -901,7 +901,7 @@ static void evergreenSetTexFilter(radeonTexObjPtr t, GLenum minf, GLenum magf, G } } -static void evergreenSetTexBorderColor(radeonTexObjPtr t, const GLfloat color[4]) +static void evergreenSetTexSampler.BorderColor(radeonTexObjPtr t, const GLfloat color[4]) { t->TD_PS_SAMPLER0_BORDER_ALPHA = *((uint32_t*)&(color[3])); t->TD_PS_SAMPLER0_BORDER_RED = *((uint32_t*)&(color[2])); @@ -1424,8 +1424,8 @@ static struct gl_texture_object *evergreenNewTextureObject(struct gl_context * c evergreenSetTexDefaultState(t); evergreenUpdateTexWrap(t); - evergreenSetTexFilter(t, t->base.MinFilter, t->base.MagFilter, t->base.MaxAnisotropy); - evergreenSetTexBorderColor(t, t->base.BorderColor.f); + evergreenSetTexFilter(t, t->base.Sampler.MinFilter, t->base.Sampler.MagFilter, t->base.MaxAnisotropy); + evergreenSetTexSampler.BorderColor(t, t->base.Sampler.BorderColor.f); return &t->base; } @@ -1475,7 +1475,7 @@ static void evergreenTexParameter(struct gl_context * ctx, GLenum target, case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_MAG_FILTER: case GL_TEXTURE_MAX_ANISOTROPY_EXT: - evergreenSetTexFilter(t, texObj->MinFilter, texObj->MagFilter, texObj->MaxAnisotropy); + evergreenSetTexFilter(t, texObj->Sampler.MinFilter, texObj->Sampler.MagFilter, texObj->MaxAnisotropy); break; case GL_TEXTURE_WRAP_S: @@ -1485,7 +1485,7 @@ static void evergreenTexParameter(struct gl_context * ctx, GLenum target, break; case GL_TEXTURE_BORDER_COLOR: - evergreenSetTexBorderColor(t, texObj->BorderColor.f); + evergreenSetTexSampler.BorderColor(t, texObj->Sampler.BorderColor.f); break; case GL_TEXTURE_BASE_LEVEL: diff --git a/src/mesa/drivers/dri/r600/r600_tex.c b/src/mesa/drivers/dri/r600/r600_tex.c index fe4f0e48661..07f6de7ad49 100644 --- a/src/mesa/drivers/dri/r600/r600_tex.c +++ b/src/mesa/drivers/dri/r600/r600_tex.c @@ -78,15 +78,15 @@ static void r600UpdateTexWrap(radeonTexObjPtr t) { struct gl_texture_object *tObj = &t->base; - SETfield(t->SQ_TEX_SAMPLER0, translate_wrap_mode(tObj->WrapS), + SETfield(t->SQ_TEX_SAMPLER0, translate_wrap_mode(tObj->Sampler.WrapS), SQ_TEX_SAMPLER_WORD0_0__CLAMP_X_shift, SQ_TEX_SAMPLER_WORD0_0__CLAMP_X_mask); if (tObj->Target != GL_TEXTURE_1D) { - SETfield(t->SQ_TEX_SAMPLER0, translate_wrap_mode(tObj->WrapT), + SETfield(t->SQ_TEX_SAMPLER0, translate_wrap_mode(tObj->Sampler.WrapT), CLAMP_Y_shift, CLAMP_Y_mask); if (tObj->Target == GL_TEXTURE_3D) - SETfield(t->SQ_TEX_SAMPLER0, translate_wrap_mode(tObj->WrapR), + SETfield(t->SQ_TEX_SAMPLER0, translate_wrap_mode(tObj->Sampler.WrapR), CLAMP_Z_shift, CLAMP_Z_mask); } } @@ -262,7 +262,7 @@ static void r600SetTexFilter(radeonTexObjPtr t, GLenum minf, GLenum magf, GLfloa } } -static void r600SetTexBorderColor(radeonTexObjPtr t, const GLfloat color[4]) +static void r600SetTexSampler.BorderColor(radeonTexObjPtr t, const GLfloat color[4]) { t->TD_PS_SAMPLER0_BORDER_ALPHA = *((uint32_t*)&(color[3])); t->TD_PS_SAMPLER0_BORDER_BLUE = *((uint32_t*)&(color[2])); @@ -292,7 +292,7 @@ static void r600TexParameter(struct gl_context * ctx, GLenum target, case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_MAG_FILTER: case GL_TEXTURE_MAX_ANISOTROPY_EXT: - r600SetTexFilter(t, texObj->MinFilter, texObj->MagFilter, texObj->MaxAnisotropy); + r600SetTexFilter(t, texObj->Sampler.MinFilter, texObj->Sampler.MagFilter, texObj->MaxAnisotropy); break; case GL_TEXTURE_WRAP_S: @@ -302,7 +302,7 @@ static void r600TexParameter(struct gl_context * ctx, GLenum target, break; case GL_TEXTURE_BORDER_COLOR: - r600SetTexBorderColor(t, texObj->BorderColor.f); + r600SetTexSampler.BorderColor(t, texObj->Sampler.BorderColor.f); break; case GL_TEXTURE_BASE_LEVEL: @@ -387,8 +387,8 @@ static struct gl_texture_object *r600NewTextureObject(struct gl_context * ctx, /* Initialize hardware state */ r600SetTexDefaultState(t); r600UpdateTexWrap(t); - r600SetTexFilter(t, t->base.MinFilter, t->base.MagFilter, t->base.MaxAnisotropy); - r600SetTexBorderColor(t, t->base.BorderColor.f); + r600SetTexFilter(t, t->base.Sampler.MinFilter, t->base.Sampler.MagFilter, t->base.MaxAnisotropy); + r600SetTexSampler.BorderColor(t, t->base.Sampler.BorderColor.f); return &t->base; } diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 4ec2845ab44..ff456c67e2e 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -141,7 +141,7 @@ static void r700SendTexSamplerState(struct gl_context *ctx, struct radeon_state_ } } -static void r700SendTexBorderColorState(struct gl_context *ctx, struct radeon_state_atom *atom) +static void r700SendTexSampler.BorderColorState(struct gl_context *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); @@ -1640,7 +1640,7 @@ void r600InitAtoms(context_t *context) ALLOC_STATE(vtx, vtx, (VERT_ATTRIB_MAX * 18), r700SendVTXState); ALLOC_STATE(tx, tx, (R700_TEXTURE_NUMBERUNITS * 20), r700SendTexState); ALLOC_STATE(tx_smplr, tx, (R700_TEXTURE_NUMBERUNITS * 5), r700SendTexSamplerState); - ALLOC_STATE(tx_brdr_clr, tx, (R700_TEXTURE_NUMBERUNITS * 6), r700SendTexBorderColorState); + ALLOC_STATE(tx_brdr_clr, tx, (R700_TEXTURE_NUMBERUNITS * 6), r700SendTexSampler.BorderColorState); r600_init_query_stateobj(&context->radeon, 6 * 2); context->radeon.hw.is_dirty = GL_TRUE; diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 1fadad2756b..03d9b264367 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -296,15 +296,15 @@ static void calculate_min_max_lod(struct gl_texture_object *tObj, case GL_TEXTURE_2D: case GL_TEXTURE_3D: case GL_TEXTURE_CUBE_MAP: - if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) { + if (tObj->Sampler.MinFilter == GL_NEAREST || tObj->Sampler.MinFilter == GL_LINEAR) { /* GL_NEAREST and GL_LINEAR only care about GL_TEXTURE_BASE_LEVEL. */ minLod = maxLod = tObj->BaseLevel; } else { - minLod = tObj->BaseLevel + (GLint)(tObj->MinLod); + minLod = tObj->BaseLevel + (GLint)(tObj->Sampler.MinLod); minLod = MAX2(minLod, tObj->BaseLevel); minLod = MIN2(minLod, tObj->MaxLevel); - maxLod = tObj->BaseLevel + (GLint)(tObj->MaxLod + 0.5); + maxLod = tObj->BaseLevel + (GLint)(tObj->Sampler.MaxLod + 0.5); maxLod = MIN2(maxLod, tObj->MaxLevel); maxLod = MIN2(maxLod, tObj->Image[0][minLod]->MaxLog2 + minLod); maxLod = MAX2(maxLod, minLod); /* need at least one level */ diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c b/src/mesa/drivers/dri/radeon/radeon_tex.c index 8a35c7d2d27..25a8ddf7b6a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex.c @@ -330,17 +330,17 @@ static void radeonTexParameter( struct gl_context *ctx, GLenum target, case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_MAG_FILTER: case GL_TEXTURE_MAX_ANISOTROPY_EXT: - radeonSetTexMaxAnisotropy( t, texObj->MaxAnisotropy ); - radeonSetTexFilter( t, texObj->MinFilter, texObj->MagFilter ); + radeonSetTexMaxAnisotropy( t, texObj->Sampler.MaxAnisotropy ); + radeonSetTexFilter( t, texObj->Sampler.MinFilter, texObj->Sampler.MagFilter ); break; case GL_TEXTURE_WRAP_S: case GL_TEXTURE_WRAP_T: - radeonSetTexWrap( t, texObj->WrapS, texObj->WrapT ); + radeonSetTexWrap( t, texObj->Sampler.WrapS, texObj->Sampler.WrapT ); break; case GL_TEXTURE_BORDER_COLOR: - radeonSetTexBorderColor( t, texObj->BorderColor.f ); + radeonSetTexBorderColor( t, texObj->Sampler.BorderColor.f ); break; case GL_TEXTURE_BASE_LEVEL: @@ -416,7 +416,7 @@ radeonNewTextureObject( struct gl_context *ctx, GLuint name, GLenum target ) radeonTexObj* t = CALLOC_STRUCT(radeon_tex_obj); _mesa_initialize_texture_object(&t->base, name, target); - t->base.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy; + t->base.Sampler.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy; t->border_fallback = GL_FALSE; @@ -424,10 +424,10 @@ radeonNewTextureObject( struct gl_context *ctx, GLuint name, GLenum target ) t->pp_txformat = (RADEON_TXFORMAT_ENDIAN_NO_SWAP | RADEON_TXFORMAT_PERSPECTIVE_ENABLE); - radeonSetTexWrap( t, t->base.WrapS, t->base.WrapT ); - radeonSetTexMaxAnisotropy( t, t->base.MaxAnisotropy ); - radeonSetTexFilter( t, t->base.MinFilter, t->base.MagFilter ); - radeonSetTexBorderColor( t, t->base.BorderColor.f ); + radeonSetTexWrap( t, t->base.Sampler.WrapS, t->base.Sampler.WrapT ); + radeonSetTexMaxAnisotropy( t, t->base.Sampler.MaxAnisotropy ); + radeonSetTexFilter( t, t->base.Sampler.MinFilter, t->base.Sampler.MagFilter ); + radeonSetTexBorderColor( t, t->base.Sampler.BorderColor.f ); return &t->base; } diff --git a/src/mesa/drivers/dri/savage/savagerender.c b/src/mesa/drivers/dri/savage/savagerender.c index 8cc448ad4f7..6687dc5f466 100644 --- a/src/mesa/drivers/dri/savage/savagerender.c +++ b/src/mesa/drivers/dri/savage/savagerender.c @@ -250,9 +250,9 @@ static GLboolean run_texnorm_stage( struct gl_context *ctx, const GLbitfield reallyEnabled = ctx->Texture.Unit[i]._ReallyEnabled; if (reallyEnabled) { const struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current; - const GLboolean normalizeS = (texObj->WrapS == GL_REPEAT); + const GLboolean normalizeS = (texObj->Sampler.WrapS == GL_REPEAT); const GLboolean normalizeT = (reallyEnabled & TEXTURE_2D_BIT) && - (texObj->WrapT == GL_REPEAT); + (texObj->Sampler.WrapT == GL_REPEAT); const GLfloat *in = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]->data; const GLint instride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]->stride; GLfloat (*out)[4] = store->texcoord[i].data; @@ -332,15 +332,15 @@ static void validate_texnorm( struct gl_context *ctx, GLuint flags = 0; if (((ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) && - (ctx->Texture.Unit[0]._Current->WrapS == GL_REPEAT)) || + (ctx->Texture.Unit[0]._Current->Sampler.WrapS == GL_REPEAT)) || ((ctx->Texture.Unit[0]._ReallyEnabled & TEXTURE_2D_BIT) && - (ctx->Texture.Unit[0]._Current->WrapT == GL_REPEAT))) + (ctx->Texture.Unit[0]._Current->Sampler.WrapT == GL_REPEAT))) flags |= VERT_BIT_TEX0; if (((ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT|TEXTURE_2D_BIT)) && - (ctx->Texture.Unit[1]._Current->WrapS == GL_REPEAT)) || + (ctx->Texture.Unit[1]._Current->Sampler.WrapS == GL_REPEAT)) || ((ctx->Texture.Unit[1]._ReallyEnabled & TEXTURE_2D_BIT) && - (ctx->Texture.Unit[1]._Current->WrapT == GL_REPEAT))) + (ctx->Texture.Unit[1]._Current->Sampler.WrapT == GL_REPEAT))) flags |= VERT_BIT_TEX1; store->active = (flags != 0); diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c index 3aece732c99..9486c12c158 100644 --- a/src/mesa/drivers/dri/savage/savagetex.c +++ b/src/mesa/drivers/dri/savage/savagetex.c @@ -502,9 +502,9 @@ savageAllocTexObj( struct gl_texture_object *texObj ) make_empty_list( &t->base ); - savageSetTexWrapping(t,texObj->WrapS,texObj->WrapT); - savageSetTexFilter(t,texObj->MinFilter,texObj->MagFilter); - savageSetTexBorderColor(t,texObj->BorderColor.f); + savageSetTexWrapping(t,texObj->Sampler.WrapS,texObj->Sampler.WrapT); + savageSetTexFilter(t,texObj->Sampler.MinFilter,texObj->Sampler.MagFilter); + savageSetTexBorderColor(t,texObj->Sampler.BorderColor.f); } return t; @@ -2031,16 +2031,16 @@ static void savageTexParameter( struct gl_context *ctx, GLenum target, switch (pname) { case GL_TEXTURE_MIN_FILTER: case GL_TEXTURE_MAG_FILTER: - savageSetTexFilter(t,tObj->MinFilter,tObj->MagFilter); + savageSetTexFilter(t,tObj->Sampler.MinFilter,tObj->Sampler.MagFilter); break; case GL_TEXTURE_WRAP_S: case GL_TEXTURE_WRAP_T: - savageSetTexWrapping(t,tObj->WrapS,tObj->WrapT); + savageSetTexWrapping(t,tObj->Sampler.WrapS,tObj->Sampler.WrapT); break; case GL_TEXTURE_BORDER_COLOR: - savageSetTexBorderColor(t,tObj->BorderColor.f); + savageSetTexBorderColor(t,tObj->Sampler.BorderColor.f); break; default: diff --git a/src/mesa/drivers/dri/sis/sis_texstate.c b/src/mesa/drivers/dri/sis/sis_texstate.c index daec2393211..6580f155bae 100644 --- a/src/mesa/drivers/dri/sis/sis_texstate.c +++ b/src/mesa/drivers/dri/sis/sis_texstate.c @@ -335,7 +335,7 @@ sis_set_texobj_parm( struct gl_context *ctx, struct gl_texture_object *texObj, current->texture[hw_unit].hwTextureMip = 0UL; current->texture[hw_unit].hwTextureSet = t->hwformat; - if ((texObj->MinFilter == GL_NEAREST) || (texObj->MinFilter == GL_LINEAR)) { + if ((texObj->Sampler.MinFilter == GL_NEAREST) || (texObj->Sampler.MinFilter == GL_LINEAR)) { firstLevel = lastLevel = texObj->BaseLevel; } else { /* Compute which mipmap levels we really want to send to the hardware. @@ -344,9 +344,9 @@ sis_set_texobj_parm( struct gl_context *ctx, struct gl_texture_object *texObj, * Yes, this looks overly complicated, but it's all needed. */ - firstLevel = texObj->BaseLevel + (GLint)(texObj->MinLod + 0.5); + firstLevel = texObj->BaseLevel + (GLint)(texObj->Sampler.MinLod + 0.5); firstLevel = MAX2(firstLevel, texObj->BaseLevel); - lastLevel = texObj->BaseLevel + (GLint)(texObj->MaxLod + 0.5); + lastLevel = texObj->BaseLevel + (GLint)(texObj->Sampler.MaxLod + 0.5); lastLevel = MAX2(lastLevel, texObj->BaseLevel); lastLevel = MIN2(lastLevel, texObj->BaseLevel + texObj->Image[0][texObj->BaseLevel]->MaxLog2); @@ -356,7 +356,7 @@ sis_set_texobj_parm( struct gl_context *ctx, struct gl_texture_object *texObj, current->texture[hw_unit].hwTextureSet |= (lastLevel << 8); - switch (texObj->MagFilter) + switch (texObj->Sampler.MagFilter) { case GL_NEAREST: current->texture[hw_unit].hwTextureMip |= TEXTURE_FILTER_NEAREST; @@ -382,7 +382,7 @@ sis_set_texobj_parm( struct gl_context *ctx, struct gl_texture_object *texObj, MASK_TextureMipmapLodBias); } - switch (texObj->MinFilter) + switch (texObj->Sampler.MinFilter) { case GL_NEAREST: current->texture[hw_unit].hwTextureMip |= TEXTURE_FILTER_NEAREST; @@ -408,7 +408,7 @@ sis_set_texobj_parm( struct gl_context *ctx, struct gl_texture_object *texObj, break; } - switch (texObj->WrapS) + switch (texObj->Sampler.WrapS) { case GL_REPEAT: current->texture[hw_unit].hwTextureSet |= MASK_TextureWrapU; @@ -431,7 +431,7 @@ sis_set_texobj_parm( struct gl_context *ctx, struct gl_texture_object *texObj, break; } - switch (texObj->WrapT) + switch (texObj->Sampler.WrapT) { case GL_REPEAT: current->texture[hw_unit].hwTextureSet |= MASK_TextureWrapV; @@ -456,10 +456,10 @@ sis_set_texobj_parm( struct gl_context *ctx, struct gl_texture_object *texObj, { GLubyte c[4]; - CLAMPED_FLOAT_TO_UBYTE(c[0], texObj->BorderColor.f[0]); - CLAMPED_FLOAT_TO_UBYTE(c[1], texObj->BorderColor.f[1]); - CLAMPED_FLOAT_TO_UBYTE(c[2], texObj->BorderColor.f[2]); - CLAMPED_FLOAT_TO_UBYTE(c[3], texObj->BorderColor.f[3]); + CLAMPED_FLOAT_TO_UBYTE(c[0], texObj->Sampler.BorderColor.f[0]); + CLAMPED_FLOAT_TO_UBYTE(c[1], texObj->Sampler.BorderColor.f[1]); + CLAMPED_FLOAT_TO_UBYTE(c[2], texObj->Sampler.BorderColor.f[2]); + CLAMPED_FLOAT_TO_UBYTE(c[3], texObj->Sampler.BorderColor.f[3]); current->texture[hw_unit].hwTextureBorderColor = PACK_COLOR_8888(c[3], c[0], c[1], c[2]); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 4cca243d076..d74ddb24005 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -327,7 +327,7 @@ static void RevalidateTexture(struct gl_context *ctx, struct gl_texture_object * &(ti->sScale), &(ti->tScale), NULL, NULL); } - if (tObj->Image[0][maxl] && (tObj->MinFilter != GL_NEAREST) && (tObj->MinFilter != GL_LINEAR)) { + if (tObj->Image[0][maxl] && (tObj->Sampler.MinFilter != GL_NEAREST) && (tObj->Sampler.MinFilter != GL_LINEAR)) { /* mipmapping: need to compute smallLodLog2 */ tdfxTexGetInfo(ctx, tObj->Image[0][maxl]->Width, tObj->Image[0][maxl]->Height, @@ -1786,12 +1786,12 @@ tdfxTestProxyTexImage(struct gl_context *ctx, GLenum target, #endif if (level == 0) { /* don't use mipmap levels > 0 */ - tObj->MinFilter = tObj->MagFilter = GL_NEAREST; + tObj->Sampler.MinFilter = tObj->Sampler.MagFilter = GL_NEAREST; } else { /* test with all mipmap levels */ - tObj->MinFilter = GL_LINEAR_MIPMAP_LINEAR; - tObj->MagFilter = GL_NEAREST; + tObj->Sampler.MinFilter = GL_LINEAR_MIPMAP_LINEAR; + tObj->Sampler.MagFilter = GL_NEAREST; } RevalidateTexture(ctx, tObj); diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c index 774f439bfb6..3b270e02a97 100644 --- a/src/mesa/drivers/dri/unichrome/via_state.c +++ b/src/mesa/drivers/dri/unichrome/via_state.c @@ -877,21 +877,21 @@ static GLboolean viaChooseTextureState(struct gl_context *ctx) if (texUnit0->_ReallyEnabled) { struct gl_texture_object *texObj = texUnit0->_Current; - vmesa->regHTXnTB[0] = get_minmag_filter( texObj->MinFilter, - texObj->MagFilter ); + vmesa->regHTXnTB[0] = get_minmag_filter( texObj->Sampler.MinFilter, + texObj->Sampler.MagFilter ); vmesa->regHTXnMPMD[0] &= ~(HC_HTXnMPMD_SMASK | HC_HTXnMPMD_TMASK); - vmesa->regHTXnMPMD[0] |= get_wrap_mode( texObj->WrapS, - texObj->WrapT ); + vmesa->regHTXnMPMD[0] |= get_wrap_mode( texObj->Sampler.WrapS, + texObj->Sampler.WrapT ); vmesa->regHTXnTB[0] &= ~(HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T); if (texObj->Image[0][texObj->BaseLevel]->Border > 0) { vmesa->regHTXnTB[0] |= (HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T); vmesa->regHTXnTBC[0] = - PACK_COLOR_888(FLOAT_TO_UBYTE(texObj->BorderColor.f[0]), - FLOAT_TO_UBYTE(texObj->BorderColor.f[1]), - FLOAT_TO_UBYTE(texObj->BorderColor.f[2])); - vmesa->regHTXnTRAH[0] = FLOAT_TO_UBYTE(texObj->BorderColor.f[3]); + PACK_COLOR_888(FLOAT_TO_UBYTE(texObj->Sampler.BorderColor.f[0]), + FLOAT_TO_UBYTE(texObj->Sampler.BorderColor.f[1]), + FLOAT_TO_UBYTE(texObj->Sampler.BorderColor.f[2])); + vmesa->regHTXnTRAH[0] = FLOAT_TO_UBYTE(texObj->Sampler.BorderColor.f[3]); } if (texUnit0->LodBias != 0.0f) { @@ -911,20 +911,20 @@ static GLboolean viaChooseTextureState(struct gl_context *ctx) if (texUnit1->_ReallyEnabled) { struct gl_texture_object *texObj = texUnit1->_Current; - vmesa->regHTXnTB[1] = get_minmag_filter( texObj->MinFilter, - texObj->MagFilter ); + vmesa->regHTXnTB[1] = get_minmag_filter( texObj->Sampler.MinFilter, + texObj->Sampler.MagFilter ); vmesa->regHTXnMPMD[1] &= ~(HC_HTXnMPMD_SMASK | HC_HTXnMPMD_TMASK); - vmesa->regHTXnMPMD[1] |= get_wrap_mode( texObj->WrapS, - texObj->WrapT ); + vmesa->regHTXnMPMD[1] |= get_wrap_mode( texObj->Sampler.WrapS, + texObj->Sampler.WrapT ); vmesa->regHTXnTB[1] &= ~(HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T); if (texObj->Image[0][texObj->BaseLevel]->Border > 0) { vmesa->regHTXnTB[1] |= (HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T); vmesa->regHTXnTBC[1] = - PACK_COLOR_888(FLOAT_TO_UBYTE(texObj->BorderColor.f[0]), - FLOAT_TO_UBYTE(texObj->BorderColor.f[1]), - FLOAT_TO_UBYTE(texObj->BorderColor.f[2])); - vmesa->regHTXnTRAH[1] = FLOAT_TO_UBYTE(texObj->BorderColor.f[3]); + PACK_COLOR_888(FLOAT_TO_UBYTE(texObj->Sampler.BorderColor.f[0]), + FLOAT_TO_UBYTE(texObj->Sampler.BorderColor.f[1]), + FLOAT_TO_UBYTE(texObj->Sampler.BorderColor.f[2])); + vmesa->regHTXnTRAH[1] = FLOAT_TO_UBYTE(texObj->Sampler.BorderColor.f[3]); } diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index a2fb010e142..1a0d1eaf070 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -495,13 +495,13 @@ static GLboolean viaSetTexImages(struct gl_context *ctx, * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL. * Yes, this looks overly complicated, but it's all needed. */ - if (texObj->MinFilter == GL_LINEAR || texObj->MinFilter == GL_NEAREST) { + if (texObj->Sampler.MinFilter == GL_LINEAR || texObj->Sampler.MinFilter == GL_NEAREST) { firstLevel = lastLevel = texObj->BaseLevel; } else { - firstLevel = texObj->BaseLevel + (GLint)(texObj->MinLod + 0.5); + firstLevel = texObj->BaseLevel + (GLint)(texObj->Sampler.MinLod + 0.5); firstLevel = MAX2(firstLevel, texObj->BaseLevel); - lastLevel = texObj->BaseLevel + (GLint)(texObj->MaxLod + 0.5); + lastLevel = texObj->BaseLevel + (GLint)(texObj->Sampler.MaxLod + 0.5); lastLevel = MAX2(lastLevel, texObj->BaseLevel); lastLevel = MIN2(lastLevel, texObj->BaseLevel + baseImage->image.MaxLog2); lastLevel = MIN2(lastLevel, texObj->MaxLevel); |