case GL_TEXTURE_2D_ARRAY:
case GL_TEXTURE_1D_ARRAY:
+ case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
brw_miptree_layout_texture_array(intel, mt);
break;
case GL_TEXTURE_2D:
case GL_TEXTURE_2D_ARRAY_EXT:
case GL_TEXTURE_EXTERNAL_OES:
+ case GL_TEXTURE_2D_MULTISAMPLE:
+ case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
return BRW_SURFACE_2D;
case GL_TEXTURE_3D:
rb->Format = image->TexFormat;
rb->InternalFormat = image->InternalFormat;
rb->_BaseFormat = image->_BaseFormat;
- rb->Width = mt->level[level].width;
- rb->Height = mt->level[level].height;
+ rb->NumSamples = mt->num_samples;
+
+ if (mt->msaa_layout != INTEL_MSAA_LAYOUT_NONE) {
+ assert(level == 0);
+ rb->Width = mt->logical_width0;
+ rb->Height = mt->logical_height0;
+ }
+ else {
+ rb->Width = mt->level[level].width;
+ rb->Height = mt->level[level].height;
+ }
rb->Delete = intel_delete_renderbuffer;
rb->AllocStorage = intel_nop_alloc_storage;
intel_miptree_check_level_layer(mt, level, layer);
irb->mt_level = level;
- irb->mt_layer = layer;
+
+ switch (mt->msaa_layout) {
+ case INTEL_MSAA_LAYOUT_UMS:
+ case INTEL_MSAA_LAYOUT_CMS:
+ irb->mt_layer = layer * mt->num_samples;
+ break;
+
+ default:
+ irb->mt_layer = layer;
+ }
intel_miptree_reference(&irb->mt, mt);
* minification. This will also catch images not present in the
* tree, changed targets, etc.
*/
- if (width != mt->level[level].width ||
- height != mt->level[level].height ||
- depth != mt->level[level].depth)
+ if (mt->target == GL_TEXTURE_2D_MULTISAMPLE ||
+ mt->target == GL_TEXTURE_2D_MULTISAMPLE_ARRAY) {
+ /* nonzero level here is always bogus */
+ assert(level == 0);
+
+ if (width != mt->logical_width0 ||
+ height != mt->logical_height0 ||
+ depth != mt->logical_depth0) {
+ return false;
+ }
+ }
+ else {
+ /* all normal textures, renderbuffers, etc */
+ if (width != mt->level[level].width ||
+ height != mt->level[level].height ||
+ depth != mt->level[level].depth) {
+ return false;
+ }
+ }
+
+ if (image->NumSamples != mt->num_samples)
return false;
return true;
#include "intel_context.h"
#include "intel_mipmap_tree.h"
#include "intel_tex.h"
+#include "intel_fbo.h"
#define FILE_DEBUG_FLAG DEBUG_TEXTURE
assert(image->Border == 0);
+ /* Quantize sample count */
+ if (image->NumSamples) {
+ image->NumSamples = intel_quantize_num_samples(intel->intelScreen, image->NumSamples);
+ if (!image->NumSamples)
+ return false;
+ }
+
/* Because the driver uses AllocTextureImageBuffer() internally, it may end
* up mismatched with FreeTextureImageBuffer(), but that is safe to call
* multiple times.
switch (texobj->Target) {
case GL_TEXTURE_3D:
case GL_TEXTURE_2D_ARRAY:
+ case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
slices = image->Depth;
break;
case GL_TEXTURE_1D_ARRAY:
height,
depth,
expect_accelerated_upload,
- 0 /* num_samples */,
+ intelImage->base.Base.NumSamples,
false /* force_y_tiling */);
}