gl: Use named_object<GL_TEXTURE> as the base class for images

This commit is contained in:
kd-11 2026-03-07 03:06:45 +03:00 committed by kd-11
parent 1e16b338b4
commit 0ea692e9ab
2 changed files with 5 additions and 4 deletions

View file

@ -410,6 +410,8 @@ namespace gl
auto view = std::make_unique<texture_view>(this, swizzle, aspect_flags);
auto result = view.get();
views.emplace(key, std::move(view));
result->set_name(fmt::format("%s_%x", name(), remap.encoded));
return result;
}

View file

@ -59,7 +59,7 @@ namespace gl
GLuint num_layers;
};
class texture
class texture : public named_object<GL_TEXTURE>
{
friend class texture_view;
@ -181,7 +181,6 @@ namespace gl
};
protected:
GLuint m_id = GL_NONE;
GLuint m_width = 0;
GLuint m_height = 0;
GLuint m_depth = 0;
@ -346,10 +345,9 @@ namespace gl
}
};
class texture_view
class texture_view : public named_object<GL_TEXTURE>
{
protected:
GLuint m_id = GL_NONE;
GLenum m_target = 0;
GLenum m_format = 0;
GLenum m_view_format = 0;
@ -465,6 +463,7 @@ namespace gl
class viewable_image : public texture
{
protected:
std::unordered_map<u64, std::unique_ptr<texture_view>> views;
public: