mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
intel: Remove ARGB internal_format == GL_RGB hacks
Now that XRGB is supported, we don't need to hack around cases of an RGBA format buffer with an internal format of GL_RGB.
This commit is contained in:
parent
b4a6169412
commit
e624b77eb2
4 changed files with 17 additions and 52 deletions
|
|
@ -55,10 +55,7 @@ translate_texture_format(GLuint mesa_format, GLuint internal_format)
|
|||
case MESA_FORMAT_ARGB4444:
|
||||
return MAPSURF_16BIT | MT_16BIT_ARGB4444;
|
||||
case MESA_FORMAT_ARGB8888:
|
||||
if (internal_format == GL_RGB)
|
||||
return MAPSURF_32BIT | MT_32BIT_XRGB8888;
|
||||
else
|
||||
return MAPSURF_32BIT | MT_32BIT_ARGB8888;
|
||||
return MAPSURF_32BIT | MT_32BIT_ARGB8888;
|
||||
case MESA_FORMAT_XRGB8888:
|
||||
return MAPSURF_32BIT | MT_32BIT_XRGB8888;
|
||||
case MESA_FORMAT_YCBCR_REV:
|
||||
|
|
|
|||
|
|
@ -56,10 +56,7 @@ translate_texture_format(gl_format mesa_format, GLuint internal_format,
|
|||
case MESA_FORMAT_ARGB4444:
|
||||
return MAPSURF_16BIT | MT_16BIT_ARGB4444;
|
||||
case MESA_FORMAT_ARGB8888:
|
||||
if (internal_format == GL_RGB)
|
||||
return MAPSURF_32BIT | MT_32BIT_XRGB8888;
|
||||
else
|
||||
return MAPSURF_32BIT | MT_32BIT_ARGB8888;
|
||||
return MAPSURF_32BIT | MT_32BIT_ARGB8888;
|
||||
case MESA_FORMAT_XRGB8888:
|
||||
return MAPSURF_32BIT | MT_32BIT_XRGB8888;
|
||||
case MESA_FORMAT_YCBCR_REV:
|
||||
|
|
|
|||
|
|
@ -94,20 +94,14 @@ static GLuint translate_tex_format( gl_format mesa_format,
|
|||
return BRW_SURFACEFORMAT_R8G8B8_UNORM;
|
||||
|
||||
case MESA_FORMAT_ARGB8888:
|
||||
if (internal_format == GL_RGB)
|
||||
return BRW_SURFACEFORMAT_B8G8R8X8_UNORM;
|
||||
else
|
||||
return BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
|
||||
return BRW_SURFACEFORMAT_B8G8R8A8_UNORM;
|
||||
|
||||
case MESA_FORMAT_XRGB8888:
|
||||
return BRW_SURFACEFORMAT_B8G8R8X8_UNORM;
|
||||
|
||||
case MESA_FORMAT_RGBA8888_REV:
|
||||
_mesa_problem(NULL, "unexpected format in i965:translate_tex_format()");
|
||||
if (internal_format == GL_RGB)
|
||||
return BRW_SURFACEFORMAT_R8G8B8X8_UNORM;
|
||||
else
|
||||
return BRW_SURFACEFORMAT_R8G8B8A8_UNORM;
|
||||
return BRW_SURFACEFORMAT_R8G8B8A8_UNORM;
|
||||
|
||||
case MESA_FORMAT_RGB565:
|
||||
return BRW_SURFACEFORMAT_B5G6R5_UNORM;
|
||||
|
|
|
|||
|
|
@ -638,13 +638,7 @@ intel_set_span_functions(struct intel_context *intel,
|
|||
intel_gttmap_InitPointers_xRGB8888(rb);
|
||||
break;
|
||||
case MESA_FORMAT_ARGB8888:
|
||||
if (rb->_BaseFormat == GL_RGB) {
|
||||
/* XXX remove this code someday when we enable XRGB surfaces */
|
||||
/* 8888 RGBx */
|
||||
intel_gttmap_InitPointers_xRGB8888(rb);
|
||||
} else {
|
||||
intel_gttmap_InitPointers_ARGB8888(rb);
|
||||
}
|
||||
intel_gttmap_InitPointers_ARGB8888(rb);
|
||||
break;
|
||||
case MESA_FORMAT_Z16:
|
||||
intel_gttmap_InitDepthPointers_z16(rb);
|
||||
|
|
@ -731,35 +725,18 @@ intel_set_span_functions(struct intel_context *intel,
|
|||
}
|
||||
break;
|
||||
case MESA_FORMAT_ARGB8888:
|
||||
if (rb->_BaseFormat == GL_RGB) {
|
||||
/* XXX remove this code someday when we enable XRGB surfaces */
|
||||
/* 8888 RGBx */
|
||||
switch (tiling) {
|
||||
case I915_TILING_NONE:
|
||||
default:
|
||||
intelInitPointers_xRGB8888(rb);
|
||||
break;
|
||||
case I915_TILING_X:
|
||||
intel_XTile_InitPointers_xRGB8888(rb);
|
||||
break;
|
||||
case I915_TILING_Y:
|
||||
intel_YTile_InitPointers_xRGB8888(rb);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
/* 8888 RGBA */
|
||||
switch (tiling) {
|
||||
case I915_TILING_NONE:
|
||||
default:
|
||||
intelInitPointers_ARGB8888(rb);
|
||||
break;
|
||||
case I915_TILING_X:
|
||||
intel_XTile_InitPointers_ARGB8888(rb);
|
||||
break;
|
||||
case I915_TILING_Y:
|
||||
intel_YTile_InitPointers_ARGB8888(rb);
|
||||
break;
|
||||
}
|
||||
/* 8888 RGBA */
|
||||
switch (tiling) {
|
||||
case I915_TILING_NONE:
|
||||
default:
|
||||
intelInitPointers_ARGB8888(rb);
|
||||
break;
|
||||
case I915_TILING_X:
|
||||
intel_XTile_InitPointers_ARGB8888(rb);
|
||||
break;
|
||||
case I915_TILING_Y:
|
||||
intel_YTile_InitPointers_ARGB8888(rb);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case MESA_FORMAT_Z16:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue