diff --git a/src/mapi/glapi/gen/NV_half_float.xml b/src/mapi/glapi/gen/NV_half_float.xml index d3be839b120..b08d57534ee 100644 --- a/src/mapi/glapi/gen/NV_half_float.xml +++ b/src/mapi/glapi/gen/NV_half_float.xml @@ -150,6 +150,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py index 5b51c222d79..6accff1b231 100644 --- a/src/mapi/glapi/gen/static_data.py +++ b/src/mapi/glapi/gen/static_data.py @@ -1677,6 +1677,18 @@ offsets = { "SecondaryColor3hNV": 1641, "SecondaryColor3hvNV": 1642, "InternalSetError": 1643, + "VertexAttrib1hNV": 1644, + "VertexAttrib1hvNV": 1645, + "VertexAttrib2hNV": 1646, + "VertexAttrib2hvNV": 1647, + "VertexAttrib3hNV": 1648, + "VertexAttrib3hvNV": 1649, + "VertexAttrib4hNV": 1650, + "VertexAttrib4hvNV": 1651, + "VertexAttribs1hvNV": 1652, + "VertexAttribs2hvNV": 1653, + "VertexAttribs3hvNV": 1654, + "VertexAttribs4hvNV": 1655, } functions = [ diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 790cb596e84..55e2daae2c4 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -1597,6 +1597,18 @@ typedef struct { void (GLAPIENTRYP MultiTexCoord3hvNV)( GLenum, const GLhalfNV * ); void (GLAPIENTRYP MultiTexCoord4hNV)( GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV ); void (GLAPIENTRYP MultiTexCoord4hvNV)( GLenum, const GLhalfNV * ); + void (GLAPIENTRYP VertexAttrib1hNV)( GLuint index, GLhalfNV x ); + void (GLAPIENTRYP VertexAttrib1hvNV)( GLuint index, const GLhalfNV *v ); + void (GLAPIENTRYP VertexAttrib2hNV)( GLuint index, GLhalfNV x, GLhalfNV y ); + void (GLAPIENTRYP VertexAttrib2hvNV)( GLuint index, const GLhalfNV *v ); + void (GLAPIENTRYP VertexAttrib3hNV)( GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z ); + void (GLAPIENTRYP VertexAttrib3hvNV)( GLuint index, const GLhalfNV *v ); + void (GLAPIENTRYP VertexAttrib4hNV)( GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w ); + void (GLAPIENTRYP VertexAttrib4hvNV)( GLuint index, const GLhalfNV *v ); + void (GLAPIENTRYP VertexAttribs1hvNV)(GLuint index, GLsizei n, const GLhalfNV *v); + void (GLAPIENTRYP VertexAttribs2hvNV)(GLuint index, GLsizei n, const GLhalfNV *v); + void (GLAPIENTRYP VertexAttribs3hvNV)(GLuint index, GLsizei n, const GLhalfNV *v); + void (GLAPIENTRYP VertexAttribs4hvNV)(GLuint index, GLsizei n, const GLhalfNV *v); void (GLAPIENTRYP FogCoordhNV)( GLhalfNV ); void (GLAPIENTRYP FogCoordhvNV)( const GLhalfNV * ); void (GLAPIENTRYP SecondaryColor3hNV)( GLhalfNV, GLhalfNV, GLhalfNV ); diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index e499ea2f1b1..aef00081744 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -1978,6 +1978,18 @@ const struct function gl_compatibility_functions_possible[] = { { "glFogCoordhvNV", 13, -1 }, { "glSecondaryColor3hNV", 13, -1 }, { "glSecondaryColor3hvNV", 13, -1 }, + { "glVertexAttrib1hNV", 13, -1 }, + { "glVertexAttrib1hvNV", 13, -1 }, + { "glVertexAttrib2hNV", 13, -1 }, + { "glVertexAttrib2hvNV", 13, -1 }, + { "glVertexAttrib3hNV", 13, -1 }, + { "glVertexAttrib3hvNV", 13, -1 }, + { "glVertexAttrib4hNV", 13, -1 }, + { "glVertexAttrib4hvNV", 13, -1 }, + { "glVertexAttribs1hvNV", 13, -1 }, + { "glVertexAttribs2hvNV", 13, -1 }, + { "glVertexAttribs3hvNV", 13, -1 }, + { "glVertexAttribs4hvNV", 13, -1 }, { NULL, 0, -1 } }; diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 007dd75b3b3..d2e75d2b0c2 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -223,6 +223,18 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, SET_MultiTexCoord3hvNV(tab, vfmt->MultiTexCoord3hvNV); SET_MultiTexCoord4hNV(tab, vfmt->MultiTexCoord4hNV); SET_MultiTexCoord4hvNV(tab, vfmt->MultiTexCoord4hvNV); + SET_VertexAttrib1hNV(tab, vfmt->VertexAttrib1hNV); + SET_VertexAttrib2hNV(tab, vfmt->VertexAttrib2hNV); + SET_VertexAttrib3hNV(tab, vfmt->VertexAttrib3hNV); + SET_VertexAttrib4hNV(tab, vfmt->VertexAttrib4hNV); + SET_VertexAttrib1hvNV(tab, vfmt->VertexAttrib1hvNV); + SET_VertexAttrib2hvNV(tab, vfmt->VertexAttrib2hvNV); + SET_VertexAttrib3hvNV(tab, vfmt->VertexAttrib3hvNV); + SET_VertexAttrib4hvNV(tab, vfmt->VertexAttrib4hvNV); + SET_VertexAttribs1hvNV(tab, vfmt->VertexAttribs1hvNV); + SET_VertexAttribs2hvNV(tab, vfmt->VertexAttribs2hvNV); + SET_VertexAttribs3hvNV(tab, vfmt->VertexAttribs3hvNV); + SET_VertexAttribs4hvNV(tab, vfmt->VertexAttribs4hvNV); SET_FogCoordhNV(tab, vfmt->FogCoordhNV); SET_FogCoordhvNV(tab, vfmt->FogCoordhvNV); SET_SecondaryColor3hNV(tab, vfmt->SecondaryColor3hNV); diff --git a/src/mesa/vbo/vbo_attrib_tmp.h b/src/mesa/vbo/vbo_attrib_tmp.h index 8d65bab7671..74174f757d9 100644 --- a/src/mesa/vbo/vbo_attrib_tmp.h +++ b/src/mesa/vbo/vbo_attrib_tmp.h @@ -1476,6 +1476,141 @@ TAG(MultiTexCoord4hvNV)(GLenum target, const GLhalfNV * v) +static void GLAPIENTRY +TAG(VertexAttrib1hNV)(GLuint index, GLhalfNV x) +{ + GET_CURRENT_CONTEXT(ctx); + if (is_vertex_position(ctx, index)) + ATTR1H(0, x); + else if (index < MAX_VERTEX_GENERIC_ATTRIBS) + ATTR1H(VBO_ATTRIB_GENERIC0 + index, x); + else + ERROR(GL_INVALID_VALUE); +} + +static void GLAPIENTRY +TAG(VertexAttrib2hNV)(GLuint index, GLhalfNV x, GLhalfNV y) +{ + GET_CURRENT_CONTEXT(ctx); + if (is_vertex_position(ctx, index)) + ATTR2H(0, x, y); + else if (index < MAX_VERTEX_GENERIC_ATTRIBS) + ATTR2H(VBO_ATTRIB_GENERIC0 + index, x, y); + else + ERROR(GL_INVALID_VALUE); +} + +static void GLAPIENTRY +TAG(VertexAttrib3hNV)(GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z) +{ + GET_CURRENT_CONTEXT(ctx); + if (is_vertex_position(ctx, index)) + ATTR3H(0, x, y, z); + else if (index < MAX_VERTEX_GENERIC_ATTRIBS) + ATTR3H(VBO_ATTRIB_GENERIC0 + index, x, y, z); + else + ERROR(GL_INVALID_VALUE); +} + +static void GLAPIENTRY +TAG(VertexAttrib4hNV)(GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w) +{ + GET_CURRENT_CONTEXT(ctx); + if (is_vertex_position(ctx, index)) + ATTR4H(0, x, y, z, w); + else if (index < MAX_VERTEX_GENERIC_ATTRIBS) + ATTR4H(VBO_ATTRIB_GENERIC0 + index, x, y, z, w); + else + ERROR(GL_INVALID_VALUE); +} + +static void GLAPIENTRY +TAG(VertexAttrib1hvNV)(GLuint index, const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + if (is_vertex_position(ctx, index)) + ATTR1HV(0, v); + else if (index < MAX_VERTEX_GENERIC_ATTRIBS) + ATTR1HV(VBO_ATTRIB_GENERIC0 + index, v); + else + ERROR(GL_INVALID_VALUE); +} + +static void GLAPIENTRY +TAG(VertexAttrib2hvNV)(GLuint index, const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + if (is_vertex_position(ctx, index)) + ATTR2HV(0, v); + else if (index < MAX_VERTEX_GENERIC_ATTRIBS) + ATTR2HV(VBO_ATTRIB_GENERIC0 + index, v); + else + ERROR(GL_INVALID_VALUE); +} + +static void GLAPIENTRY +TAG(VertexAttrib3hvNV)(GLuint index, const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + if (is_vertex_position(ctx, index)) + ATTR3HV(0, v); + else if (index < MAX_VERTEX_GENERIC_ATTRIBS) + ATTR3HV(VBO_ATTRIB_GENERIC0 + index, v); + else + ERROR(GL_INVALID_VALUE); +} + +static void GLAPIENTRY +TAG(VertexAttrib4hvNV)(GLuint index, const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + if (is_vertex_position(ctx, index)) + ATTR4HV(0, v); + else if (index < MAX_VERTEX_GENERIC_ATTRIBS) + ATTR4HV(VBO_ATTRIB_GENERIC0 + index, v); + else + ERROR(GL_INVALID_VALUE); +} + +static void GLAPIENTRY +TAG(VertexAttribs1hvNV)(GLuint index, GLsizei n, const GLhalfNV *v) +{ + GET_CURRENT_CONTEXT(ctx); + n = MIN2(n, VBO_ATTRIB_MAX - index); + for (GLint i = n - 1; i >= 0; i--) + ATTR1H(index + i, v[i]); +} + +static void GLAPIENTRY +TAG(VertexAttribs2hvNV)(GLuint index, GLsizei n, const GLhalfNV *v) +{ + GET_CURRENT_CONTEXT(ctx); + n = MIN2(n, VBO_ATTRIB_MAX - index); + for (GLint i = n - 1; i >= 0; i--) + ATTR2H(index + i, v[2 * i], v[2 * i + 1]); +} + +static void GLAPIENTRY +TAG(VertexAttribs3hvNV)(GLuint index, GLsizei n, const GLhalfNV *v) +{ + GET_CURRENT_CONTEXT(ctx); + n = MIN2(n, VBO_ATTRIB_MAX - index); + for (GLint i = n - 1; i >= 0; i--) + ATTR3H(index + i, v[3 * i], v[3 * i + 1], v[3 * i + 2]); +} + + +static void GLAPIENTRY +TAG(VertexAttribs4hvNV)(GLuint index, GLsizei n, const GLhalfNV *v) +{ + GET_CURRENT_CONTEXT(ctx); + n = MIN2(n, VBO_ATTRIB_MAX - index); + for (GLint i = n - 1; i >= 0; i--) + ATTR4H(index + i, v[4 * i], v[4 * i + 1], v[4 * i + 2], v[4 * i + 3]); +} + + + static void GLAPIENTRY TAG(FogCoordhNV)(GLhalf x) { diff --git a/src/mesa/vbo/vbo_init_tmp.h b/src/mesa/vbo/vbo_init_tmp.h index 74c81d5dd16..55295238e73 100644 --- a/src/mesa/vbo/vbo_init_tmp.h +++ b/src/mesa/vbo/vbo_init_tmp.h @@ -123,6 +123,18 @@ vfmt->MultiTexCoord3hNV = NAME(MultiTexCoord3hNV); vfmt->MultiTexCoord3hvNV = NAME(MultiTexCoord3hvNV); vfmt->MultiTexCoord4hNV = NAME(MultiTexCoord4hNV); vfmt->MultiTexCoord4hvNV = NAME(MultiTexCoord4hvNV); +vfmt->VertexAttrib1hNV = NAME(VertexAttrib1hNV); +vfmt->VertexAttrib2hNV = NAME(VertexAttrib2hNV); +vfmt->VertexAttrib3hNV = NAME(VertexAttrib3hNV); +vfmt->VertexAttrib4hNV = NAME(VertexAttrib4hNV); +vfmt->VertexAttrib1hvNV = NAME(VertexAttrib1hvNV); +vfmt->VertexAttrib2hvNV = NAME(VertexAttrib2hvNV); +vfmt->VertexAttrib3hvNV = NAME(VertexAttrib3hvNV); +vfmt->VertexAttrib4hvNV = NAME(VertexAttrib4hvNV); +vfmt->VertexAttribs1hvNV = NAME(VertexAttribs1hvNV); +vfmt->VertexAttribs2hvNV = NAME(VertexAttribs2hvNV); +vfmt->VertexAttribs3hvNV = NAME(VertexAttribs3hvNV); +vfmt->VertexAttribs4hvNV = NAME(VertexAttribs4hvNV); vfmt->FogCoordhNV = NAME(FogCoordhNV); vfmt->FogCoordhvNV = NAME(FogCoordhvNV); vfmt->SecondaryColor3hNV = NAME(SecondaryColor3hNV);