<div dir="ltr"><div><div><div><div><div><div><div><div>The maximum config is:<br></div>- 16 coverage samples<br></div>- 8 Z/S samples<br></div>- 8 color samples<br><br></div>The minimum config is:<br></div>- 1-16 coverage samples<br></div>- 1 Z/S sample<br></div>- 1 color sample<br><br></div><div>The coverage buffer (each color buffer has one) remembers undefined samples if color samples < coverage samples, and the resolve shader can guess values of undefined samples by looking at neighbors.<br></div><div><br></div>Marek<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 30, 2018 at 7:43 PM, Marek Olšák <span dir="ltr"><<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>><br>
<br>
This is a hypothetical interface for EQAA (a superset of CSAA). CSAA could be<br>
exposed via GL_NV_framebuffer_multisample_<wbr>coverage. EQAA additionally removes<br>
the restriction that the number of samples in all FBO attachments must match,<br>
which means it allows arbitrary sample counts in each FBO attachment.<br>
---<br>
 src/gallium/docs/source/scree<wbr>n.rst   | 17 +++++++++++++++--<br>
 src/gallium/include/pipe/p_de<wbr>fines.h |  1 +<br>
 src/gallium/include/pipe/p_st<wbr>ate.h   |  3 ++-<br>
 3 files changed, 18 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/gallium/docs/source/scre<wbr>en.rst b/src/gallium/docs/source/scre<wbr>en.rst<br>
index 3837360fb40..28934c2f7b9 100644<br>
--- a/src/gallium/docs/source/scre<wbr>en.rst<br>
+++ b/src/gallium/docs/source/scre<wbr>en.rst<br>
@@ -398,20 +398,22 @@ The integer capabilities:<br>
 * ``PIPE_CAP_LOAD_CONSTBUF``: True if the driver supports TGSI_OPCODE_LOAD use<br>
   with constant buffers.<br>
 * ``PIPE_CAP_TGSI_ANY_REG_AS_ADD<wbr>RESS``: Any TGSI register can be used as<br>
   an address for indirect register indexing.<br>
 * ``PIPE_CAP_TILE_RASTER_ORDER``<wbr>: Whether the driver supports<br>
   GL_MESA_tile_raster_order, using the tile_raster_order_* fields in<br>
   pipe_rasterizer_state.<br>
 * ``PIPE_CAP_MAX_COMBINED_SHADER<wbr>_OUTPUT_RESOURCES``: Limit on combined shader<br>
   output resources (images + buffers + fragment outputs). If 0 the state<br>
   tracker works it out.<br>
+* ``PIPE_CAP_EQAA_COLOR_SAMPLE_S<wbr>UPPORT_MASK``: If the i-th bit is set, EQAA<br>
+  supports (i+1) color samples.<br>
 * ``PIPE_CAP_SIGNED_VERTEX_BUFFE<wbr>R_OFFSET``:<br>
   Whether pipe_vertex_buffer::buffer_off<wbr>set is treated as signed. The u_vbuf<br>
   module needs this for optimal performance in workstation applications.<br>
 * ``PIPE_CAP_CONTEXT_PRIORITY_MA<wbr>SK``: For drivers that support per-context<br>
   priorities, this returns a bitmask of PIPE_CONTEXT_PRIORITY_x for the<br>
   supported priority levels.  A driver that does not support prioritized<br>
   contexts can return 0.<br>
 * ``PIPE_CAP_FENCE_SIGNAL``: True if the driver supports signaling semaphores<br>
   using fence_server_signal().<br>
 * ``PIPE_CAP_CONSTBUF0_FLAGS``: The bits of pipe_resource::flags that must be<br>
@@ -743,22 +745,33 @@ Modern APIs allow using buffers as shader resources.<br>
 (1 for 1D or 1D array textures).<br>
<br>
 **depth0** the depth of the base mip level of the texture<br>
 (1 for everything else).<br>
<br>
 **array_size** the array size for 1D and 2D array textures.<br>
 For cube maps this must be 6, for other textures 1.<br>
<br>
 **last_level** the last mip map level present.<br>
<br>
-**nr_samples** the nr of msaa samples. 0 (or 1) specifies a resource<br>
-which isn't multisampled.<br>
+**nr_samples**: For Z/S, this is the number of samples. For color, if EQAA<br>
+is unsupported, this is the number of both coverage samples and color samples.<br>
+If EQAA is supported, this is the number of coverage samples. 0 and 1<br>
+specify a resource which isn't multisampled.<br>
+<br>
+**nr_color_samples**: This is the number of color samples for EQAA, while<br>
+``nr_samples`` is the number of coverage samples. If the format is Z/S,<br>
+``nr_color_samples`` is ignored. Constraints:<br>
+* ``nr_color_samples`` must not be greater than ``nr_samples``.<br>
+* If ``nr_color_samples`` is equal to ``nr_samples``, it is called MSAA.<br>
+* If ``nr_color_samples`` is less than ``nr_samples``, it is called EQAA.<br>
+* If ``nr_color_samples`` is equal to 1, the behavior of the resolve blit is<br>
+driver-dependent.<br>
<br>
 **usage** one of the :ref:`PIPE_USAGE` flags.<br>
<br>
 **bind** bitmask of the :ref:`PIPE_BIND` flags.<br>
<br>
 **flags** bitmask of PIPE_RESOURCE_FLAG flags.<br>
<br>
<br>
<br>
 resource_changed<br>
diff --git a/src/gallium/include/pipe/p_d<wbr>efines.h b/src/gallium/include/pipe/p_d<wbr>efines.h<br>
index c4ae0532060..97e1a3a3d42 100644<br>
--- a/src/gallium/include/pipe/p_d<wbr>efines.h<br>
+++ b/src/gallium/include/pipe/p_d<wbr>efines.h<br>
@@ -783,20 +783,21 @@ enum pipe_cap<br>
    PIPE_CAP_ALLOW_MAPPED_BUFFERS_<wbr>DURING_EXECUTION,<br>
    PIPE_CAP_POST_DEPTH_COVERAGE,<br>
    PIPE_CAP_BINDLESS_TEXTURE,<br>
    PIPE_CAP_NIR_SAMPLERS_AS_DEREF<wbr>,<br>
    PIPE_CAP_QUERY_SO_OVERFLOW,<br>
    PIPE_CAP_MEMOBJ,<br>
    PIPE_CAP_LOAD_CONSTBUF,<br>
    PIPE_CAP_TGSI_ANY_REG_AS_ADDRE<wbr>SS,<br>
    PIPE_CAP_TILE_RASTER_ORDER,<br>
    PIPE_CAP_MAX_COMBINED_SHADER_O<wbr>UTPUT_RESOURCES,<br>
+   PIPE_CAP_EQAA_COLOR_SAMPLE_SU<wbr>PPORT_MASK,<br>
    PIPE_CAP_SIGNED_VERTEX_BUFFER_<wbr>OFFSET,<br>
    PIPE_CAP_CONTEXT_PRIORITY_MASK<wbr>,<br>
    PIPE_CAP_FENCE_SIGNAL,<br>
    PIPE_CAP_CONSTBUF0_FLAGS,<br>
    PIPE_CAP_PACKED_UNIFORMS,<br>
 };<br>
<br>
 /**<br>
  * Possible bits for PIPE_CAP_CONTEXT_PRIORITY_MASK param, which should<br>
  * return a bitmask of the supported priorities.  If the driver does not<br>
diff --git a/src/gallium/include/pipe/p_s<wbr>tate.h b/src/gallium/include/pipe/p_s<wbr>tate.h<br>
index 4dce399f848..4010b92e67b 100644<br>
--- a/src/gallium/include/pipe/p_s<wbr>tate.h<br>
+++ b/src/gallium/include/pipe/p_s<wbr>tate.h<br>
@@ -503,41 +503,42 @@ struct pipe_box<br>
    int16_t depth;<br>
 };<br>
<br>
<br>
 /**<br>
  * A memory object/resource such as a vertex buffer or texture.<br>
  */<br>
 struct pipe_resource<br>
 {<br>
    struct pipe_reference reference;<br>
-   struct pipe_screen *screen; /**< screen that this texture belongs to */<br>
<br>
    unsigned width0; /**< Used by both buffers and textures. */<br>
    uint16_t height0; /* Textures: The maximum height/depth/array_size is 16k. */<br>
    uint16_t depth0;<br>
    uint16_t array_size;<br>
<br>
    enum pipe_format format:16;         /**< PIPE_FORMAT_x */<br>
    enum pipe_texture_target target:8; /**< PIPE_TEXTURE_x */<br>
    unsigned last_level:8;    /**< Index of last mipmap level present/defined */<br>
    unsigned nr_samples:8;    /**< for multisampled surfaces, nr of samples */<br>
+   unsigned nr_color_samples:8; /**< Number of color samples for EQAA. */<br>
    unsigned usage:8;         /**< PIPE_USAGE_x (not a bitmask) */<br>
<br>
    unsigned bind;            /**< bitmask of PIPE_BIND_x */<br>
    unsigned flags;           /**< bitmask of PIPE_RESOURCE_FLAG_x */<br>
<br>
    /**<br>
     * For planar images, ie. YUV EGLImage external, etc, pointer to the<br>
     * next plane.<br>
     */<br>
    struct pipe_resource *next;<br>
+   struct pipe_screen *screen; /**< screen that this texture belongs to */<br>
 };<br>
<br>
<br>
 /**<br>
  * Transfer object.  For data transfer to/from a resource.<br>
  */<br>
 struct pipe_transfer<br>
 {<br>
    struct pipe_resource *resource; /**< resource to transfer to/from  */<br>
    unsigned level;                 /**< texture mipmap level */<br>
<span class="m_-1563692919806721664HOEnZb"><font color="#888888">-- <br>
2.17.0<br>
<br>
</font></span></blockquote></div><br></div></div>