diff options
Diffstat (limited to 'mesalib/src/mesa/main')
-rw-r--r-- | mesalib/src/mesa/main/api_arrayelt.c | 22 | ||||
-rw-r--r-- | mesalib/src/mesa/main/arbprogram.c | 6 | ||||
-rw-r--r-- | mesalib/src/mesa/main/context.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/main/mtypes.h | 30 | ||||
-rw-r--r-- | mesalib/src/mesa/main/performance_monitor.c | 16 | ||||
-rw-r--r-- | mesalib/src/mesa/main/texstorage.c | 7 | ||||
-rw-r--r-- | mesalib/src/mesa/main/varray.h | 6 |
7 files changed, 66 insertions, 23 deletions
diff --git a/mesalib/src/mesa/main/api_arrayelt.c b/mesalib/src/mesa/main/api_arrayelt.c index 6822465e8..c9d4d038f 100644 --- a/mesalib/src/mesa/main/api_arrayelt.c +++ b/mesalib/src/mesa/main/api_arrayelt.c @@ -1469,6 +1469,18 @@ check_vbo(AEcontext *actx, struct gl_buffer_object *vbo) } +static inline void +update_derived_client_arrays(struct gl_context *ctx) +{ + struct gl_array_object *arrayObj = ctx->Array.ArrayObj; + + if (arrayObj->NewArrays) { + _mesa_update_array_object_client_arrays(ctx, arrayObj); + arrayObj->NewArrays = 0; + } +} + + /** * Make a list of per-vertex functions to call for each glArrayElement call. * These functions access the array data (i.e. glVertex, glColor, glNormal, @@ -1486,12 +1498,6 @@ _ae_update_state(struct gl_context *ctx) actx->nr_vbos = 0; - if (arrayObj->NewArrays) { - /* update the derived client arrays */ - _mesa_update_array_object_client_arrays(ctx, arrayObj); - arrayObj->NewArrays = 0; - } - /* conventional vertex arrays */ if (arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Enabled) { aa->array = &arrayObj->_VertexAttrib[VERT_ATTRIB_COLOR_INDEX]; @@ -1618,6 +1624,8 @@ _ae_map_vbos(struct gl_context *ctx) if (actx->mapped_vbos) return; + update_derived_client_arrays(ctx); + if (actx->NewState) _ae_update_state(ctx); @@ -1669,6 +1677,8 @@ _ae_ArrayElement(GLint elt) const struct _glapi_table * const disp = GET_DISPATCH(); GLboolean do_map; + update_derived_client_arrays(ctx); + /* If PrimitiveRestart is enabled and the index is the RestartIndex * then we call PrimitiveRestartNV and return. */ diff --git a/mesalib/src/mesa/main/arbprogram.c b/mesalib/src/mesa/main/arbprogram.c index 51a299370..8bd3f0bd0 100644 --- a/mesalib/src/mesa/main/arbprogram.c +++ b/mesalib/src/mesa/main/arbprogram.c @@ -265,6 +265,12 @@ get_local_param_pointer(struct gl_context *ctx, const char *func, return GL_FALSE; } + if (!prog->LocalParams) { + prog->LocalParams = calloc(maxParams, sizeof(float[4])); + if (!prog->LocalParams) + return GL_FALSE; + } + *param = prog->LocalParams[index]; return GL_TRUE; } diff --git a/mesalib/src/mesa/main/context.c b/mesalib/src/mesa/main/context.c index d005d2370..8cbc9352a 100644 --- a/mesalib/src/mesa/main/context.c +++ b/mesalib/src/mesa/main/context.c @@ -494,7 +494,7 @@ init_program_limits(struct gl_context *ctx, GLenum type, prog->MaxParameters = MAX_VERTEX_PROGRAM_PARAMS; prog->MaxAttribs = MAX_VERTEX_GENERIC_ATTRIBS; prog->MaxAddressRegs = MAX_VERTEX_PROGRAM_ADDRESS_REGS; - prog->MaxUniformComponents = MAX_GEOMETRY_UNIFORM_COMPONENTS; + prog->MaxUniformComponents = 4 * MAX_UNIFORMS; prog->MaxInputComponents = 16 * 4; /* old limit not to break tnl and swrast */ prog->MaxOutputComponents = 16 * 4; /* old limit not to break tnl and swrast */ break; diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h index 41ffdb765..8801d6f61 100644 --- a/mesalib/src/mesa/main/mtypes.h +++ b/mesalib/src/mesa/main/mtypes.h @@ -1846,9 +1846,19 @@ struct gl_transform_feedback_state */ struct gl_perf_monitor_object { + GLuint Name; + + /** True if the monitor is currently active (Begin called but not End). */ GLboolean Active; /** + * True if the monitor has ended. + * + * This is distinct from !Active because it may never have began. + */ + GLboolean Ended; + + /** * A list of groups with currently active counters. * * ActiveGroups[g] == n if there are n counters active from group 'g'. @@ -1930,10 +1940,9 @@ struct gl_perf_monitor_state * NOTE: first four tokens must fit into 2 bits (see t_vb_arbprogram.c) * All values should fit in a 4-bit field. * - * NOTE: PROGRAM_ENV_PARAM, PROGRAM_STATE_VAR, - * PROGRAM_CONSTANT, and PROGRAM_UNIFORM can all be considered to - * be "uniform" variables since they can only be set outside glBegin/End. - * They're also all stored in the same Parameters array. + * NOTE: PROGRAM_STATE_VAR, PROGRAM_CONSTANT, and PROGRAM_UNIFORM can all be + * considered to be "uniform" variables since they can only be set outside + * glBegin/End. They're also all stored in the same Parameters array. */ typedef enum { @@ -1941,8 +1950,6 @@ typedef enum PROGRAM_ARRAY, /**< Arrays & Matrixes */ PROGRAM_INPUT, /**< machine->Inputs[] */ PROGRAM_OUTPUT, /**< machine->Outputs[] */ - PROGRAM_LOCAL_PARAM, /**< gl_program->LocalParams[] */ - PROGRAM_ENV_PARAM, /**< gl_program->Parameters[] */ PROGRAM_STATE_VAR, /**< gl_program->Parameters[] */ PROGRAM_CONSTANT, /**< gl_program->Parameters[] */ PROGRAM_UNIFORM, /**< gl_program->Parameters[] */ @@ -2038,8 +2045,15 @@ struct gl_program /** Named parameters, constants, etc. from program text */ struct gl_program_parameter_list *Parameters; - /** Numbered local parameters */ - GLfloat LocalParams[MAX_PROGRAM_LOCAL_PARAMS][4]; + + /** + * Local parameters used by the program. + * + * It's dynamically allocated because it is rarely used (just + * assembly-style programs), and MAX_PROGRAM_LOCAL_PARAMS entries once it's + * allocated. + */ + GLfloat (*LocalParams)[4]; /** Map from sampler unit to texture unit (set by glUniform1i()) */ GLubyte SamplerUnits[MAX_SAMPLERS]; diff --git a/mesalib/src/mesa/main/performance_monitor.c b/mesalib/src/mesa/main/performance_monitor.c index 17cae5183..6491b4200 100644 --- a/mesalib/src/mesa/main/performance_monitor.c +++ b/mesalib/src/mesa/main/performance_monitor.c @@ -62,6 +62,10 @@ new_performance_monitor(struct gl_context *ctx, GLuint index) if (m == NULL) return NULL; + m->Name = index; + + m->Active = false; + m->ActiveGroups = rzalloc_array(NULL, unsigned, ctx->PerfMonitor.NumGroups); @@ -355,8 +359,10 @@ _mesa_DeletePerfMonitorsAMD(GLsizei n, GLuint *monitors) if (m) { /* Give the driver a chance to stop the monitor if it's active. */ - if (m->Active) + if (m->Active) { ctx->Driver.ResetPerfMonitor(ctx, m); + m->Ended = false; + } _mesa_HashRemove(ctx->PerfMonitor.Monitors, monitors[i]); ralloc_free(m->ActiveGroups); @@ -474,6 +480,7 @@ _mesa_BeginPerfMonitorAMD(GLuint monitor) */ if (ctx->Driver.BeginPerfMonitor(ctx, m)) { m->Active = true; + m->Ended = false; } else { _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginPerfMonitor(driver unable to begin monitoring)"); @@ -503,6 +510,7 @@ _mesa_EndPerfMonitorAMD(GLuint monitor) ctx->Driver.EndPerfMonitor(ctx, m); m->Active = false; + m->Ended = true; } /** @@ -560,8 +568,12 @@ _mesa_GetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, return; } + /* If the monitor has never ended, there is no result. */ + bool result_available = m->Ended && + ctx->Driver.IsPerfMonitorResultAvailable(ctx, m); + /* AMD appears to return 0 for all queries unless a result is available. */ - if (!ctx->Driver.IsPerfMonitorResultAvailable(ctx, m)) { + if (!result_available) { *data = 0; if (bytesWritten != NULL) *bytesWritten = sizeof(GLuint); diff --git a/mesalib/src/mesa/main/texstorage.c b/mesalib/src/mesa/main/texstorage.c index 7bd8652b5..84b8f8224 100644 --- a/mesalib/src/mesa/main/texstorage.c +++ b/mesalib/src/mesa/main/texstorage.c @@ -365,6 +365,13 @@ texstorage(GLuint dims, GLenum target, GLsizei levels, GLenum internalformat, GET_CURRENT_CONTEXT(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexStorage%uD %s %d %s %d %d %d\n", + dims, + _mesa_lookup_enum_by_nr(target), levels, + _mesa_lookup_enum_by_nr(internalformat), + width, height, depth); + if (tex_storage_error_check(ctx, dims, target, levels, internalformat, width, height, depth)) { return; /* error was recorded */ diff --git a/mesalib/src/mesa/main/varray.h b/mesalib/src/mesa/main/varray.h index 3b9f39a61..bc820ed23 100644 --- a/mesalib/src/mesa/main/varray.h +++ b/mesalib/src/mesa/main/varray.h @@ -110,12 +110,6 @@ extern void GLAPIENTRY _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); -extern void GLAPIENTRY -_mesa_UnlockArraysEXT( void ); - -extern void GLAPIENTRY -_mesa_LockArraysEXT(GLint first, GLsizei count); - extern void GLAPIENTRY _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr); |