mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
LibVirtGPU: Remove hardcoded size from append_viewport()
This commit is contained in:
parent
7a2b9ad164
commit
4a4aa23aed
Notes:
sideshowbarker
2024-07-17 03:03:15 +09:00
Author: https://github.com/sunverwerth Commit: https://github.com/SerenityOS/serenity/commit/4a4aa23aed Pull-request: https://github.com/SerenityOS/serenity/pull/16590 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/ccapitalK Reviewed-by: https://github.com/gmta ✅ Reviewed-by: https://github.com/supercomputer7 ✅
2 changed files with 9 additions and 8 deletions
|
@ -224,16 +224,16 @@ void CommandBufferBuilder::append_set_framebuffer_state(Protocol::ObjectHandle d
|
|||
builder.appendu32(drawtarget.value()); // surf_handle
|
||||
}
|
||||
|
||||
void CommandBufferBuilder::append_viewport()
|
||||
void CommandBufferBuilder::append_viewport(Gfx::IntSize size)
|
||||
{
|
||||
CommandBuilder builder(m_buffer, Protocol::VirGLCommand::SET_VIEWPORT_STATE, Protocol::ObjectType::NONE);
|
||||
builder.appendu32(0);
|
||||
builder.appendf32(DRAWTARGET_WIDTH / 2); // scale_x
|
||||
builder.appendf32((DRAWTARGET_HEIGHT / 2)); // scale_y (flipped, due to VirGL being different from our coordinate space)
|
||||
builder.appendf32(0.5f); // scale_z
|
||||
builder.appendf32(DRAWTARGET_WIDTH / 2); // translate_x
|
||||
builder.appendf32(DRAWTARGET_HEIGHT / 2); // translate_y
|
||||
builder.appendf32(0.5f); // translate_z
|
||||
builder.appendf32(size.width() / 2); // scale_x
|
||||
builder.appendf32(size.height() / 2); // scale_y (flipped, due to VirGL being different from our coordinate space)
|
||||
builder.appendf32(0.5f); // scale_z
|
||||
builder.appendf32(size.width() / 2); // translate_x
|
||||
builder.appendf32(size.height() / 2); // translate_y
|
||||
builder.appendf32(0.5f); // translate_z
|
||||
}
|
||||
|
||||
void CommandBufferBuilder::append_set_framebuffer_state_no_attach()
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include <AK/StringView.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGfx/Size.h>
|
||||
#include <LibVirtGPU/VirGLProtocol.h>
|
||||
#include <sys/ioctl_numbers.h>
|
||||
|
||||
|
@ -29,7 +30,7 @@ public:
|
|||
void append_set_framebuffer_state(Protocol::ObjectHandle drawtarget, Protocol::ObjectHandle depthbuffer = 0);
|
||||
void append_create_vertex_elements(Protocol::ObjectHandle handle);
|
||||
void append_bind_vertex_elements(Protocol::ObjectHandle handle);
|
||||
void append_viewport();
|
||||
void append_viewport(Gfx::IntSize);
|
||||
void append_set_framebuffer_state_no_attach();
|
||||
void append_set_constant_buffer(Vector<float> const& constant_buffer);
|
||||
void append_create_shader(Protocol::ObjectHandle handle, Gallium::ShaderType shader_type, StringView shader_data);
|
||||
|
|
Loading…
Reference in a new issue