LibVirtGPU: Remove hard coded primitive type in append_draw_vbo()

This commit is contained in:
Stephan Unverwerth 2022-12-22 15:16:13 +01:00 committed by Andreas Kling
parent b5acfba487
commit 03884fad74
Notes: sideshowbarker 2024-07-17 02:34:38 +09:00
2 changed files with 14 additions and 14 deletions

View file

@ -124,21 +124,21 @@ void CommandBufferBuilder::append_end_transfers_3d()
CommandBuilder builder(m_buffer, Protocol::VirGLCommand::END_TRANSFERS, Protocol::ObjectType::NONE);
}
void CommandBufferBuilder::append_draw_vbo(u32 count)
void CommandBufferBuilder::append_draw_vbo(Protocol::PipePrimitiveTypes primitive_type, u32 count)
{
CommandBuilder builder(m_buffer, Protocol::VirGLCommand::DRAW_VBO, Protocol::ObjectType::NONE);
builder.appendu32(0); // start
builder.appendu32(count); // count
builder.appendu32(to_underlying(Protocol::PipePrimitiveTypes::TRIANGLES)); // mode
builder.appendu32(0); // indexed
builder.appendu32(1); // instance_count
builder.appendu32(0); // index_bias
builder.appendu32(0); // start_instance
builder.appendu32(0); // primitive_restart
builder.appendu32(0); // restart_index
builder.appendu32(0); // min_index
builder.appendu32(0xffffffff); // max_index
builder.appendu32(0); // cso
builder.appendu32(0); // start
builder.appendu32(count); // count
builder.appendu32(to_underlying(primitive_type)); // mode
builder.appendu32(0); // indexed
builder.appendu32(1); // instance_count
builder.appendu32(0); // index_bias
builder.appendu32(0); // start_instance
builder.appendu32(0); // primitive_restart
builder.appendu32(0); // restart_index
builder.appendu32(0); // min_index
builder.appendu32(0xffffffff); // max_index
builder.appendu32(0); // cso
}
void CommandBufferBuilder::append_clear(float r, float g, float b)

View file

@ -21,7 +21,7 @@ public:
void append_set_tweaks(u32 id, u32 value);
void append_transfer3d(Protocol::ResourceID resource, size_t width, size_t height = 1, size_t depth = 1, size_t direction = VIRGL_DATA_DIR_GUEST_TO_HOST);
void append_end_transfers_3d();
void append_draw_vbo(u32 count);
void append_draw_vbo(Protocol::PipePrimitiveTypes, u32 count);
void append_clear(float r, float g, float b);
void append_set_vertex_buffers(u32 stride, u32 offset, Protocol::ResourceID resource);
void append_create_blend(Protocol::ObjectHandle handle);