Skip to content

Make GpuTexture2DHandle never-null #1864

@emilk

Description

@emilk

Currently, GpuTexture2DHandle is defined as:

pub struct GpuTexture2DHandle(Option<GpuTexture>);

impl GpuTexture2DHandle {
    pub fn invalid() -> Self {
        Self(None)
    }
}

GpuTexture2DHandle::invalid is almost never used (and its one use can be easily refactored away), but it causes a lot of headache. In particular, TextureManager2D::get can fail, because of this invalid state.

In other words, I'd like to get rid of GpuTexture2DHandle and just use GpuTexture everywhere.

Metadata

Metadata

Assignees

Labels

🏎️ Quick IssueCan be fixed in a few hours or less🔺 re_rendererrendering, graphics, GPU🚜 refactorChange the code, not the functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions