From: Yogesh Mohan Marimuthu Date: Fri, 17 Jul 2020 12:08:19 +0000 (+0530) Subject: src/mesa: add GL_NV_half_float extension support (v2) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ef66e02a408c4b8d11a3b7122b0e8e05ffac8eb8;p=mesa.git src/mesa: add GL_NV_half_float extension support (v2) This patch adds support for GL_NV_half_float extension. v2: fix main_test failure Signed-off-by: Yogesh Mohan Marimuthu Reviewed-by: Marek Olšák Part-of: --- diff --git a/docs/relnotes/new_features.txt b/docs/relnotes/new_features.txt index e69de29bb2d..6012d06e4b6 100644 --- a/docs/relnotes/new_features.txt +++ b/docs/relnotes/new_features.txt @@ -0,0 +1 @@ +GL_NV_half_float diff --git a/src/mapi/glapi/gen/NV_half_float.xml b/src/mapi/glapi/gen/NV_half_float.xml new file mode 100644 index 00000000000..b248e6d7b45 --- /dev/null +++ b/src/mapi/glapi/gen/NV_half_float.xml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index 0e164b495d9..432749adaaf 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -1088,6 +1088,7 @@ + @@ -13328,6 +13329,7 @@ + diff --git a/src/mapi/glapi/gen/gl_marshal.py b/src/mapi/glapi/gen/gl_marshal.py index c7019a80328..0a195ed5898 100644 --- a/src/mapi/glapi/gen/gl_marshal.py +++ b/src/mapi/glapi/gen/gl_marshal.py @@ -154,6 +154,7 @@ class PrintCode(gl_XML.gl_print_base): 'GLubyte': 1, 'GLshort': 2, 'GLushort': 2, + 'GLhalfNV': 2, 'GLenum': 4, 'GLint': 4, 'GLuint': 4, diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py index 27651b3efef..2e91831f864 100644 --- a/src/mapi/glapi/gen/static_data.py +++ b/src/mapi/glapi/gen/static_data.py @@ -1644,6 +1644,38 @@ offsets = { "ViewportSwizzleNV": 1608, "AlphaToCoverageDitherControlNV": 1609, "InternalBufferSubDataCopyMESA": 1610, + "Vertex2hNV": 1611, + "Vertex2hvNV": 1612, + "Vertex3hNV": 1613, + "Vertex3hvNV": 1614, + "Vertex4hNV": 1615, + "Vertex4hvNV": 1616, + "Normal3hNV": 1617, + "Normal3hvNV": 1618, + "Color3hNV": 1619, + "Color3hvNV": 1620, + "Color4hNV": 1621, + "Color4hvNV": 1622, + "TexCoord1hNV": 1623, + "TexCoord1hvNV": 1624, + "TexCoord2hNV": 1625, + "TexCoord2hvNV": 1626, + "TexCoord3hNV": 1627, + "TexCoord3hvNV": 1628, + "TexCoord4hNV": 1629, + "TexCoord4hvNV": 1630, + "MultiTexCoord1hNV": 1631, + "MultiTexCoord1hvNV": 1632, + "MultiTexCoord2hNV": 1633, + "MultiTexCoord2hvNV": 1634, + "MultiTexCoord3hNV": 1635, + "MultiTexCoord3hvNV": 1636, + "MultiTexCoord4hNV": 1637, + "MultiTexCoord4hvNV": 1638, + "FogCoordhNV": 1639, + "FogCoordhvNV": 1640, + "SecondaryColor3hNV": 1641, + "SecondaryColor3hvNV": 1642, } functions = [ diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index a4d1d5bdaa0..322cad3a935 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -1503,6 +1503,41 @@ typedef struct { void (GLAPIENTRYP VertexAttribL1ui64ARB)( GLuint index, GLuint64EXT x); void (GLAPIENTRYP VertexAttribL1ui64vARB)( GLuint index, const GLuint64EXT *v); + + /* GL_NV_half_float */ + void (GLAPIENTRYP Vertex2hNV)( GLhalfNV, GLhalfNV ); + void (GLAPIENTRYP Vertex2hvNV)( const GLhalfNV * ); + void (GLAPIENTRYP Vertex3hNV)( GLhalfNV, GLhalfNV, GLhalfNV ); + void (GLAPIENTRYP Vertex3hvNV)( const GLhalfNV * ); + void (GLAPIENTRYP Vertex4hNV)( GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV ); + void (GLAPIENTRYP Vertex4hvNV)( const GLhalfNV * ); + void (GLAPIENTRYP Normal3hNV)( GLhalfNV, GLhalfNV, GLhalfNV ); + void (GLAPIENTRYP Normal3hvNV)( const GLhalfNV * ); + void (GLAPIENTRYP Color3hNV)( GLhalfNV, GLhalfNV, GLhalfNV ); + void (GLAPIENTRYP Color3hvNV)( const GLhalfNV * ); + void (GLAPIENTRYP Color4hNV)( GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV ); + void (GLAPIENTRYP Color4hvNV)( const GLhalfNV * ); + void (GLAPIENTRYP TexCoord1hNV)( GLhalfNV ); + void (GLAPIENTRYP TexCoord1hvNV)( const GLhalfNV * ); + void (GLAPIENTRYP TexCoord2hNV)( GLhalfNV, GLhalfNV ); + void (GLAPIENTRYP TexCoord2hvNV)( const GLhalfNV * ); + void (GLAPIENTRYP TexCoord3hNV)( GLhalfNV, GLhalfNV, GLhalfNV ); + void (GLAPIENTRYP TexCoord3hvNV)( const GLhalfNV * ); + void (GLAPIENTRYP TexCoord4hNV)( GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV ); + void (GLAPIENTRYP TexCoord4hvNV)( const GLhalfNV * ); + void (GLAPIENTRYP MultiTexCoord1hNV)( GLenum, GLhalfNV ); + void (GLAPIENTRYP MultiTexCoord1hvNV)( GLenum, const GLhalfNV * ); + void (GLAPIENTRYP MultiTexCoord2hNV)( GLenum, GLhalfNV, GLhalfNV ); + void (GLAPIENTRYP MultiTexCoord2hvNV)( GLenum, const GLhalfNV * ); + void (GLAPIENTRYP MultiTexCoord3hNV)( GLenum, GLhalfNV, GLhalfNV, GLhalfNV ); + void (GLAPIENTRYP MultiTexCoord3hvNV)( GLenum, const GLhalfNV * ); + void (GLAPIENTRYP MultiTexCoord4hNV)( GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV ); + void (GLAPIENTRYP MultiTexCoord4hvNV)( GLenum, const GLhalfNV * ); + void (GLAPIENTRYP FogCoordhNV)( GLhalfNV ); + void (GLAPIENTRYP FogCoordhvNV)( const GLhalfNV * ); + void (GLAPIENTRYP SecondaryColor3hNV)( GLhalfNV, GLhalfNV, GLhalfNV ); + void (GLAPIENTRYP SecondaryColor3hvNV)( const GLhalfNV * ); + } GLvertexformat; diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index 9780bf0079a..f394dc8e932 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -387,6 +387,7 @@ EXT(NV_fbo_color_attachments , dummy_true EXT(NV_fill_rectangle , NV_fill_rectangle , GLL, GLC, x , x , 2015) EXT(NV_fog_distance , NV_fog_distance , GLL, x , x , x , 2001) EXT(NV_fragment_shader_interlock , ARB_fragment_shader_interlock , GLL, GLC, x , 31, 2015) +EXT(NV_half_float , ARB_half_float_vertex , GLL, x, x , x, 2001) EXT(NV_image_formats , ARB_shader_image_load_store , x , x , x , 31, 2014) EXT(NV_light_max_exponent , dummy_true , GLL, x , x , x , 1999) EXT(NV_packed_depth_stencil , dummy_true , GLL, GLC, x , x , 2000) diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index 7c29833131a..8fdfeb8f3b8 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -1923,6 +1923,40 @@ const struct function gl_compatibility_functions_possible[] = { { "glProgramLocalParameters4fvEXT", 10, -1 }, { "glPrimitiveRestartNV", 10, -1 }, + /* GL_NV_half_float */ + { "glVertex2hNV", 13, -1 }, + { "glVertex2hvNV", 13, -1 }, + { "glVertex3hNV", 13, -1 }, + { "glVertex3hvNV", 13, -1 }, + { "glVertex4hNV", 13, -1 }, + { "glVertex4hvNV", 13, -1 }, + { "glNormal3hNV", 13, -1 }, + { "glNormal3hvNV", 13, -1 }, + { "glColor3hNV", 13, -1 }, + { "glColor3hvNV", 13, -1 }, + { "glColor4hNV", 13, -1 }, + { "glColor4hvNV", 13, -1 }, + { "glTexCoord1hNV", 13, -1 }, + { "glTexCoord1hvNV", 13, -1 }, + { "glTexCoord2hNV", 13, -1 }, + { "glTexCoord2hvNV", 13, -1 }, + { "glTexCoord3hNV", 13, -1 }, + { "glTexCoord3hvNV", 13, -1 }, + { "glTexCoord4hNV", 13, -1 }, + { "glTexCoord4hvNV", 13, -1 }, + { "glMultiTexCoord1hNV", 13, -1 }, + { "glMultiTexCoord1hvNV", 13, -1 }, + { "glMultiTexCoord2hNV", 13, -1 }, + { "glMultiTexCoord2hvNV", 13, -1 }, + { "glMultiTexCoord3hNV", 13, -1 }, + { "glMultiTexCoord3hvNV", 13, -1 }, + { "glMultiTexCoord4hNV", 13, -1 }, + { "glMultiTexCoord4hvNV", 13, -1 }, + { "glFogCoordhNV", 13, -1 }, + { "glFogCoordhvNV", 13, -1 }, + { "glSecondaryColor3hNV", 13, -1 }, + { "glSecondaryColor3hvNV", 13, -1 }, + { NULL, 0, -1 } }; diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index c80b329137f..1d6a0baa7f8 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -193,6 +193,40 @@ install_vtxfmt(struct gl_context *ctx, struct _glapi_table *tab, SET_SecondaryColorP3ui(tab, vfmt->SecondaryColorP3ui); SET_SecondaryColorP3uiv(tab, vfmt->SecondaryColorP3uiv); + + /* GL_NV_half_float */ + SET_Vertex2hNV(tab, vfmt->Vertex2hNV); + SET_Vertex2hvNV(tab, vfmt->Vertex2hvNV); + SET_Vertex3hNV(tab, vfmt->Vertex3hNV); + SET_Vertex3hvNV(tab, vfmt->Vertex3hvNV); + SET_Vertex4hNV(tab, vfmt->Vertex4hNV); + SET_Vertex4hvNV(tab, vfmt->Vertex4hvNV); + SET_Normal3hNV(tab, vfmt->Normal3hNV); + SET_Normal3hvNV(tab, vfmt->Normal3hvNV); + SET_Color3hNV(tab, vfmt->Color3hNV); + SET_Color3hvNV(tab, vfmt->Color4hvNV); + SET_Color4hNV(tab, vfmt->Color4hNV); + SET_Color4hvNV(tab, vfmt->Color3hvNV); + SET_TexCoord1hNV(tab, vfmt->TexCoord1hNV); + SET_TexCoord1hvNV(tab, vfmt->TexCoord1hvNV); + SET_TexCoord2hNV(tab, vfmt->TexCoord2hNV); + SET_TexCoord2hvNV(tab, vfmt->TexCoord2hvNV); + SET_TexCoord3hNV(tab, vfmt->TexCoord3hNV); + SET_TexCoord3hvNV(tab, vfmt->TexCoord3hvNV); + SET_TexCoord4hNV(tab, vfmt->TexCoord4hNV); + SET_TexCoord4hvNV(tab, vfmt->TexCoord4hvNV); + SET_MultiTexCoord1hNV(tab, vfmt->MultiTexCoord1hNV); + SET_MultiTexCoord1hvNV(tab, vfmt->MultiTexCoord1hvNV); + SET_MultiTexCoord2hNV(tab, vfmt->MultiTexCoord2hNV); + SET_MultiTexCoord2hvNV(tab, vfmt->MultiTexCoord2hvNV); + SET_MultiTexCoord3hNV(tab, vfmt->MultiTexCoord3hNV); + SET_MultiTexCoord3hvNV(tab, vfmt->MultiTexCoord3hvNV); + SET_MultiTexCoord4hNV(tab, vfmt->MultiTexCoord4hNV); + SET_MultiTexCoord4hvNV(tab, vfmt->MultiTexCoord4hvNV); + SET_FogCoordhNV(tab, vfmt->FogCoordhNV); + SET_FogCoordhvNV(tab, vfmt->FogCoordhvNV); + SET_SecondaryColor3hNV(tab, vfmt->SecondaryColor3hNV); + SET_SecondaryColor3hvNV(tab, vfmt->SecondaryColor3hvNV); } if (_mesa_is_desktop_gl(ctx)) { diff --git a/src/mesa/vbo/vbo_attrib_tmp.h b/src/mesa/vbo/vbo_attrib_tmp.h index b2dd82e7482..bfc3a311a35 100644 --- a/src/mesa/vbo/vbo_attrib_tmp.h +++ b/src/mesa/vbo/vbo_attrib_tmp.h @@ -28,6 +28,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "util/format_r11g11b10f.h" #include "main/varray.h" #include "vbo_util.h" +#include "util/u_half.h" /* ATTR */ @@ -59,6 +60,31 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define ATTR4F( A, X, Y, Z, W ) ATTRF( A, 4, X, Y, Z, W ) +/* half */ +#define ATTR1HV( A, V ) ATTRF( A, 1, util_half_to_float((uint16_t)(V)[0]), \ + 0, 0, 1 ) +#define ATTR2HV( A, V ) ATTRF( A, 2, util_half_to_float((uint16_t)(V)[0]), \ + util_half_to_float((uint16_t)(V)[1]), 0, 1 ) +#define ATTR3HV( A, V ) ATTRF( A, 3, util_half_to_float((uint16_t)(V)[0]), \ + util_half_to_float((uint16_t)(V)[1]), \ + util_half_to_float((uint16_t)(V)[2]), 1 ) +#define ATTR4HV( A, V ) ATTRF( A, 4, util_half_to_float((uint16_t)(V)[0]), \ + util_half_to_float((uint16_t)(V)[1]), \ + util_half_to_float((uint16_t)(V)[2]), \ + util_half_to_float((uint16_t)(V)[3]) ) + +#define ATTR1H( A, X ) ATTRF( A, 1, util_half_to_float(X), 0, 0, 1 ) +#define ATTR2H( A, X, Y ) ATTRF( A, 2, util_half_to_float(X), \ + util_half_to_float(Y), 0, 1 ) +#define ATTR3H( A, X, Y, Z ) ATTRF( A, 3, util_half_to_float(X), \ + util_half_to_float(Y), \ + util_half_to_float(Z), 1 ) +#define ATTR4H( A, X, Y, Z, W ) ATTRF( A, 4, util_half_to_float(X), \ + util_half_to_float(Y), \ + util_half_to_float(Z), \ + util_half_to_float(W) ) + + /* int */ #define ATTR2IV( A, V ) ATTRI( A, 2, (V)[0], (V)[1], 0, 1 ) #define ATTR3IV( A, V ) ATTRI( A, 3, (V)[0], (V)[1], (V)[2], 1 ) @@ -1235,6 +1261,251 @@ TAG(VertexAttribL1ui64vARB)(GLuint index, const GLuint64EXT *v) ERROR(GL_INVALID_VALUE); } +/* GL_NV_half_float */ +static void GLAPIENTRY +TAG(Vertex2hNV)(GLhalfNV x, GLhalfNV y) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR2H(VBO_ATTRIB_POS, x, y); +} + +static void GLAPIENTRY +TAG(Vertex2hvNV)(const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR2HV(VBO_ATTRIB_POS, v); +} + +static void GLAPIENTRY +TAG(Vertex3hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR3H(VBO_ATTRIB_POS, x, y, z); +} + +static void GLAPIENTRY +TAG(Vertex3hvNV)(const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR3HV(VBO_ATTRIB_POS, v); +} + +static void GLAPIENTRY +TAG(Vertex4hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR4H(VBO_ATTRIB_POS, x, y, z, w); +} + +static void GLAPIENTRY +TAG(Vertex4hvNV)(const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR4HV(VBO_ATTRIB_POS, v); +} + + + +static void GLAPIENTRY +TAG(Normal3hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR3H(VBO_ATTRIB_NORMAL, x, y, z); +} + +static void GLAPIENTRY +TAG(Normal3hvNV)(const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR3HV(VBO_ATTRIB_NORMAL, v); +} + + + +static void GLAPIENTRY +TAG(Color3hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR3H(VBO_ATTRIB_COLOR0, x, y, z); +} + +static void GLAPIENTRY +TAG(Color3hvNV)(const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR3HV(VBO_ATTRIB_COLOR0, v); +} + +static void GLAPIENTRY +TAG(Color4hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR4H(VBO_ATTRIB_COLOR0, x, y, z, w); +} + +static void GLAPIENTRY +TAG(Color4hvNV)(const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR4HV(VBO_ATTRIB_COLOR0, v); +} + + + +static void GLAPIENTRY +TAG(TexCoord1hNV)(GLhalfNV x) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR1H(VBO_ATTRIB_TEX0, x); +} + +static void GLAPIENTRY +TAG(TexCoord1hvNV)(const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR1HV(VBO_ATTRIB_TEX0, v); +} + +static void GLAPIENTRY +TAG(TexCoord2hNV)(GLhalfNV x, GLhalfNV y) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR2H(VBO_ATTRIB_TEX0, x, y); +} + +static void GLAPIENTRY +TAG(TexCoord2hvNV)(const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR2HV(VBO_ATTRIB_TEX0, v); +} + +static void GLAPIENTRY +TAG(TexCoord3hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR3H(VBO_ATTRIB_TEX0, x, y, z); +} + +static void GLAPIENTRY +TAG(TexCoord3hvNV)(const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR3HV(VBO_ATTRIB_TEX0, v); +} + +static void GLAPIENTRY +TAG(TexCoord4hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR4H(VBO_ATTRIB_TEX0, x, y, z, w); +} + +static void GLAPIENTRY +TAG(TexCoord4hvNV)(const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR4HV(VBO_ATTRIB_TEX0, v); +} + + + +static void GLAPIENTRY +TAG(MultiTexCoord1hNV)(GLenum target, GLhalfNV x) +{ + GET_CURRENT_CONTEXT(ctx); + GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; + ATTR1H(attr, x); +} + +static void GLAPIENTRY +TAG(MultiTexCoord1hvNV)(GLenum target, const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; + ATTR1HV(attr, v); +} + +static void GLAPIENTRY +TAG(MultiTexCoord2hNV)(GLenum target, GLhalfNV x, GLhalfNV y) +{ + GET_CURRENT_CONTEXT(ctx); + GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; + ATTR2H(attr, x, y); +} + +static void GLAPIENTRY +TAG(MultiTexCoord2hvNV)(GLenum target, const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; + ATTR2HV(attr, v); +} + +static void GLAPIENTRY +TAG(MultiTexCoord3hNV)(GLenum target, GLhalfNV x, GLhalfNV y, GLhalfNV z) +{ + GET_CURRENT_CONTEXT(ctx); + GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; + ATTR3H(attr, x, y, z); +} + +static void GLAPIENTRY +TAG(MultiTexCoord3hvNV)(GLenum target, const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; + ATTR3HV(attr, v); +} + +static void GLAPIENTRY +TAG(MultiTexCoord4hNV)(GLenum target, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w) +{ + GET_CURRENT_CONTEXT(ctx); + GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; + ATTR4H(attr, x, y, z, w); +} + +static void GLAPIENTRY +TAG(MultiTexCoord4hvNV)(GLenum target, const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + GLuint attr = (target & 0x7) + VBO_ATTRIB_TEX0; + ATTR4HV(attr, v); +} + + + +static void GLAPIENTRY +TAG(FogCoordhNV)(GLhalf x) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR1H(VBO_ATTRIB_FOG, x); +} + +static void GLAPIENTRY +TAG(FogCoordhvNV)(const GLhalf * v) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR1HV(VBO_ATTRIB_FOG, v); +} + + + +static void GLAPIENTRY +TAG(SecondaryColor3hNV)(GLhalfNV x, GLhalfNV y, GLhalfNV z) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR3H(VBO_ATTRIB_COLOR1, x, y, z); +} + +static void GLAPIENTRY +TAG(SecondaryColor3hvNV)(const GLhalfNV * v) +{ + GET_CURRENT_CONTEXT(ctx); + ATTR3HV(VBO_ATTRIB_COLOR1, v); +} + #undef ATTR1FV #undef ATTR2FV #undef ATTR3FV diff --git a/src/mesa/vbo/vbo_init_tmp.h b/src/mesa/vbo/vbo_init_tmp.h index dcc6797461a..9ba232bcf10 100644 --- a/src/mesa/vbo/vbo_init_tmp.h +++ b/src/mesa/vbo/vbo_init_tmp.h @@ -94,6 +94,40 @@ if (ctx->API == API_OPENGLES2) { vfmt->VertexAttrib4fvARB = NAME(VertexAttrib4fvARB); } +/* half float */ +vfmt->Vertex2hNV = NAME(Vertex2hNV); +vfmt->Vertex2hvNV = NAME(Vertex2hvNV); +vfmt->Vertex3hNV = NAME(Vertex3hNV); +vfmt->Vertex3hvNV = NAME(Vertex3hvNV); +vfmt->Vertex4hNV = NAME(Vertex4hNV); +vfmt->Vertex4hvNV = NAME(Vertex4hvNV); +vfmt->Normal3hNV = NAME(Normal3hNV); +vfmt->Normal3hvNV = NAME(Normal3hvNV); +vfmt->Color3hNV = NAME(Color3hNV); +vfmt->Color3hvNV = NAME(Color3hvNV); +vfmt->Color4hNV = NAME(Color4hNV); +vfmt->Color4hvNV = NAME(Color4hvNV); +vfmt->TexCoord1hNV = NAME(TexCoord1hNV); +vfmt->TexCoord1hvNV = NAME(TexCoord1hvNV); +vfmt->TexCoord2hNV = NAME(TexCoord2hNV); +vfmt->TexCoord2hvNV = NAME(TexCoord2hvNV); +vfmt->TexCoord3hNV = NAME(TexCoord3hNV); +vfmt->TexCoord3hvNV = NAME(TexCoord3hvNV); +vfmt->TexCoord4hNV = NAME(TexCoord4hNV); +vfmt->TexCoord4hvNV = NAME(TexCoord4hvNV); +vfmt->MultiTexCoord1hNV = NAME(MultiTexCoord1hNV); +vfmt->MultiTexCoord1hvNV = NAME(MultiTexCoord1hvNV); +vfmt->MultiTexCoord2hNV = NAME(MultiTexCoord2hNV); +vfmt->MultiTexCoord2hvNV = NAME(MultiTexCoord2hvNV); +vfmt->MultiTexCoord3hNV = NAME(MultiTexCoord3hNV); +vfmt->MultiTexCoord3hvNV = NAME(MultiTexCoord3hvNV); +vfmt->MultiTexCoord4hNV = NAME(MultiTexCoord4hNV); +vfmt->MultiTexCoord4hvNV = NAME(MultiTexCoord4hvNV); +vfmt->FogCoordhNV = NAME(FogCoordhNV); +vfmt->FogCoordhvNV = NAME(FogCoordhvNV); +vfmt->SecondaryColor3hNV = NAME(SecondaryColor3hNV); +vfmt->SecondaryColor3hvNV = NAME(SecondaryColor3hvNV); + /* Note that VertexAttrib4fNV is used from dlist.c and api_arrayelt.c so * they can have a single entrypoint for updating any of the legacy * attribs.