summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'mesa-public/master' into vulkanJason Ekstrand2015-10-216-169/+92
|\
| * mesa/glformats: Undo code changes from _mesa_base_tex_format() moveNanley Chery2015-10-211-141/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The refactoring commit, c6bf1cd, accidentally reverted cd49b97 and 99b1f47. These changes caused more code to be added to the function and removed the existing support for ASTC. This patch reverts those modifications. v2. Actually include ASTC support again. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92221 Cc: "11.0" <[email protected]> Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
| * mesa: simple whitespace fix in texstore.cBrian Paul2015-10-201-0/+2
| |
| * mesa: make memcpy_texture() non-staticBrian Paul2015-10-202-20/+31
| | | | | | | | | | | | | | So that we can use it directly from the mesa/gallium state tracker. Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
| * mesa: fix incorrect opcode in save_BlendFunci()Brian Paul2015-10-201-1/+1
| | | | | | | | | | | | | | | | | | Fixes assertion failure with new piglit arb_draw_buffers_blend-state_set_get test. Cc: [email protected] Reviewed-by: Jose Fonseca <[email protected]>
| * mesa: add more cases to print_list() in dlist.cBrian Paul2015-10-201-0/+46
| | | | | | | | Reviewed-by: Jose Fonseca <[email protected]>
| * mesa: replace UsesClipDistance with ClipDistanceArraySizeMarek Olšák2015-10-202-7/+4
| | | | | | | | | | | | | | This is more practical and needed by gallium. Reviewed-by: Ilia Mirkin <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* | Merge remote-tracking branch 'mesa-public/master' into vulkanJason Ekstrand2015-10-1927-575/+346
|\|
| * mesa: Move gl_frag_depth_layout from mtypes.h to shader_enums.hJason Ekstrand2015-10-191-18/+0
| | | | | | | | Reviewed-by: Topi Pohjolainen <[email protected]>
| * main: GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH is about UBOS, not SSBOsIago Toral Quiroga2015-10-191-2/+2
| | | | | | | | | | Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
| * main: Use NumUniformBlocks to count UBOsIago Toral Quiroga2015-10-191-5/+1
| | | | | | | | | | | | | | | | | | Now that we have separate index spaces for UBOs and SSBOs we do not need to iterate through BufferInterfaceBlocks any more, we can just take the UBO count directly from NumUniformBlocks. Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
| * mesa: remove FLUSH_VERTICES() in _mesa_MatrixMode()Brian Paul2015-10-171-1/+0
| | | | | | | | | | | | | | | | Changing the matrix mode alone has no effect on rendering and does not need to trigger a flush or state validation. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
| * nir: remove dependency on glslRob Clark2015-10-162-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move glsl_types into NIR, now that the dependency on glsl_symbol_table has been split out. Possibly makes sense to rename things at this point, but if we do that I'd like to keep it split out into a separate patch to make git history easier to follow (IMHO). v2: fix android build v3: I f***ing hate scons.. but at least it builds Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Rob Clark <[email protected]>
| * glsl: move half<->float convertion to utilRob Clark2015-10-165-155/+3
| | | | | | | | | | | | | | | | Needed in NIR too, so move out of mesa/main/imports.c Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Rob Clark <[email protected]>
| * glsl: couple shader_enums cleanupsRob Clark2015-10-161-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | Add missing enum to gl_system_value_name() and move VARYING_SLOT_MAX / FRAG_RESULT_MAX / etc into shader_enums.h as suggested by Emil. v2: add STATIC_ASSERT()'s Reported-by: Emil Velikov <[email protected]> Acked-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Rob Clark <[email protected]>
| * Revert "mesa: remove FLUSH_VERTICES() in _mesa_MatrixMode()"Brian Paul2015-10-161-0/+1
| | | | | | | | | | | | | | | | This reverts commit 0de5e0f3fb0f3671a3ecec6ab4473f9131ecd0ae. Michel Dänzer spotted two piglit regressions from the change. I suspect that removing the FLUSH_VERTICES() actually exposed a bug elsewhere but I don't have time to hunt down the root issue at this time.
| * mesa: Set api prefix to version string when overriding versionTapani Pälli2015-10-161-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise there are problems when user overrides version and application such as Piglit wants to detect used api with glGetString(GL_VERSION). This makes it currently impossible to run glslparsertest tests for OpenGL ES when using version override. Below is example when using MESA_GLES_VERSION_OVERRIDE=3.1. Before: "3.1 Mesa 11.1.0-devel (git-24a1a15)" After: "OpenGL ES 3.1 Mesa 11.1.0-devel (git-78042ff)" v2: only include api prefix for OpenGL ES (Boyan Ding) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Cc: "11.0" <[email protected]>
| * mesa: wrap a ridiculously long line in es1_conversion.cBrian Paul2015-10-151-1/+19
| | | | | | | | Reviewed-by: Eric Anholt <[email protected]>
| * mesa: add num_buffers() helper in blend.cBrian Paul2015-10-151-15/+22
| | | | | | | | Reviewed-by: Eric Anholt <[email protected]>
| * mesa: optimize _UsesDualSrc blend flag settingBrian Paul2015-10-151-1/+6
| | | | | | | | | | | | | | For glBlendFunc and glBlendFuncSeparate(), the _UsesDualSrc flag will be the same for all buffers, so no need to compute it N times. Reviewed-by: Eric Anholt <[email protected]>
| * mesa: fix incorrect error string in _mesa_BlendEquationiARB()Brian Paul2015-10-151-1/+1
| | | | | | | | Reviewed-by: Eric Anholt <[email protected]>
| * mesa: move validate_blend_factors() call after no-change checkBrian Paul2015-10-151-6/+6
| | | | | | | | | | | | | | A redundant call to glBlendFuncSeparateiARB() is more likely than getting invalid values, so do the no-op check first. Reviewed-by: Eric Anholt <[email protected]>
| * mesa: optimize no-change check in _mesa_BlendEquationSeparate()Brian Paul2015-10-151-15/+26
| | | | | | | | Reviewed-by: Eric Anholt <[email protected]>
| * mesa: optimize no-change check in _mesa_BlendEquation()Brian Paul2015-10-151-12/+23
| | | | | | | | | | | | Same story as preceeding change to _mesa_BlendFuncSeparate(). Reviewed-by: Eric Anholt <[email protected]>
| * mesa: optimize no-change check in _mesa_BlendFuncSeparate()Brian Paul2015-10-151-15/+28
| | | | | | | | | | | | | | | | | | | | | | | | Streamline the checking for no state change in _mesa_BlendFuncSeparate() (and _mesa_BlendFunc()). If _BlendFuncPerBuffer is false, we only need to check the 0th buffer state. Move argument validation after the no-op check. I'm looking at an app that issues about 1000 redundant glBlendFunc() calls per frame! Reviewed-by: Eric Anholt <[email protected]>
| * mesa: short-cut new_state == _NEW_LINE in _mesa_update_state_locked()Brian Paul2015-10-151-1/+5
| | | | | | | | | | | | | | | | | | | | | | We can skip to the end of _mesa_update_state_locked() if only the _NEW_LINE flag is set since none of the derived state depends on it (just like _NEW_CURRENT_ATTRIB). Note that we still call the ctx->Driver.UpdateState() function, of course. v2: use bitmask-based test, per Eric. Reviewed-by: Eric Anholt <[email protected]>
| * mesa: remove FLUSH_VERTICES() in _mesa_MatrixMode()Brian Paul2015-10-151-1/+0
| | | | | | | | | | | | | | Changing the matrix mode alone has no effect on rendering and does not need to trigger a flush or state validation. Reviewed-by: Eric Anholt <[email protected]>
| * mesa: minor indentation fix in _mesa_BindTextureUnit()Brian Paul2015-10-141-1/+1
| |
| * mesa: remove unused texUnit local in _mesa_BindTextureUnit()Brian Paul2015-10-141-7/+0
| | | | | | | | | | | | | | The texture unit is error-checked before this and the texUnit var is unused, so remove it. Reviewed-by: Anuj Phogat <[email protected]>
| * glsl: calculate TOP_LEVEL_ARRAY_SIZE and STRIDE when adding resourcesTapani Pälli2015-10-141-242/+2
| | | | | | | | | | | | | | | | | | | | Patch moves existing calculation code from shader_query.cpp to happen during program resource list creation. No Piglit or CTS regressions were observed during testing. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
| * mesa: Add {Num}UniformBlocks and {Num}ShaderStorageBlocks to gl_shader{_program}Iago Toral Quiroga2015-10-141-1/+48
| | | | | | | | | | | | These arrays provide backends with separate index spaces for UBOS and SSBOs. Reviewed-by: Kristian Høgsberg <[email protected]>
| * mesa: Rename {Num}UniformBlocks to {Num}BufferInterfaceBlocksIago Toral Quiroga2015-10-145-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, these arrays in gl_shader and gl_shader_program hold both UBOs and SSBOs, so this looks like a better name. We were already using NumBufferInterfaceBlocks in gl_shader_program, so this makes things more consistent as well. In a later patch we will add {Num}UniformBlocks and {Num}ShaderStorageBlocks which will contain only references to UBOs and SSBOs respectively that will provide backends with a separate index space for both types of objects. Reviewed-by: Kristian Høgsberg <[email protected]>
| * mesa: clean up comments for gl_current_attrib structBrian Paul2015-10-131-7/+5
| | | | | | | | Reviewed-by: Marek Olšák <[email protected]>
| * mesa: pass caller name to create_textures()Brian Paul2015-10-131-7/+6
| | | | | | | | Simpler than the dsa flag approach.
| * ff_fragment_shader: Use binding to set the sampler unitIan Romanick2015-10-121-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | This is the way layout(binding=xxx) works from GLSL. The old method just happened to work (and significantly predated support for layout(binding=xxx)), but future changes will break this. v2: Remove some stale comments. Suggested by Matt and Chris Forbes. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Cc: "10.6 11.0" <[email protected]>
| * mesa/uniforms: fix get_uniform for doubles (v2)Dave Airlie2015-10-121-16/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial glGetUniformdv support didn't cover all the casting cases that are apparantly legal, and cts seems to test for them. I've updated the piglit test to cover these cases now. v2: fix indentation - it's all broken in this file (Ilia) fix src/dst index tracking in light of fp64 support (Ilia) cc: "11.0" <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
| * mesa: call ProgramStringNotify for fixed-function vertex programsMarek Olšák2015-10-091-2/+1
| | | | | | | | | | | | | | | | | | Drivers weren't notified about this at all. This allows disabling on-demand compilation in drivers. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
| * glsl: move shader_enums into nirRob Clark2015-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First step towards inverting the dependency between glsl and nir (so nir can be used without glsl). Also solves this issue with 'make distclean' Making distclean in mesa make[2]: Entering directory '/mnt/sdb1/Src64/Mesa-git/mesa/src/mesa' Makefile:2486: ../glsl/.deps/shader_enums.Plo: No such file or directory make[2]: *** No rule to make target '../glsl/.deps/shader_enums.Plo'. Stop. make[2]: Leaving directory '/mnt/sdb1/Src64/Mesa-git/mesa/src/mesa' Makefile:684: recipe for target 'distclean-recursive' failed make[1]: *** [distclean-recursive] Error 1 make[1]: Leaving directory '/mnt/sdb1/Src64/Mesa-git/mesa/src' Makefile:615: recipe for target 'distclean-recursive' failed make: *** [distclean-recursive] Error 1 Reported-by: Andy Furniss <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Signed-off-by: Rob Clark <[email protected]>
| * mesa: Get rid of texture-dependent image unit derived state.Francisco Jerez2015-10-094-33/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The point is to avoid having to re-validate all image units when _NEW_TEXTURE is flagged, which can be expensive if the driver exposes a large number of image units. This has been reported to fix a 36% performance regression in the Synmark2 Multithread benchmark on the i965 driver which exposes 192 image units. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91788 Reported-by: Wendy Wang <[email protected]> Tested-by: Ye Tian <[email protected]> CC: "11.0" <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
| * mesa: Skip redundant texture completeness checking during image validation.Francisco Jerez2015-10-091-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The call to _mesa_test_texobj_completeness() is unnecessary if the texture is already known to be complete. If the texture object is dirtied in the meantime _BaseComplete and _MipmapComplete will be reset to false. _mesa_is_image_unit_valid() will start to be called more frequently in a future commit, so it seems desirable to avoid the unnecessary work. Tested-by: Ye Tian <[email protected]> CC: "11.0" <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
| * mesa: Expose function to calculate whether a shader image unit is valid.Francisco Jerez2015-10-092-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | A future commit will remove all texture object-dependent derived state from the image unit struct to make validation unnecessary on texture state changes. Instead of checking gl_image_unit::_Valid drivers will be required to call this function when needed to find out whether an image unit is in a valid state and whether access from the shader is allowed. Tested-by: Ye Tian <[email protected]> CC: "11.0" <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
| * main: fix length of values written to glGetProgramResourceiv() for ↵Samuel Iglesias Gonsalvez2015-10-091-4/+10
| | | | | | | | | | | | | | | | | | | | ACTIVE_VARIABLES Return the number of values written. Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
| * main: buffer array variables can have array size of 0 if they are unsizedSamuel Iglesias Gonsalvez2015-10-091-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From ARB_program_query_interface: For the property ARRAY_SIZE, a single integer identifying the number of active array elements of an active variable is written to <params>. The array size returned is in units of the type associated with the property TYPE. For active variables not corresponding to an array of basic types, the value one is written to <params>. If the variable is a shader storage block member in an array with no declared size, the value zero is written to <params>. v2: - Unsized arrays of arrays have an array size different than zero v3: - Arrays and unsized arrays will have an array_stride > 0. Use it instead of is_unsized_array flag (Timothy). Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
| * main: consider that unsized arrays have at least one active elementSamuel Iglesias Gonsalvez2015-10-091-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From ARB_shader_storage_buffer_object: "When using the ARB_program_interface_query extension to enumerate the set of active buffer variables, only the first element of arrays (sized or unsized) will be enumerated" _mesa_program_resource_array_size() is used when getting the name (and name length) of the active variables. When it is an unsized array, we want to indicate it has one active element so the returned name would have "[0]" at the end. v2: - Use array_stride > 0 and array_elements == 0 to detect unsized arrays. Because of that, we don't need is_unsized_array flag (Timothy) Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
| * main: fix TOP_LEVEL_ARRAY_SIZE and TOP_LEVEL_ARRAY_STRIDESamuel Iglesias Gonsalvez2015-10-091-1/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the active variable is an array which is already a top-level shader storage block member, don't return its array size and stride when querying TOP_LEVEL_ARRAY_SIZE and TOP_LEVEL_ARRAY_STRIDE respectively. Fixes the following 12 dEQP-GLES31 tests: dEQP-GLES31.functional.ssbo.layout.single_basic_array.shared.mat3x4 dEQP-GLES31.functional.ssbo.layout.single_basic_array.shared.row_major_mat3x4 dEQP-GLES31.functional.ssbo.layout.single_basic_array.shared.column_major_mat3x4 dEQP-GLES31.functional.ssbo.layout.single_basic_array.packed.mat3x4 dEQP-GLES31.functional.ssbo.layout.single_basic_array.packed.row_major_mat3x4 dEQP-GLES31.functional.ssbo.layout.single_basic_array.packed.column_major_mat3x4 dEQP-GLES31.functional.ssbo.layout.single_basic_array.std140.mat3x4 dEQP-GLES31.functional.ssbo.layout.single_basic_array.std140.row_major_mat3x4 dEQP-GLES31.functional.ssbo.layout.single_basic_array.std140.column_major_mat3x4 dEQP-GLES31.functional.ssbo.layout.single_basic_array.std430.mat3x4 dEQP-GLES31.functional.ssbo.layout.single_basic_array.std430.row_major_mat3x4 dEQP-GLES31.functional.ssbo.layout.single_basic_array.std430.column_major_mat3x4 v2: - Fix check when the shader storage block is instanced - Write auxiliary function to do the check. v3: - Check if full_instanced_name is NULL just after allocation (Ilia) - Remove () from one strcmp() in the if statement (Ilia) Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Tested-by: Tapani Pälli <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
| * main: fix goto in program_resource_top_level_array_strideSamuel Iglesias Gonsalvez2015-10-091-2/+2
| | | | | | | | | | | | | | | | Use found_top_level_array_stride instead of found_top_level_array_size. Signed-off-by: Samuel Iglesias Gonsalvez <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
| * mesa: add GL_UNSIGNED_INT_24_8 to _mesa_pack_depth_spanTapani Pälli2015-10-091-0/+15
| | | | | | | | | | | | | | | | | | | | | | Patch adds missing type (used with NV_read_depth) so that it gets handled correctly. This fixes errors seen with following CTS test: ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Cc: "11.0" <[email protected]>
| * mesa,meta: move gl_texture_object::TargetIndex initializationsBrian Paul2015-10-083-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, we were unconditionally assigning the TargetIndex field in _mesa_BindTexture(), even if it was already set properly. Now we initialize TargetIndex wherever we initialize the Target field, in _mesa_initialize_texture_object(), finish_texture_init(), etc. v2: also update the meta_copy_image code. In make_view() the view_tex_obj->Target field was set, but not the TargetIndex field. Also, remove a second, redundant assignment to view_tex_obj->Target. Add sanity check assertions too. Reviewed-by: Anuj Phogat <[email protected]> Tested-by: Mark Janes <[email protected]>
| * mesa: remove unused _mesa_create_nameless_texture()Brian Paul2015-10-082-23/+0
| | | | | | | | | | Reviewed-by: Anuj Phogat <[email protected]> Tested-by: Mark Janes <[email protected]>
| * mesa: remove unneeded error check in create_textures()Brian Paul2015-10-081-9/+2
| | | | | | | | | | | | | | | | | | Callers of create_texture() will either pass target=0 or a validated GL texture target enum so no need to do another error check inside the loop. Reviewed-by: Anuj Phogat <[email protected]> Tested-by: Mark Janes <[email protected]>