summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa/main: fix validation of transform-feedback queriesErik Faye-Lund2018-11-231-2/+3
| | | | | | | | | | | | | | | ctx->Extensions.EXT_transform_feedback is set based on the driver- capabilities, not based on the context type. We need to check against _mesa_has_EXT_transform_feedback(ctx) instead to figure out if the extension is really supported. We also need to check for OES_geometry_shader. This turns usage of GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN into an error on ES 2, as well as usage of GL_PRIMITIVES_GENERATED on ES 3, both as required by the spec. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: fix validation of GL_TIME_ELAPSEDErik Faye-Lund2018-11-231-1/+2
| | | | | | | | | | | | | | ctx->Extensions.EXT_timer_query is set based on the driver- capabilities, not based on the context type. We need to check against _mesa_has_EXT_timer_query(ctx) instead to figure out if the extension is really supported. We also need to check for EXT_disjoint_timer_query, which enables the same functionality for ES. This turns usage of GL_TIME_ELAPSED into an error on ES 3, as is required by the spec. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: fix validation of GL_ANY_SAMPLES_PASSED_CONSERVATIVEErik Faye-Lund2018-11-231-2/+2
| | | | | | | | | | | | | | | | | ctx->Extensions.ARB_ES3_compatibility is set based on the driver- capabilities, not based on the context type. We need to check against _mesa_has_ARB_ES3_compatibility(ctx) instead to figure out if the extension is really supported. In addition, EXT_occlusion_query_boolean should also allow this behavior. This shouldn't cause any functional change, as all drivers that support ES3_compatibility should in practice enable either ES3_compatibility or EXT_occlusion_query_boolean under all APIs that export this symbol. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: fix validation of GL_ANY_SAMPLES_PASSEDErik Faye-Lund2018-11-231-1/+2
| | | | | | | | | | | | | | | | | | ctx->Extensions.ARB_occlusion_query2 is set based on the driver- capabilities, not based on the context type. We need to check against _mesa_has_ARB_occlusion_query2(ctx) instead to figure out if the extension is really supported. In addition, EXT_occlusion_query_boolean should also allow this behavior. This shouldn't cause any functional change, as all drivers that support ARB_occlusion_query2 should in practice enable either ARB_occlusion_query2 or EXT_occlusion_query_boolean under all APIs that export this symbol. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: fix validation of GL_SAMPLES_PASSEDErik Faye-Lund2018-11-231-1/+2
| | | | | | | | | | | | | | | ctx->Extensions.ARB_occlusion_query is set based on the driver- capabilities, not based on the context type. We need to check against _mesa_has_ARB_occlusion_query(ctx) instead to figure out if the extension is really supported. We also need to check for ARB_occlusion_query2, as ARB_occlusion_query isn't available in core contexts. This turns usage of GL_SAMPLES_PASSED into an error on ES 3, as is required by the spec. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: simplify pipeline-statistics query validationErik Faye-Lund2018-11-231-2/+1
| | | | | | | | | | | | The _mesa_has_ARB_pipeline_statistics_query(ctx)-helper will already check the GLES-version according to the extension-table, so if this extension would ever be back-ported to ES, we only need to update the table to support this. This shouln't have any functional effect. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: use non-prefixed enums for consistencyErik Faye-Lund2018-11-231-33/+33
| | | | | | | | | These enums all have the same values as their non-prefixed versions, and there's several aliases for some of them. So let's switch to the non-prefixed versions for simplicity. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: correct year for EXT_occlusion_query_booleanErik Faye-Lund2018-11-231-1/+1
| | | | | | | | | | | According to the extension spec, this was initially released in 2011, so let's set this to the correct value. The value of 2001 could be a copy-paste mistake, as ARB_occlusion_query which this is based on was released then. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa/main: correct requirement for EXT_occlusion_query_booleanErik Faye-Lund2018-11-231-1/+1
| | | | | | | | | | | | | | | EXT_occlusion_query_boolean require support for GL_ANY_SAMPLES_PASSED, which ARB_occlusion_query doesn't supply. We need ARB_occlusion_query2 for this instead. This is still not 100% accurate, as we also require support for the GL_SAMPLES_PASSED_CONSERVATIVE target, which isn't guaranteed by either ARB_occlusion_query nor ARB_occlusion_query2. But it should be trivial to implement for any driver supporting ARB_occlusion_query2, as it can simply be implemented as GL_ANY_SAMPLES_PASSED. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Remove unneeded bitfield widths from the VAO.Mathias Fröhlich2018-11-211-2/+2
| | | | | | | | | | | | With the current VAO layout we do not need to make these fields a bitfield. We get a tight struct layout with this change for VAO attributes. v2: Change unsigned char -> GLubyte. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Factor out struct gl_vertex_format.Mathias Fröhlich2018-11-218-84/+114
| | | | | | | | | | | | | | | | Factor out struct gl_vertex_format from array attributes. The data type is supposed to describe the type of a vertex element. At this current stage the data type is only used with the VAO, but actually is useful in various other places. Due to the bitfields being used, special care needs to be taken for the glGet code paths. v2: Change unsigned char -> GLubyte. Use struct assignment for struct gl_vertex_format. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Unify glEdgeFlagPointer data type.Mathias Fröhlich2018-11-211-1/+1
| | | | | | | | | | | Use GL_UNSIGNED_BYTE as initialization data type for the edge flag vertex attribute array. The same datatype is used in the glEdgeFlagPointer function when setting the array pointer. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Work with bitmasks when en/dis-abling VAO arrays.Mathias Fröhlich2018-11-212-20/+40
| | | | | | | | | | | For enabling or disabling VAO arrays it is now possible to change a set of arrays with a single call without the need to iterate the attributes. Make use of this technique in the vao module. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Remove gl_array_attributes::Enabled.Mathias Fröhlich2018-11-213-22/+4
| | | | | | | | | Now that all users go via the VAO Enabled bitfield, get rid of the Enabled boolean. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Use gl_vertex_array_object::Enabled for glGet.Mathias Fröhlich2018-11-212-9/+36
| | | | | | | | | | | Instead of using gl_array_attributes::Enabled use the much more compact representation stored in gl_vertex_array_object::Enabled using the corresponding bits. Keep the glGet changes in a seperate patch at least for review. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Use the gl_vertex_array_object::Enabled bitfield.Mathias Fröhlich2018-11-215-43/+39
| | | | | | | | | | Instead of using gl_array_attributes::Enabled use the much more compact representation stored in gl_vertex_array_object::Enabled using the corresponding bits. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Rename gl_vertex_array_object::_Enabled -> Enabled.Mathias Fröhlich2018-11-216-24/+24
| | | | | | | | | Mark the up to now derived bitfield value now as primary value by removing the underscore. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa/glthread: pass the function name to _mesa_glthread_restore_dispatchMarek Olšák2018-11-203-4/+7
| | | | | | If you insert printf there, you'll know why glthread was disabled. Reviewed-by: Timothy Arceri <[email protected]>
* meson: Add tests to suitesDylan Baker2018-11-201-1/+2
| | | | | | | | | | | | | | | | Meson test has a concepts of suites, which allow tests to be grouped together. This allows for a subtest of tests to be run only (say only the tests for nir). A test can be added to more than one suite, but for the most part I've only added a test to a single suite, though I've added a compiler group that includes nir, glsl, and glcpp tests. To use this you'll need to invoke meson test directly, instead of ninja test (which always runs all targets). it can be invoked as: `meson test -C builddir --suite $suitename` (meson test has addition options that are pretty useful). Tested-By: Gert Wollny <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* mesa: Reference count shaders that are used by transform feedback objectsGert Wollny2018-11-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Transform feedback objects may hold a pointer to a shader program, and at least in Gallium, this must be a valid pointer until ctx->Driver.EndTransformFeedback in glEndTransformFeedback has been called - which is conform with the spec that any program that is part of a current rendering state should only be flagged for deletion by glDeleteProgram. This was not handled properly for the transform feedback objects so that a call sequence glUseProgram(x) glBeginTransformFreedback(...) glPauseTransformFeedback(...) glDeleteProgram(x) glEndTransformFeedback(...) would result in a use after free bug. With this patch the transform feedback object also updates the reference count to the used program thereby keeping the program valid as long as the transform feedback objects links to it. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108713 Fixes: 654587696b4234d09a6b471b70e9629cf2887c27 mesa: add end_transform_feedback() helper Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: mark GL_SR8_EXT non-renderable on GLESMarek Olšák2018-11-121-0/+1
| | | | | | Fixes: dEQP-GLES3.functional.fbo.completeness.renderable.texture.color0.sr8_ext Reviewed-by: Ilia Mirkin <[email protected]>
* Revert "mesa: expose NV_conditional_render on GLES"Erik Faye-Lund2018-11-091-1/+1
| | | | This reverts commit 5213be9fab72548c799b30e320dd1b257534f096.
* Revert "mesa/main: fixup make check after NV_conditional_render for gles"Erik Faye-Lund2018-11-091-4/+0
| | | | This reverts commit cccd7a253f9ed14ea748a222f58b0e5c895eb939.
* mesa/main: fixup make check after NV_conditional_render for glesErik Faye-Lund2018-11-091-0/+4
| | | | | | | | | It seems I missed some details when exposing NV_conditional_render on GLES; this fixes up "make check". Fixes: 5213be9fab7 ("mesa: expose NV_conditional_render on GLES") Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-and-Tested-by: Eric Engestrom <[email protected]>
* mesa: expose NV_conditional_render on GLESErik Faye-Lund2018-11-091-1/+1
| | | | | | | | The extension spec has been updated to include GLES 2 support, so let's enable it there. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/core: Add definitions and translations for EXT_texture_sRGB_R8Gert Wollny2018-11-028-3/+26
| | | | | | | | | | | | | | | | | | | | | | v2: - fix format definition line - disable for desktop GL - don't add GL_R8_EXT to glext.h since it is already in GLES2/gl2ext.h in glext.h and include this header where needed (all Emil) v3: - swrast: Fill the function table for sRGB_R8 The size of the function table is checked at compile time and must correspond to the number of mesa texture formats. dri/swrast being gles-2.0 doesn't support the extension though v4: - correct format layout comment (Ilia Mirkin) - correct logic for accepting GL_RED only textures (in part Ilia Mirkin) EXT_texture_sRGB_R8 requires OpenGL ES 3.0 which includes ARB_texture_rg/EXT_texture_rg, so one only must check for the first when SR8_EXT is really requested. v5: - add define for GL_ES8_XT to glheader.h and don't include GLES headers (Ilia Mirkin) Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa/glsl: add support for EXT_shader_implicit_conversionsErik Faye-Lund2018-11-021-0/+1
| | | | | | | | | | | EXT_shader_implicit_conversions adds support for implicit conversions for GLES 3.1 and above. This is essentially a subset of ARB_gpu_shader5, and augments OES_gpu_shader5. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Remove needless indirection in some draw functions.Mathias Fröhlich2018-11-022-126/+44
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Collect all the draw functions in draw.{h,c}.Mathias Fröhlich2018-11-014-96/+108
| | | | | | | | Some of these functions were distributed across different implementation and header files. Put them at a central place. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa/vbo: Move _vbo_draw_indirect -> _mesa_draw_indirectMathias Fröhlich2018-11-012-0/+85
| | | | | Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa/vbo: Move src/mesa/vbo/vbo_exec_array.c -> src/mesa/main/draw.cMathias Fröhlich2018-11-012-0/+2228
| | | | | | | | | | The array type draw is no longer directly dependent on the vbo module. Thus move array type draws into mesa/main/draw.c. Rename symbols starting with vbo_* to _mesa_* and apply some reindenting to make it consistent. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* vbo: Make no_current_update an argument to vbo_save_NotifyBegin.Mathias Fröhlich2018-11-011-1/+1
| | | | | | | | | | | Instead of coding additional information into the primitive mode, make the only remaining flag there a direct argument to vbo_save_NotifyBegin. v2: Fix incorrect no_current_update in glRectf. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* glspirv: no need to force entrypoint name to "main"Alejandro Piñeiro2018-10-311-1/+0
| | | | | | | Since commit "intel/compiler: Stop assuming the entrypoint is called "main"" there is no need to force the entrypoint name to be "main". Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: expose EXT_texture_compression_s3tc on GLESMarek Olšák2018-10-302-1/+12
| | | | | | | The spec was modified to support GLES. Tested-by: Erik Faye-Lund <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: Add missing include guardsMichał Janiszewski2018-10-302-0/+10
| | | | | | Signed-off-by: Michał Janiszewski <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* nir/validate: Print when the validation failedJason Ekstrand2018-10-261-1/+1
| | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* util: use C99 declaration in the for-loop set_foreach() macroEric Engestrom2018-10-251-1/+0
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* util: use C99 declaration in the for-loop hash_table_foreach() macroEric Engestrom2018-10-251-3/+0
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa/glformats: Remove redundant helper _mesa_base_format_component_countEduardo Lima Mitev2018-10-233-32/+2
| | | | | | | There exists _mesa_components_in_format() which already includes all cases handled in _mesa_base_format_component_count(). Reviewed-by: Tapani Pälli <[email protected]>
* mesa: Fix pack_uint_Z_FLOAT32()Illia Iorin2018-10-111-12/+9
| | | | | | | | | | | | Fixed pack_uint_Z_FLOAT32 by casting row data to float instead uint. Remove code duplicate function pack_uint_Z_FLOAT32_X24S8. Edited case in "_mesa_get_pack_uint_z_func". Now it looks like "_mesa_get_pack_float_z_func". Remove _mesa_problem call, which was added for debuging this issue. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91433 Signed-off-by: Illia Iorin <[email protected]> Reviewed-by: Nanley Chery <[email protected]>
* glspirv: drop pointless assert (size_t is unsigned)Dave Airlie2018-10-111-2/+0
| | | | | | Found by coverity Reviewed-by: Alejandro Piñeiro <[email protected]>
* Revert "mesa: remove unnecessary 'sort by year' for the GL extensions"Emil Velikov2018-10-031-2/+44
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3d81e11b49366b5636b8524ba0f8c7076e3fdf34. As reported by Federico, some games require the 'sort by year' since they truncate the extensions which do not fit the fixed size string array. Seemingly I did not consider that, as the documentation (both Mesa and Nvidia) mentions about program crashes ... which are worked around by setting the env. variable. This commit reinstates the workaround and enhances the documentation. Cc: Marek Olšák <[email protected]> Cc: Ian Romanick <[email protected]> Reported-by: Federico Dossena <[email protected]> Fixes: 3d81e11b493 ("mesa: remove unnecessary 'sort by year' for the GL extensions") Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Tested-by: Federico Dossena <[email protected]>
* mesa: reorder and document the tokens in glheader.hEmil Velikov2018-10-031-16/+23
| | | | | | | | Split into different sections, document each one as well as strange cases like GL_ATI_texture_compression_3dc. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove duplicate declarations from glheader.hEmil Velikov2018-10-031-54/+0
| | | | | | | | | Remove all the desktop GL and GLX entries from the list. Former are pulled by the gl.h and glext.h includes at the top while the latter are no longer needed. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: fold _glapi_check_multithread() back into _mesa_make_currentEmil Velikov2018-10-031-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | With commit c6c0f947142, back in 2006 Brian removed the _glapi_check_multithread() call from core mesa - _mesa_make_current. It was done to remove fairly awkward #ifdef guard which caused subtle differences in core mesa. Since that guard is long gone, we can drop the duplication and reintroduce the call in core. Note that the function is was missing when using EGL + classic dri HW drivers. Yet on TLS builds it's a no-op, so we're safe. Any non TLS users - more or less anything !Linux (or even musl on Linux up-to semi-recently) may have experienced problems. v2: don't remove the call from swrast - move it to core (Eric) Cc: Eric Anholt <[email protected]> Cc: Brian Paul <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: use C99 initializer in get_gl_override()Emil Velikov2018-10-031-4/+4
| | | | | | | | | The overrides array contains entries indexed on the gl_api enum. Use a C99 initializer to make it a bit more obvious. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* mesa: use GLsizeiptrARB, GLintptrARB in bufferobj.cBrian Paul2018-09-201-3/+3
| | | | | | | | | | | | | | | The function pointer declarations in dd.h for the BufferData() and BufferSubData() use the ARB-suffixed datatypes. This patch changes the buffer_data_fallback() and buffer_sub_data_fallback() functions to use those datatypes too. This fixes a build warning when building 32-bit libraries. Evidently, GLsizeiptrARB and GLsizeiptr are defined differently in that situation. All all implementations of these driver hooks use the ARB-suffixed types. Reviewed-by: Mathias Fröhlich <[email protected]>
* Revert "mesa: only update framebuffer-state for clears"Jakob Bornecrantz2018-09-191-20/+14
| | | | This reverts commit fb86365148d5b8f3f06c5e42d9c8440fc1f6693f.
* mesa: only update framebuffer-state for clearsErik Faye-Lund2018-09-191-14/+20
| | | | | | | | If we update the program-state etc, we risk compiling needless shaders, which can cost quite a bit of performance. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: enable EXT_framebuffer_object in core profileTimothy Arceri2018-09-183-25/+15
| | | | | | | | | | | | Since user defined names are not allowed in core profile we remove the allow_user_names bool and just check if we have a core profile like all other buffer/texture object handling code does. This extension is required by "Wolfenstein: The Old Blood" and is exposed in core in the Nvidia binary driver. Reviewed-by: Marek Olšák <[email protected]>