summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: make _mesa_scissor_bounding_box() staticSamuel Pitoiset2017-06-072-9/+5
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: inline update_image_transfer_state() into _mesa_update_pixel()Samuel Pitoiset2017-06-071-14/+6
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove useless check in _mesa_update_pixel()Samuel Pitoiset2017-06-073-5/+4
| | | | | | | | | The only caller is _mesa_update_state_locked() which already checks if _NEW_PIXEL is set before calling _mesa_update_pixel(). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: make use of NewWindowRectangles driver flagsSamuel Pitoiset2017-06-061-1/+3
| | | | | | | | Now, st_update_window_rectangles() won't be called when the scissor is going to be updated. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: add new gl_driver_flags::NewWindowRectanglesSamuel Pitoiset2017-06-061-0/+5
| | | | | | | | | | | | This new driver flag will replace _NEW_SCISSOR which is emitted when setting new window rectangles but it actually triggers useless changes in the state tracker (like scissor and rasterizer). EXT_window_rectangles is currently only supported by Nouveau. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: remove call to Driver.Scissor() in _mesa_WindowRectanglesEXT()Samuel Pitoiset2017-06-061-3/+0
| | | | | | | | | This is actually useless because this driver call is only used by the classic DRI drivers which don't support that extension and probably won't never support it. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: only emit _NEW_MULTISAMPLE when min sample shading changesSamuel Pitoiset2017-06-061-3/+6
| | | | | | | | We usually check that given parameters are different before updating the state. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: only emit _NEW_MULTISAMPLE when sample mask changesSamuel Pitoiset2017-06-061-0/+3
| | | | | | | | We usually check that given parameters are different before updating the state. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: only emit _NEW_MULTISAMPLE when coverage parameters changeSamuel Pitoiset2017-06-061-3/+7
| | | | | | | | We usually check that given parameters are different before updating the state. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: document range of SampleCoverageValue, MinSampleShadingValueBrian Paul2017-06-021-2/+2
| | | | Trivial.
* mesa/main: replace remaining uses of IROUND() in GetUniform*() by round()Iago Toral Quiroga2017-06-011-2/+2
| | | | | | | | | These were correct since they were used only in conversions to signed integers, however this makes the implementation a bit more is more consistent and reduces chances of propagating use of these macros to unsigned cases in the future, which would not be correct. Reviewed-by: Matt Turner <[email protected]>
* mesa/main: conversion from float in GetUniformi64v requires rounding to nearestIago Toral Quiroga2017-06-011-1/+1
| | | | | | | | As we do for all other cases of float/double conversions to integers. v2: use round() instead of IROUND() macros (Iago) Reviewed-by: Matt Turner <[email protected]>
* mesa/main: Add conversion from double to uint64/int64 in GetUniform*i64v()Iago Toral Quiroga2017-06-011-0/+14
| | | | | | | | v2: - need unsigned rounding for double->uint64 conversion (Nicolai) - use round() instead of IROUND() macros (Iago) Reviewed-by: Matt Turner <[email protected]>
* mesa/main: Clamp GetUniformui64v values to be >= 0Iago Toral Quiroga2017-06-011-1/+45
| | | | | | | | | | Like we do for the 32-bit case. v2: - need unsigned rounding for float->uint64 conversion (Nicolai) - use roundf() instead of IROUND() macros (Iago) Reviewed-by: Matt Turner <[email protected]>
* mesa/main: Clamp GetUniformuiv values to be >= 0Kenneth Graunke2017-06-011-11/+51
| | | | | | | | | | | | | | | | | | | | | | | | Section 2.2.2 (Data Conversions For State Query Commands) of the OpenGL 4.5 October 24th 2016 specification says: "If a command returning unsigned integer data is called, such as GetSamplerParameterIuiv, negative values are clamped to zero." v2: uint to int conversion should clamp to INT_MAX (Nicolai) v3 (Iago) - Add conversions conversions from 64-bit integer paths - Rebase on master v4: - need unsigned rounding for float/double->uint conversions (Nicolai) - use round{f}() instead of IROUND() macros (Iago) Fixes: KHR-GL45.gpu_shader_fp64.state_query Reviewed-by: Nicolai Hähnle <[email protected]> (v2) Reviewed-by: Matt Turner <[email protected]>
* mesa/main: fix indentation in _mesa_get_uniform()Iago Toral Quiroga2017-06-011-98/+101
| | | | | | | v2: also change the style of the large conditional in that function to follow the style from most other parts of Mesa (Nicolai) Reviewed-by: Matt Turner <[email protected]>
* mesa: throw an INVALID_OPERATION error in get_texobj_by_name()Samuel Pitoiset2017-05-311-50/+11
| | | | | | | | Because get_texobj_by_name() can already throw a INVALID_ENUM error, it makes more sense to add a check directly there. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add new 'name' parameter to get_texobj_by_name()Samuel Pitoiset2017-05-311-13/+12
| | | | | | | | To display better function names when INVALID_OPERATION is returned. Requested by Timothy. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: Avoid leaking surface in st_renderbuffer_deleteBartosz Tomczyk2017-05-301-2/+8
| | | | | | | | | v2: add comment in code Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100741 Fixes: a5e733c6b52 mesa: drop current draw/read buffer when ctx is released Reviewed-by: Rob Clark <[email protected]> (v1) Reviewed-by: Emil Velikov <[email protected]>
* mesa: add KHR_no_error support for glBindBufferRange()Timothy Arceri2017-05-302-37/+69
| | | | | Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: create bind_buffer_range() helperTimothy Arceri2017-05-301-3/+10
| | | | | | | This will help us add KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: convert mesa_bind_buffer_range_transform_feedback() to a validate functionTimothy Arceri2017-05-303-31/+35
| | | | | | | | This allows some tidy up and also makes it so we can add KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: create _mesa_bind_buffer_range_xfb() helperTimothy Arceri2017-05-301-0/+20
| | | | | Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: split bind_atomic_buffer() in twoTimothy Arceri2017-05-301-25/+29
| | | | | | | This will help us add KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: split bind_buffer_range_shader_storage_buffer() in twoTimothy Arceri2017-05-301-13/+23
| | | | | | | This will help us implement KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: split bind_buffer_range_uniform_buffer() in twoTimothy Arceri2017-05-301-13/+19
| | | | | | | This will help us implement KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: add KHR_no_error support for glVertexArrayVertexBuffer()Timothy Arceri2017-05-302-0/+17
| | | | | Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: add KHR_no_error support for glBindVertexBuffer()Timothy Arceri2017-05-302-3/+17
| | | | | Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: split vertex_array_vertex_buffer() in twoTimothy Arceri2017-05-301-42/+53
| | | | | | | | This will allow us to skip the error checkes when adding KHR_no_error support. Reviewed-by: Iago Toral Quiroga <[email protected]> Tested-by: Dieter Nützel <[email protected]>
* mesa: add KHR_no_error support for glBindImageTextures()Samuel Pitoiset2017-05-292-31/+51
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glBindImageTexture()Samuel Pitoiset2017-05-292-0/+20
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add bind_image_texture() helperSamuel Pitoiset2017-05-291-7/+16
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add set_image_binding() helperSamuel Pitoiset2017-05-291-36/+34
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: remove unused layered parameter from validate_bind_image_texture()Samuel Pitoiset2017-05-291-4/+4
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: add KHR_no_error support for glActiveTexture()Samuel Pitoiset2017-05-292-11/+28
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Remove GL_APPLE_vertex_array_object stubsIan Romanick2017-05-233-22/+0
| | | | | | | | | | | | | | | | | | Mark the functions 'exec="skip"' in the XML instead. libGL will still have the functions, but the driver won't try to use them. I verified that this commit works with piglit's 'object-namespace-pollution glClear vertex-array' on x64 with a driver built from mesa-12.0.3 tag. In fairness, this test also works with a libGL built from 7927d03. I believe it continues to work because on non-Windows platforms we generate some extra, dummy dispatch functions that can be used when a driver requests a function unknown to libGL. This was done to provide some "forward" compatibility with drivers that need more functions. This doesn't work on Windows because the Windows calling convention is for the callee to clean up the stack. That's the theory anyway. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: GL_ARB_shader_subroutine is not optional in core profileIan Romanick2017-05-226-46/+3
| | | | | | | | | | | text data bss dec hex filename 7038459 235248 37280 7310987 6f8e8b 32-bit i965_dri.so before 7038227 235248 37280 7310755 6f8da3 32-bit i965_dri.so after 6681438 303400 50608 7035446 6b5a36 64-bit i965_dri.so before 6681254 303400 50608 7035262 6b597e 64-bit i965_dri.so after Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
* mesa: add APPLE_vertex_array_object stubsTimothy Arceri2017-05-223-0/+22
| | | | | | | | | | | APPLE_vertex_array_object support was removed in 7927d0378fc7. However it turns out we can't remove the functions because this can cause issues when libglapi is used together with DRI drivers built prior to said commit Fixes: 7927d0378fc ("mesa: drop APPLE_vertex_array_object support") Reviewed-by: Emil Velikov <[email protected]>
* main: Move hashLockMutex/hashUnlockMutex to header and inlineThomas Helland2017-05-222-45/+40
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* main: Use _mesa_HashLock/UnlockMutex consistentlyThomas Helland2017-05-221-13/+10
| | | | | | | | | This is shorter and easier on the eyes. At the same time this also ensures that we are always asserting that the table pointer is not NULL. Currently that was not done for all situations. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* driconf: Add allow_glsl_builtin_variable_redeclaration optionJohn Brooks2017-05-201-0/+5
| | | | | | | | | | | | | | | This option will allow GLSL builtins to be redeclared verbatim (e.g. redeclaring "in int gl_VertexID" in a vertex shader). This is not strictly valid and would normally fail to compile, but some applications (such as newer Techland ports) do it and need more leniency. v2 (Samuel Pitoiset): - Rename allow_glsl_builtin_redeclaration -> allow_glsl_builtin_variable_redeclaration Signed-off-by: John Brooks <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* st/mesa: don't mark the program as in cache_fallback when there is cache missTimothy Arceri2017-05-201-0/+7
| | | | | | | | | | | | | | | | | | When we fallback currently the gl_program objects are re-allocated. This is likely to change when the i965 cache lands, but for now this fixes a crash when using MESA_GLSL=cache_fb. This env var simulates the fallback path taken when a tgsi cache item doesn't exist due to being evicted previously or some kind of error. Unlike i965 we are always falling back at link time so it's safe to just re-allocate everything. We will be unnecessarily freeing and re-allocate a bunch of things here but it's probably not a huge deal, and can be changed when the i965 code lands. Fixes: 0e9991f957e2 ("glsl: don't reference shader prog data during cache fallback") Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add an env var to force cache fallbackTimothy Arceri2017-05-202-0/+3
| | | | | | | | | | | | | | | | | For the gallium state tracker a tgsi binary may have been evicted from the cache to make space. In this case we would take the fallback path and recompile/link the shader. On i965 there are a number of reasons we can get to the program upload stage and have neither IR nor a valid cached binary. For example the binary may have been evicted from the cache or we need a variant that wasn't previously cached. This environment variable enables us to force the fallback path that would be taken in these cases and makes it easier to debug these otherwise hard to reproduce scenarios. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: don't check mapped buffers in every draw call if drivers allow itMarek Olšák2017-05-171-1/+14
| | | | | | | | | Before: DrawElements (16 VBOs) w/ no state change: 4.34 million/s After: DrawElements (16 VBOs) w/ no state change: 8.80 million/s This inefficiency was uncovered by Timothy Arceri's no_error work. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add gl_constants::AllowMappedBuffersDuringExecutionMarek Olšák2017-05-171-0/+3
| | | | | | for skipping mapped-buffer checking in every GL draw call Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glDispatchCompute*()Timothy Arceri2017-05-172-0/+38
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add DispatchCompute* helpersTimothy Arceri2017-05-171-13/+38
| | | | | | These will be used to add KHR_no_error support. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: move FLUSH_CURRENT() calls out of DispatchCompute*() validationTimothy Arceri2017-05-171-6/+6
| | | | | | This is required to add KHR_no_error support. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: compute.c C99 tidy upTimothy Arceri2017-05-171-4/+2
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: move DispatchCompute() validation to compute.cTimothy Arceri2017-05-173-252/+229
| | | | | | | This is the only place it is used so there is no reason for it to be in api_validate.c Reviewed-by: Nicolai Hähnle <[email protected]>