2015-09-28 22:33:29 +02:00
|
|
|
#pragma once
|
2016-04-20 01:32:27 +02:00
|
|
|
|
2015-09-28 22:33:29 +02:00
|
|
|
#include "../RSXTexture.h"
|
2016-04-20 01:32:27 +02:00
|
|
|
|
2015-09-28 22:33:29 +02:00
|
|
|
#include <vector>
|
2016-04-20 01:32:27 +02:00
|
|
|
#include "Utilities/GSL.h"
|
2015-09-28 22:33:29 +02:00
|
|
|
|
2016-03-13 20:11:19 +01:00
|
|
|
struct rsx_subresource_layout
|
2015-09-28 22:33:29 +02:00
|
|
|
{
|
2016-03-13 20:11:19 +01:00
|
|
|
gsl::span<const gsl::byte> data;
|
|
|
|
|
u16 width_in_block;
|
|
|
|
|
u16 height_in_block;
|
2016-01-25 18:07:24 +01:00
|
|
|
u16 depth;
|
2016-03-13 20:11:19 +01:00
|
|
|
u32 pitch_in_bytes;
|
2015-09-28 22:33:29 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get size to store texture in a linear fashion.
|
|
|
|
|
* Storage is assumed to use a rowPitchAlignement boundary for every row of texture.
|
|
|
|
|
*/
|
2016-06-28 11:58:44 +02:00
|
|
|
size_t get_placed_texture_storage_size(const rsx::texture &texture, size_t row_pitch_alignement, size_t mipmap_alignment = 0x200);
|
|
|
|
|
size_t get_placed_texture_storage_size(const rsx::vertex_texture &texture, size_t row_pitch_alignement, size_t mipmap_alignment = 0x200);
|
2015-09-28 22:33:29 +02:00
|
|
|
|
|
|
|
|
/**
|
2016-03-13 20:11:19 +01:00
|
|
|
* get all rsx_subresource_layout for texture.
|
|
|
|
|
* The subresources are ordered per layer then per mipmap level (as in rsx memory).
|
|
|
|
|
*/
|
|
|
|
|
std::vector<rsx_subresource_layout> get_subresources_layout(const rsx::texture &texture);
|
2016-06-28 11:58:44 +02:00
|
|
|
std::vector<rsx_subresource_layout> get_subresources_layout(const rsx::vertex_texture &texture);
|
2015-10-27 01:11:40 +01:00
|
|
|
|
2016-03-22 19:03:30 +01:00
|
|
|
void upload_texture_subresource(gsl::span<gsl::byte> dst_buffer, const rsx_subresource_layout &src_layout, int format, bool is_swizzled, size_t dst_row_pitch_multiple_of);
|
2016-03-13 20:11:19 +01:00
|
|
|
|
|
|
|
|
u8 get_format_block_size_in_bytes(int format);
|
|
|
|
|
u8 get_format_block_size_in_texel(int format);
|
2016-02-21 16:50:49 +01:00
|
|
|
|
2015-10-27 01:11:40 +01:00
|
|
|
/**
|
|
|
|
|
* Get number of bytes occupied by texture in RSX mem
|
|
|
|
|
*/
|
2015-12-17 18:31:27 +01:00
|
|
|
size_t get_texture_size(const rsx::texture &texture);
|
2016-06-28 11:58:44 +02:00
|
|
|
size_t get_texture_size(const rsx::vertex_texture &texture);
|