2020-12-05 13:08:24 +01:00
|
|
|
#pragma once
|
2018-09-29 00:12:00 +02:00
|
|
|
#include "gcm_enums.h"
|
2014-02-21 14:21:08 +01:00
|
|
|
|
2015-10-04 00:45:26 +02:00
|
|
|
namespace rsx
|
2014-02-21 14:21:08 +01:00
|
|
|
{
|
2016-09-19 03:25:49 +02:00
|
|
|
class fragment_texture
|
2015-10-04 00:45:26 +02:00
|
|
|
{
|
|
|
|
|
protected:
|
2016-07-20 18:23:55 +02:00
|
|
|
const u8 m_index;
|
2021-04-19 10:11:24 +02:00
|
|
|
std::array<u32, 0x10000 / 4>& registers;
|
2015-10-04 00:45:26 +02:00
|
|
|
|
|
|
|
|
public:
|
2021-04-19 10:11:24 +02:00
|
|
|
fragment_texture(u8 idx, std::array<u32, 0x10000 / 4>& r)
|
|
|
|
|
: m_index(idx)
|
|
|
|
|
, registers(r)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2016-09-19 03:25:49 +02:00
|
|
|
fragment_texture() = delete;
|
2016-06-26 23:37:02 +02:00
|
|
|
|
2015-10-04 00:45:26 +02:00
|
|
|
// Offset
|
|
|
|
|
u32 offset() const;
|
|
|
|
|
|
|
|
|
|
// Format
|
2020-12-24 16:01:15 +01:00
|
|
|
u8 location() const;
|
2015-10-04 00:45:26 +02:00
|
|
|
bool cubemap() const;
|
2020-12-24 16:01:15 +01:00
|
|
|
u8 border_type() const;
|
|
|
|
|
rsx::texture_dimension dimension() const;
|
|
|
|
|
|
|
|
|
|
// 2D texture can be either plane or cubemap texture depending on cubemap bit.
|
|
|
|
|
// Since cubemap is a format per se in all gfx API this function directly returns
|
|
|
|
|
// cubemap as a separate dimension.
|
2016-03-30 21:52:29 +02:00
|
|
|
rsx::texture_dimension_extended get_extended_texture_dimension() const;
|
2020-12-24 16:01:15 +01:00
|
|
|
u8 format() const;
|
2016-03-29 18:24:25 +02:00
|
|
|
bool is_compressed_format() const;
|
2020-12-24 16:01:15 +01:00
|
|
|
u16 mipmap() const;
|
|
|
|
|
|
|
|
|
|
// mipmap() returns value from register which can be higher than the actual number of mipmap level.
|
|
|
|
|
// This function clamp the result with the mipmap count allowed by texture size.
|
2016-03-25 17:44:03 +01:00
|
|
|
u16 get_exact_mipmap_count() const;
|
2015-10-04 00:45:26 +02:00
|
|
|
|
|
|
|
|
// Address
|
2016-03-30 18:55:43 +02:00
|
|
|
rsx::texture_wrap_mode wrap_s() const;
|
|
|
|
|
rsx::texture_wrap_mode wrap_t() const;
|
|
|
|
|
rsx::texture_wrap_mode wrap_r() const;
|
2019-04-15 19:39:42 +02:00
|
|
|
rsx::comparison_function zfunc() const;
|
2015-10-04 00:45:26 +02:00
|
|
|
u8 unsigned_remap() const;
|
|
|
|
|
u8 gamma() const;
|
|
|
|
|
u8 aniso_bias() const;
|
|
|
|
|
u8 signed_remap() const;
|
|
|
|
|
|
|
|
|
|
// Control0
|
|
|
|
|
bool enabled() const;
|
2019-10-16 22:21:30 +02:00
|
|
|
f32 min_lod() const;
|
|
|
|
|
f32 max_lod() const;
|
2020-12-24 16:01:15 +01:00
|
|
|
rsx::texture_max_anisotropy max_aniso() const;
|
2015-10-04 00:45:26 +02:00
|
|
|
bool alpha_kill_enabled() const;
|
|
|
|
|
|
|
|
|
|
// Control1
|
|
|
|
|
u32 remap() const;
|
|
|
|
|
|
2017-03-05 12:58:53 +01:00
|
|
|
/**
|
|
|
|
|
* returns a pair of arrays
|
|
|
|
|
* First array is a redirection table into the channel indices
|
|
|
|
|
* Second array is a lookup reference deciding whether to use the redirection table or use constants 0 and 1
|
|
|
|
|
* Both arrays have components in A-R-G-B format
|
|
|
|
|
*/
|
|
|
|
|
std::pair<std::array<u8, 4>, std::array<u8, 4>> decoded_remap() const;
|
|
|
|
|
|
2015-10-04 00:45:26 +02:00
|
|
|
// Filter
|
2019-10-16 22:21:30 +02:00
|
|
|
f32 bias() const;
|
2020-12-24 16:01:15 +01:00
|
|
|
rsx::texture_minify_filter min_filter() const;
|
|
|
|
|
rsx::texture_magnify_filter mag_filter() const;
|
|
|
|
|
u8 convolution_filter() const;
|
|
|
|
|
u8 argb_signed() const;
|
2015-10-04 00:45:26 +02:00
|
|
|
bool a_signed() const;
|
|
|
|
|
bool r_signed() const;
|
|
|
|
|
bool g_signed() const;
|
|
|
|
|
bool b_signed() const;
|
|
|
|
|
|
|
|
|
|
// Image Rect
|
|
|
|
|
u16 width() const;
|
|
|
|
|
u16 height() const;
|
|
|
|
|
|
|
|
|
|
// Border Color
|
|
|
|
|
u32 border_color() const;
|
|
|
|
|
u16 depth() const;
|
|
|
|
|
u32 pitch() const;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class vertex_texture
|
|
|
|
|
{
|
|
|
|
|
protected:
|
2016-07-20 18:23:55 +02:00
|
|
|
const u8 m_index;
|
2021-04-19 10:11:24 +02:00
|
|
|
std::array<u32, 0x10000 / 4>& registers;
|
2015-10-04 00:45:26 +02:00
|
|
|
|
|
|
|
|
public:
|
2021-04-19 10:11:24 +02:00
|
|
|
vertex_texture(u8 idx, std::array<u32, 0x10000 / 4> &r)
|
|
|
|
|
: m_index(idx)
|
|
|
|
|
, registers(r)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-26 23:37:02 +02:00
|
|
|
vertex_texture() = delete;
|
|
|
|
|
|
2015-10-04 00:45:26 +02:00
|
|
|
// Offset
|
|
|
|
|
u32 offset() const;
|
|
|
|
|
|
|
|
|
|
// Format
|
2016-06-28 11:58:44 +02:00
|
|
|
u8 location() const;
|
2015-10-04 00:45:26 +02:00
|
|
|
bool cubemap() const;
|
2016-06-28 11:58:44 +02:00
|
|
|
u8 border_type() const;
|
|
|
|
|
rsx::texture_dimension dimension() const;
|
|
|
|
|
u8 format() const;
|
|
|
|
|
u16 mipmap() const;
|
2015-10-04 00:45:26 +02:00
|
|
|
|
|
|
|
|
// Address
|
2018-07-09 20:31:31 +02:00
|
|
|
rsx::texture_wrap_mode wrap_s() const;
|
|
|
|
|
rsx::texture_wrap_mode wrap_t() const;
|
|
|
|
|
rsx::texture_wrap_mode wrap_r() const;
|
2015-10-04 00:45:26 +02:00
|
|
|
|
2017-09-08 16:52:13 +02:00
|
|
|
std::pair<std::array<u8, 4>, std::array<u8, 4>> decoded_remap() const;
|
2018-03-23 16:05:56 +01:00
|
|
|
u32 remap() const;
|
2017-09-08 16:52:13 +02:00
|
|
|
|
2015-10-04 00:45:26 +02:00
|
|
|
// Control0
|
|
|
|
|
bool enabled() const;
|
2019-10-16 22:21:30 +02:00
|
|
|
f32 min_lod() const;
|
|
|
|
|
f32 max_lod() const;
|
2015-10-04 00:45:26 +02:00
|
|
|
|
|
|
|
|
// Filter
|
2019-10-16 22:21:30 +02:00
|
|
|
f32 bias() const;
|
2016-06-28 11:58:44 +02:00
|
|
|
rsx::texture_minify_filter min_filter() const;
|
|
|
|
|
rsx::texture_magnify_filter mag_filter() const;
|
2015-10-04 00:45:26 +02:00
|
|
|
|
|
|
|
|
// Image Rect
|
|
|
|
|
u16 width() const;
|
|
|
|
|
u16 height() const;
|
|
|
|
|
|
|
|
|
|
// Border Color
|
|
|
|
|
u32 border_color() const;
|
|
|
|
|
u16 depth() const;
|
|
|
|
|
u32 pitch() const;
|
|
|
|
|
|
2016-06-28 11:58:44 +02:00
|
|
|
rsx::texture_dimension_extended get_extended_texture_dimension() const;
|
|
|
|
|
u16 get_exact_mipmap_count() const;
|
2015-10-04 00:45:26 +02:00
|
|
|
};
|
|
|
|
|
}
|