aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common
Commit message (Collapse)AuthorAgeFilesLines
* mesa: remove dd_function_table::GetCompressedTexSubImage and clean it upMarek Olšák2018-01-061-1/+0
| | | | Reviewed-by: Ian Romanick <[email protected]>
* meta: Don't pollute the texture namespaceIan Romanick2018-01-022-29/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | tl;dr: For many types of GL object, we can *NEVER* use the Gen function. In OpenGL ES (all versions!) and OpenGL compatibility profile, applications don't have to call Gen functions. The GL spec is very clear about how you can mix-and-match generated names and non-generated names: you can use any name you want for a particular object type until you call the Gen function for that object type. Here's the problem scenario: - Application calls a meta function that generates a name. The first Gen will probably return 1. - Application decides to use the same name for an object of the same type without calling Gen. Many demo programs use names 1, 2, 3, etc. without calling Gen. - Application calls the meta function again, and the meta function replaces the data. The application's data is lost, and the app fails. Have fun debugging that. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92363 Reviewed-by: Tapani Pälli <[email protected]>
* meta: Use _mesa_bind_texture instead of _mesa_BindTextureIan Romanick2018-01-022-5/+5
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta: Use _mesa_CreateTextures instead of _mesa_GenTexturesIan Romanick2018-01-021-1/+1
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta: Track temporary textures using gl_texture_object instead of GL API ↵Ian Romanick2018-01-023-17/+36
| | | | | | | object handle Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Track temporary texture using gl_texture_object instead of GL API ↵Ian Romanick2018-01-022-7/+7
| | | | | | | object handle Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Use _mesa_bind_texture instead of _mesa_BindTextureIan Romanick2018-01-021-1/+1
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Don't bind texture in _mesa_meta_bind_rb_as_tex_imageIan Romanick2018-01-022-7/+6
| | | | | | | | | | | | | All of the callers of _mesa_meta_bind_rb_as_tex_image call _mesa_meta_setup_sampler shortly after. _mesa_meta_setup_sampler also binds the texture. This is necessary because not all paths that lead to _mesa_meta_setup_sampler some through _mesa_meta_bind_rb_as_tex_image. Rename the function _mesa_meta_texture_object_from_renderbuffer to reflect its true purpose. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Track source texture using gl_texture_object instead of GL API ↵Ian Romanick2018-01-022-0/+2
| | | | | | | object handle Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Since _mesa_meta_bind_rb_as_tex_image has only one output, return itIan Romanick2018-01-022-14/+14
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Don't return the texture handle from _mesa_meta_bind_rb_as_tex_imageIan Romanick2018-01-022-9/+7
| | | | | | | It's always the same as *texObj->Name. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Don't return the target from _mesa_meta_bind_rb_as_tex_imageIan Romanick2018-01-022-14/+10
| | | | | | | It's always the same as *texObj->Target. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Don't restore state of the temporary textureIan Romanick2018-01-021-21/+27
| | | | | | | It's about to be destroyed, so there's no point. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta/blit: Check the values instead of the target before restoringIan Romanick2018-01-021-2/+6
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* meta: Fix ClearTexture with GL_DEPTH_COMPONENT.Kenneth Graunke2017-12-061-9/+14
| | | | | | | | | | | | | We only handled unpacking for GL_DEPTH_STENCIL formats. Cemu was hitting _mesa_problem() for an unsupported format in _mesa_unpack_float_32_uint_24_8_depth_stencil_row(), because the format was depth-only, rather than depth-stencil. Cc: "13.0 12.0" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94739 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103966 Reviewed-by: Tapani Pälli <[email protected]>
* meta: Initialize depth/clear values on declaration.Kenneth Graunke2017-12-061-5/+2
| | | | | | | This helps avoid compiler warningss in the next commit - everything was initialized, but it wasn't obvious to static analysis. Suggested-by: Tapani Pälli <[email protected]>
* mesa: s/GLint/gl_buffer_index/ for _ColorDrawBufferIndexesBrian Paul2017-11-091-1/+1
| | | | | | | Also fix local variable declarations and replace -1 with BUFFER_NONE. No Piglit changes. Reviewed-by: Charmaine Lee <[email protected]>
* meta: Delete the PBO texsubimage path for realJason Ekstrand2017-10-121-495/+0
| | | | Acked-by: Kenneth Graunke <[email protected]>
* meta: Delete the PBO texture upload/download pathJason Ekstrand2017-10-121-17/+0
| | | | | Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Unset the textures_used_by_txf bitfield.Kenneth Graunke2017-10-121-0/+13
| | | | | | | | | | | Drivers that use Meta are happily using blitting data using texelFetch and GL_SKIP_DECODE_EXT, but the GL_EXT_texture_sRGB spec unfortunately makes GL_SKIP_DECODE_EXT not necessarily work with texelFetch. As a hack, just unset the texture_used_by_txf bitfield so we can continue with the old desired behavior. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: add support for memory object creation/import/deleteAndres Rodriguez2017-08-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | Used by EXT_external_objects and EXT_external_objects_fd V2 (Timothy Arceri): - Throw GL_OUT_OF_MEMORY error if CreateMemoryObjectsEXT() fails. - C99 tidy ups - remove void cast (Constantine Kharlamov) V3 (Timothy Arceri): - rename mo -> memObj - check that the object is not NULL before initializing - add missing "EXT" in function error message V4 (Timothy Arceri): - remove checks for (memory objecy id == 0) and catch in _mesa_lookup_memory_object() instead. Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]>
* meta: Actually initialize ImmutableLevels to 1.Kenneth Graunke2017-07-171-0/+1
| | | | | | | | | | | | | | Otherwise, ImmutableLevels is 0, which is an illegal value. Later, _mesa_meta_setup_sampler will use _mesa_texture_parameteriv to set texObj->MaxLevel = CLAMP(params[0], texObj->BaseLevel, texObj->ImmutableLevels - 1); which turns into a completely bogus CLAMP(value, 0, -1)...where the upper bound is smaller than the lower bound. This ends up being -1 today due to the way CLAMP is implemented, which is a bogus MaxLevel. Reviewed-by: Ian Romanick <[email protected]>
* mesa: replace VP/FP/ATIfs _Enabled flags with helper functionsMarek Olšák2017-06-221-1/+1
| | | | | | | | These are only used in the GL compatibility profile. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: replace _mesa_update_stencil() with helper functionsMarek Olšák2017-06-221-1/+1
| | | | | | | | | | | | | The idea is to remove the dependency on _mesa_update_state_locked, so that st/mesa can skip it for stencil state updates, and then stop setting _NEW_STENCIL in mesa/main if the driver is st/mesa. The main motivation is to stop invoking _mesa_update_state_locked for certain state groups. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* meta: do the full FBO completeness check in decompress_texture_imageMarek Olšák2017-06-221-0/+5
| | | | | | | | | | _mesa_update_state will no longer recompute Width/Height if the framebuffer is complete. We now rely on the FBO completeness check to do it. The only code that needs to be fixed seems to be this one. Reviewed-by: Ian Romanick <[email protected]> Tested-by: Ian Romanick <[email protected]>
* meta/blit: Silence unused parameter warningIan Romanick2017-06-201-2/+2
| | | | | | | | | | drivers/common/meta_blit.c: In function ‘setup_glsl_msaa_blit_scaled_shader’: drivers/common/meta_blit.c:62:58: warning: unused parameter ‘filter’ [-Wunused-parameter] GLenum target, GLenum filter) ^~~~~~ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* meta: Silence unused parameter warningIan Romanick2017-06-201-2/+2
| | | | | | | | | drivers/common/meta.c:2694:71: warning: unused parameter ‘dims’ [-Wunused-parameter] copytexsubimage_using_blit_framebuffer(struct gl_context *ctx, GLuint dims, ^~~~ Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: create validate_buffer_sub_data() helperTimothy Arceri2017-05-172-10/+5
| | | | | | | This change assumes meta will always pass valid arguments to _mesa_buffer_sub_data(). Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: pass rb attachment to _mesa_framebuffer_texture()Timothy Arceri2017-05-111-2/+6
| | | | | | This change will help us add KHR_no_error support to the caller. Reviewed-by: Eric Anholt <[email protected]>
* mesa: tidy up renderbuffer RefCount initialisationTimothy Arceri2017-04-061-2/+0
| | | | | | | | | | | 42aaa548 changed the renderbuffer initialisation of RefCount from 1 to 0. This is inconsitent with how we use RefCount elsewhere. Also every driver implementation of NewRenderbuffer() calls _mesa_init_renderbuffer() so its safe to set it there. Reviewed-by: Brian Paul <[email protected]>
* mesa: move FLUSH_VERTICES() call to metaTimothy Arceri2017-03-311-7/+10
| | | | | | | | There is no need for this to be in the common code. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: remove dd_function_table::BindProgramMarek Olšák2017-03-291-1/+0
| | | | | | Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Add SetBackgroundContext to dd_function_tablePaul Berry2017-03-161-0/+3
| | | | | | | Acked-by: Timothy Arceri <[email protected]> Acked-by: Marek Olšák <[email protected]> Tested-by: Dieter Nützel <[email protected]> Tested-by: Mike Lothian <[email protected]>
* mesa/glsl: introduce new gl_compile_status enumTimothy Arceri2017-03-121-1/+1
| | | | | | | This will allow us to tell if a shader really has been compiled or if the shader cache has just seen it before. Acked-by: Marek Olšák <[email protected]>
* mesa: retain gl_shader_programs after glDeleteProgram if they are in useTimothy Arceri2017-02-161-1/+1
| | | | | | | | | | | | | | Fixes regressions from c505d6d852220f4aaaee161465dd2c579647e672. Switching from using gl_shader_program to gl_program for the pipline objects CurrentProgram array meant we were freeing gl_shader_programs immediately after glDeleteProgram was called, but the spec states the program should only get deleted once it is no longer in use. To work around this we add a new ReferencedPrograms array to track gl_shader_programs in use. Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Refactor texture format translationTopi Pohjolainen2017-01-271-6/+3
| | | | | | Reviewed-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Topi Pohjolainen <[email protected]>
* mesa: use gl_program for CurrentProgram rather than gl_shader_programTimothy Arceri2017-01-232-21/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes much more sense and should be more performant in some critical paths such as SSO validation which is called at draw time. Previously the CurrentProgram array could have contained multiple pointers to the same struct which was confusing and we would often need to fish out the information we were really after from the gl_program anyway. Also it was error prone to depend on the _LinkedShader array for programs in current use because a failed linking attempt will lose the infomation about the current program in use which is still valid. V2: fix validate_io() to compare linked_stages rather than the consumer and producer to decide if we are looking at inward facing shader interfaces which don't need validation. Acked-by: Edward O'Callaghan <[email protected]> To avoid build regressions the following 2 patches were squashed in to this commit: mesa/meta: rewrite _mesa_shader_program_use() and _mesa_program_use() These are rewritten to do what the function name suggests, that is _mesa_shader_program_use() sets the use of all stage and _mesa_program_use() sets the use of a single stage. Reviewed-by: Lionel Landwerlin <[email protected]> Acked-by: Edward O'Callaghan <[email protected]> mesa: update active relinked program This likely fixes a subroutine bug were _mesa_shader_program_init_subroutine_defaults() would never have been called for the relinked program as we previously just set _NEW_PROGRAM as dirty and never called the _mesa_use* functions when linking. Acked-by: Edward O'Callaghan <[email protected]>
* meta: Disable dithering during glGenerateMipmapChad Versace2017-01-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Fixes tests 'dEQP-GLES3.functional.texture.mipmap.*.generate.rgba5551*' on Intel Broadwell 0x1616. The GL 4.5 spec describes the algorithm of glGenerateMipmap as: The contents of the derived images are computed by repeated, filtered reduction of the level base image. [...] No particular filter algorithm is required, though a box filter is recommended as the default filter. Consider a texture for which all pixels are identical at level 0. From the spec's description above, one may reasonably assume that the "filtered reduction" of level 0 produces a new miplevel for which again all pixels are identical. For any 2x2 subspan of identical pixels, it is difficult to see how the "filtered reduction" of that subspan can produce a pixel that differs from the source pixels. Dithering during _mesa_meta_GenerateMipmap() violated that reasonable assumption. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99210 Reviewed-by: Kenneth Graunke <[email protected]> Cc: [email protected]
* i965: Delete the meta-base CopyImageSubData implementationJason Ekstrand2016-12-052-317/+0
| | | | | | | | | | | | | | | | | | | When I originally implemented the ARB_copy_image extension, the fast-path was written in meta using texture views. This path only worked if both images were uncompressed color images. All of the other cases fell back to the blitter or, in the worst case, mapping and memcpy on the CPU. Now that we have the blorp path, it handles all copies ever and the old meta, blitter, and CPU paths are only used on gen5 and below. The primary reason why we needed the meta path (apart from having a slow blitter on later hardware) was to handle multisampling which gen5 and earlier don't support anyway. Since the blitter is reasonably fast on gen5, we can just delete the meta path and get rid of all that terrible code. If we decide that we're ok with just disabling ARB_copy_image on gen5 and earlier (I personally am), then we could get rid of another 300 lines or so of semi-hairy code. Reviewed-by: Anuj Phogat <[email protected]>
* st/mesa/glsl/nir/i965: make use of new gl_shader_program_data in ↵Timothy Arceri2016-11-191-2/+3
| | | | | | gl_shader_program Reviewed-by: Emil Velikov <[email protected]>
* meta/GetTexSubImage: Account for GL_PACK_SKIP_IMAGES on compressed texturesEduardo Lima Mitev2016-11-151-3/+17
| | | | | | | | | | | | This option was being ignored when packing compressed 3D and cube textures. Fixes CTS test (on gen8+): * GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pixelstore v2: Drop API checks. v3 (Ken): Just apply the existing code in more cases. Reviewed-by: Kenneth Graunke <[email protected]>
* drivers/meta: Accept GL_TEXTURE_3D as target for tex image decompressionEduardo Lima Mitev2016-10-281-4/+0
| | | | | | | | | | | | | | | | | | An assert is currently raised, preventing decompression of a texture image into a GL_TEXTURE_3D target. I have not found any spec wording that would explain this, or implementation detail that would prevent it. And in any case, the driver should not cause a crash upon user input arguments. Fixes most failing subcases in CTS tests: * GL44-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pixelstore * GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pixelstore These tests were crashing the driver before. Now they just fail, but due to an unrelated issue affecting 2 out of the 45 test subcases. No regressions observed against piglit or CTS-GL. Reviewed-by: Kenneth Graunke <[email protected]>
* meta: remove remaining tabs in meta.cTimothy Arceri2016-10-261-49/+49
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* st/mesa/r200/i915/i965: eliminate gl_fragment_programTimothy Arceri2016-10-262-6/+6
| | | | | | | | | | Here we move OriginUpperLeft and PixelCenterInteger into gl_program all other fields have been replace by shader_info. V2: Don't use anonymous union/structs to hold vertex/fragment fields suggested by Ian. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa/i965/i915/r200: eliminate gl_vertex_programTimothy Arceri2016-10-262-6/+6
| | | | | | | Here we move the only field in gl_vertex_program to the ARB program fields in gl_program. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: replace gl_framebuffer::_IntegerColor wih _IntegerBuffersBrian Paul2016-10-131-1/+1
| | | | | | | | | | | 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]>
* meta: Always do GenerateMipmaps in linear colorspace.Kenneth Graunke2016-08-251-2/+10
| | | | | | | | | | | | When generating mipmaps for sRGB textures, force both decode and encode, so the filtering is done in linear colorspace, regardless of settings. Fixes a WebGL conformance test in Chrome: https://www.khronos.org/registry/webgl/sdk/tests/conformance2/textures/misc/tex-srgb-mipmap.html?webglVersion=2 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97322 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* mesa: Rename "texturebarrier" source files to "barrier".Francisco Jerez2016-08-241-2/+2
| | | | | | | In preparation for collecting all pipeline barrier GL entry points into a single source file. Reviewed-by: Kenneth Graunke <[email protected]>
* meta: Make Meta's BlitFramebuffer() follow the GL 4.4 sRGB rules.Kenneth Graunke2016-08-081-54/+30
| | | | | | | | | | Just avoid whacking GL_FRAMEBUFFER_SRGB altogether, so we respect the application's setting. This appears to work. v2: Update one more comment (requested by Ian). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: add numLevels, numSamples to Driver.TestProxyTexImage()Brian Paul2016-07-151-3/+3
| | | | | | | | | | | | | So that the function can work properly with glTexStorage(), where we know how many mipmap levels there are. And so we can compute storage for MSAA textures. Also, remove the obsolete texture border parameter. A subsequent patch will update _mesa_test_proxy_teximage() to use these new parameters. Reviewed-by: Anuj Phogat <[email protected]>