summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/storage_rd
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-12-17 12:22:03 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-12-17 12:22:03 +0100
commit2b2c372dbcf2facb3d47477150b54823ebfff4da (patch)
tree9ecdefd7aa9897ec9b2db79e7dac960322809e46 /servers/rendering/renderer_rd/storage_rd
parent13593d8644286278004242dd6c2bd27a15ab9162 (diff)
parent5e90b90a97dafa83c7cd6a4df7eb298eea5a326a (diff)
Merge pull request #70122 from clayjohn/VRS-r8uint
Don't attempt to create or use an R8_UINT texture as storage if VRS is not supported
Diffstat (limited to 'servers/rendering/renderer_rd/storage_rd')
-rw-r--r--servers/rendering/renderer_rd/storage_rd/texture_storage.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp
index 543eb0cb72..cc9f92de9b 100644
--- a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp
+++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp
@@ -419,11 +419,12 @@ TextureStorage::TextureStorage() {
tformat.format = RD::DATA_FORMAT_R8_UINT;
tformat.width = 4;
tformat.height = 4;
- 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;
- if (RD::get_singleton()->has_feature(RD::SUPPORTS_ATTACHMENT_VRS)) {
- tformat.usage_bits |= RD::TEXTURE_USAGE_VRS_ATTACHMENT_BIT;
- }
+ 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 | RD::TEXTURE_USAGE_VRS_ATTACHMENT_BIT;
tformat.texture_type = RD::TEXTURE_TYPE_2D;
+ if (!RD::get_singleton()->has_feature(RD::SUPPORTS_ATTACHMENT_VRS)) {
+ 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;
+ tformat.format = RD::DATA_FORMAT_R8_UNORM;
+ }
Vector<uint8_t> pv;
pv.resize(4 * 4);