summaryrefslogtreecommitdiff
path: root/src/mesa/main/glthread.h
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2022-12-21 01:51:49 -0500
committerMarek Olšák <marek.olsak@amd.com>2023-02-18 09:31:41 -0500
commit28724de0d7f3f45987be72120a2a1287d396a1c3 (patch)
tree1b43d937183c9698bc47304b94b9c4e565177892 /src/mesa/main/glthread.h
parente97d0b318b239d6dc81739e0b131fab2006ba4fa (diff)
glthread: track vertex formats for all attributes
We'll need this for a special vertex upload fallback. Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20624>
Diffstat (limited to 'src/mesa/main/glthread.h')
-rw-r--r--src/mesa/main/glthread.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/mesa/main/glthread.h b/src/mesa/main/glthread.h
index 05d8ebd6b53..7ce7e5901f3 100644
--- a/src/mesa/main/glthread.h
+++ b/src/mesa/main/glthread.h
@@ -75,6 +75,16 @@ union gl_vertex_format_user {
uint32_t All;
};
+#define MESA_PACK_VFORMAT(type, size, normalized, integer, doubles) \
+ (union gl_vertex_format_user){{ \
+ .Type = MIN2(type, 0xffff), /* 0xffff means invalid value */ \
+ .Bgra = size == GL_BGRA, \
+ .Size = size == GL_BGRA ? 4 : MIN2(size, 5), /* 5 means invalid value */ \
+ .Normalized = normalized, \
+ .Integer = integer, \
+ .Doubles = doubles \
+ }}
+
struct glthread_attrib_binding {
struct gl_buffer_object *buffer; /**< where non-VBO data was uploaded */
int offset; /**< offset to uploaded non-VBO data */
@@ -86,6 +96,7 @@ struct glthread_attrib {
uint8_t ElementSize; /**< max 32 */
uint8_t BufferIndex; /**< Referring to Attrib[BufferIndex]. */
uint16_t RelativeOffset; /**< max 0xffff in Mesa */
+ union gl_vertex_format_user Format;
/* Per buffer binding: */
GLuint Divisor;
@@ -314,16 +325,18 @@ void _mesa_glthread_ClientState(struct gl_context *ctx, GLuint *vaobj,
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);
+ union gl_vertex_format_user format,
+ 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);
+ union gl_vertex_format_user format,
+ GLsizei stride, GLintptr offset);
void _mesa_glthread_AttribFormat(struct gl_context *ctx, GLuint attribindex,
- GLint size, GLenum type, GLuint relativeoffset);
+ union gl_vertex_format_user format,
+ GLuint relativeoffset);
void _mesa_glthread_DSAAttribFormat(struct gl_context *ctx, GLuint vaobj,
- GLuint attribindex, GLint size, GLenum type,
+ GLuint attribindex,
+ union gl_vertex_format_user format,
GLuint relativeoffset);
void _mesa_glthread_VertexBuffer(struct gl_context *ctx, GLuint bindingindex,
GLuint buffer, GLintptr offset, GLsizei stride);