case GL_RGB5:
case GL_RGB4:
case GL_R3_G3_B2:
-/* return &_mesa_texformat_rgb888; */
+ /* Broadwater doesn't support RGB textures, so these must be
+ * stored as ARGB.
+ */
return &_mesa_texformat_argb8888;
case GL_ALPHA:
/* Layout_below: step right after second mipmap.
*/
- if (level == mt->first_level + 1)
+ if (level == mt->first_level + 1) {
x += mt->pitch / 2;
+ x = (x + 3) & ~ 3;
+ }
else {
y += img_height;
+ y += align_h - 1;
+ y &= ~(align_h - 1);
}
-
width = minify(width);
height = minify(height);
}
switch (state[1]) {
case STATE_NORMAL_SCALE:
return _NEW_MODELVIEW;
+ case STATE_TEXRECT_SCALE:
+ return _NEW_TEXTURE;
default:
assert(0);
return 0;
static void precalc_tex( struct brw_wm_compile *c,
const struct prog_instruction *inst )
{
+ struct prog_src_register coord;
+ struct prog_dst_register tmpcoord;
+
+ if (inst->TexSrcTarget == TEXTURE_RECT_INDEX) {
+ struct prog_src_register scale =
+ search_or_add_param6( c,
+ STATE_INTERNAL,
+ STATE_TEXRECT_SCALE,
+ inst->TexSrcUnit,
+ 0,0,0 );
+
+ tmpcoord = get_temp(c);
+
+ /* coord.xy = MUL inst->SrcReg[0], { 1/width, 1/height }
+ */
+ emit_op(c,
+ OPCODE_MUL,
+ tmpcoord,
+ 0, 0, 0,
+ inst->SrcReg[0],
+ scale,
+ src_undef());
+
+ coord = src_reg_from_dst(tmpcoord);
+ }
+ else {
+ coord = inst->SrcReg[0];
+ }
+
/* Need to emit YUV texture conversions by hand. Probably need to
* do this here - the alternative is in brw_wm_emit.c, but the
* conversion requires allocating a temporary variable which we
inst->SaturateMode,
inst->TexSrcUnit,
inst->TexSrcTarget,
- inst->SrcReg[0],
+ coord,
src_undef(),
src_undef());
}
src_swizzle1(tmpsrc, Z),
src_swizzle1(C1, W),
src_swizzle1(src_reg_from_dst(dst), Y));
+
+ release_temp(c, tmp);
}
+
+ if (inst->TexSrcTarget == GL_TEXTURE_RECTANGLE_NV)
+ release_temp(c, tmpcoord);
}
{ "GL_ARB_texture_env_combine", NULL },
{ "GL_ARB_texture_env_dot3", NULL },
{ "GL_ARB_texture_mirrored_repeat", NULL },
+ { "GL_ARB_texture_non_power_of_two", NULL },
+ { "GL_ARB_texture_rectangle", NULL },
+ { "GL_NV_texture_rectangle", NULL },
+ { "GL_EXT_texture_rectangle", NULL },
{ "GL_ARB_texture_rectangle", NULL },
{ "GL_ARB_vertex_buffer_object", GL_ARB_vertex_buffer_object_functions },
{ "GL_ARB_vertex_program", GL_ARB_vertex_program_functions },