<div dir="ltr"><div><div>I use a simple texturing fragment shader and the equation "src*a + dst*(1-a)" for blending.<br><br></div>Sorry A8 is probably wrong too, because the text would be black (it's (0,0,0,A), not (1,1,1,A)). I'll write a patch to use swizzling in the fragment shader instead.<br>

<br></div>Marek<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 2, 2013 at 2:33 AM, Brian Paul <span dir="ltr"><<a href="mailto:brianp@vmware.com" target="_blank">brianp@vmware.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 04/01/2013 06:18 PM, Marek Olšák wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Have you checked the font is rendered correctly?<br>
</blockquote>
<br></div>
Yeah, it works fine.<div class="im"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The font should be<br>
transparent and the blend function reads the alpha channel to<br>
determine the transparency, so A8 would be a better option. If that<br>
isn't an option either, the fragment shader should do .xxxx swizzling.<br>
</blockquote>
<br></div>
Hmmm, I just tried A8 and it text is missing.<br>
<br>
I figured you were using a KIL-based fragment shader for the text as in the state tracker's glBitmap code.<br>
<br>
I'll look closer later...<br>
<br>
-Brian<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
<br>
On Tue, Apr 2, 2013 at 12:46 AM, Brian Paul <<a href="mailto:brian.e.paul@gmail.com" target="_blank">brian.e.paul@gmail.com</a><br></div>
<mailto:<a href="mailto:brian.e.paul@gmail.com" target="_blank">brian.e.paul@gmail.com</a><u></u>>> wrote:<br>
<br>
    From: Brian Paul <<a href="mailto:brianp@vmware.com" target="_blank">brianp@vmware.com</a> <mailto:<a href="mailto:brianp@vmware.com" target="_blank">brianp@vmware.com</a>>><div><div class="h5"><br>
<br>
    ---<br>
      src/gallium/auxiliary/hud/<u></u>font.c |   17 +++++++++++++----<br>
      1 file changed, 13 insertions(+), 4 deletions(-)<br>
<br>
    diff --git a/src/gallium/auxiliary/hud/<u></u>font.c<br>
    b/src/gallium/auxiliary/hud/<u></u>font.c<br>
    index 5c4a4d0..6747874 100644<br>
    --- a/src/gallium/auxiliary/hud/<u></u>font.c<br>
    +++ b/src/gallium/auxiliary/hud/<u></u>font.c<br>
    @@ -377,17 +377,26 @@ util_font_create_fixed_8x13(<u></u>struct<br>
    pipe_context *pipe,<br>
         struct pipe_resource tex_templ, *tex;<br>
         struct pipe_transfer *transfer = NULL;<br>
         char *map;<br>
    +   enum pipe_format tex_format;<br>
         int i;<br>
<br>
    -   if (!screen->is_format_supported(<u></u>screen, PIPE_FORMAT_I8_UNORM,<br>
    -                                    PIPE_TEXTURE_RECT, 0,<br>
    -                                    PIPE_BIND_SAMPLER_VIEW)) {<br>
    +   if (screen->is_format_supported(<u></u>screen, PIPE_FORMAT_I8_UNORM,<br>
    +                                   PIPE_TEXTURE_RECT, 0,<br>
    +                                   PIPE_BIND_SAMPLER_VIEW)) {<br>
    +      tex_format = PIPE_FORMAT_I8_UNORM;<br>
    +   }<br>
    +   else if (screen->is_format_supported(<u></u>screen, PIPE_FORMAT_L8_UNORM,<br>
    +                                   PIPE_TEXTURE_RECT, 0,<br>
    +                                   PIPE_BIND_SAMPLER_VIEW)) {<br>
    +      tex_format = PIPE_FORMAT_L8_UNORM;<br>
    +   }<br>
    +   else {<br>
            return FALSE;<br>
         }<br>
<br>
         memset(&tex_templ, 0, sizeof(tex_templ));<br>
         tex_templ.target = PIPE_TEXTURE_RECT;<br>
    -   tex_templ.format = PIPE_FORMAT_I8_UNORM;<br>
    +   tex_templ.format = tex_format;<br>
         tex_templ.width0 = 128;<br>
         tex_templ.height0 = 256;<br>
         tex_templ.depth0 = 1;<br>
    --<br>
    1.7.9.5<br>
<br>
    ______________________________<u></u>_________________<br>
    mesa-dev mailing list<br></div></div>
    <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a> <mailto:<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.<u></u>freedesktop.org</a>><br>


    <a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/<u></u>mailman/listinfo/mesa-dev</a><div class="im"><br>
<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/<u></u>mailman/listinfo/mesa-dev</a><br>
</div></blockquote>
<br>
</blockquote></div><br></div>