summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa/glsl: Move string_to_uint_map into the util folderThomas Helland2016-09-122-2/+2
| | | | | | | | | | This clears the last bits of the usecases of the hash table located in mesa/program, allowing us to remove it. V2: Rebase on top of changes to Makefile.sources Signed-off-by: Thomas Helland <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: Remove unused hash table includesThomas Helland2016-09-121-1/+0
| | | | | | | This should prevent us from rebuilding the world. Signed-off-by: Thomas Helland <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa/formatquery: limit ES target support, fix core context supportIlia Mirkin2016-09-061-7/+8
| | | | | | | | | | | | | | | | | First off, as late as ES 3.2, GetInternalformat only supports RENDERBUFFER and 2DMS(_ARRAY) targets. Secondly, the _mesa_has_ext helpers are very accurate... a little too accurate, some might say. If we only show an extension in compat profiles because core profiles have the functionality guaranteed, they will return false. Fix these to either check for a core profile explicitly, or to a different-but-identical extension available in core profile. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Matteo Bruni <[email protected]> Tested-by: Matteo Bruni <[email protected]> Cc: [email protected]
* main: GL_RGB10_A2UI does not come with GL 3.0/EXT_texture_integerIlia Mirkin2016-09-061-1/+7
| | | | | | | | | | | Add a separate extension check for that format. Prevents glTexImage from trying to find a matching format, which fails on drivers without support for this format. Fixes: sized-texture-format-channels (on a3xx) Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Cc: [email protected]
* mesa: Fix types in _mesa_get_color_read_format().Kenneth Graunke2016-09-051-1/+1
| | | | | | | This is a mesa_format, not a GLenum. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* main: add KHR_robustness to ES 3.2 extension requirementsIlia Mirkin2016-09-031-0/+1
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: add gl_BoundingBox and associated varying slotsIlia Mirkin2016-08-301-0/+5
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: add support for GL_PRIMITIVE_BOUNDING_BOX storage and queryIlia Mirkin2016-08-304-0/+57
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: add scaffolding for OES/EXT_primitive_bounding_boxIlia Mirkin2016-08-307-1/+95
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Calculate bitset of secondary outputs written in ir_set_program_inouts.Francisco Jerez2016-08-301-0/+1
| | | | Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: fix format conversion bug in get_tex_rgba_uncompressed()Brian Paul2016-08-291-6/+8
| | | | | | | | | | | We need to set the need_convert flag with each loop iteration, not just when the rgba pointer is null. Bug reported by Markus Müller <[email protected]> on mesa-users list. Fixes new piglit arb_texture_float-get-tex3d test. Cc: <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: add EXT_texture_cube_map_array supportIlia Mirkin2016-08-281-0/+1
| | | | | | | | This is identical to OES_texture_cube_map_array support. dEQP has tests which use this extension. Also it is part of AEP. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove OES_shader_io_blocks enableIlia Mirkin2016-08-282-3/+2
| | | | | | | | | | This extension should just be available whenever ES 3.1 is available. With the new extension verification infrastructure, it will only be enable-able on a #version 310 es shader, rendering the original reason for having a separate enable moot. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* main: use KHR_blend_equation_advanced enable for ES 3.2 availabilityIlia Mirkin2016-08-281-1/+1
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* main: add missing EXTRA_END in OES_sample_variables get checkIlia Mirkin2016-08-281-0/+1
| | | | | | | Fixes: 3002296cb68 (mesa: add GL_OES_shader_multisample_interpolation support) Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Cc: <[email protected]>
* mesa/version: OpenGL ES 3.2 depends on OES_texture_cube_map_arrayIan Romanick2016-08-261-1/+1
| | | | | | | | This has a separate enable from ARB_texture_cube_map_array. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add support for OES_texture_cube_map_arrayIan Romanick2016-08-269-11/+16
| | | | | | | | | | | This has a separate enable flag because this extension also requires OES_geometry_shader. It is possible that some drivers may support OpenGL ES 3.1 and ARB_texture_cube_map but not support OES_geometry_shader. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add and use _mesa_has_texture_cube_map_array helperIan Romanick2016-08-263-8/+13
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Use _mesa_has_ARB_texture_cube_map_array instead of open-coding itIan Romanick2016-08-263-4/+3
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Cosmetic changes in legal_texobj_targetIan Romanick2016-08-261-12/+12
| | | | | | | | Use bool instead of GLboolean and constify ctx. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Rearrange legal_texobj_target to look more like ↵Ian Romanick2016-08-261-11/+26
| | | | | | | | | | | _mesa_legal_get_tex_level_parameter_target This makes it a bit easier to add support for more features in different APIs. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Allow GL_EXT_geometry_shader and GL_EXT_geometry_point_sizeIan Romanick2016-08-262-0/+6
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Document reasons for allowing XFB drawing modes in GLES 3.1 ↵Ian Romanick2016-08-261-2/+31
| | | | | | | | | | | w/GL_OES_geometry_shader Originally this patch added the checks to allow the draw calls with XFB, but commit 2dabd497 beat me to it. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Remove redundant _mesa_has_shader_subroutineIan Romanick2016-08-263-26/+16
| | | | | | | | | | The checks in _mesa_has_shader_subroutine are slightly different than _mesa_has_ARB_shader_subroutine, but they're not different in a way that matters. The only way to have ctx->Version >= 40 is if ctx->Extensions.ARB_shader_subroutine is set. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Nanley Chery <[email protected]>
* main: Add MESA_VERBOSE=api support for glClearStencilJordan Justen2016-08-261-0/+3
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* main: Add MESA_VERBOSE=api support for glTexImageJordan Justen2016-08-261-0/+5
| | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa/main: Fix missing return in non void functionTobias Klausmann2016-08-261-1/+1
| | | | | | | | | | | This was found by obs: I: Program returns random data in a function E: Mesa no-return-in-nonvoid-function main/program_resource.c:109 v2: Remove the ! on the string (Ian Romanick) Signed-off-by: Tobias Klausmann <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Implement GL_KHR_blend_equation_advanced_coherent.Kenneth Graunke2016-08-256-0/+23
| | | | | | | | | This adds the extension enable (so drivers can advertise it) and the extra boolean state flag, GL_BLEND_ADVANCED_COHERENT_KHR, which can be set to request coherent blending. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* mesa: Add draw time validation for advanced blending modes.Kenneth Graunke2016-08-251-0/+52
| | | | | | | v2: Add null checks (requested by Curro). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* mesa: Restyle _mesa_check_blend_func_error().Kenneth Graunke2016-08-251-15/+15
| | | | | | | | | | | | I'm about to add more error conditions to this function, so I wanted to move the current spec citation above the code that checks it. Indenting it required reformatting, so I tried to move it to our newer style. While there, I also decided to drop some GL type usage, and drop the unnecessary "_mesa_" prefix on a static function. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* mesa: Track the current advanced blending mode.Kenneth Graunke2016-08-252-13/+50
| | | | | | | | | | | This will be useful for a number of things: - Checking the current advanced blending mode against the shader's blend_support_* qualifiers. - Disabling hardware blending when emulating advanced blending. - Uploading the current advanced blending mode as a state var. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* mesa: Allow advanced blending enums in glBlendEquation[i].Kenneth Graunke2016-08-251-10/+54
| | | | | | | | Don't allow them in glBlendEquationSeparate[i], though, as required by the spec. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* glsl: process blend_support_* qualifiersIlia Mirkin2016-08-251-0/+5
| | | | | | | | | | v2 (Ken): Add a BLEND_NONE enum value (no qualifiers in use). v3 (Ken): Rename gl_blend_support_qualifier to gl_advanced_blend_mode. v4 (Ken): Mark map[] as static const (Ilia). Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* mesa: add KHR_blend_equation_advanced enable and extension stringIlia Mirkin2016-08-252-0/+2
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* glapi: add KHR_blend_equation_advanced dispatchIlia Mirkin2016-08-251-0/+6
| | | | | | | | | | v2 (Ken): Fix enum values, drop _mesa_BlendBarrierKHR stub as Curro has already implemented it. v3 (Ken): Rework for _mesa_BlendBarrierKHR -> _mesa_BlendBarrier rename. Signed-off-by: Ilia Mirkin <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* mesa: Rename _mesa_BlendBarrierMESA to _mesa_BlendBarrier.Kenneth Graunke2016-08-252-2/+2
| | | | | | | | | | | Note that _mesa_BlendBarrierMESA is not currently hooked up in the glapi XML, so we can just rename it. We'll hook it up for the KHR_blend_equation_advanced extension shortly. We may as well use the ES 3.2 core name with no suffixes. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* glsl: Keep track of the set of fragment outputs read by a GL program.Francisco Jerez2016-08-241-0/+1
| | | | | | | | This is the set of shader outputs whose initial value is provided to the shader by some external means when the shader is executed, rather than computed by the shader itself. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add blend barrier entry point and driver hook.Francisco Jerez2016-08-243-0/+29
| | | | | | | | | | | | | Both MESA_shader_framebuffer_fetch_non_coherent and the non-coherent variant of KHR_blend_equation_advanced will use this driver hook to request coherency between framebuffer reads and writes. This intentionally doesn't hook up glBlendBarrierMESA to the dispatch layer since the extension isn't exposed to applications yet, see [1] for more details. [1] https://lists.freedesktop.org/archives/mesa-dev/2016-July/124028.html Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Move shader memory barrier functions into barrier.c.Francisco Jerez2016-08-244-57/+57
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Rename "texturebarrier" source files to "barrier".Francisco Jerez2016-08-242-10/+10
| | | | | | | In preparation for collecting all pipeline barrier GL entry points into a single source file. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add support for querying GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT.Francisco Jerez2016-08-243-0/+14
| | | | | | | | | | | This can currently only give true as result since the only way you can expose EXT_shader_framebuffer_fetch right now is by flipping the MESA_shader_framebuffer_fetch bit, but that could potentially change in the future, see [1] for an explanation. [1] https://lists.freedesktop.org/archives/mesa-dev/2016-July/124028.html Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Add extension enables for framebuffer fetch extensions.Francisco Jerez2016-08-242-0/+3
| | | | | | | | | | | This allows drivers to expose EXT_shader_framebuffer_fetch in GLES2+ contexts if desired. Note that this adds boolean flags for two MESA extensions, but only the EXT GLES-only extension is exposed for the moment, see the cover letter of this series [1] for the rationale. [1] https://lists.freedesktop.org/archives/mesa-dev/2016-July/124028.html Reviewed-by: Kenneth Graunke <[email protected]>
* shaderapi: don't generate not linked error on GetProgramStage in generalAlejandro Piñeiro2016-08-241-1/+18
| | | | | | | | | | Both ARB_shader_subroutine and the GL core spec doesn't list any error when the program is not linked. We left a error generation for the uniform location, in order to be consistent with other methods from the spec that generate them. Reviewed-by: Tapani Pälli <[email protected]>
* program_resource: subroutine active uniforms should return NumSubroutineUniformsAlejandro Piñeiro2016-08-241-23/+118
| | | | | | | | | | | | | | | | | | | | | | Before this commit, GetProgramInterfaceiv for pname ACTIVE_RESOURCES and all the <shader>_SUBROUTINE_UNIFORM programInterface were returning the count of resources on the shader program using that interface, instead of the num of uniform resources. This would get a wrong value (for example) if the shader has an array of subroutine uniforms. Note that this means that in order to get a proper value, the shader needs to be linked, something that is not explicitly mentioned on ARB_program_interface_query spec, but comes from the general definition of active uniform. If the program is not linked we return 0. v2: don't generate an error if the program is not linked, returning 0 active uniforms instead, plus extra spec references (Tapani Palli) Fixes GL44-CTS.program_interface_query.subroutines-compute Reviewed-by: Tapani Pälli <[email protected]>
* mesa/subroutines: drop the old subroutine index uploads.Dave Airlie2016-08-231-6/+0
| | | | | | | | | We used to upload the indices when they changed, now we rely on the drivers calling the correct hook to have the values updated from the context storage. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Andres Gomez <[email protected]>
* mesa: add api to write subroutine indicies to the program storage.Dave Airlie2016-08-232-0/+13
| | | | | | | | | | | | This writes the subroutine indicies to the program storage for a stage. This API is intended to be used by drivers to update the uniform storage before uploading to the hw. This isn't the most thread safe effort, but it will be significantly more multi-context safe. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Andres Gomez <[email protected]>
* mesa/subroutines: start adding per-context subroutine index support (v1.1)Dave Airlie2016-08-234-32/+61
| | | | | | | | | | | | | | | | | | | | | | | One piece of ARB_shader_subroutine I ignored was the fact that it needs to store the subroutine index data per context and not per shader program. There is one CTS test that tests this: GL45-CTS.shader_subroutine.multiple_contexts However the test only does a write to context and readback, it never renders using the values, so this is enough to fix the test however not enough to do what the spec says. So with this patch the info is now stored per context, but it gets updated into the program at UseProgram and when the values are inserted into the context, which won't help if multiple contexts are in use in multiple threads. v1.1: cleanups and nit-picks (Andres) Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Andres Gomez <[email protected]>
* mesa: Fix fixed function spot lighting on newer hardware (again)Daniel Scharrer2016-08-191-14/+3
| | | | | | | | | | | | This was first fixed in commit b3f9c5c and then broken again in commit fe2d2c7, which removed the abs modifier from input registers. v2: Don't change the size of struct ureg. Cc: "12.0" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91342 Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Daniel Scharrer <[email protected]>
* mesa: avoid valgrind warning due to opaque only being set sometimesIlia Mirkin2016-08-181-2/+2
| | | | | | | | | | | Valgrind complains with a "Conditional jump or move depends on uninitialised value(s)" warning due to opaque being conditionally initialized. However in the punchthrough_alpha == true case, it is always initialized, so just flip the condition around to silence the warning. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* mesa: Remove duplicate include.Mathias Fröhlich2016-08-151-1/+0
| | | | | | | | In api_validate.c stdbool.h was included twice. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Eric Anholt <[email protected]>