[Mesa-dev] [Bug 90264] [Regression, bisected] Tooltip corruption in Chrome
https://bugs.freedesktop.org/show_bug.cgi?id=90264 Diego Violachanged: What|Removed |Added CC||diego.vi...@gmail.com -- You are receiving this mail because: You are the assignee for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 1/2] vl: add a lanczos interpolation filter v2
Thanks for testing :) On Monday, July 25, 2016, Andy Furnisswrote: > Nayan Deshmukh wrote: > >> Hi Christian, >> >> I have sent the new patches, they should fix all the artifacts. :) >> > > I have briefly tried these over time and v3 1/2 + v2 2/2 still show > artifacts for me. What are these artifacts? can you please tell me about these artifacts and if possible also send me the videos where this are happening. > > All versions have issues with 8/9, and I agree with the view that > you shouldn't really use up all the levels anyway. > > For me level 8/9 render nothing and on quit will segfault/abort > this one is mpv - > > The 8/9 level didn't work for me either, but I it was because of my hardware. I will limit it 7 in the follow up patch once the artifacts are done with. Regards, Nayan > Exiting... (Quit) > [Thread 0x7fffeccde700 (LWP 25133) exited] > [Thread 0x7fffed4df700 (LWP 25132) exited] > > Program received signal SIGSEGV, Segmentation fault. > [Switching to Thread 0x7fffe6ffd700 (LWP 25137)] > pipe_reference_described (get_desc=, reference=0x0, > ptr=0x70001) at ../../../../src/gallium/auxiliary/util/u_inlines.h:89 > 89 if (p_atomic_dec_zero(>count)) { > (gdb) bt > #0 pipe_reference_described (get_desc=, reference=0x0, > ptr=0x70001) at ../../../../src/gallium/auxiliary/util/u_inlines.h:89 > #1 pipe_resource_reference (tex=0x0, ptr=0x7fffdc31ced0) at > ../../../../src/gallium/auxiliary/util/u_inlines.h:138 > #2 r600_resource_reference (res=0x0, ptr=0x7fffdc31ced0) at > ../../../../src/gallium/drivers/radeon/r600_pipe_common.h:801 > #3 si_pm4_free_state_simple (state=0x7fffdc31ced0) at si_pm4.c:110 > #4 0x7fffe5adfc24 in vl_lanczos_filter_cleanup > (filter=0x7fffdc367310) at vl/vl_lanczos_filter.c:353 > #5 0x7fffe5a9fb0e in vlVdpVideoMixerDestroy (mixer=10) at mixer.c:216 > #6 0x0051628e in mp_vdpau_mixer_destroy (mixer=0x7fffdc30bf50) at > ../video/vdpau_mixer.c:83 > #7 0x005414a4 in uninit (vo=0x2273570) at > ../video/out/vo_vdpau.c:1034 > #8 0x0053b5b1 in vo_thread (ptr=0x2273570) at > ../video/out/vo.c:941 > #9 0x75a03434 in start_thread () from /lib/libpthread.so.0 > #10 0x70fce06d in clone () from /lib/libc.so.6 > > and mplayer - > > *** Error in `/mnt/sdb1/Gits/mplayer/mplayer': free(): invalid pointer: > 0x57328310 *** > === Backtrace: = > /lib/libc.so.6(+0x72025)[0x70773025] > /lib/libc.so.6(+0x77986)[0x70778986] > /lib/libc.so.6(+0x7816e)[0x7077916e] > /usr/lib/vdpau/libvdpau_radeonsi.so.1(+0x5fc24)[0x7fffea725c24] > /usr/lib/vdpau/libvdpau_radeonsi.so.1(+0x1fb0e)[0x7fffea6e5b0e] > /mnt/sdb1/Gits/mplayer/mplayer(+0x18dd51)[0x556e1d51] > === Memory map: > > > > Program received signal SIGABRT, Aborted. > 0x707345c8 in raise () from /lib/libc.so.6 > (gdb) bt > #0 0x707345c8 in raise () from /lib/libc.so.6 > #1 0x70735a4a in abort () from /lib/libc.so.6 > #2 0x7077302a in __libc_message () from /lib/libc.so.6 > #3 0x70778986 in malloc_printerr () from /lib/libc.so.6 > #4 0x7077916e in _int_free () from /lib/libc.so.6 > #5 0x7fffea725c24 in vl_lanczos_filter_cleanup > (filter=0x57264f80) at vl/vl_lanczos_filter.c:353 > #6 0x7fffea6e5b0e in vlVdpVideoMixerDestroy (mixer=4) at mixer.c:216 > #7 0x556e1d51 in free_video_specific () > #8 0x0001 in ?? () > #9 0x in ?? () > ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [RFC mesa] Introduce .editorconfig
On 23.07.2016 22:04, Nicolai Hähnle wrote: > On 22.07.2016 17:09, Emil Velikov wrote: >> On 18 July 2016 at 00:46, Eric Engestromwrote: >>> >>> --- /dev/null >>> +++ b/src/mesa/drivers/dri/radeon/.editorconfig >>> @@ -0,0 +1,3 @@ >>> +# Coin toss? Leaving this one empty (ie. global rules) for now because >>> +# there are files with 3-spaces, 4-spaces and tab indentations. >>> +# Tell me what you'd prefer if not the 3-space style of the rest of >>> Mesa. >> IMHO having something is always better than none. So fwiw I'd just >> keep this file. > > Fine with me. FWIW, editorconfig supports different settings on a per-file basis. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 97019] [clover] build failure in llvm/codegen/native.cpp:129:52
https://bugs.freedesktop.org/show_bug.cgi?id=97019 --- Comment #7 from Dieter Nützel--- Created attachment 125305 --> https://bugs.freedesktop.org/attachment.cgi?id=125305=edit clover-llvm-codegen-native.cpp.patch -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 97019] [clover] build failure in llvm/codegen/native.cpp:129:52
https://bugs.freedesktop.org/show_bug.cgi?id=97019 --- Comment #6 from Dieter Nützel--- (In reply to Francisco Jerez from comment #5) > Seems like a GCC bug... You may be able to work around the issue by using > the old-fashioned constructor call syntax with parentheses instead of braces > to initialize the "fos" variable. This one worked (see attachment). OpenGL renderer string: Gallium 0.4 on AMD TURKS (DRM 2.43.0 / 4.6.4-6.g684e9e1-default, LLVM 4.0.0) OpenGL core profile version string: 3.3 (Core Profile) Mesa 12.1.0-devel (git-e7b2ce5) opencl-example / run_tests.sh Passed 71 passes, 0 fails -- You are receiving this mail because: You are the assignee for the bug. You are the QA Contact for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 97067] WebGL: conformance/glsl/misc/shaders-with-invariance.html Fail
https://bugs.freedesktop.org/show_bug.cgi?id=97067 --- Comment #2 from Luke--- Yes, I'm seeing these errors even with llvmpipe (LIBGL_ALWAYS_SOFTWARE=1 ./firefox). -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] mesa clover from git fails to compile
Hello, after fixing problem with mako version mesa from git still fails to compile. Now problematic part is clover state tracker. Error message is: libtool: compile: g++-4.8 -DPACKAGE_NAME=\"Mesa\" -DPACKAGE_TARNAME=\"mesa\" - DPACKAGE_VERSION=\"12.1.0-devel\" "-DPACKAGE_STRING=\"Mesa 12.1.0-devel\"" "- DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\"; -DPACKAGE_URL=\"\" - DPACKAGE=\"mesa\" -DVERSION=\"12.1.0-devel\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 - DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DYYTEXT_POINTER=1 - DHAVE___BUILTIN_BSWAP32=1 -DHAVE___BUILTIN_BSWAP64=1 -DHAVE___BUILTIN_CLZ=1 -DHAVE___BUILTIN_CLZLL=1 - DHAVE___BUILTIN_CTZ=1 -DHAVE___BUILTIN_EXPECT=1 -DHAVE___BUILTIN_FFS=1 -DHAVE___BUILTIN_FFSLL=1 - DHAVE___BUILTIN_POPCOUNT=1 -DHAVE___BUILTIN_POPCOUNTLL=1 -DHAVE___BUILTIN_UNREACHABLE=1 - DHAVE_FUNC_ATTRIBUTE_CONST=1 -DHAVE_FUNC_ATTRIBUTE_FLATTEN=1 -DHAVE_FUNC_ATTRIBUTE_FORMAT=1 - DHAVE_FUNC_ATTRIBUTE_MALLOC=1 -DHAVE_FUNC_ATTRIBUTE_PACKED=1 -DHAVE_FUNC_ATTRIBUTE_PURE=1 - DHAVE_FUNC_ATTRIBUTE_UNUSED=1 -DHAVE_FUNC_ATTRIBUTE_VISIBILITY=1 - DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT=1 -DHAVE_FUNC_ATTRIBUTE_WEAK=1 -DHAVE_DLADDR=1 - DHAVE_PTHREAD=1 -DHAVE_LIBEXPAT=1 -I. -I../../../../../../src/gallium/state_trackers/clover - I../../../../../../include -I../../../../../../src -I../../../../../../src/gallium/include - I../../../../../../src/gallium/drivers -I../../../../../../src/gallium/auxiliary - I../../../../../../src/gallium/winsys -I../../../../src - I../../../../../../src/gallium/state_trackers/clover -DHAVE_CLOVER_ICD -D_FORTIFY_SOURCE=2 -std=c++11 -fvisibility=hidden -I/usr/lib/llvm-3.7/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS - D__STDC_LIMIT_MACROS -std=c++11 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D_GNU_SOURCE - DUSE_SSE41 -DNDEBUG -DTEXTURE_FLOAT_ENABLED -DUSE_X86_64_ASM -DHAVE_XLOCALE_H -DHAVE_SYS_SYSCTL_H - DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_DLOPEN -DHAVE_POSIX_MEMALIGN -DHAVE_LIBDRM -DGLX_USE_DRM - DHAVE_LIBUDEV -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_TLS -DHAVE_ALIAS - DHAVE_MINCORE -DHAVE_ST_VDPAU -DHAVE_LLVM=0x0307 -DMESA_LLVM_VERSION_PATCH=0 - DLIBCLC_INCLUDEDIR=\"/usr/include/\" -DLIBCLC_LIBEXECDIR=\"/usr/lib/clc/\" - DCLANG_RESOURCE_DIR=\"/usr/lib/llvm-3.7/lib/clang/3.7.0\" -g -O2 -fstack-protector --param=ssp-buffer- size=4 -Wformat -Wformat-security -Werror=format-security -Wall -Wall -fno-strict-aliasing -fno-math- errno -fno-trapping-math -MT llvm/libclllvm_la-invocation.lo -MD -MP -MF llvm/.deps/libclllvm_la- invocation.Tpo -c ../../../../../../src/gallium/state_trackers/clover/llvm/invocation.cpp -fPIC -DPIC -o llvm/.libs/libclllvm_la-invocation.o ../../../../../../src/gallium/state_trackers/clover/llvm/codegen/native.cpp: In function 'std::vector {anonymous}::emit_code(llvm::Module&, const clover::llvm::target&, llvm::TargetMachine::CodeGenFileType, std::string&)': ../../../../../../src/gallium/state_trackers/clover/llvm/codegen/native.cpp:129:52: error: invalid initialization of non-const reference of type 'clover::llvm::compat::raw_ostream_to_emit_file {aka llvm::raw_svector_ostream&}' from an rvalue of type '' compat::raw_ostream_to_emit_file fos { os }; ^ make[5]: *** [llvm/codegen/libclllvm_la-native.lo] Error 1 -- Pali Rohár pali.ro...@gmail.com signature.asc Description: This is a digitally signed message part. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] Required Mako version? (WAS: mesa from git fails to compile)
On Tuesday 19 July 2016 05:11:56 Kenneth Graunke wrote: > On Monday, July 18, 2016 10:58:25 PM PDT Pali Rohár wrote: > > Any conclusion or fix for this issue? > > Dylan suggested you use pip --user to install a newer version of > Mako. Is that a workable solution to your problem? Now I was able to upgrade mako to version 0.9.1, hope that it is enough. -- Pali Rohár pali.ro...@gmail.com signature.asc Description: This is a digitally signed message part. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] Handling component layouts in TGSI
Your proposition seems reasonable, but it's sad that drivers have to deal with this. Marek On Mon, Jul 25, 2016 at 12:32 AM, Ilia Mirkinwrote: > I was working on the component layouts stuff required for > ARB_enhanced_layouts, and ran into an issue with representing this in > TGSI. > > Right now when we indirectly index into arrays, we include an ArrayID > to indicate which array it is we're indexing into. > > However with component layouts, we might have an array that spans > components 0..2 of positions 0..10, and then another array that spans > component 3 of positions 0..5 and another for component 3 of positions > 6..10. > > I'm thinking that this will make sense to be represented as > > DECL IN[0..10](1).xyz > DECL IN[0..5](2).w > DECL IN[6..10](3).w > > And then accessing something like IN[4].xyzw would be fully legit, > however indirect accesses would have to specify the array id, and only > refer to the components of the declared array. > > Does this sound reasonable to everyone? Is there a better (read: > simpler) way of handling this? > > Cheers, > > -ilia > ___ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/mesa-dev ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH 6/6] glsl: move uniform linking code to link_assign_uniform_storage()
On Sun, Jul 24, 2016 at 7:36 PM, Timothy Arceriwrote: > This makes link_assign_uniform_locations(). I think you accidentally the whole sentence. ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 2/6] glsl: remove dead builtins before assigning varying locations
Builtins already have locations assigned so this shouldn't changing anything. We want to call it earlier so we can tranform GLSL IR to NIR earlier. --- src/compiler/glsl/linker.cpp | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 02d16ec..2fefccf 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -4587,8 +4587,12 @@ link_varyings_and_uniforms(unsigned first, unsigned last, /* If the program is made up of only a single stage */ if (first == last) { - gl_linked_shader *const sh = prog->_LinkedShaders[last]; + + do_dead_builtin_varyings(ctx, NULL, sh, 0, NULL); + do_dead_builtin_varyings(ctx, sh, NULL, num_tfeedback_decls, + tfeedback_decls); + if (prog->SeparateShader) { const uint64_t reserved_slots = reserved_varying_slot(sh, ir_var_shader_in); @@ -4604,10 +4608,6 @@ link_varyings_and_uniforms(unsigned first, unsigned last, reserved_slots)) return false; } - - do_dead_builtin_varyings(ctx, NULL, sh, 0, NULL); - do_dead_builtin_varyings(ctx, sh, NULL, num_tfeedback_decls, - tfeedback_decls); } else { /* Linking the stages in the opposite order (from fragment to vertex) * ensures that inter-shader outputs written to in an earlier stage @@ -4627,16 +4627,16 @@ link_varyings_and_uniforms(unsigned first, unsigned last, const uint64_t reserved_in_slots = reserved_varying_slot(sh_next, ir_var_shader_in); +do_dead_builtin_varyings(ctx, sh_i, sh_next, + next == MESA_SHADER_FRAGMENT ? num_tfeedback_decls : 0, + tfeedback_decls); + if (!assign_varying_locations(ctx, mem_ctx, prog, sh_i, sh_next, next == MESA_SHADER_FRAGMENT ? num_tfeedback_decls : 0, tfeedback_decls, reserved_out_slots | reserved_in_slots)) return false; -do_dead_builtin_varyings(ctx, sh_i, sh_next, - next == MESA_SHADER_FRAGMENT ? num_tfeedback_decls : 0, - tfeedback_decls); - /* This must be done after all dead varyings are eliminated. */ if (sh_i != NULL) { unsigned slots_used = _mesa_bitcount_64(reserved_out_slots); -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 5/6] glsl: move uniform linking code to new link_setup_uniform_remap_tables()
This makes link_assign_uniform_locations() easier to follow. --- src/compiler/glsl/link_uniforms.cpp | 330 +++- src/compiler/glsl/linker.cpp| 4 +- src/compiler/glsl/linker.h | 5 +- 3 files changed, 177 insertions(+), 162 deletions(-) diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp index dbe808f..89196e6 100644 --- a/src/compiler/glsl/link_uniforms.cpp +++ b/src/compiler/glsl/link_uniforms.cpp @@ -998,12 +998,168 @@ find_empty_block(struct gl_shader_program *prog, return -1; } +static void +link_setup_uniform_remap_tables(struct gl_context *ctx, +struct gl_shader_program *prog, +unsigned num_explicit_uniform_locs) +{ + unsigned total_entries = num_explicit_uniform_locs; + unsigned empty_locs = + prog->NumUniformRemapTable - num_explicit_uniform_locs; + + /* Reserve all the explicit locations of the active uniforms. */ + for (unsigned i = 0; i < prog->NumUniformStorage; i++) { + if (prog->UniformStorage[i].type->is_subroutine() || + prog->UniformStorage[i].is_shader_storage) + continue; + + if (prog->UniformStorage[i].remap_location != UNMAPPED_UNIFORM_LOC) { + /* How many new entries for this uniform? */ + const unsigned entries = +MAX2(1, prog->UniformStorage[i].array_elements); + + /* Set remap table entries point to correct gl_uniform_storage. */ + for (unsigned j = 0; j < entries; j++) { +unsigned element_loc = prog->UniformStorage[i].remap_location + j; +assert(prog->UniformRemapTable[element_loc] == + INACTIVE_UNIFORM_EXPLICIT_LOCATION); +prog->UniformRemapTable[element_loc] = >UniformStorage[i]; + } + } + } + + /* Reserve locations for rest of the uniforms. */ + for (unsigned i = 0; i < prog->NumUniformStorage; i++) { + + if (prog->UniformStorage[i].type->is_subroutine() || + prog->UniformStorage[i].is_shader_storage) + continue; + + /* Built-in uniforms should not get any location. */ + if (prog->UniformStorage[i].builtin) + continue; + + /* Explicit ones have been set already. */ + if (prog->UniformStorage[i].remap_location != UNMAPPED_UNIFORM_LOC) + continue; + + /* how many new entries for this uniform? */ + const unsigned entries = MAX2(1, prog->UniformStorage[i].array_elements); + + /* Find UniformRemapTable for empty blocks where we can fit this uniform. */ + int chosen_location = -1; + + if (empty_locs) + chosen_location = find_empty_block(prog, >UniformStorage[i]); + + /* Add new entries to the total amount of entries. */ + total_entries += entries; + + if (chosen_location != -1) { + empty_locs -= entries; + } else { + chosen_location = prog->NumUniformRemapTable; + + /* resize remap table to fit new entries */ + prog->UniformRemapTable = +reralloc(prog, + prog->UniformRemapTable, + gl_uniform_storage *, + prog->NumUniformRemapTable + entries); + prog->NumUniformRemapTable += entries; + } + + /* set pointers for this uniform */ + for (unsigned j = 0; j < entries; j++) + prog->UniformRemapTable[chosen_location + j] = +>UniformStorage[i]; + + /* set the base location in remap table for the uniform */ + prog->UniformStorage[i].remap_location = chosen_location; + } + + /* Verify that total amount of entries for explicit and implicit locations +* is less than MAX_UNIFORM_LOCATIONS. +*/ + + if (total_entries > ctx->Const.MaxUserAssignableUniformLocations) { + linker_error(prog, "count of uniform locations > MAX_UNIFORM_LOCATIONS" + "(%u > %u)", total_entries, + ctx->Const.MaxUserAssignableUniformLocations); + } + + /* Reserve all the explicit locations of the active subroutine uniforms. */ + for (unsigned i = 0; i < prog->NumUniformStorage; i++) { + if (!prog->UniformStorage[i].type->is_subroutine()) + continue; + + if (prog->UniformStorage[i].remap_location == UNMAPPED_UNIFORM_LOC) + continue; + + for (unsigned j = 0; j < MESA_SHADER_STAGES; j++) { + struct gl_linked_shader *sh = prog->_LinkedShaders[j]; + if (!sh) +continue; + + if (!prog->UniformStorage[i].opaque[j].active) +continue; + + /* How many new entries for this uniform? */ + const unsigned entries = +MAX2(1, prog->UniformStorage[i].array_elements); + + /* Set remap table entries point to correct gl_uniform_storage. */ + for (unsigned k = 0; k < entries; k++) { +unsigned element_loc = prog->UniformStorage[i].remap_location + k; +
[Mesa-dev] [PATCH 3/6] glsl: use UniformHash to find storage location
There is no need to be looping over all the uniforms. --- src/compiler/glsl/link_uniform_initializers.cpp | 29 ++--- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/src/compiler/glsl/link_uniform_initializers.cpp b/src/compiler/glsl/link_uniform_initializers.cpp index effbb6a..1d7c207 100644 --- a/src/compiler/glsl/link_uniform_initializers.cpp +++ b/src/compiler/glsl/link_uniform_initializers.cpp @@ -22,6 +22,7 @@ */ #include "main/core.h" +#include "program/hash_table.h" #include "ir.h" #include "linker.h" #include "ir_uniform.h" @@ -33,14 +34,13 @@ namespace linker { gl_uniform_storage * -get_storage(gl_uniform_storage *storage, unsigned num_storage, - const char *name) +get_storage(struct gl_shader_program *prog, const char *name) { - for (unsigned int i = 0; i < num_storage; i++) { - if (strcmp(name, storage[i].name) == 0) -return [i]; - } + unsigned id; + if (prog->UniformHash->get(id, name)) + return >UniformStorage[id]; + assert(!"No uniform storage found!"); return NULL; } @@ -109,13 +109,10 @@ set_opaque_binding(void *mem_ctx, gl_shader_program *prog, element_name, binding); } } else { - struct gl_uniform_storage *const storage = - get_storage(prog->UniformStorage, prog->NumUniformStorage, name); + struct gl_uniform_storage *const storage = get_storage(prog, name); - if (storage == NULL) { - assert(storage != NULL); + if (!storage) return; - } const unsigned elements = MAX2(storage->array_elements, 1); @@ -208,14 +205,10 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, return; } - struct gl_uniform_storage *const storage = - get_storage(prog->UniformStorage, - prog->NumUniformStorage, - name); - if (storage == NULL) { - assert(storage != NULL); + struct gl_uniform_storage *const storage = get_storage(prog, name); + + if (!storage) return; - } if (val->type->is_array()) { const enum glsl_base_type base_type = -- 2.7.4 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH 4/6] glsl: remove remaining tabs in link_uniform_initializers.cpp
--- src/compiler/glsl/link_uniform_initializers.cpp | 78 - 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/src/compiler/glsl/link_uniform_initializers.cpp b/src/compiler/glsl/link_uniform_initializers.cpp index 1d7c207..db5e899 100644 --- a/src/compiler/glsl/link_uniform_initializers.cpp +++ b/src/compiler/glsl/link_uniform_initializers.cpp @@ -46,31 +46,31 @@ get_storage(struct gl_shader_program *prog, const char *name) void copy_constant_to_storage(union gl_constant_value *storage, -const ir_constant *val, -const enum glsl_base_type base_type, + const ir_constant *val, + const enum glsl_base_type base_type, const unsigned int elements, unsigned int boolean_true) { for (unsigned int i = 0; i < elements; i++) { switch (base_type) { case GLSL_TYPE_UINT: -storage[i].u = val->value.u[i]; -break; + storage[i].u = val->value.u[i]; + break; case GLSL_TYPE_INT: case GLSL_TYPE_SAMPLER: -storage[i].i = val->value.i[i]; -break; + storage[i].i = val->value.i[i]; + break; case GLSL_TYPE_FLOAT: -storage[i].f = val->value.f[i]; -break; + storage[i].f = val->value.f[i]; + break; case GLSL_TYPE_DOUBLE: /* XXX need to check on big-endian */ storage[i * 2].u = *(uint32_t *)>value.d[i]; storage[i * 2 + 1].u = *(((uint32_t *)>value.d[i]) + 1); break; case GLSL_TYPE_BOOL: -storage[i].b = val->value.b[i] ? boolean_true : 0; -break; + storage[i].b = val->value.b[i] ? boolean_true : 0; + break; case GLSL_TYPE_ARRAY: case GLSL_TYPE_STRUCT: case GLSL_TYPE_IMAGE: @@ -80,11 +80,11 @@ copy_constant_to_storage(union gl_constant_value *storage, case GLSL_TYPE_SUBROUTINE: case GLSL_TYPE_FUNCTION: case GLSL_TYPE_ERROR: -/* All other types should have already been filtered by other - * paths in the caller. - */ -assert(!"Should not get here."); -break; + /* All other types should have already been filtered by other + * paths in the caller. + */ + assert(!"Should not get here."); + break; } } } @@ -103,9 +103,9 @@ set_opaque_binding(void *mem_ctx, gl_shader_program *prog, const glsl_type *const element_type = type->fields.array; for (unsigned int i = 0; i < type->length; i++) { -const char *element_name = ralloc_asprintf(mem_ctx, "%s[%d]", name, i); + const char *element_name = ralloc_asprintf(mem_ctx, "%s[%d]", name, i); -set_opaque_binding(mem_ctx, prog, element_type, + set_opaque_binding(mem_ctx, prog, element_type, element_name, binding); } } else { @@ -173,7 +173,7 @@ set_block_binding(gl_shader_program *prog, const char *block_name, void set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, - const char *name, const glsl_type *type, +const char *name, const glsl_type *type, ir_constant *val, unsigned int boolean_true) { const glsl_type *t_without_array = type->without_array(); @@ -183,12 +183,12 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, field_constant = (ir_constant *)val->components.get_head(); for (unsigned int i = 0; i < type->length; i++) { -const glsl_type *field_type = type->fields.structure[i].type; -const char *field_name = ralloc_asprintf(mem_ctx, "%s.%s", name, - type->fields.structure[i].name); -set_uniform_initializer(mem_ctx, prog, field_name, + const glsl_type *field_type = type->fields.structure[i].type; + const char *field_name = ralloc_asprintf(mem_ctx, "%s.%s", name, +type->fields.structure[i].name); + set_uniform_initializer(mem_ctx, prog, field_name, field_type, field_constant, boolean_true); -field_constant = (ir_constant *)field_constant->next; + field_constant = (ir_constant *)field_constant->next; } return; } else if (t_without_array->is_record() || @@ -196,9 +196,9 @@ set_uniform_initializer(void *mem_ctx, gl_shader_program *prog, const glsl_type *const element_type = type->fields.array; for (unsigned int i = 0; i < type->length; i++) { -const char *element_name = ralloc_asprintf(mem_ctx, "%s[%d]", name, i); + const char *element_name = ralloc_asprintf(mem_ctx, "%s[%d]", name, i); -set_uniform_initializer(mem_ctx, prog, element_name, + set_uniform_initializer(mem_ctx, prog, element_name,
[Mesa-dev] [PATCH 6/6] glsl: move uniform linking code to link_assign_uniform_storage()
This makes link_assign_uniform_locations(). --- src/compiler/glsl/link_uniforms.cpp | 132 +++- 1 file changed, 69 insertions(+), 63 deletions(-) diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp index 89196e6..793f12c 100644 --- a/src/compiler/glsl/link_uniforms.cpp +++ b/src/compiler/glsl/link_uniforms.cpp @@ -1153,13 +1153,77 @@ link_setup_uniform_remap_tables(struct gl_context *ctx, } } +static void +link_assign_uniform_storage(struct gl_context *ctx, +struct gl_shader_program *prog, +const unsigned num_data_slots, +unsigned num_explicit_uniform_locs) +{ + /* On the outside chance that there were no uniforms, bail out. +*/ + if (prog->NumUniformStorage == 0) + return; + + unsigned int boolean_true = ctx->Const.UniformBooleanTrue; + + prog->UniformStorage = rzalloc_array(prog, struct gl_uniform_storage, +prog->NumUniformStorage); + union gl_constant_value *data = rzalloc_array(prog->UniformStorage, + union gl_constant_value, + num_data_slots); +#ifndef NDEBUG + union gl_constant_value *data_end = [num_data_slots]; +#endif + + parcel_out_uniform_storage parcel(prog, prog->UniformHash, + prog->UniformStorage, data); + + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { + if (prog->_LinkedShaders[i] == NULL) + continue; + + parcel.start_shader((gl_shader_stage)i); + + foreach_in_list(ir_instruction, node, prog->_LinkedShaders[i]->ir) { + ir_variable *const var = node->as_variable(); + + if ((var == NULL) || (var->data.mode != ir_var_uniform && + var->data.mode != ir_var_shader_storage)) +continue; + + parcel.set_and_process(var); + } + + prog->_LinkedShaders[i]->active_samplers = parcel.shader_samplers_used; + prog->_LinkedShaders[i]->shadow_samplers = parcel.shader_shadow_samplers; + + STATIC_ASSERT(sizeof(prog->_LinkedShaders[i]->SamplerTargets) == +sizeof(parcel.targets)); + memcpy(prog->_LinkedShaders[i]->SamplerTargets, parcel.targets, + sizeof(prog->_LinkedShaders[i]->SamplerTargets)); + } + +#ifndef NDEBUG + for (unsigned i = 0; i < prog->NumUniformStorage; i++) { + assert(prog->UniformStorage[i].storage != NULL || + prog->UniformStorage[i].builtin || + prog->UniformStorage[i].is_shader_storage || + prog->UniformStorage[i].block_index != -1); + } + + assert(parcel.values == data_end); +#endif + + link_setup_uniform_remap_tables(ctx, prog, num_explicit_uniform_locs); + + link_set_uniform_initializers(prog, boolean_true); +} + void link_assign_uniform_locations(struct gl_shader_program *prog, struct gl_context *ctx, unsigned int num_explicit_uniform_locs) { - unsigned int boolean_true = ctx->Const.UniformBooleanTrue; - ralloc_free(prog->UniformStorage); prog->UniformStorage = NULL; prog->NumUniformStorage = 0; @@ -1225,70 +1289,12 @@ link_assign_uniform_locations(struct gl_shader_program *prog, } prog->NumUniformStorage = uniform_size.num_active_uniforms; - const unsigned num_data_slots = uniform_size.num_values; - const unsigned hidden_uniforms = uniform_size.num_hidden_uniforms; + prog->NumHiddenUniforms = uniform_size.num_hidden_uniforms; /* assign hidden uniforms a slot id */ hiddenUniforms->iterate(assign_hidden_uniform_slot_id, _size); delete hiddenUniforms; - /* On the outside chance that there were no uniforms, bail out. -*/ - if (prog->NumUniformStorage == 0) - return; - - prog->UniformStorage = rzalloc_array(prog, struct gl_uniform_storage, -prog->NumUniformStorage); - union gl_constant_value *data = rzalloc_array(prog->UniformStorage, - union gl_constant_value, - num_data_slots); -#ifndef NDEBUG - union gl_constant_value *data_end = [num_data_slots]; -#endif - - parcel_out_uniform_storage parcel(prog, prog->UniformHash, - prog->UniformStorage, data); - - for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { - if (prog->_LinkedShaders[i] == NULL) - continue; - - parcel.start_shader((gl_shader_stage)i); - - foreach_in_list(ir_instruction, node, prog->_LinkedShaders[i]->ir) { - ir_variable *const var = node->as_variable(); - - if ((var == NULL) || (var->data.mode != ir_var_uniform && - var->data.mode != ir_var_shader_storage)) -continue; - -
[Mesa-dev] [PATCH 1/6] glsl: split out varying and uniform linking code
Here a new function link_varyings_and_uniforms() is created this should help make it easier to follow the code in link_shader() which was getting very large. Note the end of the new function contains a for loop with some lowering calls that currently don't seem related to varyings or uniforms but they are a dependancy for converting to NIR ealier which an upcoming series will attempt to do so we move things here now to keep things easy to follow. --- src/compiler/glsl/linker.cpp | 429 ++- 1 file changed, 222 insertions(+), 207 deletions(-) diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index 6d45a02..02d16ec 100644 --- a/src/compiler/glsl/linker.cpp +++ b/src/compiler/glsl/linker.cpp @@ -4475,6 +4475,226 @@ disable_varying_optimizations_for_sso(struct gl_shader_program *prog) } } +static bool +link_varyings_and_uniforms(unsigned first, unsigned last, + unsigned num_explicit_uniform_locs, + struct gl_context *ctx, + struct gl_shader_program *prog, void *mem_ctx) +{ + bool has_xfb_qualifiers = false; + unsigned num_tfeedback_decls = 0; + char **varying_names = NULL; + tfeedback_decl *tfeedback_decls = NULL; + + /* Mark all generic shader inputs and outputs as unpaired. */ + for (unsigned i = MESA_SHADER_VERTEX; i <= MESA_SHADER_FRAGMENT; i++) { + if (prog->_LinkedShaders[i] != NULL) { + link_invalidate_variable_locations(prog->_LinkedShaders[i]->ir); + } + } + + unsigned prev = first; + for (unsigned i = prev + 1; i <= MESA_SHADER_FRAGMENT; i++) { + if (prog->_LinkedShaders[i] == NULL) + continue; + + match_explicit_outputs_to_inputs(prog->_LinkedShaders[prev], + prog->_LinkedShaders[i]); + prev = i; + } + + if (!assign_attribute_or_color_locations(prog, >Const, +MESA_SHADER_VERTEX)) { + return false; + } + + if (!assign_attribute_or_color_locations(prog, >Const, +MESA_SHADER_FRAGMENT)) { + return false; + } + + /* From the ARB_enhanced_layouts spec: +* +*"If the shader used to record output variables for transform feedback +*varyings uses the "xfb_buffer", "xfb_offset", or "xfb_stride" layout +*qualifiers, the values specified by TransformFeedbackVaryings are +*ignored, and the set of variables captured for transform feedback is +*instead derived from the specified layout qualifiers." +*/ + for (int i = MESA_SHADER_FRAGMENT - 1; i >= 0; i--) { + /* Find last stage before fragment shader */ + if (prog->_LinkedShaders[i]) { + has_xfb_qualifiers = +process_xfb_layout_qualifiers(mem_ctx, prog->_LinkedShaders[i], + _tfeedback_decls, + _names); + break; + } + } + + if (!has_xfb_qualifiers) { + num_tfeedback_decls = prog->TransformFeedback.NumVarying; + varying_names = prog->TransformFeedback.VaryingNames; + } + + if (num_tfeedback_decls != 0) { + /* From GL_EXT_transform_feedback: + * A program will fail to link if: + * + * * the specified by TransformFeedbackVaryingsEXT is + * non-zero, but the program object has no vertex or geometry + * shader; + */ + if (first >= MESA_SHADER_FRAGMENT) { + linker_error(prog, "Transform feedback varyings specified, but " + "no vertex, tessellation, or geometry shader is " + "present.\n"); + return false; + } + + tfeedback_decls = ralloc_array(mem_ctx, tfeedback_decl, + num_tfeedback_decls); + if (!parse_tfeedback_decls(ctx, prog, mem_ctx, num_tfeedback_decls, + varying_names, tfeedback_decls)) + return false; + } + + /* If there is no fragment shader we need to set transform feedback. +* +* For SSO we also need to assign output locations. We assign them here +* because we need to do it for both single stage programs and multi stage +* programs. +*/ + if (last < MESA_SHADER_FRAGMENT && + (num_tfeedback_decls != 0 || prog->SeparateShader)) { + const uint64_t reserved_out_slots = + reserved_varying_slot(prog->_LinkedShaders[last], ir_var_shader_out); + if (!assign_varying_locations(ctx, mem_ctx, prog, +prog->_LinkedShaders[last], NULL, +num_tfeedback_decls, tfeedback_decls, +reserved_out_slots)) + return false; + } + + if (last <= MESA_SHADER_FRAGMENT) { + /* Remove unused varyings from the first/last stage unless SSO */ +
[Mesa-dev] [Bug 97019] [clover] build failure in llvm/codegen/native.cpp:129:52
https://bugs.freedesktop.org/show_bug.cgi?id=97019 --- Comment #5 from Francisco Jerez--- Seems like a GCC bug... You may be able to work around the issue by using the old-fashioned constructor call syntax with parentheses instead of braces to initialize the "fos" variable. -- You are receiving this mail because: You are the assignee for the bug. You are the QA Contact for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 1/2] vl: add a lanczos interpolation filter v2
Nayan Deshmukh wrote: Hi Christian, I have sent the new patches, they should fix all the artifacts. :) I have briefly tried these over time and v3 1/2 + v2 2/2 still show artifacts for me. All versions have issues with 8/9, and I agree with the view that you shouldn't really use up all the levels anyway. For me level 8/9 render nothing and on quit will segfault/abort this one is mpv - Exiting... (Quit) [Thread 0x7fffeccde700 (LWP 25133) exited] [Thread 0x7fffed4df700 (LWP 25132) exited] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffe6ffd700 (LWP 25137)] pipe_reference_described (get_desc=, reference=0x0, ptr=0x70001) at ../../../../src/gallium/auxiliary/util/u_inlines.h:89 89 if (p_atomic_dec_zero(>count)) { (gdb) bt #0 pipe_reference_described (get_desc=, reference=0x0, ptr=0x70001) at ../../../../src/gallium/auxiliary/util/u_inlines.h:89 #1 pipe_resource_reference (tex=0x0, ptr=0x7fffdc31ced0) at ../../../../src/gallium/auxiliary/util/u_inlines.h:138 #2 r600_resource_reference (res=0x0, ptr=0x7fffdc31ced0) at ../../../../src/gallium/drivers/radeon/r600_pipe_common.h:801 #3 si_pm4_free_state_simple (state=0x7fffdc31ced0) at si_pm4.c:110 #4 0x7fffe5adfc24 in vl_lanczos_filter_cleanup (filter=0x7fffdc367310) at vl/vl_lanczos_filter.c:353 #5 0x7fffe5a9fb0e in vlVdpVideoMixerDestroy (mixer=10) at mixer.c:216 #6 0x0051628e in mp_vdpau_mixer_destroy (mixer=0x7fffdc30bf50) at ../video/vdpau_mixer.c:83 #7 0x005414a4 in uninit (vo=0x2273570) at ../video/out/vo_vdpau.c:1034 #8 0x0053b5b1 in vo_thread (ptr=0x2273570) at ../video/out/vo.c:941 #9 0x75a03434 in start_thread () from /lib/libpthread.so.0 #10 0x70fce06d in clone () from /lib/libc.so.6 and mplayer - *** Error in `/mnt/sdb1/Gits/mplayer/mplayer': free(): invalid pointer: 0x57328310 *** === Backtrace: = /lib/libc.so.6(+0x72025)[0x70773025] /lib/libc.so.6(+0x77986)[0x70778986] /lib/libc.so.6(+0x7816e)[0x7077916e] /usr/lib/vdpau/libvdpau_radeonsi.so.1(+0x5fc24)[0x7fffea725c24] /usr/lib/vdpau/libvdpau_radeonsi.so.1(+0x1fb0e)[0x7fffea6e5b0e] /mnt/sdb1/Gits/mplayer/mplayer(+0x18dd51)[0x556e1d51] === Memory map: Program received signal SIGABRT, Aborted. 0x707345c8 in raise () from /lib/libc.so.6 (gdb) bt #0 0x707345c8 in raise () from /lib/libc.so.6 #1 0x70735a4a in abort () from /lib/libc.so.6 #2 0x7077302a in __libc_message () from /lib/libc.so.6 #3 0x70778986 in malloc_printerr () from /lib/libc.so.6 #4 0x7077916e in _int_free () from /lib/libc.so.6 #5 0x7fffea725c24 in vl_lanczos_filter_cleanup (filter=0x57264f80) at vl/vl_lanczos_filter.c:353 #6 0x7fffea6e5b0e in vlVdpVideoMixerDestroy (mixer=4) at mixer.c:216 #7 0x556e1d51 in free_video_specific () #8 0x0001 in ?? () #9 0x in ?? () ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] Handling component layouts in TGSI
I was working on the component layouts stuff required for ARB_enhanced_layouts, and ran into an issue with representing this in TGSI. Right now when we indirectly index into arrays, we include an ArrayID to indicate which array it is we're indexing into. However with component layouts, we might have an array that spans components 0..2 of positions 0..10, and then another array that spans component 3 of positions 0..5 and another for component 3 of positions 6..10. I'm thinking that this will make sense to be represented as DECL IN[0..10](1).xyz DECL IN[0..5](2).w DECL IN[6..10](3).w And then accessing something like IN[4].xyzw would be fully legit, however indirect accesses would have to specify the array id, and only refer to the components of the declared array. Does this sound reasonable to everyone? Is there a better (read: simpler) way of handling this? Cheers, -ilia ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 93551] Divinity: Original Sin Enhanced Edition(Native) crash on start
https://bugs.freedesktop.org/show_bug.cgi?id=93551 Thomas J. Moorechanged: What|Removed |Added CC||dark...@gmail.com --- Comment #32 from Thomas J. Moore --- Created attachment 125302 --> https://bugs.freedesktop.org/attachment.cgi?id=125302=edit Simple LD_PRELOAD shim to apply necessary patches for divos Game works great for me with the above patches (thanks to those who figured this out!). However, since they are not likely to be incorporated into Mesa, and patching my system Mesa just for one poorly written game is a bad idea, I think one of two alternate solutions needs to be provided. My preference would be to patch the game binaries. I don't really want to mess with that right now, though (especially since I can't easily locate where it does the vendor check). The other would be to provide the patches in the form of an LD_PRELOAD shim. I have attached the source code for one that seems to work for me. -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 97019] [clover] build failure in llvm/codegen/native.cpp:129:52
https://bugs.freedesktop.org/show_bug.cgi?id=97019 --- Comment #4 from Jan Vesely--- (In reply to Dieter Nützel from comment #3) > c++ (SUSE Linux) 4.8.3 > > openSUSE 13.2 system version (worked for ages) > > Iaroslav is on openSUSE Leap 42.1+ (4.8.5) or updated to 5.x, I think. Clover was significantly rewritten few weeks ago. I'd guess this error does not happen before 600ac51448f0dc62808e962a206d11e1b179a32f It works OK with gcc-4.9.3. The question is whether to bump clover reqs or avoid using the feature. -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 97019] [clover] build failure in llvm/codegen/native.cpp:129:52
https://bugs.freedesktop.org/show_bug.cgi?id=97019 --- Comment #3 from Dieter Nützel--- c++ (SUSE Linux) 4.8.3 openSUSE 13.2 system version (worked for ages) Iaroslav is on openSUSE Leap 42.1+ (4.8.5) or updated to 5.x, I think. -- You are receiving this mail because: You are the assignee for the bug. You are the QA Contact for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 97067] WebGL: conformance/glsl/misc/shaders-with-invariance.html Fail
https://bugs.freedesktop.org/show_bug.cgi?id=97067 Ilia Mirkinchanged: What|Removed |Added QA Contact|nouveau@lists.freedesktop.o |mesa-dev@lists.freedesktop. |rg |org Assignee|nouveau@lists.freedesktop.o |mesa-dev@lists.freedesktop. |rg |org Component|Drivers/DRI/nouveau |Mesa core --- Comment #1 from Ilia Mirkin --- I believe this is a core mesa issue, not something nouveau-specific. I get a few failures in there (including the ones you point out) with i965/SKL and Mesa 12.0.1. -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [Bug 97019] [clover] build failure in llvm/codegen/native.cpp:129:52
https://bugs.freedesktop.org/show_bug.cgi?id=97019 --- Comment #2 from Jan Vesely--- This looks like an old compiler (not fully c++11 capable). what version are you using? -- You are receiving this mail because: You are the QA Contact for the bug. You are the assignee for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH v2 1/2] vl: add a lanczos interpolation filter v2
Hi Christian, I have sent the new patches, they should fix all the artifacts. :) Regards, Nayan. On Sat, Jul 23, 2016 at 3:30 PM, Nayan Deshmukhwrote: > Hi Christian, > > I tried using the approach, the artifacts are gone. But for some videos > the output quality has reduced. The quality for such videos is somewhere > between nearest neighbor and linear interpolation. > > Regards, > Nayan > > On Thu, Jul 21, 2016 at 7:48 PM, Christian König > wrote: > >> Am 21.07.2016 um 16:05 schrieb Nayan Deshmukh: >> >> Hi Christian, >> >> Yes, that is for pixel center adjustment. >> >> let me give you an example, for lanczos I need frac(x) where x is the >> original >> coordinate before scaling. To calculate that first I subtract half_pixel >> and then >> multiply by the original surface size, which gives me the original >> coordinate. >> >> eg. if the coordinate before scaling was 24.5 (total size 300) after 2x >> it becomes >> 49. When the frag shader is executed we get 49.5/600 as the coordinate so >> what >> I do is 49.5/600 - 0.5/600 = 49/600 and then multiply it with 300 to get >> 24.5 the >> original coordinate. >> >> >> Well in your case the coordinates are always between 0.0 and 1.0, so >> scaling doesn't affect the coordinate. >> >> You could take a look at how I did that in the weave shader: >> 1. In the vertex shader I use 0..width instead of 0..1 for the range >> (from create_vert_shader() in vl_compositor.c): >> >> * o_vtop.x = vtex.x >> * o_vtop.y = vtex.y * tmp.x + 0.25f >> >> 2. Then in the fragment shader I just need to do the following to get the >> original coordinate to sample from: >> * t_tc.y = (round(i_tc.y - 0.5) + 0.5) / height * 2 >> >> I use 0.25 and "height * 2" here because the top/bottom fields are always >> halve the height and shifted a bit up/down. >> >> For your case that should just be: >> >> o_vtex.x = i_vpos.x * video_width >> o_vtex.y = i_vpos.y * video_height >> >> In the vertex shader and then: >> >> t_tc.x = (round(i_tc.x - 0.5) + 0.5) / video_width >> t_tc.y = (round(i_tc.x - 0.5) + 0.5) / video_height >> >> In the fragment shader to get the correct coordinate. No need to actually >> mess with the destination sizes here. >> >> Regards, >> Christian. >> >> >> >> Regards, >> Nayan. >> On Thu, Jul 21, 2016 at 7:20 PM, Christian König > > wrote: >> >>> >>> This seems to be the reason for the artifacts. >>> >>> + ureg_SUB(shader, ureg_writemask(t_array[0], TGSI_WRITEMASK_XY), > +i_vtex, half_pixel); > >>> On debugging I found that after removing this ^^^ instruction the >>> artifacts are gone. >>> Not sure why is this happening but the filter is working fine. >>> >>> Any ideas Christian? >>> >>> >>> Could it be that your values run out of the representable numeric range? >>> Otherwise I run out of ideas as well. >>> >>> Additional to that I'm not 100% sure I get what are you trying to do >>> here. Is that for the pixel center adjustment? >>> >>> Regards, >>> Christian. >>> >>> >>> Am 20.07.2016 um 14:02 schrieb Nayan Deshmukh: >>> >>> Hi Christian, >>> >>> Thanks for the review. >>> >>> >>> On Tue, Jul 19, 2016 at 4:58 PM, Christian König < >>> deathsim...@vodafone.de> wrote: >>> Am 18.07.2016 um 21:55 schrieb Nayan Deshmukh: > v2: avoCould it be that your values run out of the representable > numeric range?iding dividing by zero when calculating lanczos > > Signed-off-by: Nayan Deshmukh > That looks much better, but there are still quite a bunch of artifacts. Take a look at the attached screenshots. good.jpg was created with hqscalling=0, bad with hqscalling=7. Especially on the left side we have lines from top to bottom where there shouldn't be any. Regards, Christian. --- > src/gallium/auxiliary/Makefile.sources | 2 + > src/gallium/auxiliary/vl/vl_lanczos_filter.c | 447 > +++ > src/gallium/auxiliary/vl/vl_lanczos_filter.h | 63 > 3 files changed, 512 insertions(+) > create mode 100644 src/gallium/auxiliary/vl/vl_lanczos_filter.c > create mode 100644 src/gallium/auxiliary/vl/vl_lanczos_filter.h > > diff --git a/src/gallium/auxiliary/Makefile.sources > b/src/gallium/auxiliary/Makefile.sources > index e0311bf..4eb0f65 100644 > --- a/src/gallium/auxiliary/Makefile.sources > +++ b/src/gallium/auxiliary/Makefile.sources > @@ -330,6 +330,8 @@ VL_SOURCES := \ > vl/vl_deint_filter.h \ > vl/vl_idct.c \ > vl/vl_idct.h \ > + vl/vl_lanczos_filter.c \ > + vl/vl_lanczos_filter.h \ > vl/vl_matrix_filter.c \ > vl/vl_matrix_filter.h \ > vl/vl_mc.c \ > diff --git a/src/gallium/auxiliary/vl/vl_lanczos_filter.c >
[Mesa-dev] [PATCH 2/2] st/vdapu: use lanczos filter for scaling v2
HIGH_QUALITY_SCALING_L2 to HIGH_QUALTIY_SCALING_L9 uses lanczos filter with number representing the size of the sinc window. Signed-off-by: Nayan Deshmukh--- src/gallium/state_trackers/vdpau/mixer.c | 116 --- src/gallium/state_trackers/vdpau/query.c | 8 ++ src/gallium/state_trackers/vdpau/vdpau_private.h | 7 ++ 3 files changed, 97 insertions(+), 34 deletions(-) diff --git a/src/gallium/state_trackers/vdpau/mixer.c b/src/gallium/state_trackers/vdpau/mixer.c index cb0ef03..87822c8 100644 --- a/src/gallium/state_trackers/vdpau/mixer.c +++ b/src/gallium/state_trackers/vdpau/mixer.c @@ -82,14 +82,6 @@ vlVdpVideoMixerCreate(VdpDevice device, switch (features[i]) { /* they are valid, but we doesn't support them */ case VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL: - case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L2: - case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L3: - case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L4: - case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L5: - case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L6: - case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L7: - case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L8: - case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L9: case VDP_VIDEO_MIXER_FEATURE_INVERSE_TELECINE: break; @@ -112,6 +104,17 @@ vlVdpVideoMixerCreate(VdpDevice device, case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1: vmixer->bicubic.supported = true; break; + + case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L2: + case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L3: + case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L4: + case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L5: + case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L6: + case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L7: + case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L8: + case VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L9: + vmixer->lanczos.supported = true; + break; default: goto no_params; } } @@ -209,6 +212,10 @@ vlVdpVideoMixerDestroy(VdpVideoMixer mixer) vl_bicubic_filter_cleanup(vmixer->bicubic.filter); FREE(vmixer->bicubic.filter); } + if (vmixer->lanczos.filter) { + vl_lanczos_filter_cleanup(vmixer->lanczos.filter); + FREE(vmixer->lanczos.filter); + } pipe_mutex_unlock(vmixer->device->mutex); DeviceReference(>device, NULL); @@ -335,7 +342,7 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer, } vl_compositor_set_buffer_layer(>cstate, compositor, layer, video_buffer, prect, NULL, deinterlace); - if(vmixer->bicubic.filter) { + if(vmixer->bicubic.filter || vmixer->lanczos.filter) { struct pipe_context *pipe; struct pipe_resource res_tmpl, *res; struct pipe_sampler_view sv_templ; @@ -389,7 +396,7 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer, ++layers; } - if (!vmixer->noise_reduction.filter && !vmixer->sharpness.filter && !vmixer->bicubic.filter) + if (!vmixer->noise_reduction.filter && !vmixer->sharpness.filter && !vmixer->bicubic.filter && !vmixer->lanczos.filter) vlVdpSave4DelayedRendering(vmixer->device, destination_surface, >cstate); else { vl_compositor_render(>cstate, compositor, surface, _area, true); @@ -408,6 +415,12 @@ VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer, RectToPipe(destination_video_rect, ), RectToPipe(destination_rect, )); + if (vmixer->lanczos.filter) + vl_lanczos_filter_render(vmixer->lanczos.filter, + sampler_view, dst->surface, + RectToPipe(destination_video_rect, ), + RectToPipe(destination_rect, )); + if(surface != dst->surface) { pipe_sampler_view_reference(_view, NULL); pipe_surface_reference(, NULL); @@ -536,6 +549,29 @@ vlVdpVideoMixerUpdateBicubicFilter(vlVdpVideoMixer *vmixer) } /** + * Update the lanczos filter + */ +static void +vlVdpVideoMixerUpdateLanczosFilter(vlVdpVideoMixer *vmixer) +{ + assert(vmixer); + + /* if present remove the old filter first */ + if (vmixer->lanczos.filter) { + vl_lanczos_filter_cleanup(vmixer->lanczos.filter); + FREE(vmixer->lanczos.filter); + vmixer->lanczos.filter = NULL; + } + /* and create a new filter as needed */ + if (vmixer->lanczos.enabled) { + vmixer->lanczos.filter = MALLOC(sizeof(struct vl_lanczos_filter)); + vl_lanczos_filter_init(vmixer->lanczos.filter, vmixer->device->context, + vmixer->lanczos.size, vmixer->video_width, + vmixer->video_height); + } +} + +/** * Retrieve whether features were requested
[Mesa-dev] [PATCH 1/2] vl: add a lanczos interpolation filter v3
v2: avoiding dividing by zero when calculating lanczos v3: make range of vtex 0..width instead of 0..1 (Christian) Signed-off-by: Nayan Deshmukh--- src/gallium/auxiliary/Makefile.sources | 2 + src/gallium/auxiliary/vl/vl_lanczos_filter.c | 445 +++ src/gallium/auxiliary/vl/vl_lanczos_filter.h | 63 3 files changed, 510 insertions(+) create mode 100644 src/gallium/auxiliary/vl/vl_lanczos_filter.c create mode 100644 src/gallium/auxiliary/vl/vl_lanczos_filter.h diff --git a/src/gallium/auxiliary/Makefile.sources b/src/gallium/auxiliary/Makefile.sources index e0311bf..4eb0f65 100644 --- a/src/gallium/auxiliary/Makefile.sources +++ b/src/gallium/auxiliary/Makefile.sources @@ -330,6 +330,8 @@ VL_SOURCES := \ vl/vl_deint_filter.h \ vl/vl_idct.c \ vl/vl_idct.h \ + vl/vl_lanczos_filter.c \ + vl/vl_lanczos_filter.h \ vl/vl_matrix_filter.c \ vl/vl_matrix_filter.h \ vl/vl_mc.c \ diff --git a/src/gallium/auxiliary/vl/vl_lanczos_filter.c b/src/gallium/auxiliary/vl/vl_lanczos_filter.c new file mode 100644 index 000..0c7d162 --- /dev/null +++ b/src/gallium/auxiliary/vl/vl_lanczos_filter.c @@ -0,0 +1,445 @@ +/** + * + * Copyright 2016 Nayan Deshmukh. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **/ + +#include + +#include "pipe/p_context.h" + +#include "tgsi/tgsi_ureg.h" + +#include "util/u_draw.h" +#include "util/u_memory.h" +#include "util/u_math.h" +#include "util/u_rect.h" + +#include "vl_types.h" +#include "vl_vertex_buffers.h" +#include "vl_lanczos_filter.h" + +enum VS_OUTPUT +{ + VS_O_VPOS = 0, + VS_O_VTEX = 0 +}; + +static void * +create_vert_shader(struct vl_lanczos_filter *filter, unsigned width, unsigned height) +{ + struct ureg_program *shader; + struct ureg_src i_vpos; + struct ureg_dst o_vpos, o_vtex; + + shader = ureg_create(PIPE_SHADER_VERTEX); + if (!shader) + return NULL; + + i_vpos = ureg_DECL_vs_input(shader, 0); + o_vpos = ureg_DECL_output(shader, TGSI_SEMANTIC_POSITION, VS_O_VPOS); + o_vtex = ureg_DECL_output(shader, TGSI_SEMANTIC_GENERIC, VS_O_VTEX); + /* +* o_vpos = i_vpos +* o_vtex = i_vpos * i_size +*/ + + ureg_MOV(shader, o_vpos, i_vpos); + ureg_MUL(shader, o_vtex, i_vpos, ureg_imm2f(shader, width, height)); + + ureg_END(shader); + + return ureg_create_shader_and_destroy(shader, filter->pipe); +} + +static void +create_frag_shader_lanczos(struct ureg_program *shader, struct ureg_src a, + struct ureg_src x, struct ureg_dst o_fragment) +{ + struct ureg_dst temp[8]; + unsigned i; + + for(i = 0; i < 8; ++i) + temp[i] = ureg_DECL_temporary(shader); + + /* +* temp[0] = (x == 0) ? 1.0f : x +* temp[7] = (sin(pi * x) * sin ((pi * x)/a)) / x^2 +* o_fragment = (x == 0) ? 1.0f : temp[7] +*/ + ureg_MOV(shader, temp[0], x); + ureg_SEQ(shader, temp[1], x, ureg_imm1f(shader, 0.0f)); + + ureg_LRP(shader, temp[0], ureg_src(temp[1]), +ureg_imm1f(shader, 1.0f), ureg_src(temp[0])); + + ureg_MUL(shader, temp[2], x, +ureg_imm1f(shader, 3.141592)); + ureg_DIV(shader, temp[3], ureg_src(temp[2]), a); + + ureg_SIN(shader, temp[4], ureg_src(temp[2])); + ureg_SIN(shader, temp[5], ureg_src(temp[3])); + + ureg_MUL(shader, temp[6], ureg_src(temp[4]), +ureg_src(temp[5])); + ureg_MUL(shader, temp[7], ureg_imm1f(shader, +0.101321), a); + ureg_MUL(shader, temp[7], ureg_src(temp[7]), +ureg_src(temp[6])); + ureg_DIV(shader, temp[7], ureg_src(temp[7]), +ureg_src(temp[0])); + ureg_DIV(shader, o_fragment, + ureg_src(temp[7]), ureg_src(temp[0])); + +
[Mesa-dev] [Bug 97019] [clover] build failure in llvm/codegen/native.cpp:129:52
https://bugs.freedesktop.org/show_bug.cgi?id=97019 --- Comment #1 from Dieter Nützel--- I'm back from vacation and can second this with LLVM 3.9.0svn and current (today) LLVM 4.0.0svn my post was titled: clover: compilation error with former LLVM 3.9.0svn and current LLVM 4.0.0svn -- You are receiving this mail because: You are the assignee for the bug. You are the QA Contact for the bug.___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] clover: compilation error with former LLVM 3.9.0svn and current LLVM 4.0.0svn
/opt/opencl-example> llc --version LLVM (http://llvm.org/): LLVM version 4.0.0svn Optimized build. Default target: x86_64-unknown-linux-gnu Host CPU: nehalem Registered Targets: amdgcn - AMD GCN GPUs r600 - AMD GPUs HD2XXX-HD6XXX x86- 32-bit X86: Pentium-Pro and above x86-64 - 64-bit X86: EM64T and AMD64 make[4]: Entering directory '/opt/mesa/src/gallium/state_trackers/clover' CXX llvm/codegen/libclllvm_la-native.lo llvm/codegen/native.cpp: In function 'std::vector {anonymous}::emit_code(llvm::Module&, const clover::llvm::target&, llvm::TargetMachine::CodeGenFileType, std::string&)': llvm/codegen/native.cpp:129:52: error: invalid initialization of non-const reference of type 'clover::llvm::compat::raw_ostream_to_emit_file {aka llvm::raw_svector_ostream&}' from an rvalue of type 'initializer list>' compat::raw_ostream_to_emit_file fos { os }; ^ Makefile:914: recipe for target 'llvm/codegen/libclllvm_la-native.lo' failed make[4]: *** [llvm/codegen/libclllvm_la-native.lo] Error 1 make[4]: Leaving directory '/opt/mesa/src/gallium/state_trackers/clover' Makefile:594: recipe for target 'all-recursive' failed make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory '/opt/mesa/src/gallium' Makefile:700: recipe for target 'all-recursive' failed make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory '/opt/mesa/src' Makefile:574: recipe for target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving directory '/opt/mesa/src' Makefile:640: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev