summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: minor fix-ups for _mesa_validate_sync()Brian Paul2013-10-012-4/+13
| | | | | | Return bool instead of int. Const-qualify the syncObj. Add some comments. Reviewed-by: Ian Romanick <[email protected]>
* mesa: add missing error checks in _mesa_GetObject[Ptr]Label()Brian Paul2013-10-011-0/+12
| | | | | | | | | | | Error checking bufSize isn't mentioned in the spec, but it is in the man pages. However, I believe the man page is incorrect. Typically, GL functions that take GLsizei parameters check that they're positive or non-negative. Negative values don't make sense here. A spec bug has been filed with Khronos/ARB. v2: check for negative values, not <= 0.
* mesa: use caller string in error message in get_label_pointer()Brian Paul2013-10-011-1/+1
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* mesa: asst. clean-ups in copy_label()Brian Paul2013-10-011-10/+27
| | | | | | | | | | | This incorporates Vinson's change to check for a null src pointer as detected by coverity. Also, rename the function params to be src/dst, const-qualify src, and use GL types to match the calling functions. And add some more comments. Reviewed-by: Timothy Arceri <[email protected]>
* mesa: Remove all traces of GL_OES_matrix_getIan Romanick2013-09-303-12/+0
| | | | | | | | | | | | | I believe this extension was enabled by accident. As far as I can tell, there has never been any code in Mesa to actually support it. Not only that, this extension is only useful in the common-lite profile, and Mesa does the common profile. This "fixes" the piglit test oes_matrix_get-api. Signed-off-by: Ian Romanick <[email protected]> Cc: "9.1 9.2" <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Include stdint.h in mtypes.h for uint32_t symbol.Vinson Lee2013-09-261-0/+2
| | | | | | | | | | | | | This patch fixes the MSVC build error introduced with commit b2e327e08f8519da131dd382adcc99240d433404. api_arrayelt.c src\mesa\main/mtypes.h(1809) : error C2061: syntax error : identifier 'uint32_t' src\mesa\main/mtypes.h(1810) : error C2059: syntax error : '}' src\mesa\main/mtypes.h(1825) : error C2079: 'Minimum' uses undefined union 'gl_perf_monitor_counter_value' src\mesa\main/mtypes.h(1828) : error C2079: 'Maximum' uses undefined union 'gl_perf_monitor_counter_value' Signed-off-by: Vinson Lee <[email protected]>
* mesa: Add core support for the GL_AMD_performance_monitor extension.Kenneth Graunke2013-09-267-0/+820
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This provides an interface for applications (and OpenGL-based tools) to access GPU performance counters. Since the exact performance counters available vary between vendors and hardware generations, the extension provides an API the application can use to get the names, types, and minimum/maximum values of all available counters. Counters are also organized into groups. Applications create "performance monitor" objects, select the counters they want to track, and Begin/End monitoring, much like OpenGL's query API. Multiple monitors can be in flight simultaneously. v2: Pass ctx to all driver hooks (suggested by Christoph), and attempt to fix overallocation of bitsets (caught by Christoph). Incomplete. v3: Significantly rework core data structures. Store counters in groups rather than in a global list. Use their array index in the group's counter list as the ID rather than trying to store a globally unique counter ID. Use bitsets for active counters within a group, and also track which groups are active so that's easy to query. v4: Remove _mesa_ prefix on static functions; detect out of memory conditions in new_performance_monitor(); make BeginPerfMonitor hook return a boolean rather than setting m->Active or raising an error. Switch to GLuint/unsigned for NumGroups, NumCounters, and MaxActiveCounters (which also means switching a bunch of temporary variable types). All suggested by Brian Paul. Also, remove commented out code at the bottom of the block. Finally, fix the dispatch sanity test (noticed by Ian Romanick). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Brian Paul <[email protected]> [v3] Reviewed-by: Ian Romanick <[email protected]>
* mesa: Remove 'invalidate_state' parameter to _mesa_dirty_texobj().Kenneth Graunke2013-09-264-12/+8
| | | | | | | Every caller passed true. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Remove some remaining FEATURE_* detritus.Eric Anholt2013-09-261-2/+1
| | | | | Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove handcounted magic numberDylan Noblesmith2013-09-241-13/+20
| | | | | | Also make it a compile-time error with STATIC_ASSERT. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove outdated commentDylan Noblesmith2013-09-241-1/+0
| | | | | | | | | | | | | | No such argument exists since this commit: commit 92f3fca0ea429dcf07123e63447449db53308266 Author: Ian Romanick <[email protected]> AuthorDate: Sun Aug 21 17:23:58 2011 -0700 Commit: Ian Romanick <[email protected]> CommitDate: Tue Aug 23 14:52:09 2011 -0700 mesa: Remove target parameter from dd_function_table::BufferSubData Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: remove stale commentDylan Noblesmith2013-09-241-2/+0
| | | | | | | This line stopped making sense in the great sed replace of commit f9995b30756140724f41daf963fa06167912be7f Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Shrink the size of the enum string lookup struct.Eric Anholt2013-09-231-0/+9
| | | | | | | | | | Since it's only used for debug information, we can misalign the struct and save the disk space. Another 19k on a 64-bit build. v2: Make a compiler.h macro to only use the attribute if we know we can. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Remove _mesa_lookup_enum_by_name().Eric Anholt2013-09-232-34/+0
| | | | | | | | It's been unused for a long time. I stopped digging through git history as of 2009. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Silence GCC warning 'comparison between signed and unsigned integer ↵Ian Romanick2013-09-191-1/+1
| | | | | | | | | expressions' Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Fix broken call to print_table_statsIan Romanick2013-09-191-1/+3
| | | | | | | | | | The function takes a parameter, but none was given. Also, in the non-GET_DEBUG case, silence the unused parameter warning. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Allow several ARB_geometry_shader4 queries in OpenGL 3.2Ian Romanick2013-09-192-4/+10
| | | | | | | | | | | | GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS, GL_MAX_GEOMETRY_OUTPUT_VERTICES, GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS, and GL_MAX_GEOMETRY_UNIFORM_COMPONENTS all have the same enum value and meaning as their _ARB counterparts. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Expose MAX_GEOMETRY_{INPUT,OUTPUT}_COMPONENTS on OpenGL 3.2Ian Romanick2013-09-191-1/+3
| | | | | | | | | | | | | | | The comment '# GL 3.0 / GLES3' was incorrect. The MAX_VERTEX_OUTPUT_COMPONENTS and MAX_FRAGMENT_INPUT_COMPONENTS queries were added in OpenGL 3.2 (with geometry shaders) and OpenGL ES 3.0. This just fixes that comment. v2: Add the GEOMETRY queries in the existing '# GL 3.2' section since they have nothing to do with GLES3. Suggested by Paul. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Get GL_MAX_FRAGMENT_INPUT_COMPONENTS from ↵Ian Romanick2013-09-192-2/+1
| | | | | | | | | | | | FragmentProgram.MaxInputComponents In OpenGL ES 3.0 the minimum-maximum for GL_MAX_VERTEX_OUTPUT_VECTORS is 16, but the minimum-maximum for GL_MAX_FRAGMENT_INTPUT_VECTORS is 15. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Get GL_MAX_VERTEX_OUTPUT_COMPONENTS from VertexProgram.MaxOutputComponentsIan Romanick2013-09-192-2/+1
| | | | | | | | | | In OpenGL ES 3.0 the minimum-maximum for GL_MAX_VERTEX_OUTPUT_VECTORS is 16, but the minimum-maximum for GL_MAX_FRAGMENT_INTPUT_VECTORS is 15. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Set default values for Max{Input,Output}Components in init_program_limitsIan Romanick2013-09-191-0/+6
| | | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* mesa: Remove gl_constants::MaxVaryingComponentsIan Romanick2013-09-191-1/+0
| | | | | | | | | | There are no longer any users. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]> Cc: Zack Rusin <[email protected]>
* mesa: Use correct data for MAX_{VERTEX,GEOMETRY}_VARYING_COMPONENTS_ARB queriesIan Romanick2013-09-191-2/+2
| | | | | | | | | | | | | | | | | | | | | Previously gl_constants::MaxVaryingComponents was used. Now gl_constants::VertexProgram::MaxOutputs and gl_constants::GeometryProgram::MaxOutputs are used. This means that st_extensions.c had to be updated to set these fields instead of MaxVaryingComponents. It was previously the only place that set MaxVaryingComponents. I believe that the structure is allocated by calloc, so the value should be initialized to zero in non-Gallium drivers before and after my change. Right now nobody enables GL_ARB_geometry_shader4, so it's pretty much dead code anyway. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]> Cc: Zack Rusin <[email protected]>
* mesa: Track per-stage shader input and output limits independentlyIan Romanick2013-09-191-0/+24
| | | | | | | | | | | | | | | | | | | | | | | In OpenGL 3.2 these are independently queryable. In addition, the spec has different minimum-maximums for various values. GL_MAX_VERTEX_OUTPUT_COMPONENTS is 64, but GL_MAX_GEOMETRY_OUTPUT_COMPONENTS (and GL_MAX_FRAGMENT_INPUT_COMPONENTS) is 128. In OpenGL ES 3.0 these are also independently queryable. The spec has different minimum-maximums for various values. GL_MAX_VERTEX_OUTPUT_VECTORS is 16, but GL_MAX_FRAGMENT_INTPUT_VECTORS is 15. None of these values are used yet. I have just added space to the structures. Future patches will add users and eventually remove some old fields. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]> Cc: Zack Rusin <[email protected]>
* mesa: Support GL_MAX_VERTEX_OUTPUT_COMPONENTS query with ES3Ian Romanick2013-09-192-0/+2
| | | | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Paul Berry <[email protected]> Cc: "9.1 9.2" <[email protected]>
* mesa: Rename MESA_shader_integer_mix to EXT_shader_integer_mixIan Romanick2013-09-132-2/+2
| | | | | | | | | | | | | | Everyone at the Khronos meeting was as surprised that GLSL didn't already support this as we were. Several vendors said they'd ship it, but there didn't seem to be enough interest to put in the effort to make it ARB or KHR. v2: Fix a couple typos and rename the spec file to EXT_shader_integer_mix.spec. Suggested by Roland. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* mesa: Disallow relinking if a program is used by an active XFB object.Kenneth Graunke2013-09-123-7/+47
| | | | | | | | | | | | | | | | | Paused transform feedback objects may refer to a program other than the current program. If any active objects refer to a program, LinkProgram must reject the request to relink. The code to detect this is ugly since _mesa_HashWalk is awkward to use, but unfortunately we can't use hash_table_foreach since there's no way to get at the underlying struct hash_table (and even then, we'd need to handle locking somehow). Fixes the last subcase of Piglit's new ARB_transform_feedback2 api-errors test. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Reject ResumeTransformFeedback if the wrong program is bound.Kenneth Graunke2013-09-121-0/+11
| | | | | | | | | | | This is actually a pretty important error condition: otherwise, you could set up transform feedback with one program, and resume it with a program that generates a completely different set of outputs. Fixes a subcase of Piglit's new ARB_transform_feedback2 api-errors test. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Track the vertex program active at BeginTransformFeedback() time.Kenneth Graunke2013-09-122-0/+8
| | | | | | | | | | The next few patches will use this for API error checking. All of the drivers appear to CALLOC_STRUCT transform feedback objects, so this should be properly NULL initialized on creation. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: Disallow TransformFeedbackVaryings when active.Kenneth Graunke2013-09-121-0/+10
| | | | | | | Fixes a subcase of Piglit's new ARB_transform_feedback2 api-errors test. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* glsl: During linking, record whether a GS uses EndPrimitive().Paul Berry2013-09-112-0/+3
| | | | | | | | | This information will be useful in the i965 back end, since we can save some compilation effort if we know from the outset that the shader never calls EndPrimitive(). Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use correct enum conversion function.Vinson Lee2013-09-101-1/+1
| | | | | | | Fixes "Mixing enum types" defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Ensure gl_sync_object is fully initialized.Vinson Lee2013-09-101-1/+1
| | | | | | | | | | | | 278372b47e4db8a022d57f60302eec74819e9341 added the uninitialized pointer field gl_sync_object:Label. A free of this pointer, added in commit 6d8dd59cf53d2f47b817d79204a52bb3a46e8c77, resulted in a crash. This patch fixes piglit ARB_sync regressions with swrast introduced by 6d8dd59cf53d2f47b817d79204a52bb3a46e8c77. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* glsl: Implement MESA_shader_integer_mix extension.Matt Turner2013-09-092-1/+3
| | | | | | | Because why doesn't GLSL allow you to do this already? Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Always use seamless cubemap filtering in GLES3Ian Romanick2013-09-081-0/+8
| | | | | | | | | | | | | | | | | | | | | | | Appendix F.2 of the OpenGL ES 3.0.0 spec says: "OpenGL ES 3.0 requires that all cube map filtering be seamless. OpenGL ES 2.0 specified that a single cube map face be selected and used for filtering." Setting the field only in the context will work fine with sampler objects (and drivers that support AMD_seamless_cubemap_per_texture) because seamless filtering is used if *either* the context or the sampler enable it: "If TEXTURE_CUBE_MAP_SEAMLESS_ARB is emabled (sic) globally or the value of the texture's TEXTURE_CUBE_MAP_SEAMLESS_ARB parameter is TRUE, seamless cube map sampling is enabled..." Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Paul Berry <[email protected]> Reported-by: Maxence Le Dore <[email protected]> Thanked-by: Maxence Le Dore <[email protected]>
* mesa: Don't allow glSamplerParameteriv(GL_TEXTURE_CUBE_MAP_SEAMLESS) in ESIan Romanick2013-09-081-1/+2
| | | | | | | | | | There is no GL_TEXTURE_CUBE_MAP_SEAMLESS in any version of OpenGL ES or in any extension that applies to OpenGL ES. The same error check already occurs for glTexParameteri. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chris Forbes <[email protected]> Cc: Maxence Le Dore <[email protected]>
* mesa: Ensure gl_query_object is fully initialized.Vinson Lee2013-09-061-1/+1
| | | | | | | | | | | | 278372b47e4db8a022d57f60302eec74819e9341 added the uninitialized pointer field gl_query_object:Label. A free of this pointer resulted in a crash. This patch fixes piglit regressions with swrast introduced by 6d8dd59cf53d2f47b817d79204a52bb3a46e8c77. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69047 Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add GL_KHR_debug functions to dispatch_sanity.cppBrian Paul2013-09-061-0/+12
| | | | | | Fixes 'make check' failures. Reviewed-by: Ian Romanick <[email protected]>
* mesa: Setup remaining infrastucture and enable KHR_debugTimothy Arceri2013-09-042-5/+12
| | | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Remap debug type and severityTimothy Arceri2013-09-042-8/+58
| | | | | | | | | Remap any type or severity exclusive to KHR_debug to something suitable for ARB_debug_output Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Implement GL_DEBUG_OUTPUTTimothy Arceri2013-09-043-0/+13
| | | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Implement KHR_debug ObjectLabel functionsTimothy Arceri2013-09-042-0/+343
| | | | | | | | | | | | | | V3: make sure to add null terminator when setting label, generate error when the client specifies an explicit length that exceeds MAX_LABEL_LENGTH, set label pointer to NULL when freed, and output correct length in MAX_LABEL_LENGTH error message. V2: fixed indentation of comment Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: make _mesa_validate_sync() non-staticTimothy Arceri2013-09-042-1/+4
| | | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: free object labels when deletingTimothy Arceri2013-09-0411-0/+14
| | | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add debug Label field to several data structuresTimothy Arceri2013-09-041-0/+12
| | | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: make _mesa_lookup_list() non-staticTimothy Arceri2013-09-042-6/+8
| | | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: make _mesa_lookup_arrayobj() non-staticTimothy Arceri2013-09-042-5/+8
| | | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Implement glPushDebugGroup and glPopDebugGroupTimothy Arceri2013-09-043-71/+214
| | | | | | | | | | | | V4: fixes _mesa_error() compiler warnings (BrianP). V3: removed C++ style comment V2: fixed spelling typo in comment Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add a clone function to mesa hashTimothy Arceri2013-09-042-0/+31
| | | | | | | | V2: const qualify table parameter Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Share common code between ARB_debug_output and KHR_debug functionsTimothy Arceri2013-09-042-97/+226
| | | | | | Signed-off-by: Timothy Arceri <[email protected]> Reviewed-by: Brian Paul <[email protected]>