-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize shared texture creations #98760
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -903,7 +903,7 @@ RID RenderingDevice::texture_create_shared(const TextureView &p_view, RID p_with | |
|
||
// Create view. | ||
|
||
Texture texture = *src_texture; | ||
Texture texture = src_texture->duplicate_as_shared_texture(); | ||
texture.shared_fallback = nullptr; | ||
|
||
RDD::TextureView tv; | ||
|
@@ -960,8 +960,6 @@ RID RenderingDevice::texture_create_shared(const TextureView &p_view, RID p_with | |
|
||
ERR_FAIL_COND_V(!texture.driver_id, RID()); | ||
|
||
texture.slice_trackers.clear(); | ||
|
||
if (texture.draw_tracker != nullptr) { | ||
texture.draw_tracker->reference_count++; | ||
} | ||
|
@@ -1055,7 +1053,7 @@ RID RenderingDevice::texture_create_shared_from_slice(const TextureView &p_view, | |
slice_layers = 6; | ||
} | ||
|
||
Texture texture = *src_texture; | ||
Texture texture = src_texture->duplicate_as_shared_texture(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find it a bit surprising that we don't call CC @DarioSamo who added the call in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The clear is made in |
||
texture.shared_fallback = nullptr; | ||
|
||
get_image_format_required_size(texture.format, texture.width, texture.height, texture.depth, p_mipmap + 1, &texture.width, &texture.height); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess
duplicate_as_shared_resource
should also avoid copyingshared_fallback
so we don't have to manually set it to nullptr right after doing the copy