Advertisement
Conmanx360

Untitled

Jul 16th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. if (texture->resource.format_flags & WINED3DFMT_FLAG_DECOMPRESS)
  2. {
  3. unsigned int dst_row_pitch, dst_slice_pitch;
  4. void *src_mem;
  5. void (*decompress)(const BYTE *src, BYTE *dst, unsigned int src_row_pitch, unsigned int src_slice_pitch,
  6. unsigned int dst_row_pitch, unsigned int dst_slice_pitch,
  7. unsigned int width, unsigned int height, unsigned int depth);
  8.  
  9. decompress = format->decompress;
  10. format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM, WINED3DUSAGE_TEXTURE);
  11. f = *format;
  12. f.decompress = decompress;
  13. format = &f;
  14.  
  15. wined3d_format_calculate_pitch(format, 1, update_w, update_h, &dst_row_pitch, &dst_slice_pitch);
  16.  
  17. if (!(converted_mem = heap_calloc(update_d, dst_slice_pitch)))
  18. {
  19. ERR("Failed to allocate upload buffer.\n");
  20. return;
  21. }
  22. src_mem = context_map_bo_address(context, &bo, src_slice_pitch,
  23. GL_PIXEL_UNPACK_BUFFER, WINED3D_MAP_READ);
  24. format->decompress(src_mem, converted_mem, src_row_pitch, src_slice_pitch,
  25. dst_row_pitch, dst_slice_pitch, update_w, update_h, update_d);
  26. context_unmap_bo_address(context, &bo, GL_PIXEL_UNPACK_BUFFER);
  27.  
  28. bo.buffer_object = 0;
  29. bo.addr = converted_mem;
  30. src_row_pitch = dst_row_pitch;
  31. src_slice_pitch = dst_slice_pitch;
  32. texture->resource.format_flags &= ~WINED3DFMT_FLAG_BLOCKS;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement