summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa: add an env var to force cache fallbackTimothy Arceri2017-05-203-1/+8
| | | | | | | | | | | | | | | | | 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]>
* st/mesa: improve shader cache debug infoTimothy Arceri2017-05-201-2/+4
| | | | | | | | | | | This will explicitly state that we are following the fallback path when we find invalid/corrupt cache items. It will also output the fallback message when the fallback path is forced via an environment variable, the following patches will allow this. Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* i965/formats: Update the three-channel DXT1 mappingsNanley Chery2017-05-182-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The procedure for decompressing an opaque DXT1 OpenGL format is dependant on the comparison of two colors stored in the first 32 bits of the compressed block. Here's the specified OpenGL behavior for reference: The RGB color for a texel at location (x,y) in the block is given by: RGB0, if color0 > color1 and code(x,y) == 0 RGB1, if color0 > color1 and code(x,y) == 1 (2*RGB0+RGB1)/3, if color0 > color1 and code(x,y) == 2 (RGB0+2*RGB1)/3, if color0 > color1 and code(x,y) == 3 RGB0, if color0 <= color1 and code(x,y) == 0 RGB1, if color0 <= color1 and code(x,y) == 1 (RGB0+RGB1)/2, if color0 <= color1 and code(x,y) == 2 BLACK, if color0 <= color1 and code(x,y) == 3 The sampling operation performed on an opaque DXT1 Intel format essentially hard-codes the comparison result of the two colors as color0 > color1. This means that the behavior is incompatible with OpenGL. This is stated in the SKL PRM, Vol 5: Memory Views: Opaque Textures (DXT1_RGB) Texture format DXT1_RGB is identical to DXT1, with the exception that the One-bit Alpha encoding is removed. Color 0 and Color 1 are not compared, and the resulting texel color is derived strictly from the Opaque Color Encoding. The alpha channel defaults to 1.0. Programming Note Context: Opaque Textures (DXT1_RGB) The behavior of this format is not compliant with the OGL spec. The opaque and non-opaque DXT1 OpenGL formats are specified to be decoded in exactly the same way except the BLACK value must have a transparent alpha channel in the latter. Use the four-channel BC1 Intel formats with the alpha set to 1 to provide the behavior required by the spec. Note that the alpha is already set to 1 for RGB formats in brw_get_texture_swizzle(). v2: Provide a more detailed commit message (Kenneth Graunke). v3: Ensure the alpha channel is set to 1 for DXT1 formats. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100925 Cc: <[email protected]> Acked-by: Tapani Pälli <[email protected]> (v1) Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Nanley Chery <[email protected]>
* st/mesa: silence a valgrind warning in u_threaded_context due to st_draw_vboMarek Olšák2017-05-181-0/+1
| | | | | Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* glsl_to_tgsi: declare all SSBOs and atomics when indirect indexing is usedMarek Olšák2017-05-181-16/+14
| | | | | | | | Only the first array element was declared, so tgsi_shader_info:: shader_buffers_declared didn't match what the shader was using. Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* tgsi: store the sampler view type directly in the instructionSamuel Pitoiset2017-05-184-16/+28
| | | | | | | | | | | RadeonSI needs to do a special lowering for Gather4 with integer formats, but with bindless samplers we just can't access the index. Instead, store the return type in the instruction like the target. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* st/mesa: remove an incorrect assertionNicolai Hähnle2017-05-181-2/+0
| | | | | | | | | | | There is really no reason why the current DrawBuffer needs to be complete at this point. In particular, the assertion gets hit on the X server side in libglx when running .../piglit/bin/glx-get-current-display-ext -auto (which uses indirect GLX rendering). Fixes: 19b61799e3d0 ("st/mesa: don't cast the incomplete framebufer to st_framebuffer") Reported-by: Michel Dänzer <[email protected]> Reviewed-by: Marek Olšák <[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-172-0/+6
| | | | | | for skipping mapped-buffer checking in every GL draw call Reviewed-by: Nicolai Hähnle <[email protected]>
* Android: correct libz dependencyChih-Wei Huang2017-05-171-1/+2
| | | | | | | | | | | | | | | | | | | Commit 6facb0c0 ("android: fix libz dynamic library dependencies") unconditionally adds libz as a dependency to all shared libraries. That is unnecessary. Commit 85a9b1b5 introduced libz as a dependency to libmesa_util. So only the shared libraries that use libmesa_util need libz. Fix Android Lollipop build by adding the include path of zlib to libmesa_util explicitly instead of getting the path implicitly from zlib since it doesn't export the include path in Lollipop. Fixes: 6facb0c0 "android: fix libz dynamic library dependencies" Signed-off-by: Chih-Wei Huang <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Rob Herring <[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]>
* mesa: add KHR_no_error support for glBlendEquationSeparateiARB()Timothy Arceri2017-05-172-0/+12
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add blend_equation_separatei() helperTimothy Arceri2017-05-171-9/+17
| | | | | | Will be used to add KHR_no_error support. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glBlendFunc*iARB()Timothy Arceri2017-05-172-0/+24
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add blend_func_separatei() helperTimothy Arceri2017-05-171-17/+28
| | | | | | This will be used to add KHR_no_error support. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glBufferSubData()Timothy Arceri2017-05-172-3/+20
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glNamedBufferSubData()Timothy Arceri2017-05-172-7/+23
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add buffer_sub_data() helperTimothy Arceri2017-05-171-17/+24
| | | | | | | This will allow us to share code between the dsa, non-dsa and no_error variants. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: create validate_buffer_sub_data() helperTimothy Arceri2017-05-174-40/+45
| | | | | | | This change assumes meta will always pass valid arguments to _mesa_buffer_sub_data(). Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glBufferStorage()Timothy Arceri2017-05-172-3/+20
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glNamedBufferStorage()Timothy Arceri2017-05-172-7/+27
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add inlined_buffer_storage() helperTimothy Arceri2017-05-171-20/+27
| | | | | | | This will allow us to share code between the dsa, non-dsa and no_error variants. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add validate_buffer_storage() helperTimothy Arceri2017-05-171-15/+27
| | | | | | This will allow use to add KHR_no_error support. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glCompressedTex*SubImage3D()Timothy Arceri2017-05-172-1/+41
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add 3D support to compressed_tex_sub_image() helperTimothy Arceri2017-05-171-119/+66
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glCompressedTex*SubImage2D()Timothy Arceri2017-05-172-0/+39
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add 2D support to compressed_tex_sub_image() helperTimothy Arceri2017-05-171-67/+16
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for CompressedTex*SubImage1D()Timothy Arceri2017-05-172-9/+51
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add compressed_tex_sub_image() helperTimothy Arceri2017-05-171-44/+38
| | | | | | | | This reduces duplication between the dsa and non-dsa function and will also be used in the following commit to add KHR_no_error support. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: make _mesa_compressed_texture_sub_image() staticTimothy Arceri2017-05-172-51/+30
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for NamedFramebufferTextureTimothy Arceri2017-05-172-0/+11
| | | | | | V3: use frame_buffer_texture() helper Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for FramebufferTextureTimothy Arceri2017-05-172-0/+12
| | | | | | V3: use the frame_buffer_texture() helper Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add *FramebufferTexture() support to frame_buffer_texture helperTimothy Arceri2017-05-171-100/+41
| | | | | | V2: call check_layered_texture_target() even for no_error Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for NamedFramebufferTextureLayerTimothy Arceri2017-05-172-0/+17
| | | | | | v3: use frame_buffer_texture_layer() helper Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for FramebufferTextureLayerTimothy Arceri2017-05-172-0/+13
| | | | | | V3: use frame_buffer_texture_layer() helper Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add no error support to frame_buffer_texture_layer() helperTimothy Arceri2017-05-171-27/+43
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add frame_buffer_texture_layer() helperTimothy Arceri2017-05-171-54/+31
| | | | | | | To be used to add KHR_no_error support while sharing code between the DSA and non-DSA OpenGL function. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: add KHR_no_error support for glUseProgramTimothy Arceri2017-05-172-20/+47
| | | | | | V3: use always_inline attribute (Suggested by Nicolai) Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: move use_program() inside _mesa_use_program()Timothy Arceri2017-05-171-29/+21
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa/st: fix yuv EGLImage'sRob Clark2017-05-161-2/+30
| | | | | | | | | | | | Don't reject YUV formats that the driver doesn't handle natively, since mesa/st already knows how to lower this in shader. Reported-by: Nicolas Dechesne <[email protected]> Fixes: 83e9de2 ("st/mesa: EGLImageTarget* error handling") Cc: 17.1 <[email protected] Signed-off-by: Rob Clark <[email protected]> Tested-by: Nicolas Dechesne <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: unify _mesa_uniform() for image uniformsSamuel Pitoiset2017-05-161-6/+8
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Elie Tournier <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: fix indentation in _mesa_uniform()Samuel Pitoiset2017-05-161-18/+19
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Elie Tournier <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: fix indentation in _mesa_associate_uniform_storage()Samuel Pitoiset2017-05-161-52/+49
| | | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Elie Tournier <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* mesa: replace _mesa_problem() with unreachable() in pack.cTimothy Arceri2017-05-161-6/+4
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: replace _mesa_problem() with unreachable() in mipmap.cTimothy Arceri2017-05-161-4/+3
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>
* mesa: replace _mesa_problem() with unreachable() in _mesa_convert_colors()Timothy Arceri2017-05-161-1/+1
| | | | Reviewed-by: Samuel Pitoiset <[email protected]>