gallium,vbo: add PIPE_BIND_VERTEX_STATE for display lists
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13399>
This commit is contained in:
@@ -480,6 +480,7 @@ enum pipe_flush_flags
|
||||
#define PIPE_BIND_INDEX_BUFFER (1 << 5) /* draw_elements */
|
||||
#define PIPE_BIND_CONSTANT_BUFFER (1 << 6) /* set_constant_buffer */
|
||||
#define PIPE_BIND_DISPLAY_TARGET (1 << 7) /* flush_front_buffer */
|
||||
#define PIPE_BIND_VERTEX_STATE (1 << 8) /* create_vertex_state */
|
||||
/* gap */
|
||||
#define PIPE_BIND_STREAM_OUTPUT (1 << 10) /* set_stream_output_buffers */
|
||||
#define PIPE_BIND_CURSOR (1 << 11) /* mouse cursor */
|
||||
|
@@ -92,6 +92,12 @@ struct pipe_vertex_element;
|
||||
/* This buffer will only be mapped/unmapped once */
|
||||
#define MESA_MAP_ONCE 0x10000
|
||||
|
||||
/* This BufferStorage flag indicates that the buffer will be used
|
||||
* by pipe_vertex_state, which doesn't track buffer busyness and doesn't
|
||||
* support invalidations.
|
||||
*/
|
||||
#define MESA_GALLIUM_VERTEX_STATE_STORAGE 0x20000
|
||||
|
||||
|
||||
/**
|
||||
* Device driver function table.
|
||||
|
@@ -353,7 +353,10 @@ bufferobj_data(struct gl_context *ctx,
|
||||
|
||||
release_buffer(obj);
|
||||
|
||||
const unsigned bindings = buffer_target_to_bind_flags(target);
|
||||
unsigned bindings = buffer_target_to_bind_flags(target);
|
||||
|
||||
if (storageFlags & MESA_GALLIUM_VERTEX_STATE_STORAGE)
|
||||
bindings |= PIPE_BIND_VERTEX_STATE;
|
||||
|
||||
if (ST_DEBUG & DEBUG_BUFFER) {
|
||||
debug_printf("Create buffer size %" PRId64 " bind 0x%x\n",
|
||||
|
@@ -746,7 +746,8 @@ compile_vertex_list(struct gl_context *ctx)
|
||||
GL_ELEMENT_ARRAY_BUFFER_ARB,
|
||||
MAX2(total_bytes_needed, VBO_SAVE_BUFFER_SIZE),
|
||||
NULL,
|
||||
GL_STATIC_DRAW_ARB, GL_MAP_WRITE_BIT,
|
||||
GL_STATIC_DRAW_ARB, GL_MAP_WRITE_BIT |
|
||||
MESA_GALLIUM_VERTEX_STATE_STORAGE,
|
||||
save->current_bo);
|
||||
if (!success) {
|
||||
_mesa_reference_buffer_object(ctx, &save->current_bo, NULL);
|
||||
@@ -876,7 +877,8 @@ end:
|
||||
GL_ELEMENT_ARRAY_BUFFER_ARB,
|
||||
VBO_SAVE_BUFFER_SIZE,
|
||||
NULL,
|
||||
GL_STATIC_DRAW_ARB, GL_MAP_WRITE_BIT,
|
||||
GL_STATIC_DRAW_ARB, GL_MAP_WRITE_BIT |
|
||||
MESA_GALLIUM_VERTEX_STATE_STORAGE,
|
||||
save->current_bo);
|
||||
if (!success)
|
||||
handle_out_of_memory(ctx);
|
||||
|
Reference in New Issue
Block a user