[Mesa-dev] [PATCH 26/35] meta: Use common GLSL code for blits

Alex Deucher alexdeucher at gmail.com
Mon Feb 3 15:46:26 CET 2014


On Mon, Feb 3, 2014 at 3:54 AM, Rogovin, Kevin <kevin.rogovin at intel.com> wrote:
> Hi,
>
>> We can't do stencil blits with GLSL because no driver that uses meta can
>> do the GL_ARB_shader_stencil_export extension.  For depth and color
>> blits, we can always write the values from the shader, and disable
>> writes to the buffers using glColorMask and glDepthMask.  So... we just
>> need one shader.
>
> Should we add GL_ARB_shader_stencil_export as one of the extensions Mesa
> can support? Naturally that is major tangent from this, and I am not too sure
> what hardware beyond newer AMD hardware has that capability.

Mesa already supports it, at least for AMD hardware.

Alex

>
> The shader had that the fragment depth used the same value as the red of the
> fragment color, so should it not be then 3 shaders (color only, depth only, color and depth)
> with the last one having two samplers?
>
> Also, should not the case of blitting from MSAA to non-MSAA be handled correctly?
> i.e. use the sampler type sampler2DMS  and average over the number of samples?
> or possible fancier filtering kernels?
>
> Best Regards,
>  -Kevin Rogovin
> ________________________________________
> From: Ian Romanick [idr at freedesktop.org]
> Sent: Sunday, February 02, 2014 5:45 PM
> To: Rogovin, Kevin; mesa-dev at lists.freedesktop.org
> Subject: Re: [Mesa-dev] [PATCH 26/35] meta: Use common GLSL code for blits
>
> On 01/30/2014 09:51 AM, Rogovin, Kevin wrote:
>>> @@ -487,6 +486,7 @@ setup_shader_for_sampler(struct gl_context *ctx, struct glsl_sampler
>>> *sampler)
>>>                                   "void main()\n"
>>>                                  "{\n"
>>>                                  "   gl_FragColor = %s(texSampler, %s);\n"
>>> +                                  "   gl_FragDepth = gl_FragColor.x;\n"
>>
>> *IF* I understood what this is to do, is to provide FBO blit API
>> implementation from upstairs mesa. Should not a different shader be used
>> base on the 8 possibilities(really 7 since all 0 means no-op) of the
>> bits being up and down: COLOR_BUFFER_BIT, DEPTH_BUFFER_BIT and
>> STENCIL_BUFFER_BIT ? The above looks like to me to handle either
>> COLOR_BUFFER_BIT or DEPTH_BUFFER_BIT up, but not both. With that in mind
>> then there would be up to 3 separate samplers (one for color, one for
>> stencil and one for depth).
>
> We can't do stencil blits with GLSL because no driver that uses meta can
> do the GL_ARB_shader_stencil_export extension.  For depth and color
> blits, we can always write the values from the shader, and disable
> writes to the buffers using glColorMask and glDepthMask.  So... we just
> need one shader.
>
>> Or am I missing something?
>>
>> -Kevin
>>
>>
>> _______________________________________________
>> 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