mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Handle the case where VRS is a two byte per pixel format when creating default VRS texture
This commit is contained in:
parent
17fb6e3bd0
commit
b0d7a241b2
2 changed files with 9 additions and 3 deletions
|
@ -481,9 +481,10 @@ TextureStorage::TextureStorage() {
|
||||||
tformat.usage_bits = RD::TEXTURE_USAGE_COLOR_ATTACHMENT_BIT | RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_STORAGE_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT | (vrs_supported ? RD::TEXTURE_USAGE_VRS_ATTACHMENT_BIT : 0);
|
tformat.usage_bits = RD::TEXTURE_USAGE_COLOR_ATTACHMENT_BIT | RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_STORAGE_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT | (vrs_supported ? RD::TEXTURE_USAGE_VRS_ATTACHMENT_BIT : 0);
|
||||||
tformat.texture_type = RD::TEXTURE_TYPE_2D;
|
tformat.texture_type = RD::TEXTURE_TYPE_2D;
|
||||||
|
|
||||||
|
uint32_t pixel_size = RD::get_image_format_pixel_size(tformat.format);
|
||||||
Vector<uint8_t> pv;
|
Vector<uint8_t> pv;
|
||||||
pv.resize(4 * 4);
|
pv.resize(4 * 4 * pixel_size);
|
||||||
for (int i = 0; i < 4 * 4; i++) {
|
for (int i = 0; i < pv.size(); i++) {
|
||||||
pv.set(i, 0);
|
pv.set(i, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -987,7 +987,6 @@ protected:
|
||||||
|
|
||||||
static const uint32_t TEXTURE_SAMPLES_COUNT[TEXTURE_SAMPLES_MAX];
|
static const uint32_t TEXTURE_SAMPLES_COUNT[TEXTURE_SAMPLES_MAX];
|
||||||
|
|
||||||
static uint32_t get_image_format_pixel_size(DataFormat p_format);
|
|
||||||
static void get_compressed_image_format_block_dimensions(DataFormat p_format, uint32_t &r_w, uint32_t &r_h);
|
static void get_compressed_image_format_block_dimensions(DataFormat p_format, uint32_t &r_w, uint32_t &r_h);
|
||||||
uint32_t get_compressed_image_format_block_byte_size(DataFormat p_format) const;
|
uint32_t get_compressed_image_format_block_byte_size(DataFormat p_format) const;
|
||||||
static uint32_t get_compressed_image_format_pixel_rshift(DataFormat p_format);
|
static uint32_t get_compressed_image_format_pixel_rshift(DataFormat p_format);
|
||||||
|
@ -1009,6 +1008,12 @@ protected:
|
||||||
static uint32_t get_format_vertex_size(DataFormat p_format);
|
static uint32_t get_format_vertex_size(DataFormat p_format);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
/*****************/
|
||||||
|
/**** TEXTURE ****/
|
||||||
|
/*****************/
|
||||||
|
|
||||||
|
static uint32_t get_image_format_pixel_size(DataFormat p_format);
|
||||||
|
|
||||||
/****************/
|
/****************/
|
||||||
/**** SHADER ****/
|
/**** SHADER ****/
|
||||||
/****************/
|
/****************/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue