Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (texture->resource.format_flags & WINED3DFMT_FLAG_DECOMPRESS)
- {
- unsigned int dst_row_pitch, dst_slice_pitch;
- void *src_mem;
- void (*decompress)(const BYTE *src, BYTE *dst, unsigned int src_row_pitch, unsigned int src_slice_pitch,
- unsigned int dst_row_pitch, unsigned int dst_slice_pitch,
- unsigned int width, unsigned int height, unsigned int depth);
- decompress = format->decompress;
- format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM, WINED3DUSAGE_TEXTURE);
- f = *format;
- f.decompress = decompress;
- format = &f;
- wined3d_format_calculate_pitch(format, 1, update_w, update_h, &dst_row_pitch, &dst_slice_pitch);
- if (!(converted_mem = heap_calloc(update_d, dst_slice_pitch)))
- {
- ERR("Failed to allocate upload buffer.\n");
- return;
- }
- src_mem = context_map_bo_address(context, &bo, src_slice_pitch,
- GL_PIXEL_UNPACK_BUFFER, WINED3D_MAP_READ);
- format->decompress(src_mem, converted_mem, src_row_pitch, src_slice_pitch,
- dst_row_pitch, dst_slice_pitch, update_w, update_h, update_d);
- context_unmap_bo_address(context, &bo, GL_PIXEL_UNPACK_BUFFER);
- bo.buffer_object = 0;
- bo.addr = converted_mem;
- src_row_pitch = dst_row_pitch;
- src_slice_pitch = dst_slice_pitch;
- texture->resource.format_flags &= ~WINED3DFMT_FLAG_BLOCKS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement