This came from the "kill it with fire" discussion at XDS 2010.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
case GL_INTENSITY8:
return MESA_FORMAT_I8;
- case GL_COLOR_INDEX:
- case GL_COLOR_INDEX1_EXT:
- case GL_COLOR_INDEX2_EXT:
- case GL_COLOR_INDEX4_EXT:
- case GL_COLOR_INDEX12_EXT:
- case GL_COLOR_INDEX16_EXT:
- case GL_COLOR_INDEX8_EXT:
- return MESA_FORMAT_CI8;
-
default:
assert(0);
}
case MESA_FORMAT_L8:
case MESA_FORMAT_I8:
case MESA_FORMAT_RGB332:
- case MESA_FORMAT_CI8:
return NV04_SWIZZLED_SURFACE_FORMAT_COLOR_Y8;
case MESA_FORMAT_RGB565:
case MESA_FORMAT_L8:
case MESA_FORMAT_I8:
case MESA_FORMAT_RGB332:
- case MESA_FORMAT_CI8:
return NV04_CONTEXT_SURFACES_2D_FORMAT_Y8;
case MESA_FORMAT_RGB565:
case MESA_FORMAT_L8:
case MESA_FORMAT_I8:
case MESA_FORMAT_RGB332:
- case MESA_FORMAT_CI8:
return NV04_GDI_RECTANGLE_TEXT_COLOR_FORMAT_A8R8G8B8;
case MESA_FORMAT_RGB565:
case MESA_FORMAT_L8:
case MESA_FORMAT_I8:
case MESA_FORMAT_RGB332:
- case MESA_FORMAT_CI8:
return NV03_SCALED_IMAGE_FROM_MEMORY_COLOR_FORMAT_AY8;
case MESA_FORMAT_RGB565:
case MESA_FORMAT_L8:
return NV10_3D_TEX_FORMAT_FORMAT_L8;
- case MESA_FORMAT_CI8:
- return NV10_3D_TEX_FORMAT_FORMAT_INDEX8;
-
default:
assert(0);
}
case MESA_FORMAT_L8:
return NV20_3D_TEX_FORMAT_FORMAT_L8;
- case MESA_FORMAT_CI8:
- return NV20_3D_TEX_FORMAT_FORMAT_INDEX8;
-
default:
assert(0);
}
return R300_EASY_TX_FORMAT(X, X, X, ONE, X8);
case MESA_FORMAT_I8:
return R300_EASY_TX_FORMAT(X, X, X, X, X8);
- case MESA_FORMAT_CI8:
- return R300_EASY_TX_FORMAT(X, X, X, X, X8);
case MESA_FORMAT_YCBCR:
return R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8) | R300_TX_FORMAT_YUV_MODE;
case MESA_FORMAT_YCBCR_REV:
case MESA_FORMAT_RGB332:
case MESA_FORMAT_A8:
case MESA_FORMAT_I8:
- case MESA_FORMAT_CI8:
case MESA_FORMAT_L8:
case MESA_FORMAT_RGBA_FLOAT32:
case MESA_FORMAT_RGBA_FLOAT16:
source_format = 1;
break;
case MESA_FORMAT_I8:
- case MESA_FORMAT_CI8:
format = COLOR_8;
comp_swap = SWAP_STD;
number_type = NUMBER_UNORM;
SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
break;
case MESA_FORMAT_I8: /* X, X, X, X */
- case MESA_FORMAT_CI8:
SETfield(sq_tex_resource7, FMT_8,
EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift,
EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask);
source_format = 1;
break;
case MESA_FORMAT_I8:
- case MESA_FORMAT_CI8:
format = COLOR_8;
comp_swap = SWAP_STD;
number_type = NUMBER_UNORM;
SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
break;
case MESA_FORMAT_I8: /* X, X, X, X */
- case MESA_FORMAT_CI8:
SETfield(t->SQ_TEX_RESOURCE7, FMT_8,
EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_shift,
EG_SQ_TEX_RESOURCE_WORD7_0__DATA_FORMAT_mask);
case MESA_FORMAT_RGB332:
case MESA_FORMAT_A8:
case MESA_FORMAT_I8:
- case MESA_FORMAT_CI8:
case MESA_FORMAT_L8:
case MESA_FORMAT_RGBA_FLOAT32:
case MESA_FORMAT_RGBA_FLOAT16:
SETfield(cb_color0_info, NUMBER_UNORM, NUMBER_TYPE_shift, NUMBER_TYPE_mask);
break;
case MESA_FORMAT_I8:
- case MESA_FORMAT_CI8:
format = COLOR_8;
comp_swap = SWAP_STD;
SETbit(cb_color0_info, SOURCE_FORMAT_bit);
SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
break;
case MESA_FORMAT_I8: /* X, X, X, X */
- case MESA_FORMAT_CI8:
SETfield(sq_tex_resource1, FMT_8,
SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
case MESA_FORMAT_RGB332:
case MESA_FORMAT_A8:
case MESA_FORMAT_I8:
- case MESA_FORMAT_CI8:
case MESA_FORMAT_L8:
case MESA_FORMAT_RGBA_FLOAT32:
case MESA_FORMAT_RGBA_FLOAT16:
SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
break;
case MESA_FORMAT_I8: /* X, X, X, X */
- case MESA_FORMAT_CI8:
SETfield(t->SQ_TEX_RESOURCE1, FMT_8,
SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
SETbit(r700->render_target[id].CB_COLOR0_INFO.u32All, SOURCE_FORMAT_bit);
break;
case MESA_FORMAT_I8:
- case MESA_FORMAT_CI8:
format = COLOR_8;
comp_swap = SWAP_STD;
number_type = NUMBER_UNORM;