wined3d: Rename yuv to complex in order to prepare for 8-bit palette fixups using the same code.

This commit is contained in:
Roderick Colenbrander 2010-03-02 16:21:45 +01:00 committed by Alexandre Julliard
parent 2d76bf2e69
commit 922ad80f42
5 changed files with 69 additions and 69 deletions

View File

@ -1161,10 +1161,10 @@ static void gen_color_correction(struct wined3d_shader_buffer *buffer, const cha
{
DWORD mask;
if (is_yuv_fixup(fixup))
if (is_complex_fixup(fixup))
{
enum yuv_fixup yuv_fixup = get_yuv_fixup(fixup);
FIXME("YUV fixup (%#x) not supported\n", yuv_fixup);
enum complex_fixup complex_fixup = get_complex_fixup(fixup);
FIXME("Complex fixup (%#x) not supported\n", complex_fixup);
return;
}
@ -4673,8 +4673,8 @@ static BOOL shader_arb_color_fixup_supported(struct color_fixup_desc fixup)
dump_color_fixup_desc(fixup);
}
/* We support everything except YUV conversions. */
if (!is_yuv_fixup(fixup))
/* We support everything except complex conversions. */
if (!is_complex_fixup(fixup))
{
TRACE("[OK]\n");
return TRUE;
@ -6260,13 +6260,13 @@ static void arbfp_blit_free(IWineD3DDevice *iface) {
device->blit_priv = NULL;
}
static BOOL gen_planar_yuv_read(struct wined3d_shader_buffer *buffer, enum yuv_fixup yuv_fixup,
static BOOL gen_planar_yuv_read(struct wined3d_shader_buffer *buffer, enum complex_fixup fixup,
GLenum textype, char *luminance)
{
char chroma;
const char *tex, *texinstr;
if (yuv_fixup == YUV_FIXUP_UYVY) {
if (fixup == COMPLEX_FIXUP_UYVY) {
chroma = 'x';
*luminance = 'w';
} else {
@ -6495,7 +6495,7 @@ static BOOL gen_yv12_read(struct wined3d_shader_buffer *buffer, GLenum textype,
}
/* Context activation is done by the caller. */
static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum yuv_fixup yuv_fixup, GLenum textype)
static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum complex_fixup yuv_fixup, GLenum textype)
{
GLenum shader;
struct wined3d_shader_buffer buffer;
@ -6568,8 +6568,8 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum yuv_fixup yuv_fixu
switch (yuv_fixup)
{
case YUV_FIXUP_UYVY:
case YUV_FIXUP_YUY2:
case COMPLEX_FIXUP_UYVY:
case COMPLEX_FIXUP_YUY2:
if (!gen_planar_yuv_read(&buffer, yuv_fixup, textype, &luminance_component))
{
shader_buffer_free(&buffer);
@ -6577,7 +6577,7 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum yuv_fixup yuv_fixu
}
break;
case YUV_FIXUP_YV12:
case COMPLEX_FIXUP_YV12:
if (!gen_yv12_read(&buffer, textype, &luminance_component))
{
shader_buffer_free(&buffer);
@ -6629,17 +6629,17 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum yuv_fixup yuv_fixu
switch (yuv_fixup)
{
case YUV_FIXUP_YUY2:
case COMPLEX_FIXUP_YUY2:
if (textype == GL_TEXTURE_RECTANGLE_ARB) priv->yuy2_rect_shader = shader;
else priv->yuy2_2d_shader = shader;
break;
case YUV_FIXUP_UYVY:
case COMPLEX_FIXUP_UYVY:
if (textype == GL_TEXTURE_RECTANGLE_ARB) priv->uyvy_rect_shader = shader;
else priv->uyvy_2d_shader = shader;
break;
case YUV_FIXUP_YV12:
case COMPLEX_FIXUP_YV12:
if (textype == GL_TEXTURE_RECTANGLE_ARB) priv->yv12_rect_shader = shader;
else priv->yv12_2d_shader = shader;
break;
@ -6656,9 +6656,9 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, const struct GlPixelFormatD
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) iface;
float size[4] = {width, height, 1, 1};
struct arbfp_blit_priv *priv = device->blit_priv;
enum yuv_fixup yuv_fixup;
enum complex_fixup fixup;
if (!is_yuv_fixup(format_desc->color_fixup))
if (!is_complex_fixup(format_desc->color_fixup))
{
TRACE("Fixup:\n");
dump_color_fixup_desc(format_desc->color_fixup);
@ -6670,24 +6670,24 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, const struct GlPixelFormatD
return WINED3D_OK;
}
yuv_fixup = get_yuv_fixup(format_desc->color_fixup);
fixup = get_complex_fixup(format_desc->color_fixup);
switch(yuv_fixup)
switch(fixup)
{
case YUV_FIXUP_YUY2:
case COMPLEX_FIXUP_YUY2:
shader = textype == GL_TEXTURE_RECTANGLE_ARB ? priv->yuy2_rect_shader : priv->yuy2_2d_shader;
break;
case YUV_FIXUP_UYVY:
case COMPLEX_FIXUP_UYVY:
shader = textype == GL_TEXTURE_RECTANGLE_ARB ? priv->uyvy_rect_shader : priv->uyvy_2d_shader;
break;
case YUV_FIXUP_YV12:
case COMPLEX_FIXUP_YV12:
shader = textype == GL_TEXTURE_RECTANGLE_ARB ? priv->yv12_rect_shader : priv->yv12_2d_shader;
break;
default:
FIXME("Unsupported YUV fixup %#x, not setting a shader\n", yuv_fixup);
FIXME("Unsupported YUV fixup %#x, not setting a shader\n", fixup);
ENTER_GL();
glEnable(textype);
checkGLcall("glEnable(textype)");
@ -6695,7 +6695,7 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, const struct GlPixelFormatD
return E_NOTIMPL;
}
if (!shader) shader = gen_yuv_shader(device, yuv_fixup, textype);
if (!shader) shader = gen_yuv_shader(device, fixup, textype);
ENTER_GL();
glEnable(GL_FRAGMENT_PROGRAM_ARB);
@ -6734,7 +6734,7 @@ static void arbfp_blit_unset(IWineD3DDevice *iface) {
static BOOL arbfp_blit_color_fixup_supported(struct color_fixup_desc fixup)
{
enum yuv_fixup yuv_fixup;
enum complex_fixup complex_fixup;
if (TRACE_ON(d3d_shader) && TRACE_ON(d3d))
{
@ -6749,23 +6749,23 @@ static BOOL arbfp_blit_color_fixup_supported(struct color_fixup_desc fixup)
}
/* We only support YUV conversions. */
if (!is_yuv_fixup(fixup))
if (!is_complex_fixup(fixup))
{
TRACE("[FAILED]\n");
return FALSE;
}
yuv_fixup = get_yuv_fixup(fixup);
switch(yuv_fixup)
complex_fixup = get_complex_fixup(fixup);
switch(complex_fixup)
{
case YUV_FIXUP_YUY2:
case YUV_FIXUP_UYVY:
case YUV_FIXUP_YV12:
case COMPLEX_FIXUP_YUY2:
case COMPLEX_FIXUP_UYVY:
case COMPLEX_FIXUP_YV12:
TRACE("[OK]\n");
return TRUE;
default:
FIXME("Unsupported YUV fixup %#x\n", yuv_fixup);
FIXME("Unsupported YUV fixup %#x\n", complex_fixup);
TRACE("[FAILED]\n");
return FALSE;
}

View File

@ -1829,10 +1829,10 @@ static void shader_glsl_color_correction(const struct wined3d_shader_instruction
if (!mask) return; /* Nothing to do */
if (is_yuv_fixup(fixup))
if (is_complex_fixup(fixup))
{
enum yuv_fixup yuv_fixup = get_yuv_fixup(fixup);
FIXME("YUV fixup (%#x) not supported\n", yuv_fixup);
enum complex_fixup complex_fixup = get_complex_fixup(fixup);
FIXME("Complex fixup (%#x) not supported\n",complex_fixup);
return;
}
@ -4907,7 +4907,7 @@ static BOOL shader_glsl_color_fixup_supported(struct color_fixup_desc fixup)
}
/* We support everything except YUV conversions. */
if (!is_yuv_fixup(fixup))
if (!is_complex_fixup(fixup))
{
TRACE("[OK]\n");
return TRUE;

View File

@ -1407,7 +1407,7 @@ static BOOL shader_none_color_fixup_supported(struct color_fixup_desc fixup)
}
/* Faked to make some apps happy. */
if (!is_yuv_fixup(fixup))
if (!is_complex_fixup(fixup))
{
TRACE("[OK]\n");
return TRUE;

View File

@ -1088,15 +1088,15 @@ static void apply_format_fixups(struct wined3d_gl_info *gl_info)
if (!gl_info->supported[APPLE_YCBCR_422])
{
idx = getFmtIdx(WINED3DFMT_YUY2);
gl_info->gl_formats[idx].color_fixup = create_yuv_fixup_desc(YUV_FIXUP_YUY2);
gl_info->gl_formats[idx].color_fixup = create_complex_fixup_desc(COMPLEX_FIXUP_YUY2);
idx = getFmtIdx(WINED3DFMT_UYVY);
gl_info->gl_formats[idx].color_fixup = create_yuv_fixup_desc(YUV_FIXUP_UYVY);
gl_info->gl_formats[idx].color_fixup = create_complex_fixup_desc(COMPLEX_FIXUP_UYVY);
}
idx = getFmtIdx(WINED3DFMT_YV12);
gl_info->gl_formats[idx].heightscale = 1.5f;
gl_info->gl_formats[idx].color_fixup = create_yuv_fixup_desc(YUV_FIXUP_YV12);
gl_info->gl_formats[idx].color_fixup = create_complex_fixup_desc(COMPLEX_FIXUP_YV12);
if (gl_info->supported[ARB_VERTEX_ARRAY_BGRA])
{
@ -1913,8 +1913,8 @@ static const char *debug_fixup_channel_source(enum fixup_channel_source source)
WINED3D_TO_STR(CHANNEL_SOURCE_Y);
WINED3D_TO_STR(CHANNEL_SOURCE_Z);
WINED3D_TO_STR(CHANNEL_SOURCE_W);
WINED3D_TO_STR(CHANNEL_SOURCE_YUV0);
WINED3D_TO_STR(CHANNEL_SOURCE_YUV1);
WINED3D_TO_STR(CHANNEL_SOURCE_COMPLEX0);
WINED3D_TO_STR(CHANNEL_SOURCE_COMPLEX1);
#undef WINED3D_TO_STR
default:
FIXME("Unrecognized fixup_channel_source %#x\n", source);
@ -1922,26 +1922,26 @@ static const char *debug_fixup_channel_source(enum fixup_channel_source source)
}
}
static const char *debug_yuv_fixup(enum yuv_fixup yuv_fixup)
static const char *debug_complex_fixup(enum complex_fixup fixup)
{
switch(yuv_fixup)
switch(fixup)
{
#define WINED3D_TO_STR(x) case x: return #x
WINED3D_TO_STR(YUV_FIXUP_YUY2);
WINED3D_TO_STR(YUV_FIXUP_UYVY);
WINED3D_TO_STR(YUV_FIXUP_YV12);
WINED3D_TO_STR(COMPLEX_FIXUP_YUY2);
WINED3D_TO_STR(COMPLEX_FIXUP_UYVY);
WINED3D_TO_STR(COMPLEX_FIXUP_YV12);
#undef WINED3D_TO_STR
default:
FIXME("Unrecognized YUV fixup %#x\n", yuv_fixup);
FIXME("Unrecognized complex fixup %#x\n", fixup);
return "unrecognized";
}
}
void dump_color_fixup_desc(struct color_fixup_desc fixup)
{
if (is_yuv_fixup(fixup))
if (is_complex_fixup(fixup))
{
TRACE("\tYUV: %s\n", debug_yuv_fixup(get_yuv_fixup(fixup)));
TRACE("\tComplex: %s\n", debug_complex_fixup(get_complex_fixup(fixup)));
return;
}

View File

@ -61,15 +61,15 @@ enum fixup_channel_source
CHANNEL_SOURCE_Y = 3,
CHANNEL_SOURCE_Z = 4,
CHANNEL_SOURCE_W = 5,
CHANNEL_SOURCE_YUV0 = 6,
CHANNEL_SOURCE_YUV1 = 7,
CHANNEL_SOURCE_COMPLEX0 = 6,
CHANNEL_SOURCE_COMPLEX1 = 7,
};
enum yuv_fixup
enum complex_fixup
{
YUV_FIXUP_YUY2 = 0,
YUV_FIXUP_UYVY = 1,
YUV_FIXUP_YV12 = 2,
COMPLEX_FIXUP_YUY2 = 0,
COMPLEX_FIXUP_UYVY = 1,
COMPLEX_FIXUP_YV12 = 2,
};
#include <pshpack2.h>
@ -103,14 +103,14 @@ static inline struct color_fixup_desc create_color_fixup_desc(
return fixup;
}
static inline struct color_fixup_desc create_yuv_fixup_desc(enum yuv_fixup yuv_fixup)
static inline struct color_fixup_desc create_complex_fixup_desc(enum complex_fixup complex_fixup)
{
struct color_fixup_desc fixup =
{
0, yuv_fixup & (1 << 0) ? CHANNEL_SOURCE_YUV1 : CHANNEL_SOURCE_YUV0,
0, yuv_fixup & (1 << 1) ? CHANNEL_SOURCE_YUV1 : CHANNEL_SOURCE_YUV0,
0, yuv_fixup & (1 << 2) ? CHANNEL_SOURCE_YUV1 : CHANNEL_SOURCE_YUV0,
0, yuv_fixup & (1 << 3) ? CHANNEL_SOURCE_YUV1 : CHANNEL_SOURCE_YUV0,
0, complex_fixup & (1 << 0) ? CHANNEL_SOURCE_COMPLEX1 : CHANNEL_SOURCE_COMPLEX0,
0, complex_fixup & (1 << 1) ? CHANNEL_SOURCE_COMPLEX1 : CHANNEL_SOURCE_COMPLEX0,
0, complex_fixup & (1 << 2) ? CHANNEL_SOURCE_COMPLEX1 : CHANNEL_SOURCE_COMPLEX0,
0, complex_fixup & (1 << 3) ? CHANNEL_SOURCE_COMPLEX1 : CHANNEL_SOURCE_COMPLEX0,
};
return fixup;
}
@ -120,19 +120,19 @@ static inline BOOL is_identity_fixup(struct color_fixup_desc fixup)
return !memcmp(&fixup, &COLOR_FIXUP_IDENTITY, sizeof(fixup));
}
static inline BOOL is_yuv_fixup(struct color_fixup_desc fixup)
static inline BOOL is_complex_fixup(struct color_fixup_desc fixup)
{
return fixup.x_source == CHANNEL_SOURCE_YUV0 || fixup.x_source == CHANNEL_SOURCE_YUV1;
return fixup.x_source == CHANNEL_SOURCE_COMPLEX0 || fixup.x_source == CHANNEL_SOURCE_COMPLEX1;
}
static inline enum yuv_fixup get_yuv_fixup(struct color_fixup_desc fixup)
static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup)
{
enum yuv_fixup yuv_fixup = 0;
if (fixup.x_source == CHANNEL_SOURCE_YUV1) yuv_fixup |= (1 << 0);
if (fixup.y_source == CHANNEL_SOURCE_YUV1) yuv_fixup |= (1 << 1);
if (fixup.z_source == CHANNEL_SOURCE_YUV1) yuv_fixup |= (1 << 2);
if (fixup.w_source == CHANNEL_SOURCE_YUV1) yuv_fixup |= (1 << 3);
return yuv_fixup;
enum complex_fixup complex_fixup = 0;
if (fixup.x_source == CHANNEL_SOURCE_COMPLEX1) complex_fixup |= (1 << 0);
if (fixup.y_source == CHANNEL_SOURCE_COMPLEX1) complex_fixup |= (1 << 1);
if (fixup.z_source == CHANNEL_SOURCE_COMPLEX1) complex_fixup |= (1 << 2);
if (fixup.w_source == CHANNEL_SOURCE_COMPLEX1) complex_fixup |= (1 << 3);
return complex_fixup;
}
void *wined3d_rb_alloc(size_t size) DECLSPEC_HIDDEN;