Commit 7b049245 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Always provide P8 GL texture information.

parent bfb5be0f
......@@ -1457,12 +1457,6 @@ static void surface_download_data(struct wined3d_surface *surface, const struct
int src_pitch = 0;
int dst_pitch = 0;
if (format->id == WINED3DFMT_P8_UINT)
{
gl_format = GL_ALPHA;
gl_type = GL_UNSIGNED_BYTE;
}
if (surface->flags & SFLAG_NONPOW2)
{
unsigned char alignment = surface->resource.device->surface_alignment;
......@@ -3211,8 +3205,6 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
const struct wined3d_gl_info *gl_info;
struct wined3d_context *context;
BYTE *mem;
GLint fmt;
GLint type;
BYTE *row, *top, *bottom;
int i;
BOOL srcIsUpsideDown;
......@@ -3246,18 +3238,6 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
srcIsUpsideDown = FALSE;
}
switch (surface->resource.format->id)
{
case WINED3DFMT_P8_UINT:
fmt = GL_ALPHA;
type = GL_UNSIGNED_BYTE;
break;
default:
fmt = surface->resource.format->glFormat;
type = surface->resource.format->glType;
}
if (data.buffer_object)
{
GL_EXTCALL(glBindBufferARB(GL_PIXEL_PACK_BUFFER_ARB, data.buffer_object));
......@@ -3270,7 +3250,8 @@ static void read_from_framebuffer(struct wined3d_surface *surface, DWORD dst_loc
gl_info->gl_ops.gl.p_glReadPixels(0, 0,
surface->resource.width, surface->resource.height,
fmt, type, data.addr);
surface->resource.format->glFormat,
surface->resource.format->glType, data.addr);
checkGLcall("glReadPixels");
/* Reset previous pixel store pack state */
......
......@@ -743,7 +743,7 @@ static const struct wined3d_format_texture_info format_texture_info[] =
{WINED3DFMT_P8_UINT, GL_RGBA, GL_RGBA, 0,
GL_ALPHA, GL_UNSIGNED_BYTE, 0,
0,
ARB_FRAGMENT_PROGRAM, NULL},
0, NULL},
/* Standard ARGB formats */
{WINED3DFMT_B8G8R8_UNORM, GL_RGB8, GL_RGB8, 0,
GL_BGR, GL_UNSIGNED_BYTE, 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment