*/
firstImage = tObj->Image[0][intelObj->firstLevel];
- dri_bo_reference(intelObj->mt->region->buffer);
- i830->state.tex_buffer[unit] = intelObj->mt->region->buffer;
- i830->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, 0,
- intelObj->
- firstLevel);
-
+ if (intelObj->imageOverride) {
+ i830->state.tex_buffer[unit] = NULL;
+ i830->state.tex_offset[unit] = intelObj->textureOffset;
+
+ switch (intelObj->depthOverride) {
+ case 32:
+ format = MAPSURF_32BIT | MT_32BIT_ARGB8888;
+ break;
+ case 24:
+ default:
+ format = MAPSURF_32BIT | MT_32BIT_XRGB8888;
+ break;
+ case 16:
+ format = MAPSURF_16BIT | MT_16BIT_RGB565;
+ break;
+ }
+
+ pitch = intelObj->pitchOverride;
+ } else {
- i830->state.tex_buffer[unit] = driBOReference(intelObj->mt->region->
- buffer);
++ dri_bo_reference(intelObj->mt->region->buffer);
++ i830->state.tex_buffer[unit] = intelObj->mt->region->buffer;
+ i830->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt,
+ 0, intelObj->
+ firstLevel);
+
+ format = translate_texture_format(firstImage->TexFormat->MesaFormat);
+ pitch = intelObj->mt->pitch * intelObj->mt->cpp;
+ }
state[I830_TEXREG_TM0LI] = (_3DSTATE_LOAD_STATE_IMMEDIATE_2 |
(LOAD_TEXTURE_MAP0 << unit) | 4);
*/
firstImage = tObj->Image[0][intelObj->firstLevel];
- dri_bo_reference(intelObj->mt->region->buffer);
- i915->state.tex_buffer[unit] = intelObj->mt->region->buffer;
-
- i915->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, 0,
- intelObj->
- firstLevel);
+ if (intelObj->imageOverride) {
+ i915->state.tex_buffer[unit] = NULL;
+ i915->state.tex_offset[unit] = intelObj->textureOffset;
+
+ switch (intelObj->depthOverride) {
+ case 32:
+ format = MAPSURF_32BIT | MT_32BIT_ARGB8888;
+ break;
+ case 24:
+ default:
+ format = MAPSURF_32BIT | MT_32BIT_XRGB8888;
+ break;
+ case 16:
+ format = MAPSURF_16BIT | MT_16BIT_RGB565;
+ break;
+ }
+
+ pitch = intelObj->pitchOverride;
+ } else {
- i915->state.tex_buffer[unit] = driBOReference(intelObj->mt->region->
- buffer);
++ dri_bo_reference(intelObj->mt->region->buffer);
++ i915->state.tex_buffer[unit] = intelObj->mt->region->buffer;
+ i915->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt,
+ 0, intelObj->
+ firstLevel);
+
+ format = translate_texture_format(firstImage->TexFormat->MesaFormat);
+ pitch = intelObj->mt->pitch * intelObj->mt->cpp;
+ }
state[I915_TEXREG_MS3] =
(((firstImage->Height - 1) << MS3_HEIGHT_SHIFT) |
if (state->tex_buffer[i]) {
OUT_RELOC(state->tex_buffer[i],
DRM_BO_FLAG_MEM_TT | DRM_BO_FLAG_READ,
- DRM_BO_MASK_MEM | DRM_BO_FLAG_READ,
state->tex_offset[i]);
}
- else {
+ else if (state == &i915->meta) {
assert(i == 0);
- assert(state == &i915->meta);
OUT_BATCH(0);
}
+ else {
+ OUT_BATCH(state->tex_offset[i]);
+ }
OUT_BATCH(state->Tex[i][I915_TEXREG_MS3]);
OUT_BATCH(state->Tex[i][I915_TEXREG_MS4]);