mesa: fix incomplete GL_NV_half_float implementation

All of the VertexAttrib* functions were missing.

Fixes: ef66e02a40 ("src/mesa: add GL_NV_half_float extension support (v2)")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10431>
This commit is contained in:
Timothy Arceri
2021-04-23 20:39:50 +10:00
committed by Marge Bot
parent 48d48fbf3c
commit a02a0df2a2
7 changed files with 265 additions and 0 deletions

View File

@@ -150,6 +150,76 @@
<param name="v" type="const GLhalfNV *" count="4"/>
</function>
<function name="VertexAttrib1hNV" exec="dynamic" deprecated="3.1">
<param name="index" type="GLuint"/>
<param name="x" type="GLhalfNV"/>
</function>
<function name="VertexAttrib1hvNV" exec="dynamic" deprecated="3.1">
<param name="index" type="GLuint"/>
<param name="v" type="const GLhalfNV *" count="1"/>
</function>
<function name="VertexAttrib2hNV" exec="dynamic" deprecated="3.1">
<param name="index" type="GLuint"/>
<param name="x" type="GLhalfNV"/>
<param name="y" type="GLhalfNV"/>
</function>
<function name="VertexAttrib2hvNV" exec="dynamic" deprecated="3.1">
<param name="index" type="GLuint"/>
<param name="v" type="const GLhalfNV *" count="2"/>
</function>
<function name="VertexAttrib3hNV" exec="dynamic" deprecated="3.1">
<param name="index" type="GLuint"/>
<param name="x" type="GLhalfNV"/>
<param name="y" type="GLhalfNV"/>
<param name="z" type="GLhalfNV"/>
</function>
<function name="VertexAttrib3hvNV" exec="dynamic" deprecated="3.1">
<param name="index" type="GLuint"/>
<param name="v" type="const GLhalfNV *" count="3"/>
</function>
<function name="VertexAttrib4hNV" exec="dynamic" deprecated="3.1">
<param name="index" type="GLuint"/>
<param name="x" type="GLhalfNV"/>
<param name="y" type="GLhalfNV"/>
<param name="z" type="GLhalfNV"/>
<param name="w" type="GLhalfNV"/>
</function>
<function name="VertexAttrib4hvNV" exec="dynamic" deprecated="3.1">
<param name="index" type="GLuint"/>
<param name="v" type="const GLhalfNV *" count="4"/>
</function>
<function name="VertexAttribs1hvNV" exec="dynamic" deprecated="3.1">
<param name="index" type="GLuint"/>
<param name="n" type="GLsizei"/>
<param name="v" type="const GLhalfNV *" count="n"/>
</function>
<function name="VertexAttribs2hvNV" exec="dynamic" deprecated="3.1">
<param name="index" type="GLuint"/>
<param name="n" type="GLsizei"/>
<param name="v" type="const GLhalfNV *" count="n" count_scale="2"/>
</function>
<function name="VertexAttribs3hvNV" exec="dynamic" deprecated="3.1">
<param name="index" type="GLuint"/>
<param name="n" type="GLsizei"/>
<param name="v" type="const GLhalfNV *" count="n" count_scale="3"/>
</function>
<function name="VertexAttribs4hvNV" exec="dynamic" deprecated="3.1">
<param name="index" type="GLuint"/>
<param name="n" type="GLsizei"/>
<param name="v" type="const GLhalfNV *" count="n" count_scale="4"/>
</function>
<function name="FogCoordhNV" exec="dynamic" deprecated="3.1">
<param name="x" type="GLhalfNV"/>
</function>

View File

@@ -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 = [

View File

@@ -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 );

View File

@@ -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 }
};

View File

@@ -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);

View File

@@ -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)
{

View File

@@ -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);