diff options
author | Jordan Justen <[email protected]> | 2012-10-23 18:00:11 -0700 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2012-11-03 10:54:41 -0700 |
commit | 83b6a7cdaa86e2859177abab0e0117f208ddbe6c (patch) | |
tree | 41e1aec8cfea2bc1db5e7429dd17784dddfdb593 | |
parent | 7e64fe583f625c01d6a6eed664f5a4f808607830 (diff) |
dispatch_sanity test: allow newer functions to be set to NOP
If a GL function was introduced in a later GL version than the
context we are testing, then it is okay if it is set to the
_mesa_generic_nop function.
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Paul Berry <[email protected]>
-rw-r--r-- | src/mesa/main/tests/dispatch_sanity.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index 474413cbf57..a54653b8028 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -117,6 +117,12 @@ validate_functions(struct gl_context *ctx, const struct function *function_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. + */ + bool cant_be_nop = ctx->Version >= function_table[i].Version; + const int offset = (function_table[i].offset != -1) ? function_table[i].offset : _glapi_get_proc_offset(function_table[i].name); @@ -126,9 +132,11 @@ validate_functions(struct gl_context *ctx, const struct function *function_table ASSERT_EQ(offset, _glapi_get_proc_offset(function_table[i].name)) << "Function: " << function_table[i].name; - EXPECT_NE((_glapi_proc) _mesa_generic_nop, table[offset]) - << "Function: " << function_table[i].name - << " at offset " << offset; + if (cant_be_nop) { + EXPECT_NE((_glapi_proc) _mesa_generic_nop, table[offset]) + << "Function: " << function_table[i].name + << " at offset " << offset; + } table[offset] = (_glapi_proc) _mesa_generic_nop; } |