return;
}
+ if (plane > 0) {
+ if (mt->plane[plane - 1] == NULL)
+ return;
+ mt = mt->plane[plane - 1];
+ }
+
surf = brw_state_batch(brw, AUB_TRACE_SURFACE_STATE,
6 * 4, 32, surf_offset);
uint32_t tex_format = translate_tex_format(brw, intelObj->_Format,
sampler->sRGBDecode);
- if (tObj->Target == GL_TEXTURE_EXTERNAL_OES) {
- if (plane > 0)
- mt = mt->plane[plane - 1];
- if (mt == NULL)
- return;
-
- tex_format = translate_tex_format(brw, mt->format, sampler->sRGBDecode);
- }
-
if (for_gather) {
/* Sandybridge's gather4 message is broken for integer formats.
* To work around this, we pretend the surface is UNORM for
} else {
struct intel_texture_object *intel_obj = intel_texture_object(obj);
struct intel_mipmap_tree *mt = intel_obj->mt;
+
+ if (plane > 0) {
+ if (mt->plane[plane - 1] == NULL)
+ return;
+ mt = mt->plane[plane - 1];
+ }
+
struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit);
/* If this is a view with restricted NumLayers, then our effective depth
* is not just the miptree depth.
const unsigned swizzle = (unlikely(alpha_depth) ? SWIZZLE_XYZW :
brw_get_texture_swizzle(&brw->ctx, obj));
- unsigned format = translate_tex_format(
- brw, intel_obj->_Format, sampler->sRGBDecode);
-
- if (obj->Target == GL_TEXTURE_EXTERNAL_OES) {
- if (plane > 0)
- mt = mt->plane[plane - 1];
- if (mt == NULL)
- return;
-
- format = translate_tex_format(brw, mt->format, sampler->sRGBDecode);
- }
+ mesa_format mesa_fmt = plane == 0 ? intel_obj->_Format : mt->format;
+ unsigned format = translate_tex_format(brw, mesa_fmt,
+ sampler->sRGBDecode);
if (for_gather && format == BRW_SURFACEFORMAT_R32G32_FLOAT)
format = BRW_SURFACEFORMAT_R32G32_FLOAT_LD;
struct gl_texture_image *firstImage = obj->Image[0][obj->BaseLevel];
struct intel_texture_object *intel_obj = intel_texture_object(obj);
struct intel_mipmap_tree *mt = intel_obj->mt;
+
+ if (plane > 0) {
+ if (mt->plane[plane - 1] == NULL)
+ return;
+ mt = mt->plane[plane - 1];
+ }
+
struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit);
/* If this is a view with restricted NumLayers, then our effective depth
* is not just the miptree depth.
const unsigned swizzle = (unlikely(alpha_depth) ? SWIZZLE_XYZW :
brw_get_texture_swizzle(&brw->ctx, obj));
- unsigned format = translate_tex_format(brw, intel_obj->_Format,
+ mesa_format mesa_fmt = plane == 0 ? intel_obj->_Format : mt->format;
+ unsigned format = translate_tex_format(brw, mesa_fmt,
sampler->sRGBDecode);
+
if (obj->StencilSampling && firstImage->_BaseFormat == GL_DEPTH_STENCIL) {
mt = mt->stencil_mt;
format = BRW_SURFACEFORMAT_R8_UINT;
- } else if (obj->Target == GL_TEXTURE_EXTERNAL_OES) {
- if (plane > 0)
- mt = mt->plane[plane - 1];
- if (mt == NULL)
- return;
-
- format = translate_tex_format(brw, mt->format, sampler->sRGBDecode);
-
}
const int surf_index = surf_offset - &brw->wm.base.surf_offset[0];