diff --git a/src/gallium/auxiliary/hud/font.c b/src/gallium/auxiliary/hud/font.c index a372410b109..0173808f9f7 100644 --- a/src/gallium/auxiliary/hud/font.c +++ b/src/gallium/auxiliary/hud/font.c @@ -390,7 +390,7 @@ util_font_create_fixed_8x13(struct pipe_context *pipe, for (i = 0; i < ARRAY_SIZE(formats); i++) { if (screen->is_format_supported(screen, formats[i], - PIPE_TEXTURE_RECT, 0, 0, + PIPE_TEXTURE_2D, 0, 0, PIPE_BIND_SAMPLER_VIEW)) { tex_format = formats[i]; break; @@ -403,7 +403,7 @@ util_font_create_fixed_8x13(struct pipe_context *pipe, } memset(&tex_templ, 0, sizeof(tex_templ)); - tex_templ.target = PIPE_TEXTURE_RECT; + tex_templ.target = PIPE_TEXTURE_2D; tex_templ.format = tex_format; tex_templ.width0 = 128; tex_templ.height0 = 256; diff --git a/src/gallium/auxiliary/hud/font.h b/src/gallium/auxiliary/hud/font.h index cf1c8798403..5269c1456a1 100644 --- a/src/gallium/auxiliary/hud/font.h +++ b/src/gallium/auxiliary/hud/font.h @@ -37,7 +37,7 @@ enum util_font_name { UTIL_FONT_FIXED_8X13 }; -/* The font is stored in a RECT texture. There are 256 glyphs +/* The font is stored in a 2D texture. There are 256 glyphs * drawn in a 16x16 matrix. The texture coordinates of a glyph * within the matrix should be calculated as follows: * diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c index 56af41552ca..5fd3cdfea8d 100644 --- a/src/gallium/auxiliary/hud/hud_context.c +++ b/src/gallium/auxiliary/hud/hud_context.c @@ -1682,11 +1682,11 @@ hud_set_draw_context(struct hud_context *hud, struct cso_context *cso, "FRAG\n" "DCL IN[0], GENERIC[0], LINEAR\n" "DCL SAMP[0]\n" - "DCL SVIEW[0], RECT, FLOAT\n" + "DCL SVIEW[0], 2D, FLOAT\n" "DCL OUT[0], COLOR[0]\n" "DCL TEMP[0]\n" - "TEX TEMP[0], IN[0], SAMP[0], RECT\n" + "TEX TEMP[0], IN[0], SAMP[0], 2D\n" "MOV OUT[0], TEMP[0].xxxx\n" "END\n" }; @@ -1753,6 +1753,7 @@ hud_set_draw_context(struct hud_context *hud, struct cso_context *cso, "DCL CONST[0][0..2]\n" "DCL TEMP[0]\n" "IMM[0] FLT32 { -1, 0, 0, 1 }\n" + "IMM[1] FLT32 { 0.0078125, 0.00390625, 1, 1 }\n" // 1.0 / 128, 1.0 / 256, 1, 1 /* v = in * (xscale, yscale) + (xoffset, yoffset) */ "MAD TEMP[0].xy, IN[0], CONST[0][2].xyyy, CONST[0][1].zwww\n" @@ -1760,7 +1761,7 @@ hud_set_draw_context(struct hud_context *hud, struct cso_context *cso, "MAD OUT[0].xy, TEMP[0], CONST[0][1].xyyy, IMM[0].xxxx\n" "MOV OUT[0].zw, IMM[0]\n" - "MOV OUT[1], IN[1]\n" + "MUL OUT[1], IN[1], IMM[1]\n" "END\n" }; @@ -1935,7 +1936,7 @@ hud_create(struct cso_context *cso, struct st_context_iface *st, hud->font_sampler_state.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE; hud->font_sampler_state.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE; hud->font_sampler_state.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE; - hud->font_sampler_state.normalized_coords = 0; + hud->font_sampler_state.normalized_coords = 1; /* constants */ hud->constbuf.buffer_size = sizeof(hud->constants);