<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, May 1, 2018 at 10:48 AM, Roland Scheidegger <span dir="ltr"><<a href="mailto:sroland@vmware.com" target="_blank">sroland@vmware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">Am 01.05.2018 um 01:43 schrieb Marek Olšák:<br>
> From: Marek Olšák <<a href="mailto:marek.olsak@amd.com">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>
</span>The idea sounds ok to me, as long as you don't expose the additional<br>
modes with more samples as ordinary msaa modes.<br>
(I'm quite sure at some point nvidia exposed 16x msaa modes through<br>
ordinary means, which then gave you really 4 color samples and 12<br>
coverage-only samples, in some not-very-compliant way. Though IIRC the<br>
extension is actually older than the ability to do per-sample msaa fb<br>
reads, so it wasn't as problematic back then.)<br>
<span class=""><br>
> ---<br>
> src/gallium/docs/source/<wbr>screen.rst | 17 +++++++++++++++--<br>
> src/gallium/include/pipe/p_<wbr>defines.h | 1 +<br>
> src/gallium/include/pipe/p_<wbr>state.h | 3 ++-<br>
> 3 files changed, 18 insertions(+), 3 deletions(-)<br>
> <br>
> diff --git a/src/gallium/docs/source/<wbr>screen.rst b/src/gallium/docs/source/<wbr>screen.rst<br>
> index 3837360fb40..28934c2f7b9 100644<br>
> --- a/src/gallium/docs/source/<wbr>screen.rst<br>
> +++ b/src/gallium/docs/source/<wbr>screen.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_<wbr>ADDRESS``: 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_<wbr>SHADER_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_<wbr>SUPPORT_MASK``: If the i-th bit is set, EQAA<br>
> + supports (i+1) color samples.<br>
</span>I agree with Nicolai here, this looks strange, this should instead query<br>
for total samples or something.<br>
<span class=""><br>
> * ``PIPE_CAP_SIGNED_VERTEX_<wbr>BUFFER_OFFSET``:<br>
> Whether pipe_vertex_buffer::buffer_<wbr>offset is treated as signed. The u_vbuf<br>
> module needs this for optimal performance in workstation applications.<br>
> * ``PIPE_CAP_CONTEXT_PRIORITY_<wbr>MASK``: 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>
</span>I think you should keep nr_samples alone, and re-change the meaning to<br>
actually be "real" samples with all associated data (which is what<br>
everybody expects with msaa).<br>
<span class=""><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>
</span>Hence instead use something like "total_samples" or "coverage samples"<br>
here (albeit the latter could be a bit confusing, unclear if it means<br>
all samples or just the extra ones).<br>
If you'd use something like "number of additional coverage samples"<br>
instead, then you could even leave all state trackers alone, since 0<br>
would automatically mean ordinary msaa without crazy stuff.<br>
And fwiw I'd stick to the CSAA name - coverage at least has some<br>
meaning, whereas "enhanced" (which is what the "E" in EQAA is for<br>
according to some old articles) really is just completely meaningless<br>
marketing term. There really isn't any difference, ok the ability to use<br>
different amount of samples per rt might be something, but you can't<br>
expose this anyway (AMD didn't come up with an extension for this since<br>
the 7+ years it's supported (since NI), so I have some doubts of its<br>
usefulness - besides you could have another cap which then would say if<br>
that's valid or not if you really come up with an extension specifically<br>
for it.)<br>
Unless there's some non-technical reasons you can't use the term CSAA.<br></blockquote><div><br></div><div>EQAA is a superset of CSAA and is more complicated, so it doesn't make sense to use "CSAA".<br><br></div><div>Marek<br></div></div><br></div></div>