[Mesa-dev] [PATCH] cso: add point rasterization sanity check assertion

Marek Olšák maraeo at gmail.com
Tue Dec 12 01:58:09 UTC 2017


On Mon, Dec 11, 2017 at 10:41 PM, Roland Scheidegger <sroland at vmware.com> wrote:
> Am 11.12.2017 um 18:42 schrieb Brian Paul:
>> ---
>>  src/gallium/auxiliary/cso_cache/cso_context.c | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
>> index df5543c..dd9821e 100644
>> --- a/src/gallium/auxiliary/cso_cache/cso_context.c
>> +++ b/src/gallium/auxiliary/cso_cache/cso_context.c
>> @@ -592,6 +592,11 @@ enum pipe_error cso_set_rasterizer(struct cso_context *ctx,
>>                                                         (void*)templ, key_size);
>>     void *handle = NULL;
>>
>> +   /* We can't have both point_quad_rasterization (sprites) and point_smooth
>> +    * (round AA points) enabled at the same time.
>> +    */
>> +   assert(!(templ->point_quad_rasterization && templ->point_smooth));
>> +
>>     if (cso_hash_iter_is_null(iter)) {
>>        struct cso_rasterizer *cso = MALLOC(sizeof(struct cso_rasterizer));
>>        if (!cso)
>>
>
> I'm ok with not allowing it, but it contradicts the gallium docs (which
> basically specify that point_quad_rasterization takes precedence over
> point_smooth). Albeit in another paragraph, the docs also state it's an
> error for mismatches in these states, so I suppose it's ok, but probably
> a doc clarification would be nice.
> Either way,
> Reviewed-by: Roland Scheidegger <sroland at vmware.com>

My understanding is that point_quad_rasterization enables
sprite_coord_enable and TGSI_SEMANTIC_PCOORD.

Likewise, AA points are basically point sprites where the shader
computes the alpha channel for blending AA points manually and/or
kills pixels, but the shader needs sprite coordinates for that.

In all cases, the point-quad rasterization can't be disabled. Only the
enablement of sprite coordinates can be controlled (in AMD and NV
GPUs).

Marek


More information about the mesa-dev mailing list