Handle the case where VRS is a two byte per pixel format when creating default VRS texture

This commit is contained in:
clayjohn 2025-08-26 12:22:23 -07:00
parent 17fb6e3bd0
commit b0d7a241b2
2 changed files with 9 additions and 3 deletions

View file

@ -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.texture_type = RD::TEXTURE_TYPE_2D;
uint32_t pixel_size = RD::get_image_format_pixel_size(tformat.format);
Vector<uint8_t> pv;
pv.resize(4 * 4);
for (int i = 0; i < 4 * 4; i++) {
pv.resize(4 * 4 * pixel_size);
for (int i = 0; i < pv.size(); i++) {
pv.set(i, 0);
}

View file

@ -987,7 +987,6 @@ protected:
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);
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);
@ -1009,6 +1008,12 @@ protected:
static uint32_t get_format_vertex_size(DataFormat p_format);
public:
/*****************/
/**** TEXTURE ****/
/*****************/
static uint32_t get_image_format_pixel_size(DataFormat p_format);
/****************/
/**** SHADER ****/
/****************/