[Mesa-dev] [PATCH 26/35] meta: Use common GLSL code for blits
Ian Romanick
idr at freedesktop.org
Sun Feb 2 16:45:44 CET 2014
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
More information about the mesa-dev
mailing list