X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fglthread.h;h=c13ca9e823695ce89ea666bbeeb0299d94b42947;hb=9037005d6034d6bcbeb508e0f783622e2351b957;hp=a50b2f87ceb4e3d97021e6b02386106591e1345e;hpb=b6b1ab8d548252f99df6c86cb124faa95abda26f;p=mesa.git diff --git a/src/mesa/main/glthread.h b/src/mesa/main/glthread.h index a50b2f87ceb..c13ca9e8236 100644 --- a/src/mesa/main/glthread.h +++ b/src/mesa/main/glthread.h @@ -50,13 +50,28 @@ #include "compiler/shader_enums.h" struct gl_context; +struct gl_buffer_object; struct _mesa_HashTable; +struct glthread_attrib_binding { + struct gl_buffer_object *buffer; /**< where non-VBO data was uploaded */ + int offset; /**< offset to uploaded non-VBO data */ + const void *original_pointer; /**< restore this pointer after the draw */ +}; + struct glthread_vao { GLuint Name; GLuint CurrentElementBufferName; GLbitfield Enabled; GLbitfield UserPointerMask; + GLbitfield NonZeroDivisorMask; + + struct { + GLuint ElementSize; + GLsizei Stride; + GLuint Divisor; + const void *Pointer; + } Attrib[VERT_ATTRIB_MAX]; }; /** A single batch of commands queued up for execution. */ @@ -103,6 +118,15 @@ struct glthread_state /** Index of the batch being filled and about to be submitted. */ unsigned next; + /** Upload buffer. */ + struct gl_buffer_object *upload_buffer; + uint8_t *upload_ptr; + unsigned upload_offset; + int upload_buffer_private_refcount; + + /** Caps. */ + GLboolean SupportsBufferUploads; + /** Vertex Array objects tracked by glthread independently of Mesa. */ struct _mesa_HashTable *VAOs; struct glthread_vao *CurrentVAO; @@ -123,6 +147,10 @@ void _mesa_glthread_disable(struct gl_context *ctx, const char *func); void _mesa_glthread_flush_batch(struct gl_context *ctx); void _mesa_glthread_finish(struct gl_context *ctx); void _mesa_glthread_finish_before(struct gl_context *ctx, const char *func); +void _mesa_glthread_upload(struct gl_context *ctx, const void *data, + GLsizeiptr size, unsigned *out_offset, + struct gl_buffer_object **out_buffer, + uint8_t **out_ptr); void _mesa_glthread_BindBuffer(struct gl_context *ctx, GLenum target, GLuint buffer); @@ -136,7 +164,14 @@ void _mesa_glthread_GenVertexArrays(struct gl_context *ctx, GLsizei n, GLuint *arrays); void _mesa_glthread_ClientState(struct gl_context *ctx, GLuint *vaobj, gl_vert_attrib attrib, bool enable); -void _mesa_glthread_AttribPointer(struct gl_context *ctx, - gl_vert_attrib attrib); +void _mesa_glthread_AttribDivisor(struct gl_context *ctx, const GLuint *vaobj, + gl_vert_attrib attrib, GLuint divisor); +void _mesa_glthread_AttribPointer(struct gl_context *ctx, gl_vert_attrib attrib, + GLint size, GLenum type, GLsizei stride, + const void *pointer); +void _mesa_glthread_DSAAttribPointer(struct gl_context *ctx, GLuint vao, + GLuint buffer, gl_vert_attrib attrib, + GLint size, GLenum type, GLsizei stride, + GLintptr offset); #endif /* _GLTHREAD_H*/