if (!(fb->nr_cbufs || fb->zsbuf))
return MAX2(fb->samples, 1);
+ /**
+ * If a driver doesn't advertise PIPE_CAP_SURFACE_SAMPLE_COUNT,
+ * pipe_surface::nr_samples will always be 0.
+ */
for (i = 0; i < fb->nr_cbufs; i++) {
if (fb->cbufs[i]) {
- return MAX2(1, fb->cbufs[i]->texture->nr_samples);
+ return MAX3(1, fb->cbufs[i]->texture->nr_samples,
+ fb->cbufs[i]->nr_samples);
}
}
if (fb->zsbuf) {
- return MAX2(1, fb->zsbuf->texture->nr_samples);
+ return MAX3(1, fb->zsbuf->texture->nr_samples,
+ fb->zsbuf->nr_samples);
}
return 1;
0 means no limit.
* ``PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET``: The maximum supported value for
of pipe_vertex_element::src_offset.
+* ``PIPE_CAP_SURFACE_SAMPLE_COUNT_TEXTURE``: Whether the driver
+ supports pipe_surface overrides of resource nr_samples. If set, will
+ enable EXT_multisampled_render_to_texture.
.. _pipe_capf:
PIPE_CAP_MAX_COMBINED_HW_ATOMIC_COUNTER_BUFFERS,
PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET,
PIPE_CAP_MAX_VERTEX_ELEMENT_SRC_OFFSET,
+ PIPE_CAP_SURFACE_SAMPLE_COUNT,
};
/**
uint16_t width; /**< logical width in pixels */
uint16_t height; /**< logical height in pixels */
+ /**
+ * Number of samples for the surface. This will be 0 if rendering
+ * should use the resource's nr_samples, or another value if the resource
+ * is bound using FramebufferTexture2DMultisampleEXT.
+ */
+ unsigned nr_samples:8;
+
union pipe_surface_desc u;
};