mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 15:37:46 +00:00
LibGL+LibGPU+LibSoftGPU: Move ImageFormat.h to LibGPU
This commit is contained in:
parent
24d420312c
commit
4e0643ae97
8 changed files with 172 additions and 172 deletions
|
@ -16,11 +16,11 @@
|
|||
#include <AK/Vector.h>
|
||||
#include <LibGL/GLContext.h>
|
||||
#include <LibGPU/Enums.h>
|
||||
#include <LibGPU/ImageFormat.h>
|
||||
#include <LibGfx/Bitmap.h>
|
||||
#include <LibGfx/Painter.h>
|
||||
#include <LibGfx/Vector4.h>
|
||||
#include <LibSoftGPU/Device.h>
|
||||
#include <LibSoftGPU/ImageFormat.h>
|
||||
|
||||
__attribute__((visibility("hidden"))) GL::GLContext* g_gl_context;
|
||||
|
||||
|
@ -927,7 +927,7 @@ void GLContext::gl_tex_image_2d(GLenum target, GLint level, GLint internal_forma
|
|||
// that constructing GL textures in any but the default mipmap order, going from level 0 upwards will cause mip levels to stay uninitialized.
|
||||
// To be spec compliant we should create the device image once the texture has become complete and is used for rendering the first time.
|
||||
// All images that were attached before the device image was created need to be stored somewhere to be used to initialize the device image once complete.
|
||||
texture_2d->set_device_image(m_rasterizer.create_image(SoftGPU::ImageFormat::BGRA8888, width, height, 1, 999, 1));
|
||||
texture_2d->set_device_image(m_rasterizer.create_image(GPU::ImageFormat::BGRA8888, width, height, 1, 999, 1));
|
||||
m_sampler_config_is_dirty = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -66,16 +66,16 @@ void Texture2D::replace_sub_texture_data(GLuint lod, GLint xoffset, GLint yoffse
|
|||
layout.depth_stride = 0;
|
||||
|
||||
if (type == GL_UNSIGNED_SHORT_5_6_5) {
|
||||
layout.format = SoftGPU::ImageFormat::RGB565;
|
||||
layout.format = GPU::ImageFormat::RGB565;
|
||||
} else if (type == GL_UNSIGNED_BYTE) {
|
||||
if (format == GL_RGB)
|
||||
layout.format = SoftGPU::ImageFormat::RGB888;
|
||||
layout.format = GPU::ImageFormat::RGB888;
|
||||
else if (format == GL_BGR)
|
||||
layout.format = SoftGPU::ImageFormat::BGR888;
|
||||
layout.format = GPU::ImageFormat::BGR888;
|
||||
else if (format == GL_RGBA)
|
||||
layout.format = SoftGPU::ImageFormat::RGBA8888;
|
||||
layout.format = GPU::ImageFormat::RGBA8888;
|
||||
else if (format == GL_BGRA)
|
||||
layout.format = SoftGPU::ImageFormat::BGRA8888;
|
||||
layout.format = GPU::ImageFormat::BGRA8888;
|
||||
}
|
||||
|
||||
Vector3<unsigned> offset {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue