Skip to content

Commit

Permalink
Ensure YUV output texture is cleared on creation
Browse files Browse the repository at this point in the history
  • Loading branch information
EIREXE committed Apr 17, 2024
1 parent d3da9b2 commit 36ff06d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ffmpeg_video_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ Error YUVGPUConverter::_ensure_output_texture() {
out_texture_format.array_layers = 1;
out_texture_format.mipmaps = 1;
// RD::TEXTURE_USAGE_CAN_UPDATE_BIT not needed since we won't update it from the CPU
out_texture_format.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_COLOR_ATTACHMENT_BIT | RD::TEXTURE_USAGE_STORAGE_BIT;
out_texture_format.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_COLOR_ATTACHMENT_BIT | RD::TEXTURE_USAGE_STORAGE_BIT | RD::TEXTURE_USAGE_CAN_COPY_TO_BIT;

#ifdef GDEXTENSION
Ref<RDTextureView> texture_view;
Expand All @@ -507,6 +507,7 @@ Error YUVGPUConverter::_ensure_output_texture() {
RD::TextureView texture_view;
#endif
out_texture->set_texture_rd_rid(rd->texture_create(out_texture_format_c, texture_view));
rd->texture_clear(out_texture->get_texture_rd_rid(), Color(0, 0, 0, 0), 0, 1, 0, 1);

if (out_uniform_set.is_valid()) {
FREE_RD_RID(out_uniform_set);
Expand Down

0 comments on commit 36ff06d

Please sign in to comment.