gl: Use named_object<GL_TEXTURE> as the base class for images
This commit is contained in:
@@ -410,6 +410,8 @@ namespace gl
|
|||||||
auto view = std::make_unique<texture_view>(this, swizzle, aspect_flags);
|
auto view = std::make_unique<texture_view>(this, swizzle, aspect_flags);
|
||||||
auto result = view.get();
|
auto result = view.get();
|
||||||
views.emplace(key, std::move(view));
|
views.emplace(key, std::move(view));
|
||||||
|
|
||||||
|
result->set_name(fmt::format("%s_%x", name(), remap.encoded));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace gl
|
|||||||
GLuint num_layers;
|
GLuint num_layers;
|
||||||
};
|
};
|
||||||
|
|
||||||
class texture
|
class texture : public named_object<GL_TEXTURE>
|
||||||
{
|
{
|
||||||
friend class texture_view;
|
friend class texture_view;
|
||||||
|
|
||||||
@@ -181,7 +181,6 @@ namespace gl
|
|||||||
};
|
};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
GLuint m_id = GL_NONE;
|
|
||||||
GLuint m_width = 0;
|
GLuint m_width = 0;
|
||||||
GLuint m_height = 0;
|
GLuint m_height = 0;
|
||||||
GLuint m_depth = 0;
|
GLuint m_depth = 0;
|
||||||
@@ -346,10 +345,9 @@ namespace gl
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class texture_view
|
class texture_view : public named_object<GL_TEXTURE>
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
GLuint m_id = GL_NONE;
|
|
||||||
GLenum m_target = 0;
|
GLenum m_target = 0;
|
||||||
GLenum m_format = 0;
|
GLenum m_format = 0;
|
||||||
GLenum m_view_format = 0;
|
GLenum m_view_format = 0;
|
||||||
@@ -465,6 +463,7 @@ namespace gl
|
|||||||
|
|
||||||
class viewable_image : public texture
|
class viewable_image : public texture
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
std::unordered_map<u64, std::unique_ptr<texture_view>> views;
|
std::unordered_map<u64, std::unique_ptr<texture_view>> views;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user