summaryrefslogtreecommitdiffstats
path: root/src/mesa
Commit message (Collapse)AuthorAgeFilesLines
* mesa: stop trying new filenames if the filename existing is not the issueEric Engestrom2019-06-281-0/+6
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa: use os_file_create_unique()Eric Engestrom2019-06-281-5/+4
| | | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* i965/icl: Apply WA_1606682166 to compute workloadsAnuj Phogat2019-06-281-1/+3
| | | | | | | We missed the workaround for compute workloads in earlier patches. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* Revert "i965/icl: Add WA_2204188704 to disable pixel shader panic dispatch"Anuj Phogat2019-06-282-10/+0
| | | | | | | | | | | | | | SLICE_COMMON_CHICKEN3 is a privileged register not accesible from userspace. This patch silences a simulator warning about it. We don't need to add this workaround in linux kernel as the WA description says it's fixed on latest stepping. This reverts commit 85ecd14ef6a084f5e82860de6dbc79870b335682. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* i965/icl: Fix WA_1606682166Anuj Phogat2019-06-281-2/+1
| | | | | | | | | | An earlier change was setting the SamplerCount = 0 for Gen 11 under #if GEN_GEN < 7. This commit fixes the problem. This WA has also been added to the linux kernel. Signed-off-by: Anuj Phogat <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: add display list support for gl(Compressed)TextureSubImage2DEXTPierre-Eric Pelloux-Prayer2019-06-281-0/+89
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add glTextureParameteri/iv/f/fvEXTPierre-Eric Pelloux-Prayer2019-06-284-6/+223
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: extend _mesa_lookup_or_create_texture to support EXT_dsaPierre-Eric Pelloux-Prayer2019-06-282-3/+19
| | | | | | | Adds a boolean to implement EXT_dsa specifics. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: refactor bind_texturePierre-Eric Pelloux-Prayer2019-06-282-17/+36
| | | | | | | | | Splits texture lookup and binding actions. The new _mesa_lookup_or_create_texture will be useful to implement the EXT_direct_state_access extension. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: extract helper function for glTexParameter*Pierre-Eric Pelloux-Prayer2019-06-281-13/+24
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add buffer != 0 checks to glNamedBufferEXT functionsPierre-Eric Pelloux-Prayer2019-06-281-2/+33
| | | | | | | | | | | | | | | | | | The EXT_direct_state_access spec says: INVALID_OPERATION is generated by GetNamedBufferParameterivEXT, GetNamedBufferPointervEXT, GetNamedBufferSubDataEXT, MapNamedBufferEXT, NamedBufferDataEXT, NamedBufferSubDataEXT, and UnmapNamedBufferEXT if the buffer parameter is zero. This commits adds buffer != 0 validation to the implemented functions. glNamedBufferStorageEXT isn't included in this list and the EXT_buffer_storage doesn't says that buffer = 0 is an error either so I didn't add the same validation for this function. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: fix a typo in map_named_buffer_rangeMarek Olšák2019-06-281-2/+2
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add support for glMapNamedBufferEXT()Timothy Arceri2019-06-283-1/+26
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add support for glUnmapNamedBufferEXT()Timothy Arceri2019-06-283-6/+5
| | | | | | | | | Since the ARB DSA function glUnmapNamedBuffer() is only exposed for 3.1 or above we make glUnmapNamedBuffer() an alias of glUnmapNamedBufferEXT() rather than the other way around. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add support for glCompressedTextureSubImage2DEXT()Timothy Arceri2019-06-283-25/+59
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add support for glTextureSubImage2DEXT()Timothy Arceri2019-06-283-29/+116
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add support for glMapNamedBufferRangeEXT()Timothy Arceri2019-06-283-14/+36
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add support for glNamedBufferStorageEXTTimothy Arceri2019-06-283-0/+19
| | | | | | | | This is available in ARB_buffer_storage when EXT_direct_state_access is present. Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add support for glNamedBuffer*DataEXT()Timothy Arceri2019-06-283-2/+39
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: add support for glBindMultiTextureEXTTimothy Arceri2019-06-283-10/+37
| | | | | Reviewed-by: Marek Olšák <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: delete framebuffer texture attachment sampler viewsPierre-Eric Pelloux-Prayer2019-06-281-0/+15
| | | | | | | | | | | | | | | | | | | | | When a context is destroyed the destroy_tex_sampler_cb makes sure that all the sampler views created by that context are destroyed. This is done by walking the ctx->Shared->TexObjects hash table. In a multiple context environment the texture can be deleted by a different context, so it will be removed from the TexObjects table and will prevent the above mechanism to work. This can result in an assertion in st_save_zombie_sampler_view because the sampler_view owns a reference to a destroyed context. This issue occurs in blender 2.80. This commit fixes this by explicitly releasing sampler_view created by the destroyed context for all texture attachments. Fixes: 593e36f956 (st/mesa: implement "zombie" sampler views (v2)) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110944 Signed-off-by: Marek Olšák <[email protected]>
* meson: set up a proper internal dependency for xmlconfigEric Engestrom2019-06-272-5/+5
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* mesa: use a correct function return typeAndrii Simiklit2019-06-272-2/+2
| | | | | | | | v2: standard 'bool' can be used ( Eric Engestrom <[email protected]> ) Reviewed-by: Eric Engestrom <[email protected]> Signed-off-by: Andrii Simiklit <[email protected]>
* st/mesa: Set EmitNoIndirectSampler if GLSLVersion < 400.Kenneth Graunke2019-06-261-1/+1
| | | | | | | | | | | | | | | This patch changes the code which sets EmitNoIndirectSampler to check the core profile GLSL version, rather than the ARB_gpu_shader5 extension enable. st/mesa exposes ARB_gpu_shader5 if GLSLVersion (in core profiles) or GLSLVersionCompat (in compat profiles) >= 400. The Intel drivers do not currently expose ARB_gpu_shader5 in compat profiles. But the backend can absolutely handle indirect samplers. Looking at the core profile version number should be a good indication of what the driver supports. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* st/glsl: fix silly regression finding gs/tes variantsTimothy Arceri2019-06-261-1/+1
| | | | | | Fixes: d19fe5e67a39 ("st/glsl: support clamping color outputs in compat for gs/tes") Reviewed-by: Ilia Mirkin <[email protected]>
* st/glsl: support clamping color outputs in compat for gs/tesTimothy Arceri2019-06-264-13/+60
| | | | | | | This support requires the driver to be a NIR driver as we use the NIR lowering pass to do the clamping. Reviewed-by: Kenneth Graunke <[email protected]>
* i965: leaking of upload-BO with push constantsSergii Romantsov2019-06-251-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of any enabled VS members from: uses_firstvertex, uses_baseinstance, uses_drawid, uses_is_indexed_draw leaks may happens. Call gen6_upload_push_constants allocates stage_stat->push_const_bo. It than takes pointer from push_const_bo to draw_params_bo (in the call brw_prepare_shader_draw_parameters by brw_upload_data) and do reference which finally haven't got unreferenced. Fixes leak: 136 bytes in 1 blocks are definitely lost in loss record 6 of 13 at 0x4C31B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) by 0xC2B64B7: bo_alloc_internal (brw_bufmgr.c:596) by 0xC2B6748: brw_bo_alloc (brw_bufmgr.c:672) by 0xC314BB3: brw_upload_space (intel_upload.c:88) by 0xC2EBBC5: gen6_upload_push_constants (gen6_constant_state.c:155) by 0xC9E4FA6: gen9_upload_vs_push_constants (genX_state_upload.c:3300) by 0xC2E0EDA: check_and_emit_atom (brw_state_upload.c:540) by 0xC2E0EDA: brw_upload_pipeline_state (brw_state_upload.c:659) by 0xC2E0FF1: brw_upload_render_state (brw_state_upload.c:681) by 0xC2C5D2D: brw_draw_single_prim (brw_draw.c:1052) by 0xC2C62CB: brw_draw_prims (brw_draw.c:1175) by 0xC488AD1: vbo_exec_vtx_flush (vbo_exec_draw.c:386) by 0xC485270: vbo_exec_FlushVertices_internal (vbo_exec_api.c:652) Reviewed-by: Lionel Landwerlin <[email protected]> Reported-by: Yevhenii Kolesnikov <[email protected]> Signed-off-by: Sergii Romantsov <[email protected]>
* i965: Move resources lowering after NIR linkingCaio Marcelo de Oliveira Filho2019-06-243-10/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Those either depend on information filled by the NIR linking steps OR are restricted by those: - gl_nir_lower_samplers: depends on UniformStorage being set by the linker. - brw_nir_lower_image_load_store: After 6981069fc80 "i965: Ignore uniform storage for samplers or images, use binding info" we want this pass to happen after gl_nir_lower_samplers. - gl_nir_lower_buffers: depends on UniformBlocks and SharedStorageBlocks being set by the linker. For the regular GLSL code path, those datastructures are filled earlier. For NIR linking code path we need to generate the nir_shader first then process it -- and currently the processing works with all shaders together. So move the passes out of brw_create_nir into its own function, called by the brwProgramStringNotify and brw_link_shader(). This patch prepares ground for ARB_gl_spirv, that will make use of NIR linker. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* i965,iris: Move guardband calculations to a common locationJason Ekstrand2019-06-211-92/+2
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* glspirv: Call pass to lower frexp instructionsCaio Marcelo de Oliveira Filho2019-06-191-0/+2
| | | | | | | | These were previously handled by the spirv_to_nir, but that changed to be an explict pass in 23d30f4099f "spirv,nir: lower frexp_exp/frexp_sig inside a new NIR pass" Reviewed-by: Jason Ekstrand <[email protected]>
* glsl/types: Rename is_integer to is_integer_32Jason Ekstrand2019-06-191-1/+1
| | | | | | | It only accepts 32-bit integers so it should have a more descriptive name. This patch should not be a functional change. Reviewed-by: Karol Herbst <[email protected]>
* meson: Search for execinfo.hJory Pratt2019-06-191-1/+1
| | | | | | | | | | Rather than checking __GLIBC__/__UCLIBC__ macros as a proxy for execinfo.h presence, just check directly. This allows the build to work on musl. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* st/nir: Use gl_nir_opt_accessConnor Abbott2019-06-191-0/+2
| | | | | | Nothing uses its results yet, that will come with the following commits. Reviewed-by: Timothy Arceri <[email protected]>
* st/mesa: Respect GL_TEXTURE_SRGB_DECODE_EXT in GenerateMipmaps()Kenneth Graunke2019-06-141-0/+3
| | | | | | | | | | | | | | Apparently, we're supposed to look at the texture object's built-in sampler object's sRGB decode setting in order to decide whether to decode/downsample/re-encode, or simply downsample as-is. Previously, we had just respected the pipe_resource's format. Fixes SKQP's Skia_Unit_Tests.SRGBMipMaps test. (This ports commit 337a808062c756b474ee80a9ac04b5a3dbbeb67e from i965 to st/mesa for Gallium drivers.) Reviewed-by: Eric Anholt <[email protected]>
* i965: support UYVY for external import onlyHaihao Xiang2019-06-141-1/+2
| | | | | | | | It is similar with YUYV Fixes: 165e704719b85c ("i965/i915: Add UYVY as the supported format") Signed-off-by: Haihao Xiang <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* gallium: Add PIPE_CAP_ATOMIC_FLOAT_MINMAXCaio Marcelo de Oliveira Filho2019-06-131-0/+1
| | | | | | | Used to enable INTEL_shader_atomic_float_minmax. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* i965: Fix INTEL_DEBUG=batCaio Marcelo de Oliveira Filho2019-06-122-23/+9
| | | | | | | | | | | | | Use hash_table_u64 instead of hash_table directly, since the former will also handle the special keys (deleted and freed) and allow use the whole u64 space. Fixes crash in INTEL_DEBUG=bat when using a key with value 0 -- the current value for a freed key. Fixes: b38dab101ca "util/hash_table: Assert that keys are not reserved pointers" Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* u_dynarray: turn util_dynarray_{grow, resize} into element-oriented macrosNicolai Hähnle2019-06-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The main motivation for this change is API ergonomics: most operations on dynarrays are really on elements, not on bytes, so it's weird to have grow and resize as the odd operations out. The secondary motivation is memory safety. Users of the old byte-oriented functions would often multiply a number of elements with the element size, which could overflow, and checking for overflow is tedious. With this change, we only need to implement the overflow checks once. The checks are cheap: since eltsize is a compile-time constant and the functions should be inlined, they only add a single comparison and an unlikely branch. v2: - ensure operations are no-op when allocation fails - in util_dynarray_clone, call resize_bytes with a compile-time constant element size v3: - fix iris, lima, panfrost Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: Add rgbx handling for fp formatsKevin Strasser2019-06-121-0/+6
| | | | | | | | | Add missing cases for fp32 and fp16 formats. Fixes: c68334ffc0a9 "st/mesa: add floating point formats in st_new_renderbuffer_fb()" Signed-off-by: Kevin Strasser <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* gallium: Add PIPE_CAP_CS_DERIVED_SYSTEM_VALUES_SUPPORTEDCaio Marcelo de Oliveira Filho2019-06-111-1/+2
| | | | | | | | | | | Tells whether or not the driver can handle gl_LocalInvocationIndex and gl_GlobalInvocationID. If not supported (the default), state tracker will lower those on behalf of the driver. v2: Add case to u_screen.c. (Anholt) Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* st/glsl: Perform some var optimizationsCaio Marcelo de Oliveira Filho2019-06-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Perform those before some derefs are gone when we lower the buffers after the st_nir_opts() call. Intel SKL shader-db results: total instructions in shared programs: 15593685 -> 15590708 (-0.02%) instructions in affected programs: 378078 -> 375101 (-0.79%) helped: 777 HURT: 44 helped stats (abs) min: 1 max: 68 x̄: 4.07 x̃: 4 helped stats (rel) min: 0.04% max: 31.58% x̄: 2.88% x̃: 1.37% HURT stats (abs) min: 1 max: 24 x̄: 4.20 x̃: 2 HURT stats (rel) min: 0.17% max: 8.00% x̄: 1.60% x̃: 1.27% 95% mean confidence interval for instructions value: -4.02 -3.23 95% mean confidence interval for instructions %-change: -2.93% -2.35% Instructions are helped. total loops in shared programs: 4815 -> 4815 (0.00%) loops in affected programs: 0 -> 0 helped: 0 HURT: 0 total cycles in shared programs: 371965528 -> 371788566 (-0.05%) cycles in affected programs: 184190307 -> 184013345 (-0.10%) helped: 3650 HURT: 2855 helped stats (abs) min: 1 max: 59400 x̄: 99.45 x̃: 15 helped stats (rel) min: <.01% max: 43.18% x̄: 2.60% x̃: 1.02% HURT stats (abs) min: 1 max: 16362 x̄: 65.16 x̃: 10 HURT stats (rel) min: <.01% max: 66.22% x̄: 2.78% x̃: 0.81% 95% mean confidence interval for cycles value: -53.73 -0.68 95% mean confidence interval for cycles %-change: -0.39% -0.08% Cycles are helped. total spills in shared programs: 11936 -> 11956 (0.17%) spills in affected programs: 443 -> 463 (4.51%) helped: 0 HURT: 8 total fills in shared programs: 25644 -> 25619 (-0.10%) fills in affected programs: 2306 -> 2281 (-1.08%) helped: 24 HURT: 2 LOST: 7 GAINED: 16 Total CPU time (seconds): 1679.04 -> 1695.69 (0.99%) shader-db results radeonsi (VEGA64): Totals from affected shaders: SGPRS: 180160 -> 179552 (-0.34 %) VGPRS: 115368 -> 114544 (-0.71 %) Spilled SGPRs: 5627 -> 5603 (-0.43 %) Spilled VGPRs: 0 -> 0 (0.00 %) Private memory VGPRs: 0 -> 0 (0.00 %) Scratch size: 0 -> 0 (0.00 %) dwords per thread Code Size: 7808364 -> 7803268 (-0.07 %) bytes LDS: 192 -> 192 (0.00 %) blocks Max Waves: 19202 -> 19340 (0.72 %) Wait states: 0 -> 0 (0.00 %) Radeonsi results provided by Timothy. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa/main: Expose EXT_clip_control and related enums and the functionGert Wollny2019-06-063-2/+8
| | | | | | | Signed-off-by: Gert Wollny <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* i965: Allow signed/unsigned integer conversions in miptree up/downloadKenneth Graunke2019-06-051-24/+0
| | | | | | BLORP now handles this so there's no reason to fall back. Reviewed-by: Jason Ekstrand <[email protected]>
* st/nir: Don't use GLSL IR's MOD_TO_FLOOR lowering when using NIR.Kenneth Graunke2019-06-051-1/+1
| | | | | | | | | | | | | | | Both GLSL IR and NIR perform the same mod -> floor lowering for 32-bit types. But nir_lower_double_ops is slightly more defensive against lowered drcp precision loss, and handles mod(x, x) = 0 directly. This works well...assuming nir_lower_double_ops actually gets an fmod op to lower in the first place. The previous patches enabled NIR-based lowering for the remaining drivers, so we can stop using the GLSL IR lowering when using NIR. Fixes KHR-GL45.gpu_shader_fp64.builtin.mod_dvec[234] on iris. Reviewed-by: Marek Olšák <[email protected]>
* intel/nir: Take nir_shader*s in brw_nir_link_shadersJason Ekstrand2019-06-051-2/+2
| | | | | | | Since NIR_PASS no longer swaps out the NIR pointer when NIR_TEST_* is enabled, we can just take a single pointer and not a pointer to pointer. Reviewed-by: Kenneth Graunke <[email protected]>
* intel/nir: Stop returning the shader from helpersJason Ekstrand2019-06-051-1/+1
| | | | | | | | Now that NIR_TEST_* doesn't swap the shader out from under us, it's sufficient to just modify the shader rather than having to return in case we're testing serialization or cloning. Reviewed-by: Kenneth Graunke <[email protected]>
* st/glsl: make sure to propagate initialisers to driver storageTimothy Arceri2019-06-045-27/+23
| | | | | | | | | | | | This essentially reverts 20234cfe3a20. Fixes piglit test: tests/spec/arb_get_program_binary/execution/uniform-after-restore.shader_test Fixes: 20234cfe3a20 "st/mesa: don't propagate uniforms when restoring from cache" Reviewed-by: Tapani Pälli <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110784
* mesa: Use string literals for format stringsMark Janes2019-06-031-3/+3
| | | | | | | | Android build settings require format strings to be string literals. Fixes: d2906293c43 "mesa: EXT_dsa add selectorless matrix stack functions" Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110833 Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: ARB program parser should clean parametersSergii Romantsov2019-06-032-2/+13
| | | | | | | | | | Program parser allocates parameter list. In case of parsing error some variables will not be freed. Patch adds freeing of it. Signed-off-by: Sergii Romantsov <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Signed-off-by: Marek Olšák <[email protected]>
* mesa: EXT_dsa add selectorless matrix stack functionsPierre-Eric Pelloux-Prayer2019-06-034-112/+820
| | | | | | | | | Allows the legacy matrix stacks to be manipulated without disturbing the matrix mode selector. Adapted from a patch from Chris Forbes. Reviewed-by: Marek Olšák <[email protected]>