mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 02:07:35 +00:00
LibGL+LibGPU+LibSoftGPU: Move ImageDataLayout.h to LibGPU
This commit is contained in:
parent
4e0643ae97
commit
54307a9cd3
4 changed files with 7 additions and 7 deletions
|
@ -60,7 +60,7 @@ void Texture2D::replace_sub_texture_data(GLuint lod, GLint xoffset, GLint yoffse
|
||||||
int const physical_width = pixels_per_row > 0 ? pixels_per_row : width;
|
int const physical_width = pixels_per_row > 0 ? pixels_per_row : width;
|
||||||
size_t const physical_width_bytes = physical_width * pixel_size_bytes;
|
size_t const physical_width_bytes = physical_width * pixel_size_bytes;
|
||||||
|
|
||||||
SoftGPU::ImageDataLayout layout;
|
GPU::ImageDataLayout layout;
|
||||||
layout.column_stride = pixel_size_bytes;
|
layout.column_stride = pixel_size_bytes;
|
||||||
layout.row_stride = physical_width_bytes + (byte_alignment - physical_width_bytes % byte_alignment) % byte_alignment;
|
layout.row_stride = physical_width_bytes + (byte_alignment - physical_width_bytes % byte_alignment) % byte_alignment;
|
||||||
layout.depth_stride = 0;
|
layout.depth_stride = 0;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
#include <LibGPU/ImageFormat.h>
|
#include <LibGPU/ImageFormat.h>
|
||||||
|
|
||||||
namespace SoftGPU {
|
namespace GPU {
|
||||||
|
|
||||||
struct ImageDataLayout final {
|
struct ImageDataLayout final {
|
||||||
GPU::ImageFormat format;
|
GPU::ImageFormat format;
|
|
@ -39,7 +39,7 @@ Image::Image(unsigned width, unsigned height, unsigned depth, unsigned max_level
|
||||||
m_num_levels = level + 1;
|
m_num_levels = level + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Image::write_texels(unsigned layer, unsigned level, Vector3<unsigned> const& offset, Vector3<unsigned> const& size, void const* data, ImageDataLayout const& layout)
|
void Image::write_texels(unsigned layer, unsigned level, Vector3<unsigned> const& offset, Vector3<unsigned> const& size, void const* data, GPU::ImageDataLayout const& layout)
|
||||||
{
|
{
|
||||||
VERIFY(layer < num_layers());
|
VERIFY(layer < num_layers());
|
||||||
VERIFY(level < num_levels());
|
VERIFY(level < num_levels());
|
||||||
|
@ -58,7 +58,7 @@ void Image::write_texels(unsigned layer, unsigned level, Vector3<unsigned> const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Image::read_texels(unsigned layer, unsigned level, Vector3<unsigned> const& offset, Vector3<unsigned> const& size, void* data, ImageDataLayout const& layout) const
|
void Image::read_texels(unsigned layer, unsigned level, Vector3<unsigned> const& offset, Vector3<unsigned> const& size, void* data, GPU::ImageDataLayout const& layout) const
|
||||||
{
|
{
|
||||||
VERIFY(layer < num_layers());
|
VERIFY(layer < num_layers());
|
||||||
VERIFY(level < num_levels());
|
VERIFY(level < num_levels());
|
||||||
|
|
|
@ -11,12 +11,12 @@
|
||||||
#include <AK/RefCounted.h>
|
#include <AK/RefCounted.h>
|
||||||
#include <AK/RefPtr.h>
|
#include <AK/RefPtr.h>
|
||||||
#include <LibGPU/Enums.h>
|
#include <LibGPU/Enums.h>
|
||||||
|
#include <LibGPU/ImageDataLayout.h>
|
||||||
#include <LibGPU/ImageFormat.h>
|
#include <LibGPU/ImageFormat.h>
|
||||||
#include <LibGfx/Vector3.h>
|
#include <LibGfx/Vector3.h>
|
||||||
#include <LibGfx/Vector4.h>
|
#include <LibGfx/Vector4.h>
|
||||||
#include <LibSoftGPU/Buffer/Typed3DBuffer.h>
|
#include <LibSoftGPU/Buffer/Typed3DBuffer.h>
|
||||||
#include <LibSoftGPU/Config.h>
|
#include <LibSoftGPU/Config.h>
|
||||||
#include <LibSoftGPU/ImageDataLayout.h>
|
|
||||||
|
|
||||||
namespace SoftGPU {
|
namespace SoftGPU {
|
||||||
|
|
||||||
|
@ -156,8 +156,8 @@ public:
|
||||||
pack_color(color, texel_pointer(layer, level, x, y, z), GPU::ImageFormat::BGRA8888);
|
pack_color(color, texel_pointer(layer, level, x, y, z), GPU::ImageFormat::BGRA8888);
|
||||||
}
|
}
|
||||||
|
|
||||||
void write_texels(unsigned layer, unsigned level, Vector3<unsigned> const& offset, Vector3<unsigned> const& size, void const* data, ImageDataLayout const& layout);
|
void write_texels(unsigned layer, unsigned level, Vector3<unsigned> const& offset, Vector3<unsigned> const& size, void const* data, GPU::ImageDataLayout const& layout);
|
||||||
void read_texels(unsigned layer, unsigned level, Vector3<unsigned> const& offset, Vector3<unsigned> const& size, void* data, ImageDataLayout const& layout) const;
|
void read_texels(unsigned layer, unsigned level, Vector3<unsigned> const& offset, Vector3<unsigned> const& size, void* data, GPU::ImageDataLayout const& layout) const;
|
||||||
void copy_texels(Image const& source, unsigned source_layer, unsigned source_level, Vector3<unsigned> const& source_offset, Vector3<unsigned> const& size, unsigned destination_layer, unsigned destination_level, Vector3<unsigned> const& destination_offset);
|
void copy_texels(Image const& source, unsigned source_layer, unsigned source_level, Vector3<unsigned> const& source_offset, Vector3<unsigned> const& size, unsigned destination_layer, unsigned destination_level, Vector3<unsigned> const& destination_offset);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue