mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:57:35 +00:00
LibGL: Implement glGetTexImage
The plumbing was already there in LibGPU, so all that was left was to implement the API :^)
This commit is contained in:
parent
4f69022c32
commit
8ab410a536
6 changed files with 46 additions and 0 deletions
|
@ -11,6 +11,14 @@
|
|||
|
||||
namespace GL {
|
||||
|
||||
void Texture2D::download_texture_data(GLuint lod, GPU::ImageDataLayout output_layout, GLvoid* pixels)
|
||||
{
|
||||
if (device_image().is_null())
|
||||
return;
|
||||
|
||||
device_image()->read_texels(0, lod, { 0, 0, 0 }, pixels, output_layout);
|
||||
}
|
||||
|
||||
void Texture2D::upload_texture_data(GLuint lod, GLenum internal_format, GPU::ImageDataLayout input_layout, GLvoid const* pixels)
|
||||
{
|
||||
// NOTE: Some target, format, and internal formats are currently unsupported.
|
||||
|
|
|
@ -27,6 +27,7 @@ public:
|
|||
|
||||
virtual bool is_texture_2d() const override { return true; }
|
||||
|
||||
void download_texture_data(GLuint lod, GPU::ImageDataLayout output_layout, GLvoid* pixels);
|
||||
void upload_texture_data(GLuint lod, GLenum internal_format, GPU::ImageDataLayout input_layout, GLvoid const* pixels);
|
||||
void replace_sub_texture_data(GLuint lod, GPU::ImageDataLayout input_layout, Vector3<i32> const& output_offset, GLvoid const* pixels);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue