main: Add entry point for NamedFramebufferRenderbuffer.
[mesa.git] / src / mesa / main / tests / dispatch_sanity.cpp
index fb077b3d5c519f365190e6beedbc4ccb6ad67759..32b082bcb28fdb6461ec527bb240f5b19ae9074e 100644 (file)
@@ -82,6 +82,7 @@ public:
    struct dd_function_table driver_functions;
    struct gl_context share_list;
    struct gl_context ctx;
+   _glapi_proc *nop_table;
 };
 
 void
@@ -93,6 +94,9 @@ DispatchSanity_test::SetUp()
    memset(&ctx, 0, sizeof(ctx));
 
    _mesa_init_driver_functions(&driver_functions);
+
+   const unsigned size = _glapi_get_dispatch_table_size();
+   nop_table = (_glapi_proc *) _glapi_new_nop_table(size);
 }
 
 void
@@ -119,19 +123,20 @@ offset_to_proc_name_safe(unsigned offset)
 }
 
 /* Scan through the dispatch table and check that all the functions in
- * _glapi_proc *table exist. When found, set their pointers in the table
- * to _mesa_generic_nop.  */
+ * _glapi_proc *table exist.
+ */
 static void
-validate_functions(struct gl_context *ctx, const struct function *function_table)
+validate_functions(struct gl_context *ctx, const struct function *function_table,
+                   const _glapi_proc *nop_table)
 {
    _glapi_proc *table = (_glapi_proc *) ctx->Exec;
 
    for (unsigned i = 0; function_table[i].name != NULL; i++) {
-      /* The context version is >= the GL version where the
-         function was introduced. Therefore, the function cannot
-         be set to the nop function.
+      /* The context version is >= the GL version where the function was
+       * introduced. Therefore, the function cannot be set to the nop
+       * function.
        */
-      bool cant_be_nop = ctx->Version >= function_table[i].Version;
+      const bool cant_be_nop = ctx->Version >= function_table[i].Version;
 
       const int offset = (function_table[i].offset != -1)
          ? function_table[i].offset
@@ -143,25 +148,26 @@ validate_functions(struct gl_context *ctx, const struct function *function_table
                 _glapi_get_proc_offset(function_table[i].name))
          << "Function: " << function_table[i].name;
       if (cant_be_nop) {
-         EXPECT_NE((_glapi_proc) _mesa_generic_nop, table[offset])
+         EXPECT_NE(nop_table[offset], table[offset])
             << "Function: " << function_table[i].name
             << " at offset " << offset;
       }
 
-      table[offset] = (_glapi_proc) _mesa_generic_nop;
+      table[offset] = nop_table[offset];
    }
 }
 
 /* Scan through the table and ensure that there is nothing except
- * _mesa_generic_nop (as set by validate_functions().  */
+ * nop functions (as set by validate_functions().
+ */
 static void
-validate_nops(struct gl_context *ctx)
+validate_nops(struct gl_context *ctx, const _glapi_proc *nop_table)
 {
    _glapi_proc *table = (_glapi_proc *) ctx->Exec;
 
    const unsigned size = _glapi_get_dispatch_table_size();
    for (unsigned i = 0; i < size; i++) {
-      EXPECT_EQ((_glapi_proc) _mesa_generic_nop, table[i])
+      EXPECT_EQ(nop_table[i], table[i])
          << "i = " << i << " (" << offset_to_proc_name_safe(i) << ")";
    }
 }
@@ -169,30 +175,30 @@ validate_nops(struct gl_context *ctx)
 TEST_F(DispatchSanity_test, GL31_CORE)
 {
    SetUpCtx(API_OPENGL_CORE, 31);
-   validate_functions(&ctx, gl_core_functions_possible);
-   validate_nops(&ctx);
+   validate_functions(&ctx, gl_core_functions_possible, nop_table);
+   validate_nops(&ctx, nop_table);
 }
 
 TEST_F(DispatchSanity_test, GLES11)
 {
    SetUpCtx(API_OPENGLES, 11);
-   validate_functions(&ctx, gles11_functions_possible);
-   validate_nops(&ctx);
+   validate_functions(&ctx, gles11_functions_possible, nop_table);
+   validate_nops(&ctx, nop_table);
 }
 
 TEST_F(DispatchSanity_test, GLES2)
 {
    SetUpCtx(API_OPENGLES2, 20);
-   validate_functions(&ctx, gles2_functions_possible);
-   validate_nops(&ctx);
+   validate_functions(&ctx, gles2_functions_possible, nop_table);
+   validate_nops(&ctx, nop_table);
 }
 
 TEST_F(DispatchSanity_test, GLES3)
 {
    SetUpCtx(API_OPENGLES2, 30);
-   validate_functions(&ctx, gles2_functions_possible);
-   validate_functions(&ctx, gles3_functions_possible);
-   validate_nops(&ctx);
+   validate_functions(&ctx, gles2_functions_possible, nop_table);
+   validate_functions(&ctx, gles3_functions_possible, nop_table);
+   validate_nops(&ctx, nop_table);
 }
 
 const struct function gl_core_functions_possible[] = {
@@ -774,16 +780,16 @@ const struct function gl_core_functions_possible[] = {
    { "glProgramUniformMatrix4x3dv", 40, -1 },
    { "glValidateProgramPipeline", 43, -1 },
    { "glGetProgramPipelineInfoLog", 43, -1 },
-// { "glVertexAttribL1d", 43, -1 },                     // XXX: Add to xml
-// { "glVertexAttribL2d", 43, -1 },                     // XXX: Add to xml
-// { "glVertexAttribL3d", 43, -1 },                     // XXX: Add to xml
-// { "glVertexAttribL4d", 43, -1 },                     // XXX: Add to xml
-// { "glVertexAttribL1dv", 43, -1 },                    // XXX: Add to xml
-// { "glVertexAttribL2dv", 43, -1 },                    // XXX: Add to xml
-// { "glVertexAttribL3dv", 43, -1 },                    // XXX: Add to xml
-// { "glVertexAttribL4dv", 43, -1 },                    // XXX: Add to xml
-// { "glVertexAttribLPointer", 43, -1 },                // XXX: Add to xml
-// { "glGetVertexAttribLdv", 43, -1 },                  // XXX: Add to xml
+   { "glVertexAttribL1d", 41, -1 },
+   { "glVertexAttribL2d", 41, -1 },
+   { "glVertexAttribL3d", 41, -1 },
+   { "glVertexAttribL4d", 41, -1 },
+   { "glVertexAttribL1dv", 41, -1 },
+   { "glVertexAttribL2dv", 41, -1 },
+   { "glVertexAttribL3dv", 41, -1 },
+   { "glVertexAttribL4dv", 41, -1 },
+   { "glVertexAttribLPointer", 41, -1 },
+   { "glGetVertexAttribLdv", 41, -1 },
    { "glViewportArrayv", 43, -1 },
    { "glViewportIndexedf", 43, -1 },
    { "glViewportIndexedfv", 43, -1 },
@@ -863,12 +869,12 @@ const struct function gl_core_functions_possible[] = {
    { "glInvalidateSubFramebuffer", 43, -1 },
    { "glMultiDrawArraysIndirect", 43, -1 },
    { "glMultiDrawElementsIndirect", 43, -1 },
-// { "glGetProgramInterfaceiv", 43, -1 },               // XXX: Add to xml
-// { "glGetProgramResourceIndex", 43, -1 },             // XXX: Add to xml
-// { "glGetProgramResourceName", 43, -1 },              // XXX: Add to xml
-// { "glGetProgramResourceiv", 43, -1 },                // XXX: Add to xml
-// { "glGetProgramResourceLocation", 43, -1 },          // XXX: Add to xml
-// { "glGetProgramResourceLocationIndex", 43, -1 },     // XXX: Add to xml
+   { "glGetProgramInterfaceiv", 43, -1 },
+   { "glGetProgramResourceIndex", 43, -1 },
+   { "glGetProgramResourceName", 43, -1 },
+   { "glGetProgramResourceiv", 43, -1 },
+   { "glGetProgramResourceLocation", 43, -1 },
+   { "glGetProgramResourceLocationIndex", 43, -1 },
 // { "glShaderStorageBlockBinding", 43, -1 },           // XXX: Add to xml
    { "glTexBufferRange", 43, -1 },
 // { "glTextureBufferRangeEXT", 43, -1 },               // XXX: Add to xml
@@ -953,6 +959,12 @@ const struct function gl_core_functions_possible[] = {
    { "glClipControl", 45, -1 },
 
    /* GL_ARB_direct_state_access */
+   { "glCreateTransformFeedbacks", 45, -1 },
+   { "glTransformFeedbackBufferBase", 45, -1 },
+   { "glTransformFeedbackBufferRange", 45, -1 },
+   { "glGetTransformFeedbackiv", 45, -1 },
+   { "glGetTransformFeedbacki_v", 45, -1 },
+   { "glGetTransformFeedbacki64_v", 45, -1 },
    { "glCreateBuffers", 45, -1 },
    { "glNamedBufferStorage", 45, -1 },
    { "glNamedBufferData", 45, -1 },
@@ -963,6 +975,17 @@ const struct function gl_core_functions_possible[] = {
    { "glMapNamedBuffer", 45, -1 },
    { "glMapNamedBufferRange", 45, -1 },
    { "glUnmapNamedBuffer", 45, -1 },
+   { "glFlushMappedNamedBufferRange", 45, -1 },
+   { "glGetNamedBufferParameteriv", 45, -1 },
+   { "glGetNamedBufferParameteri64v", 45, -1 },
+   { "glGetNamedBufferPointerv", 45, -1 },
+   { "glGetNamedBufferSubData", 45, -1 },
+   { "glCreateFramebuffers", 45, -1 },
+   { "glNamedFramebufferRenderbuffer", 45, -1 },
+   { "glCreateRenderbuffers", 45, -1 },
+   { "glNamedRenderbufferStorage", 45, -1 },
+   { "glNamedRenderbufferStorageMultisample", 45, -1 },
+   { "glGetNamedRenderbufferParameteriv", 45, -1 },
    { "glCreateTextures", 45, -1 },
    { "glTextureStorage1D", 45, -1 },
    { "glTextureStorage2D", 45, -1 },
@@ -996,6 +1019,27 @@ const struct function gl_core_functions_possible[] = {
    { "glTextureStorage3DMultisample", 45, -1 },
    { "glTextureBuffer", 45, -1 },
    { "glTextureBufferRange", 45, -1 },
+   { "glCreateVertexArrays", 45, -1 },
+   { "glDisableVertexArrayAttrib", 45, -1 },
+   { "glEnableVertexArrayAttrib", 45, -1 },
+   { "glVertexArrayElementBuffer", 45, -1 },
+   { "glVertexArrayVertexBuffer", 45, -1 },
+   { "glVertexArrayVertexBuffers", 45, -1 },
+   { "glVertexArrayAttribFormat", 45, -1 },
+   { "glVertexArrayAttribIFormat", 45, -1 },
+   { "glVertexArrayAttribLFormat", 45, -1 },
+   { "glVertexArrayAttribBinding", 45, -1 },
+   { "glVertexArrayBindingDivisor", 45, -1 },
+   { "glGetVertexArrayiv", 45, -1 },
+   { "glGetVertexArrayIndexediv", 45, -1 },
+   { "glGetVertexArrayIndexed64iv", 45, -1 },
+   { "glCreateSamplers", 45, -1 },
+   { "glCreateProgramPipelines", 45, -1 },
+   { "glCreateQueries", 45, -1 },
+   { "glGetQueryBufferObjectiv", 45, -1 },
+   { "glGetQueryBufferObjectuiv", 45, -1 },
+   { "glGetQueryBufferObjecti64v", 45, -1 },
+   { "glGetQueryBufferObjectui64v", 45, -1 },
 
    /* GL_EXT_polygon_offset_clamp */
    { "glPolygonOffsetClampEXT", 11, -1 },