[Mesa-dev] [PATCH] st/mesa: only resolve is number of samples is > 1
Roland Scheidegger
sroland at vmware.com
Thu Dec 1 07:45:45 PST 2011
Am 30.11.2011 21:43, schrieb Jose Fonseca:
>
>
> ----- Original Message -----
>> On 11/30/2011 09:10 PM, Dave Airlie wrote:
>>> From: Dave Airlie <airlied at redhat.com>
>>>
>>> This fixes the firefox crash but I've no idea if its correct.
>>
>> I don't think it is. Visual.samples is the value passed to
>> RenderbufferStorageMultisample, and 1 here means "a desired minimum
>> number of samples" so the actual sample count may (even if very
>> unlikely) be > 1.
>>
>> If you don't implement resource_resolve, mesa/st shouldn't expose
>> framebuffer_multisample for you, or you shouldn't expose > 0
>> samples (that's an issue with the gallium interface, which doesn't
>> define whether 0 means "no storage" or "single sampled").
>
> src/gallium/docs/source/screen.rst is crystal clear on this matter: 0
> or 1 means single-sampled.
>
> And isn't "multi-sampling" with "single-sampled" storage a paradox?
>
> But now you mention, it's probably better to make 0 samples illegal,
> as it only creates unnecessary complexity (and I'm not sure it's
> handled correctly everywhere).
This is probably a fine change. I think the zero and one sample both
meaning single-sampled is because a) when it was introduced this meant
it did not needed to be initialized to some new value and b) in OGL
rendering single-sampled and multi-sampled but with only one sample
isn't actually the same. I don't think the latter case is handled right
though everywhere nor do I know if anyone cares (changes some
rasterization rules).
Roland
>
> Jose
>
>>>
>>> Signed-off-by: Dave Airlie <airlied at redhat.com> ---
>>> src/mesa/state_tracker/st_cb_blit.c | 2 +- 1 files changed, 1
>>> insertions(+), 1 deletions(-)
>>>
>>> diff --git a/src/mesa/state_tracker/st_cb_blit.c
>>> b/src/mesa/state_tracker/st_cb_blit.c index 750f541..8f0c2e8
>>> 100644 --- a/src/mesa/state_tracker/st_cb_blit.c +++
>>> b/src/mesa/state_tracker/st_cb_blit.c @@ -178,7 +178,7 @@
>>> st_BlitFramebuffer(struct gl_context *ctx,
>>> st->pipe->render_condition(st->pipe, NULL, 0); }
>>>
>>> - if (readFB->Visual.sampleBuffers >
>>> drawFB->Visual.sampleBuffers) { + if
>>> (readFB->Visual.sampleBuffers > drawFB->Visual.sampleBuffers &&
>>> readFB->Visual.samples > 1) { struct pipe_resolve_info info;
>>>
>>> if (dstX0 < dstX1) {
>>
>> _______________________________________________ mesa-dev mailing
>> list mesa-dev at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>
> _______________________________________________ mesa-dev mailing
> list mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list