Advertisement
Conmanx360

Untitled

Jul 18th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. static void convert_dxt1_b8g8r8a8_unorm(const BYTE *src, BYTE *dst, UINT src_row_pitch, UINT src_slice_pitch,
  2. UINT dst_row_pitch, UINT dst_slice_pitch, UINT width, UINT height, UINT depth);
  3. static void convert_dxt3_b8g8r8a8_unorm(const BYTE *src, BYTE *dst, UINT src_row_pitch, UINT src_slice_pitch,
  4. UINT dst_row_pitch, UINT dst_slice_pitch, UINT width, UINT height, UINT depth);
  5. static void convert_dxt5_b8g8r8a8_unorm(const BYTE *src, BYTE *dst, UINT src_row_pitch, UINT src_slice_pitch,
  6. UINT dst_row_pitch, UINT dst_slice_pitch, UINT width, UINT height, UINT depth);
  7.  
  8. struct wined3d_format_decompress_info
  9. {
  10. enum wined3d_format_id id;
  11. DWORD flags;
  12. void (*decompress)(const BYTE *src, BYTE *dst, unsigned int src_row_pitch, unsigned int src_slice_pitch,
  13. unsigned int dst_row_pitch, unsigned int dst_slice_pitch,
  14. unsigned int width, unsigned int height, unsigned int depth);
  15. };
  16.  
  17. static const struct wined3d_format_decompress_info format_decompress_info[] =
  18. {
  19. {WINED3DFMT_DXT1, WINED3DFMT_FLAG_DECOMPRESS, convert_dxt1_b8g8r8a8_unorm},
  20. {WINED3DFMT_DXT2, WINED3DFMT_FLAG_DECOMPRESS, convert_dxt3_b8g8r8a8_unorm},
  21. {WINED3DFMT_DXT3, WINED3DFMT_FLAG_DECOMPRESS, convert_dxt3_b8g8r8a8_unorm},
  22. {WINED3DFMT_DXT4, WINED3DFMT_FLAG_DECOMPRESS, convert_dxt5_b8g8r8a8_unorm},
  23. {WINED3DFMT_DXT5, WINED3DFMT_FLAG_DECOMPRESS, convert_dxt5_b8g8r8a8_unorm},
  24. {WINED3DFMT_BC1_UNORM, WINED3DFMT_FLAG_DECOMPRESS, convert_dxt1_b8g8r8a8_unorm},
  25. {WINED3DFMT_BC2_UNORM, WINED3DFMT_FLAG_DECOMPRESS, convert_dxt3_b8g8r8a8_unorm},
  26. {WINED3DFMT_BC3_UNORM, WINED3DFMT_FLAG_DECOMPRESS, convert_dxt5_b8g8r8a8_unorm},
  27. };
  28.  
  29. ---This part is in function init_format_base_info(struct wined3d_gl_info *gl_info)
  30.  
  31. for (i = 0; i < ARRAY_SIZE(format_decompress_info); ++i)
  32. {
  33. if (!(format = get_format_internal(gl_info, format_decompress_info[i].id)))
  34. goto fail;
  35.  
  36. format->flags[WINED3D_GL_RES_TYPE_TEX_3D] |= format_decompress_info[i].flags;
  37. format->decompress = format_decompress_info[i].decompress;
  38.  
  39. if (format->decompress)
  40. FIXME("format->decompress is fine here.\n");
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement