diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 073bc5b5834..7fefd516908 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -669,6 +669,13 @@ void wined3d_resource_memory_colour_fill(struct wined3d_resource *resource, } break; + case 8: + case 12: + case 16: + for (x = 0; x < w; ++x) + memcpy(((uint8_t *)map->data) + x * bpp, c, bpp); + break; + default: FIXME("Not implemented for bpp %u.\n", bpp); return; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 6fe792c015f..6d785c461d4 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -6116,6 +6116,27 @@ void wined3d_format_convert_from_float(const struct wined3d_format *format, return; } + /* 32 bit float formats. We don't handle D32_FLOAT and D32_FLOAT_S8X24_UINT for now. */ + if ((format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FLOAT) && format->red_size == 32) + { + float *ret_f = ret; + + switch (format->byte_count) + { + case 16: ret_f[3] = color->a; + case 12: ret_f[2] = color->b; + case 8: ret_f[1] = color->g; + case 4: ret_f[0] = color->r; + break; + + default: + ERR("Unexpected byte count %u, format %s.\n", format->byte_count, debug_d3dformat(format_id)); + break; + } + + return; + } + FIXME("Conversion for format %s not implemented.\n", debug_d3dformat(format_id)); }