summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* glsl: fix spelling of embedded in commentTimothy Arceri2017-03-281-1/+1
|
* glsl: fix lower jumps for returns when loop is inside an ifTimothy Arceri2017-03-281-5/+12
| | | | | | | | | | | | | | | | | Previously we would just escape the loop and move everything following the loop inside the if to the else branch of a new if with a return flag conditional. However everything outside the if the loop was nested in would still get executed. Adding a new return to the then branch of the new if fixes this and we just let a follow pass clean it up if needed. Fixes: tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop.shader_test tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop2.shader_test Cc: "13.0 17.0" <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* radv: don't emit no color formats. (v3)Dave Airlie2017-03-281-2/+19
| | | | | | | | | | | | | | | If we had no rasterization, we'd emit SPI color format as all 0's the hw dislikes this, add the workaround from radeonsi. Found while debugging tessellation v2: handle at pipeline stage, we have to handle it after we process the fragment shader. (Bas) v3: simplify even further, remove old fallback. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa/tests: Link main-test with CLOCK_LIB.Vinson Lee2017-03-271-1/+2
| | | | | | | | | | Fix 'make check' linking error with glibc < 2.17. CXXLD main-test ../../../../src/mesa/.libs/libmesa.a(libmesautil_la-u_queue.o): In function `u_thread_get_time_nano': src/util/../../src/util/u_thread.h:84: undefined reference to `clock_gettime' Signed-off-by: Vinson Lee <[email protected]>
* i965/fs: Don't emit SEL instructions for type-converting MOVs.Matt Turner2017-03-271-0/+2
| | | | | | | | | | SEL can only convert between a few integer types, which we basically never do. Fixes fs/vs-double-uniform-array-direct-indirect-non-uniform-control-flow Cc: [email protected] Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Acked-by: Francisco Jerez <[email protected]>
* anv/blorp: Fix a crash in CmdClearColorImageXu Randy2017-03-271-2/+2
| | | | | | | | | | | | | We should use anv_get_layerCount() to access layerCount of VkImageSub- resourceRange in anv_CmdClearColorImage and anv_CmdClearDepthStencil- Image, which handles the VK_REMAINING_ARRAY_LAYERS (~0) case. Test: Sample multithreadcmdbuf from LunarG can run without crash Signed-off-by: Xu Randy <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Cc: "13.0 17.0" <[email protected]>
* mesa: simplify code around 'variable_data' in marshal.cBrian Paul2017-03-271-12/+7
| | | | | | | Remove needless pointer increments, unneeded vars, etc. Untested. Plus, fix a couple comments. Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: move duplicated st_ws_framebuffer() function into header fileBrian Paul2017-03-273-28/+18
| | | | Reviewed-by: Marek Olšák <[email protected]>
* glsl: Interface Block instances don't need linking validationAndres Gomez2017-03-271-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From page 45 (page 52 of the PDF) of the GLSL ES 3.00 v.6 spec: " When instance names are present on matched block names, it is allowed for the instance names to differ; they need not match for the blocks to match. From page 51 (page 57 of the PDF) of the GLSL 4.30 v.8 spec: " When instance names are present on matched block names, it is allowed for the instance names to differ; they need not match for the blocks to match." Therefore, no cross linking validation is needed for the instance name of an Interface Block. This patch will make that no link error will be reported on a program like this: "# VS layout(binding = 1) Block1 { vec4 color; } uni_block; ... # FS layout(binding = 2) Block2 { vec4 color; } uni_block; ..." Fixes GL45-CTS.enhanced_layouts.ssb_layout_qualifier_conflict Signed-off-by: Andres Gomez <[email protected]> Cc: Timothy Arceri <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* glsl: UBOs and SSBOs must match the binding qualifier tooAndres Gomez2017-03-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From page 140 (page 147 of the PDF) of the GLSL ES 3.10 v.4 spec: " 9.2 Matching of Qualifiers The following tables summarize the requirements for matching of qualifiers. It applies whenever there are two or more matching variables in a shader interface. Notes: 1. Yes means the qualifiers must match. ... 9.2.1 Linked Shaders | Qualifier | Qualifier | in/out | Default | uniform | buffer| | Class | | | Uniforms | Block | Block | ... | Layout | binding | N/A | Yes | Yes | Yes |" From page 93 (page 110 of the PDF) of the GL 4.2 (Core Profile) spec: " 2.11.7 Uniform Variables ... Uniform Blocks ... When a named uniform block is declared by multiple shaders in a program, it must be declared identically in each shader. The uniforms within the block must be declared with the same names and types, and in the same order. If a program contains multiple shaders with different declarations for the same named uniform block differs between shader, the program will fail to link." From page 129 (page 150 of the PDF) of the GL 4.3 (Core Profile) spec: " 7.8 Shader Buffer Variables and Shader Storage Blocks ... When a named shader storage block is declared by multiple shaders in a program, it must be declared identically in each shader. The buffer variables within the block must be declared with the same names, types, qualification, and declaration order. If a program contains multiple shaders with different declarations for the same named shader storage block, the program will fail to link." Therefore, if the binding qualifier differs between two linked Uniform or Shader Storage Blocks of the same name, a link error should happen. This patch will make that a link error will be reported on a program like this: "# VS layout(binding = 1) Block { vec4 color; } uni_block1; ... # FS layout(binding = 2) Block { vec4 color; } uni_block2; ..." Signed-off-by: Andres Gomez <[email protected]> Cc: Ian Romanick <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* glsl: on UBO/SSBOs link error reset the number of active blocks to 0Andres Gomez2017-03-271-0/+6
| | | | | | | | | | | | | While it's legal to have an active blocks count > 0 on link failure. Unless we actually assign memory for the blocks array we can end up segfaulting in calls such as glUniformBlockBinding(). To avoid having to NULL check these api calls we simply reset the block count to 0 if the array was not created. Signed-off-by: Andres Gomez <[email protected]> Cc: Timothy Arceri <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* anv: enable sampling from fast-cleared images on SKLSamuel Iglesias Gonsálvez2017-03-271-2/+2
| | | | | | | | A resolve is not needed on Skylake in this case. We were forcing a resolve because we set the input_aux_usage to ISL_AUX_USAGE_NONE. Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Nanley Chery <[email protected]>
* glsl, st/shader_cache: check the whole sha1 for zeroGrazvydas Ignotas2017-03-272-2/+4
| | | | | | | | | | | | The checks were only looking at the first byte, while the intention seems to be to check if the whole sha1 is zero. This prevented all shaders with first byte zero in their sha1 from being saved. This shaves around a second from Deus Ex load time on a hot cache. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* glsl/shader_cache: restore evicted shader keysGrazvydas Ignotas2017-03-271-0/+17
| | | | | | | | | | | | | | | | | Even though the programs themselves stay in cache and are loaded, the shader keys can be evicted separately. If that happens, unnecessary compiles are caused that waste time, and no matter how many times the program is re-run, performance never recovers to the levels of first hot cache run. To deal with this, we need to refresh the shader keys of shaders that were recompiled. An easy way to currently observe this is running Deux Ex, then piglit and Deux Ex again, or deleting just the cache index. The later is causing over a minute of lost time on all later Deux Ex runs, with this patch it returns to normal after 1 run. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* st/nine: Use atomics for available_texture_memAxel Davy2017-03-261-2/+2
| | | | | | | | | Resource dtor can be executed in the worker thread. Use atomic to avoid threading safety issues. CC: "17.0" <[email protected]> Signed-off-by: Axel Davy <[email protected]> Tested-by: James Harvey <[email protected]>
* st/nine: Resolve deadlock in surface/volume dtors when using csmtAxel Davy2017-03-263-5/+17
| | | | | | | | | | | | | | | | | | | | Surfaces and Volumes can be freed in the worker thread. Without this patch, pending_uploads_counter could be non-zero in the Surfaces or Volumes dtor, leading to deadlock. Instead decrease properly the counter before releasing the item. Also avoid another potential deadlock if the item is not properly unlocked: Do not call UnlockRect which will cause deadlock, but free directly using the deadlock safe nine_context_get_pipe_multithread. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99246 CC: "17.0" <[email protected]> Signed-off-by: Axel Davy <[email protected]> Tested-by: James Harvey <[email protected]>
* st/nine: Fix user vertex data uploader with csmtAxel Davy2017-03-262-8/+8
| | | | | | | | | | Fix regression caused by abb1c645c476b5dd289ce3efae0594f8796f9cf8 The patch made csmt use context.pipe instead of secondary_pipe, leading to thread safety issues. Signed-off-by: Axel Davy <[email protected]>
* scons: Fix dependencies of marshal_generated.[ch].Jose Fonseca2017-03-261-2/+2
| | | | | | | | | | | These generated source files depend not only upon gl_and_es_API.xml, but all other XML files that are included by it. This change updates the generation rules to depend on all gen/*.xml files, like done for other SCons generation rules, and should fix incremental broken SCons builds due to missing dependencies. Trivial.
* glsl: Link tests with CLOCK_LIB.Vinson Lee2017-03-251-3/+6
| | | | | | | | | | Fix 'make check' linking errors with glibc < 2.17. CXXLD glsl/glsl_test glsl/.libs/libglsl.a(libmesautil_la-u_queue.o): In function `u_thread_get_time_nano': src/util/../../src/util/u_thread.h:84: undefined reference to `clock_gettime' Signed-off-by: Vinson Lee <[email protected]>
* mesa/glthread: add custom marshalling for ClearBufferfv()Timothy Arceri2017-03-253-1/+84
| | | | | | This is one of the main causes of syncs in Civ6. Reviewed-by: Nicolai Hähnle <[email protected]>
* util/disk_cache: don't deadlock on premature EOFGrazvydas Ignotas2017-03-251-17/+26
| | | | | | | | | | | | | | If we get EOF earlier than expected, the current read loops will deadlock. This may easily happen if the disk cache gets corrupted. Fix it by using a helper function that handles EOF. Steps to reproduce (on a build with asserts disabled): $ glxgears $ find ~/.cache/mesa/ -type f -exec truncate -s 0 '{}' \; $ glxgears # deadlock Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* genxml: Add 3DSTATE_DEPTH_BUFFER to gen5.xmlChad Versace2017-03-241-0/+56
| | | | | | isl will use this for validating the depth buffer pitch. Reviewed-by: Jason Ekstrand <[email protected]>
* tests/cache_test: mark arguments constGrazvydas Ignotas2017-03-251-4/+4
| | | | | | | | While at it, also fix up a failure message to not reference timestamp and gpu dirs as those are no longer being made. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* freedreno: free compiler when screen is destroyedRob Clark2017-03-243-6/+2
| | | | | | | | | | | | Drop ir3_compiler_destroy(), since it is only ralloc_free() and we shouldn't really have an ir3 dependency in core. If some future hw has a new compiler, as long as all it's resources are ralloc()d then things will all just work. (In practice, I suppose you never really see this leak, but removing it at least cleans up some noise in valgrind.) Signed-off-by: Rob Clark <[email protected]>
* genxml: Whitespace fixesJason Ekstrand2017-03-245-39/+39
| | | | | | | Some field names had extra spaces and some had places where we should have had a space but didn't. Reviewed-by: Chad Versace <[email protected]>
* genxml: Replace "[N]" with "N"Jason Ekstrand2017-03-243-15/+15
| | | | Reviewed-by: Chad Versace <[email protected]>
* genxml/gen6: Remove a couple of bogus valuesJason Ekstrand2017-03-241-6/+2
| | | | Reviewed-by: Chad Versace <[email protected]>
* genxml/gen8: Remove BLACK_LEVEL_CORRECTION_STATEJason Ekstrand2017-03-241-6/+0
| | | | | | | We've never used it, it only exists on gen8, and the name of the struct contains piles of bad characters. Reviewed-by: Chad Versace <[email protected]>
* genxml: Rename two MCS fields to Auxiliary Surface on gen7Jason Ekstrand2017-03-243-8/+7
| | | | | | This makes gen7 more consistent with gen8+ Reviewed-by: Chad Versace <[email protected]>
* freedreno: fix memory leakRob Clark2017-03-241-0/+2
| | | | | | | | | | | | | Otherwise blitter would still hold a ref to, for example, sampler- views. To reproduce: glmark2 -b desktop:duration=2 --run-forever Fixes: a8e6734 ("freedreno: support for using generic clear path") Cc: "13.0 17.0" <[email protected]> Signed-off-by: Rob Clark <[email protected]>
* genxml: Fix gen_zipped_file.py dependencyChad Versace2017-03-241-1/+1
| | | | | | | The gen*_xml.h files depend on gen_zipped_file.py, not the gen*_pack.h files. Reviewed-by: Emil Velikov <[email protected]>
* genxml: Define GENXML_XML_FILES in Makefile.sourcesChad Versace2017-03-242-8/+11
| | | | | | The future header genX_bits.h will depend on GENXML_XML_FILES. Reviewed-by: Emil Velikov <[email protected]>
* clover: use pipe_resource referencesJan Vesely2017-03-242-3/+9
| | | | | | | | | | | v2: buffers are created with one reference. v3: add pipe_resource reference to mapping object v4: rename to pres and drop inline initializers CC: "17.0 13.0" <[email protected]> Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
* i965: Fix symbolic size of next_offset[] array.Kenneth Graunke2017-03-241-1/+1
| | | | | | | It's indexed by buffer, not stream. BRW_MAX_SOL_BUFFERS and MAX_VERTEX_STREAMS happen to both be 4, so there's no actual bug. Reviewed-by: Matt Turner <[email protected]>
* i965: Remove pointless NULL check from Gen6 primitive counting code.Kenneth Graunke2017-03-241-2/+3
| | | | | | | | | We create the BO when creating a transform feedback object, and only destroy it when deleting that object. So it won't be NULL. CID: 1401410 Reviewed-by: Matt Turner <[email protected]>
* radeonsi: don't crash on compute shader compile failureMarek Olšák2017-03-241-1/+5
| | | | | Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: don't hang on shader compile failureMarek Olšák2017-03-241-1/+1
| | | | | | Cc: 17.0 <[email protected]> Reviewed-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* radeonsi: fix dvec[34] attributes sourced from current attribute stateNicolai Hähnle2017-03-241-3/+4
| | | | | | | | | | | | The state tracker no longer uploads those attributes for us, so we must conservatively upload the size of the largest attribute, which is a dvec4. Fixes a regression of GL45-CTS.gpu_shader_fp64.varyings and GL45-CTS.vertex_attrib_64bit.limits_test. Fixes: 9b91e0b54cc2 ("radeonsi: allow unaligned vertex buffer offsets and strides on CIK-VI") Reviewed-by: Marek Olšák <[email protected]>
* anv: automake: ensure that the destination directory is createdEmil Velikov2017-03-241-0/+1
| | | | | | | | | | | | | Earlier commit unintentionally dropped the mkdir, as it was rebased. Some versions of autotools will not create the output directory for generated sources. Thus the issue went unnoticed by the original author. Cc: Dylan Baker <[email protected]> Cc: Steven Newbury <[email protected]> Reported-by: Steven Newbury <[email protected]> Fixes: Fixes: 1610b3dede1 ("anv: don't pass xmlfile via stdin anv_entrypoints_gen.py") Signed-off-by: Emil Velikov <[email protected]>
* glsl_to_tgsi: don't rely on glsl types when visiting tex instructionsSamuel Pitoiset2017-03-241-7/+6
| | | | | | | Instead add is_cube_shadow like is_cube_array. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* anv/query: handle out of host memory without crashing in compute_query_result()Iago Toral Quiroga2017-03-241-0/+5
| | | | | | | | | | | | We don't need to make the caller (CmdCopyQueryPoolResults) aware of the problem since compute_query_result() only emits state. The caller is also expected to hit OOM in this scenario right after calling this function, but it is already handling it safely. Fixes: dEQP-VK.api.out_of_host_memory.cmd_copy_query_pool_results Reviewed-by: Topi Pohjolainen <[email protected]>
* anv/pipeline: make FragCoord include sample positions when sample shadingIago Toral Quiroga2017-03-243-8/+20
| | | | | | | | | | | | | | | | | | | | | | We need to know if sample shading has been requested during shader compilation since that affects the way fragment coordinates are computed. Notice that the semantics of fragment coordinates only depend on whether sample shading has been requested, not on whether more than one sample will actually be produced (that is, minSampleShading and rasterizationSamples do not affect this behavior). Because this setting affects the code we generate for the shader, we also need to include it in the WM prog key. Notice we don't need to alter the OpenGL code because it doesn't ever use this behavior, so they key's value is always false (the default). Fixes: dEQP-VK.glsl.builtin_var.fragcoord_msaa.* Reviewed-by: Jason Ekstrand <[email protected]>
* nir/lower_wpos_center: support adding sample position to fragment coordinateIago Toral Quiroga2017-03-243-9/+26
| | | | | | | | | | | | | According to section 14.6 of the Vulkan specification: "When sample shading is enabled, the x and y components of FragCoord reflect the location of the sample corresponding to the shader invocation." So add a boolean parameter to the lowering pass to select this behavior when we need it. Reviewed-by: Jason Ekstrand <[email protected]>
* anv: return VK_ERROR_DEVICE_LOST immeditely when device is known to be lostIago Toral Quiroga2017-03-242-1/+24
| | | | | | | | If we know the device has been lost we should return this error code for any command that can report it before we attempt to do anything with the device. Reviewed-by: Jason Ekstrand <[email protected]>
* anv/device: keep track of 'device lost' stateIago Toral Quiroga2017-03-242-0/+6
| | | | | | | | | | | | | | | | | | | | | | The Vulkan specs say: "A logical device may become lost because of hardware errors, execution timeouts, power management events and/or platform-specific events. This may cause pending and future command execution to fail and cause hardware resources to be corrupted. When this happens, certain commands will return VK_ERROR_DEVICE_LOST (see Error Codes for a list of such commands). After any such event, the logical device is considered lost. It is not possible to reset the logical device to a non-lost state, however the lost state is specific to a logical device (VkDevice), and the corresponding physical device (VkPhysicalDevice) may be otherwise unaffected. In some cases, the physical device may also be lost, and attempting to create a new logical device will fail, returning VK_ERROR_DEVICE_LOST." This means that we need to track if a logical device has been lost so we can have the commands referenced by the spec return VK_ERROR_DEVICE_LOST immediately. Reviewed-by: Jason Ekstrand <[email protected]>
* anv/device: return VK_ERROR_DEVICE_LOST for errors during queue submissionsIago Toral Quiroga2017-03-241-0/+25
| | | | | | | | | | | So that we don't have to do things like rolling back address relocations in case that we ran into OOM after computing them, etc Also, make sure that if the queue submission comes with a fence, we set it up correctly so it behaves according to the spec after returning VK_ERROR_DEVICE_LOST. Reviewed-by: Jason Ekstrand <[email protected]>
* mesa/marshal: add custom BufferData/BufferSubData marshallingTimothy Arceri2017-03-243-2/+145
| | | | | | | | | | GL_AMD_pinned_memory requires memory to be aligned correctly, so we skip marshalling in this case. Also copying the data defeats the purpose of EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD. Fixes GL_AMD_pinned_memory piglit tests when glthread is enabled. Acked-by: Edward O'Callaghan <[email protected]>
* util/disk_cache: write cache entry keys to file headerTimothy Arceri2017-03-241-6/+44
| | | | | | | | | | | | This can be used to deal with key hash collisions from different versions (should we find that to actually happen) and to find which mesa version produced the cache entry. V2: use blob created at cache creation. v3: remove left over var from v1. Reviewed-by: Grazvydas Ignotas <[email protected]>
* util/disk_cache: hash pointer size and gpu name into cache keysGrazvydas Ignotas2017-03-243-54/+17
| | | | | | | | | | | | | | | | This allows to get rid of the arch and gpu name directories. v2: (Timothy Arceri) don't use an opaque data type to store pointer size and gpu name. v3: (Timothy Arceri) use blob to store driver keys just make sure to store null terminator for strings, and make sure blob is defined by disk_cache and not it's users. v4: (Timothy Arceri) fix typo, and make ptr_size a uint8_t. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* util/disk_cache: hash timestamps into the cache keysGrazvydas Ignotas2017-03-242-56/+31
| | | | | | | | | | | | | | | | | | | | | | | | Instead of using a directory, hash the timestamps into the cache keys themselves. Since there is no more timestamp directory, there is no more need for deleting the cache of other mesa versions and we rely on eviction to clean up the old cache entries. This solves the problem of using several incarnations of disk_cache at the same time, where one deletes a directory belonging to the other, like when both OpenGL and gallium nine are used simultaneously (or several different mesa installations). v2: using additional blob instead of trying to clone sha1 state v3: (Timothy Arceri) don't use an opaque data type to store timestamp. V4: (Timothy Arceri) use blob to store driver keys just make sure to store null terminator for strings, and make sure blob is defined by disk_cache and not it's users. Signed-off-by: Grazvydas Ignotas <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100091