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/dri/i965 | |
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/dri/i965')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_draw.c | 12 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm.c | 8 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_sampler_state.c | 34 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 5 |
4 files changed, 30 insertions, 29 deletions
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: */ |