aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
...
* mesa: copy tes metadata directly to shared shader infoTimothy Arceri2016-10-261-7/+4
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* i965/mesa/st: eliminate gl_tess_ctrl_programTimothy Arceri2016-10-263-18/+7
| | | | | | We now get all the tcs metadata from shader_info. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: set tcs shader_info metadata directlyTimothy Arceri2016-10-261-3/+1
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* glsl: add temporary copy_shader_info() functionTimothy Arceri2016-10-261-0/+2
| | | | | | | | | | | | | This function is added here to ease refactoring towards using the new shared shader_info. Once refactoring is complete and values are set directly it will be removed. We call it from _mesa_copy_linked_program_data() rather than glsl_to_nir() so that the values will be set for all drivers. In order to do this some calls need to be moved around so that we make sure to call do_set_program_inouts() before _mesa_copy_linked_program_data() Reviewed-by: Jason Ekstrand <[email protected]>
* glsl: add a shader info field to the gl_program typeTimothy Arceri2016-10-261-0/+3
| | | | | | | | | | And use this field as the source for shader info in the nir_shader this will allow us to set some of these fields from GLSL directly. It will also simplify restoring from shader cache and allow the removal of duplicate fields from GLSL. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: modify _mesa_copy_linked_program_data() to take gl_linked_shaderTimothy Arceri2016-10-262-22/+22
| | | | | | | | | | This allows us to do some small tidy ups, but will also allow us to call a new function that copies values to a shared shader info from here. In order to make this change this function now requires _mesa_reference_program() to have previously been called. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: fix error handling in DrawBuffersTapani Pälli2016-10-251-34/+37
| | | | | | | | | | | | | | | | | | | | | | Patch rearranges error checking so that enum checking provided via destmask happens before other checks. It needs to be done in this order because other error checks do not work properly if there were invalid enums passed. Patch also refines one existing check and it's documentation to match GLES 3.0 spec (also in later specs). This was somewhat mysteriously referring to desktop GL but had a check for gles3. Fixes following dEQP tests: dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.draw_buffers no CI regressions observed. Signed-off-by: Tapani Pälli <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98134 Cc: "12.0 13.0" <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* glsl: add matrix layout information to interface block typesIago Toral Quiroga2016-10-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | So far we have been checking that interface block definitions had matching matrix layouts by comparing the definitions of their fields, however, this does not cover the case where the interface blocks are defined with mismatching matrix layouts but don't define any field with a matrix type. In this case Mesa will not fail to link because none of the fields will inherit the mismatching layout qualifier. This patch fixes the problem in the same way we fixed it for packing layout information: we add the the layout information to the interface type and then we check it matches during the uniform block linking process. v2: Fix unit tests so they pass the new parameter to glsl_type::get_interface_instance() Fixes: dEQP-GLES31.functional.shaders.linkage.uniform.block.layout_qualifier_mismatch_3 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98245 Reviewed-by: Nicolai Hähnle <[email protected]> (v1)
* mesa: remove unused LocalSizeVariableTimothy Arceri2016-10-202-6/+0
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: remove gl_shader_compiler_options::EmitNoNoiseMarek Olšák2016-10-191-1/+0
| | | | | | | it's always true Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* util: move min/max/clamp macros to util macros.hDave Airlie2016-10-191-13/+0
| | | | | | | | | Although the vulkan drivers include mesa macros.h, for radv I'd like to move away from that. Reviewed-by: Nicolai Hähnle <[email protected]> Acked-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: fix indentation in vertex_attrib_binding()Brian Paul2016-10-131-2/+2
| | | | Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: add sanity check assertion in update_array_formatBrian Paul2016-10-131-0/+3
| | | | | | At most, one of the normalized, integer, doubles bools can be true. Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: remove needless cast in update_array()Brian Paul2016-10-131-1/+1
| | | | Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: simplify update_array() with a vao local varBrian Paul2016-10-131-7/+7
| | | | Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: rename gl_vertex_attrib_array gl_array_attributesBrian Paul2016-10-137-27/+27
| | | | | | | The structure contains the attributes of a vertex array. The old name was kind of confusing. Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: rename gl_vertex_attrib_array::VertexBindingBrian Paul2016-10-134-23/+23
| | | | | | | | | Rename to gl_vertex_attrib_array::BufferBindingIndex because this field is an index into the array of buffer binding points. This makes some code a little easier to follow since there's also a "VertexBinding" field in gl_vertex_array_object. Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: rename some vars in arrayobj.cBrian Paul2016-10-131-24/+31
| | | | | | | Use 'vao' instead of 'obj' to be consistent with other code. Plus, add a comment. Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: replace gl_framebuffer::_IntegerColor wih _IntegerBuffersBrian Paul2016-10-136-9/+14
| | | | | | | | | | | Use a bitmask to indicate which color buffers are integer-valued, rather than a bool. Also, the old field was mis-computed. If an integer buffer was followed by a non-integer buffer, the _IntegerColor field was wrongly set to false. This fixes the new piglit gl-3.1-mixed-int-float-fbo test. Reviewed-by: Marek Olšák <[email protected]>
* mesa: remove 'params' parameter from ctx->Driver.TexParameter()Brian Paul2016-10-134-29/+14
| | | | | | | | | | | None of the drivers which implement this hook do anything with the texture parameter value. Drivers just look at the pname and set a dirty flag if needed. We were doing some ugly casting and type conversion to setup the argument so that all goes away. Reviewed-by: Marek Olšák <[email protected]>
* mesa: fix error handling in _mesa_TransformFeedbackVaryingsTapani Pälli2016-10-111-10/+6
| | | | | | | | | | | | | Patch changes function to use _mesa_lookup_shader_program_err both in TransformFeedbackVaryings and GetTransformFeedbackVarying that handles errors correctly for invalid values of shader program. Fixes following dEQP test: dEQP-GLES31.functional.debug.negative_coverage.get_error.shader.transform_feedback_varyings Signed-off-by: Tapani Pälli <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98135 Reviewed-by: Iago Toral Quiroga <[email protected]>
* mesa: throw error if bufSize negative in GetSynciv on OpenGL ESTapani Pälli2016-10-101-0/+8
| | | | | | | | | | | | | | Fixes following dEQP tests: dEQP-GLES31.functional.debug.negative_coverage.callbacks.state.get_synciv dEQP-GLES31.functional.debug.negative_coverage.get_error.state.get_synciv dEQP-GLES31.functional.debug.negative_coverage.log.state.get_synciv v2: drop _mesa_is_gles check (Kenneth) Signed-off-by: Tapani Pälli <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98133 Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/main: add support for ARB_compute_variable_groups_sizeSamuel Pitoiset2016-10-0711-1/+185
| | | | | | | | | | | | | v5: - replace fixed_local_size by !LocalSizeVariable (Nicolai) v4: - slightly indent spec quotes (Nicolai) - drop useless _mesa_has_compute_shaders() check (Nicolai) - move the fixed local size outside of the loop (Nicolai) - add missing check for invalid use of work group count v2: - update formatting spec quotations (Ian) - move the total_invocations check outside of the loop (Ian) Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glapi: add entry points for GL_ARB_compute_variable_group_sizeSamuel Pitoiset2016-10-073-0/+16
| | | | | | | | | v2: - correctly sort that new extension (Ian) - fix up the comment (Ian) Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: call ctx->Driver.TexParameter() in texture_buffer_range()Brian Paul2016-10-061-0/+13
| | | | | | | To inform drivers of texture buffer offset/size changes, as we do for other texture object parameters. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: make _mesa_texture_buffer_range() staticBrian Paul2016-10-062-23/+19
| | | | | | Not called from any other file. Also, add a comment. Reviewed-by: Anuj Phogat <[email protected]>
* mesa: add const qualifier, comment on can_avoid_reallocation()Brian Paul2016-10-061-1/+8
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* mesa: add comment/assertion on get_tex_level_parameter_buffer()Brian Paul2016-10-061-0/+5
| | | | Reviewed-by: Anuj Phogat <[email protected]>
* mesa: annotate AttribFuncsARB[] as constEmil Velikov2016-10-061-1/+1
| | | | | | | | It's read-only data, so annotate it accordingly. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* mesa: remove the UsesDFdy flagTimothy Arceri2016-10-061-1/+0
| | | | | | Seems the last user of this was removed in 08bc74e69. Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Raise INVALID_ENUM in FramebufferTexture*D for unknown textargets.Kenneth Graunke2016-10-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ES3-CTS.functional.negative_api.buffer.framebuffer_texture2d expects glFramebufferTexture[123]D to raise GL_INVALID_ENUM when supplied a completely bogus textarget parameter (i.e. 0xffffffff). This is at odds with the spec. GLES 3.1 says: "An INVALID_OPERATION error is generated if texture is not zero and textarget is not one of TEXTURE_2D, TEXTURE_2D_MULTISAMPLE, or one of the cube map face targets from table 8.21." (and GLES 3.0 and GL 4.5 both have similar text). However, GL has a general guideline that says: "If a command that requires an enumerated value is passed a symbolic constant that is not one of those specified as allowable for that command, an INVALID_ENUM error is generated." Apparently other vendors reconcile these two rules as follows: GL should raise INVALID_OPERATION for actual texture target enumeration values which are not allowed for this particular glFramebufferTexture*D call. Any value that is not a texture target should result in GL_INVALID_ENUM. For example, glFramebufferTexture2D with GL_TEXTURE_1D would result in INVALID_OPERATION because it is a real texture target, but not allowed for the 2D version of the function. But calling it with GL_FRONT would result in INVALID_ENUM, as that isn't even a texture target. Fixes: - {ES3-CTS,dEQP-GLES3}.functional.negative_api.buffer.framebuffer_texture2d - {ES31-CTS,ES32-CTS,dEQP-GLES31}.functional.debug.negative_coverage.get_error.buffer.framebuffer_texture2d References: https://gitlab.khronos.org/opengl/cts/merge_requests/387 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: Reorganize check_textarget().Kenneth Graunke2016-10-041-43/+37
| | | | | | | | Having one top-level switch statement covering all known texture targets will make the next change easier to implement. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: Add a check for OES_viewport_arrayAnuj Phogat2016-10-041-1/+3
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: Enable enums for OES_viewport_arrayAnuj Phogat2016-10-042-4/+10
| | | | | Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: use uint32_t rather than unsigned for xfb struct membersTimothy Arceri2016-10-011-10/+10
| | | | | | | These structs will be written to disk as part of the shader cache so use uint32_t just to be safe. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: move _mesa_valid_to_render() to api_validate.cBrian Paul2016-09-305-191/+195
| | | | | | | Almost all of the other drawing validation code is in api_validate.c so put this function there as well. Reviewed-by: Anuj Phogat <[email protected]>
* glsl: don't crash when dumping shaders if some come from cacheTimothy Arceri2016-09-281-2/+7
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/st: support lowering multi-planar YUVRob Clark2016-09-261-0/+16
| | | | | | | | | | | | | | | Support multi-planar YUV for external EGLImage's (currently just in the dma-buf import path) by lowering to multiple texture fetch's for each plane and CSC in shader. There was some discussion of alternative approaches for tracking the additional UV or U/V planes: https://lists.freedesktop.org/archives/mesa-dev/2016-September/127832.html They all seemed worse than pipe_resource::next Signed-off-by: Rob Clark <[email protected]>
* Revert "glsl: move xfb BufferStride into gl_transform_feedback_info"Timothy Arceri2016-09-241-3/+2
| | | | | | | This reverts commit f5a6aab4031bc4754756c1773411728ad9a73381. This broke some tests. It seems gl_transform_feedback_info gets memset to 0 so we were losing the values in BufferStride before we used them.
* glsl: move xfb BufferStride into gl_transform_feedback_infoTimothy Arceri2016-09-241-2/+3
| | | | | | | | It makes more sense to have this here where we store the other values from xfb qualifiers. The struct it was previously part of is now only used to store values that come from the api. Reviewed-by: Alejandro Piñeiro <[email protected]>
* mesa: add implementations for new float depth functionsIlia Mirkin2016-09-221-1/+18
| | | | | | | | This just up-converts them to doubles. Not great, but this is what all the other variants also do. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: move ARB_viewport_array params to a GLES 3.1-accessible sectionIlia Mirkin2016-09-221-6/+6
| | | | | | | This is needed for GL_OES_viewport_array. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: add GL_OES_viewport_array to the extension stringIlia Mirkin2016-09-222-0/+2
| | | | | | | | | The expectation is that drivers will set this based on OES_geometry_shader and ARB_viewport_array support. This is a separate enable on the same reasoning as for OES_texture_cube_map_array. Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: add new entrypoints for GL_OES_viewport_arrayIlia Mirkin2016-09-223-0/+29
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* mesa: Implement ARB_shader_viewport_layer_array for i965Dylan Baker2016-09-202-0/+2
| | | | | | | | | | | | | This extension is a combination of AMD_vertex_shader_viewport_index and AMD_vertex_shader_layer, making it rather trivial to implement. For gallium I *think* this needs a new cap because of the addition of support in tessellation evaluation shaders, and since I don't have any hardware to test it on, I've left that for someone else to wire up. Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Move buffers-unmapped earlier in check_valid_to_render().Kenneth Graunke2016-09-161-6/+6
| | | | | | | | | | | This needs to be above the switch on API, as that can return true (valid to render) before this error check even had a chance to run. Fixes ESEXT-CTS.draw_elements_base_vertex_tests.invalid_mapped_bos, which worked before commit 72f1566f90c434c7752d8405193eec68d6743246. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Mathias Fröhlich <[email protected]>
* mesa: Expose GL_CONTEXT_FLAGS in ES 3.2.Kenneth Graunke2016-09-161-3/+5
| | | | | | | Fixes four ES32-CTS.context_flags.* tests. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: fix glGetFramebufferAttachmentParameteriv w/ on-demand FRONT_BACK allocMarek Olšák2016-09-161-2/+14
| | | | | | | This fixes 66 CTS tests on st/mesa. Cc: 12.0 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: check for no matrix change in _mesa_LoadMatrixf()Brian Paul2016-09-151-3/+5
| | | | | | | | | | | | | Some apps issue redundant glLoadMatrixf() calls with the same matrix. Try to avoid setting dirty state in that situation. This reduces the number of constant buffer updates by about half in ET Quake Wars. Tested with Piglit, ETQW, Sauerbraten, Google Earth, etc. Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Expose RESET_NOTIFICATION_STRATEGY with KHR_robustness.Kenneth Graunke2016-09-152-3/+10
| | | | | | | | | | | | | | | This is supposed to be exposed with the GL_KHR_robustness extension, which we support on ES 2.0 and later. On desktop GL, it's also exposed by GL_ARB_robustness, which is supported by all drivers ("dummy_true"). so we also allow desktop GL. Fixes: - ES32-CTS.robust.robustness.noResetNotification - ES32-CTS.robust.robustness.loseContextOnReset Cc: [email protected] Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>