aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
Commit message (Collapse)AuthorAgeFilesLines
* mesa: add packing support for setting uniform handlesTimothy Arceri2018-03-201-3/+13
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add packing support for setting uniformsTimothy Arceri2018-03-201-19/+53
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: create copy uniform to storage helpersTimothy Arceri2018-03-201-63/+91
| | | | | | | | These will be used in the following patch to allow copying directly to the param list when packing is enabled. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: rework ParameterList to allow packingTimothy Arceri2018-03-201-6/+8
| | | | | | | | | | | | | | Currently everything is padded to 4 components. Making the list more flexible will allow us to do uniform packing. V2 (suggestions from Nicolai): - always pass existing calls to _mesa_add_parameter() true for padd_and_align - fix bindless param value offsets - remove left over wip logic from pad and align code - zero out param value padding - whitespace fix Reviewed-by: Marek Olšák <[email protected]>
* mesa: add PackedDriverUniformStorage constTimothy Arceri2018-03-201-0/+3
| | | | | | | Will be used to determine whether to take packing code paths or not. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: adjust incorrect comment in texture_buffer_rangeMarek Olšák2018-03-191-2/+2
|
* main/program_binary: In ProgramBinary set link status as LINKING_SKIPPEDJordan Justen2018-03-191-1/+1
| | | | | | | | | | | | | This change allows the disk shader cache to work with programs loaded with ProgramBinary. Drivers check for LINKING_SKIPPED, and if set, then they try to use the shader cache. Since the program loaded by ProgramBinary is similar to loading the shader from the disk cache, this is probably more appropriate. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* glsl: Remove api_enabled tracking for transform feedbackJordan Justen2018-03-191-3/+0
| | | | | | | | | | We used this to prevent usage of the disk shader cache when transform feedback was enabled via the GL API. This is no longer used. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105444 Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: RGB9_E5 invalid for CopyTexSubImage* in GLESJuan A. Suarez Romero2018-03-161-0/+14
| | | | | | | | | | According to OpenGL ES 3.2, section 8.6, CopyTexSubImage* should return an INVALID_OPERATION if the internalformat of the texture is RGB9_E5. This fixes dEQP-GLES31.functional.debug.negative_coverage.*.copytexsubimage2d_texture_internalformat. Reviewed-by: Tapani Pälli <[email protected]>
* Revert "mesa: do not trigger _NEW_TEXTURE_STATE in glActiveTexture()"Samuel Pitoiset2018-03-151-0/+13
| | | | | | | | | | | | | | | | This reverts commit f314a532fdc7af8381586144d2631d9968331f05. This appears to introduce some blinking textures in UT2004. Not sure exactly what's the root cause because we don't have much information about the issue. Anyway, this was just a micro optimization that actually breaks, at least, one app almost one year later. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105436 Cc: <[email protected]> Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: Don't write to user buffer in glGetTexParameterIuiv on errorIan Romanick2018-03-121-26/+2
| | | | | | | | | | | | | | | | | | | | | | | With some sets of optimization flags, GCC will generate warnings like this: src/mesa/main/texparam.c:2327:27: warning: ‘*((void *)&ip+12)’ may be used uninitialized in this function [-Wmaybe-uninitialized] params[3] = ip[3]; ~~^~~ src/mesa/main/texparam.c:2320:16: note: ‘*((void *)&ip+12)’ was declared here GLint ip[4]; ^~ ip is not initialized in cases where a GL error is generated. In these cases, we should *not* write to the user's buffer, so this is actually a bug. I wrote a new piglit test gl-3.0-texparameteri to show this bug. I suspect that Coverity also detected this, but the scan site is currently down. Fixes: c2c507786 "main: Added entry points for glGetTextureParameteriv, Iiv, and Iuiv." Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: Make gl_vertex_array contain pointers to first order VAO members.Mathias Fröhlich2018-03-105-106/+28
| | | | | | | | | | | | | | | Instead of keeping a copy of the vertex array content in struct gl_vertex_array only keep pointers to the first order information originaly in the VAO. For that represent the current values by struct gl_array_attributes and struct gl_vertex_buffer_binding. v2: Change comments. Remove gl... prefix from variables except in the i965 directory where it was like that before. Reindent because of that. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Fröhlich <[email protected]>
* mesa: Silence unused parameter warnings from TEXSTORE_PARAMSIan Romanick2018-03-022-13/+27
| | | | | | | | | | | | | | | | | | Reduces my build from 1717 warnings to 1547 warnings by silencing 170 instances of things like In file included from ../../SOURCE/master/src/mesa/main/texcompress_bptc.h:30:0, from ../../SOURCE/master/src/mesa/main/texcompress_bptc.c:31: ../../SOURCE/master/src/mesa/main/texcompress_bptc.c: In function ‘_mesa_texstore_bptc_rgba_unorm’: ../../SOURCE/master/src/mesa/main/texstore.h:60:14: warning: unused parameter ‘dstFormat’ [-Wunused-parameter] mesa_format dstFormat, \ ^ ../../SOURCE/master/src/mesa/main/texcompress_bptc.c:1276:32: note: in expansion of macro ‘TEXSTORE_PARAMS’ _mesa_texstore_bptc_rgba_unorm(TEXSTORE_PARAMS) ^~~~~~~~~~~~~~~ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* mesa: Expose EXT_shader_framebuffer_fetch(_non_coherent) on desktop and ↵Francisco Jerez2018-02-241-1/+2
| | | | | | embedded GL. Reviewed-by: Plamena Manolova <[email protected]>
* mesa: Implement glFramebufferFetchBarrierEXT entry point.Francisco Jerez2018-02-243-2/+24
| | | | Reviewed-by: Plamena Manolova <[email protected]>
* mesa: Rename MESA_shader_framebuffer_fetch gl_extensions bits to EXT.Francisco Jerez2018-02-245-9/+8
| | | | | | | | The changes I had originally planned for the MESA_shader_framebuffer_fetch extension have been merged into the EXT spec, there's no point in keeping MESA_shader_framebuffer_fetch extension enables. Reviewed-by: Plamena Manolova <[email protected]>
* mesa: Rename dd_function_table::BlendBarrier to match latest EXT spec.Francisco Jerez2018-02-242-4/+4
| | | | | | | | This GL entry point was renamed to glFramebufferFetchBarrier() in the EXT extension on request from Khronos members. Update the Mesa codebase to match the latest spec. Reviewed-by: Plamena Manolova <[email protected]>
* mesa: Update vertex processing mode on _mesa_UseProgram.Mathias Fröhlich2018-02-231-0/+2
| | | | | | | | | | | | The change is a bug fix for 92d76a169: mesa: Provide an alternative to get_vp_mode() that actually got exposed through 4562a7b0: vbo: Make use of _DrawVAO from the dlist code. Fixes: KHR-GLES31.core.shader_image_load_store.advanced-sso-simple Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105229 Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: rename has_core_gs -> has_gs in get_programivMarek Olšák2018-02-231-5/+5
| | | | | | | This is also true for GLES. Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: replace some API_OPENGL_CORE checks with _mesa_is_desktop_glMarek Olšák2018-02-232-4/+4
| | | | | | | This is more accurate with respect to the compatibility profile. Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add some of missing compatibility support for ARB_bindless_textureMarek Olšák2018-02-232-8/+9
| | | | | | | The extension is exposed in the compatibility profile. Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: expose ARB_enhanced_layouts in the compatibility profileMarek Olšák2018-02-231-1/+1
| | | | | | | GLSL 1.40 is required. Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: enable OpenGL 3.1 with ARB_compatibilityMarek Olšák2018-02-231-6/+10
| | | | | Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: implement ARB_compatibilityMarek Olšák2018-02-232-0/+2
| | | | | Tested-by: Dieter Nützel <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add missing RGB9_E5 format in _mesa_base_fbo_formatJuan A. Suarez Romero2018-02-231-0/+3
| | | | | | | | | | | | | | | | | | RGB9_E5 should be accepted by RenderbufferStorage if the EXT_texture_shared_exponent is exposed. It is left to the implementations to return GL_FRAMEBUFFER_UNSUPPORTED_EXT when checking the framebuffer completeness if they do not support rendering in this format. Discussed in: https://github.com/KhronosGroup/OpenGL-API/issues/32 This fixes KHR-GL45.internalformat.renderbuffer.rgb9_e5 v2: Added more info to the commit message (Antia) Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Antia Puentes <[email protected]>
* mesa: Use atomics for shared VAO reference counts.Mathias Fröhlich2018-02-233-5/+46
| | | | | | | | | | | VAOs will be used in the next change as immutable object across multiple contexts. Only reference counting may write concurrently on the VAO. So, make the reference count thread safe for those and only those VAO objects. v3: Use bool/true/false for gl_vertex_array_object::SharedAndImmutable. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add flush_vertices to _mesa_bind_vertex_buffer.Mathias Fröhlich2018-02-233-9/+10
| | | | | | | We will need the flush_vertices argument later in this series. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Make _mesa_vertex_attrib_binding public.Mathias Fröhlich2018-02-232-18/+27
| | | | | | | | | Change vertex_attrib_binding() to _mesa_vertex_attrib_binding(), add a flush_vertices argument, and make it publicly available. The function will be needed later in the series. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Add flush_vertices to _mesa_{enable,disable}_vertex_array_attrib.Mathias Fröhlich2018-02-233-15/+23
| | | | | | | We will need the flush_vertices argument later in this series. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Introduce a yet unused _DrawVAO.Mathias Fröhlich2018-02-237-0/+69
| | | | | | | | | | | | | During the patch series this VAO gets populated with either the currently bound VAO or an internal VAO that will be used for immediate mode and dlist rendering. v2: More comments about the _DrawVAO, filter and enabled mask. Rename _DrawVAOEnabled to _DrawVAOEnabledAttribs. v3: Fix and move comment. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: Provide an alternative to get_vp_mode()Mathias Fröhlich2018-02-238-0/+72
| | | | | | | | | | | | | | | | | To get equivalent information than get_vp_mode(), track the vertex processing mode in a per context variable at gl_vertex_program_state::_VPMode. This aims to replace get_vp_mode() as seen in the vbo module. But instead of the get_vp_mode() implementation which only gives correct answers past calling _mesa_update_state() this context variable is immediately tracked when the vertex processing state is modified. The correctness of this value is asserted on state validation. With this in place we should be able to untangle the dependency with varying_vp_inputs and state invalidation. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add xbgr support adjacent to xrgbIlia Mirkin2018-02-191-1/+3
| | | | | Signed-off-by: Ilia Mirkin <[email protected]> Acked-by: Daniel Stone <[email protected]>
* mesa: Move compute_num_levels from st_gen_mipmap.c to mipmap.c.Kenneth Graunke2018-02-162-0/+28
| | | | | | | I want to use compute_num_levels inside i965. Rather than duplicating it, move it from mesa/st to core Mesa, and make it non-static. Reviewed-by: Marek Olšák <[email protected]>
* mesa: don't clamp just based on ARB_viewport_array extensionGurchetan Singh2018-02-151-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The ARB_viewport_array spec says: "Dependencies OpenGL 1.0 is required. OpenGL 3.2 or the EXT_geometry_shader4 or ARB_geometry_shader4 extensions are required. This extension is written against the OpenGL 3.2 (Compatibility) Specification." As such, we should ignore it for GLES2 contexts. Fixes: dEQP-GLES2.functional.state_query.integers.viewport_getinteger dEQP-GLES2.functional.state_query.integers.viewport_getfloat on llvmpipe and virgl. v2: Use _mesa_has_* (Ilia) Signed-off-by: Marek Olšák <[email protected]> Cc: 17.3 18.0 <[email protected]>
* mesa: add glsl version query (v4)Vadym Shovkoplias2018-02-135-0/+103
| | | | | | | | | | | | | | | | | | | | | Add support for GL_NUM_SHADING_LANGUAGE_VERSIONS and glGetStringi for GL_SHADING_LANGUAGE_VERSION v2: - Combine similar functionality into _mesa_get_shading_language_version() function. - Change GLSL version return mechanism. v3: - Add return of empty string for GLSL ver 1.10. - Move _mesa_get_shading_language_version() function to src/mesa/main/version.c. v4: - Add OpenGL version check. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104915 Signed-off-by: Andriy Khulap <[email protected]> Signed-off-by: Vadym Shovkoplias <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: add missing switch case for EXTRA_VERSION_40 in check_extra()Brian Paul2018-02-131-0/+5
| | | | | | | | | The EXTRA_VERSION_40 predicate is tested as part of extra_gl40_ARB_sample_shading but there was no switch case for it. Fixes: 77b440e42d8e7247c2295 ("mesa: Add new functions and enums required by GL_ARB_sample_shading") Reviewed-by: Eric Engestrom <[email protected]>
* Partially revert "mesa: use GLenum16 in a few more places"Mark Janes2018-02-131-1/+1
| | | | | | This reverts part of commit ca721b3d894a49d7342f5aa053ed132017e9352a. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105067
* Revert "mesa: reduce the size of gl_texture_image"Mark Janes2018-02-131-24/+23
| | | | | | | | | This reverts commit f4ea2b2a9e99d93fbf36c3f0e5f6f384be3cdb89. Several members reduced in size by the offending commit are not large enough to store the data needed by the i965 driver. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105067
* mesa: reduce the size of gl_texture_imageMarek Olšák2018-02-131-23/+24
| | | | | | 80 -> 40 bytes. Reviewed-by: Brian Paul <[email protected]>
* mesa,glsl,nir: reduce gl_state_index size to 2 bytesMarek Olšák2018-02-133-3/+3
| | | | | | | | | Let's use the new gl_state_index16 type everywhere and remove the typecasts. This helps reduce the size of gl_program_parameter. Reviewed-by: Brian Paul <[email protected]>
* mesa: reduce the size of gl_viewport_attribMarek Olšák2018-02-131-1/+1
| | | | | | | | | | | All drivers convert these to float, so there is no reason to use double. The piglit test that expects double precision from glGet will be adjusted not to require it (there is a piglit patch). gl_context::ViewportArray: 512 -> 384 bytes Reviewed-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* mesa: reduce the size of gl_texture_objectMarek Olšák2018-02-132-30/+30
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: reduce the size of gl_programMarek Olšák2018-02-131-2/+2
| | | | | | gl_program: 1456 -> 976 bytes Reviewed-by: Brian Paul <[email protected]>
* mesa: reduce the size of gl_image_unit (v2)Marek Olšák2018-02-132-7/+8
| | | | | | | | gl_context::ImageUnits: 6144 -> 4608 bytes v2: use ASSERT_BITFIELD_SIZE Reviewed-by: Brian Paul <[email protected]>
* mesa: further reduce the size of ctx->TextureMarek Olšák2018-02-132-23/+26
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: decrease the array size of ctx->Texture.FixedFuncUnit to 8Marek Olšák2018-02-135-2/+37
| | | | | | | | | | GL allows doing glTexEnv on 192 texture units, while in reality, only MaxTextureCoordUnits units are used by fixed-func shaders. There is a piglit patch that adjusts piglits/texunits to check only MaxTextureCoordUnits units. Reviewed-by: Brian Paul <[email protected]>
* mesa: separate legacy stuff from gl_texture_unit into gl_fixedfunc_texture_unitMarek Olšák2018-02-1313-106/+164
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: inline init_texture_unitMarek Olšák2018-02-131-51/+39
| | | | | | because this is going to be changed Reviewed-by: Brian Paul <[email protected]>
* mesa: use GLenum16 in a few more placesMarek Olšák2018-02-131-3/+3
| | | | Reviewed-by: Brian Paul <[email protected]>
* mesa: Only update enabled VAO gl_vertex_array entries.Mathias Fröhlich2018-02-092-15/+22
| | | | | | | | | | | | Instead of updating all modified gl_vertex_array_object::_VertexArray entries just update those that are modified and enabled. Also release buffer object from the _VertexArray that belong to disabled attributes. v2: Also set Ptr and Size to zero. Signed-off-by: Mathias Fröhlich <[email protected]> Reviewed-by: Brian Paul <[email protected]>