* * *

Recent Posts

Pages: [1] 2 3 ... 10
1
FPSpreadsheet / Re: I Can't Delete Rows??
« Last post by Thaddy on Today at 08:59:12 am »
Then you first have to disconnect the two or also delete the data in the other sheet that result relies on.
I don't think that's a real bug. You would probably have to disable the cells /rows/cols hat depend on calculations over both sheets.
2
General / Re: Linux alternative to LockWindowUpdate?
« Last post by Thaddy on Today at 08:22:19 am »
Or DbGrid.BeginUpdate/EndUpdate. That what it is for.
Too many grids? use this with as parent the form you want to stop updating the grids:
Code: Pascal  [Select]
  1. procedure UpdateDbGrids(const parent:Tcomponent;StartUpdate:Boolean = true);
  2. var i:integer;
  3. begin
  4.   for i := 0 to parent.ComponentCount -1 do
  5.     if parent.Components[i] is TDbGrid then
  6.       if StartUpdate = true then
  7.         (parent.Components[i] as TDbGrid).BeginUpdate
  8.       else
  9.         (parent.Components[i] as TDbGrid).EndUpdate;
  10. end;  
3
General / Re: How to create video from Component canvas?
« Last post by mercury on Today at 08:04:27 am »
Try this http://forum.lazarus.freepascal.org/index.php/topic,33105.0.html
I am not sure what you really want to do.
To cap a webcam use arguments
Code: Pascal  [Select]
  1. -f vfwcap -i 0
This lib is only for decode audio/video, no image rendering no encode.
4
General / Re: Linux alternative to LockWindowUpdate?
« Last post by taazz on Today at 07:54:30 am »
as far as I know it doesn't exists. how about disablecontrols of the dataset?
5
General / Re: EasyLazFreeType memory leak
« Last post by mercury on Today at 05:48:48 am »
I might find the problem. It's not memory leak, but do keep wasting memory.
In unit “easylazfreetype” function:
Code: Pascal  [Select]
  1. function TFreeTypeFont.GetGlyph(Index: integer): TFreeTypeGlyph;
  2. var node: TAvgLvlTreeNode;
  3.     lGlyph: TFreeTypeGlyph;
  4. begin
  5.   if not CheckInstance then
  6.   begin
  7.     result := nil;
  8.     exit;
  9.   end;
  10.   node := FindGlyphNode(Index);
  11.   if node = nil then
  12.   begin
  13.     lGlyph := TFreeTypeGlyph.Create(self, Index);;
  14.     FGlyphTable.Add(lGlyph);
  15.   end else
  16.     lGlyph := TFreeTypeGlyph(node.Data);
  17.   result := lGlyph;
  18. end;
FindGlyphNode cannot result an accuracy value. So it keep doing “FGlyphTable.Add(lGlyph);”. That’s the problem.

Any idea how to fix this?
6
General / Re: Lazarus + Vulkan?
« Last post by skalogryz on Today at 03:35:22 am »
No 64-bit Ubuntu 16.10 Amd RX 480
try to call SetExceptionMask (pass empty mask there) prior to the initialization.
7
General / Re: Compare code optimization of C and FreePascal !
« Last post by Akira1364 on Today at 03:24:58 am »
Personally I always use the following set of flags in the "custom options" menu of Lazarus whenever I want what I call a super-release build:
-CfAVX2 -CpCOREAVX2 -g- OpCOREAVX2 -Si -Sv
I also usually set -O4, -CX and -XX in the "Compilation And Linking" menu, and -Xs in the "Debugging" menu.

The resulting assembly code I typically get from all of that (when I bother to look at it, which isn't that often) is not too shabby, honestly. The compiler is pretty good at knowing when to use the AVX/AVX2 vector versions of various math instructions (IE, VMULSS instead of MULSS, e.t.c) Also, I find that passing as many things as "constref" (not just "const" as it doesn't always work) as you possibly can helps knock down the number of lines of generated ASM quite a bit as well.
8
General / Re: Lazarus + Vulkan?
« Last post by Akira1364 on Today at 03:02:31 am »
I am. User BeRo has this: https://forums.khronos.org/showthread.php/13078-PasVulkan-Vulkan-header-for-Object-Pascal-supporting-all-Vulkan-OS-targets

Side note: I am legitimately convinced that BeRo has got to be like one of the top 10 or top 5 Pascal programmers alive today. No idea how that guy manages to continuously write such gigantic libraries (Kraft Physics, e.t.c) that always work perfectly the first time you try them, at such a rapid pace.
9
General / Re: How to create video from Component canvas?
« Last post by Akira1364 on Today at 01:58:17 am »
I just found something like MediaPlayer component for Lazarus. I don't know if it works or if files in that folder are all it needs:
https://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/mplayer/

Judging from example project's source code it should support video
Code: Pascal  [Select]
  1. MPlayerControl1.StartParam := '-vo direct3d -nofontconfig';

That component is just a wrapper around DirectShow, I believe... so the required libraries should already be in place by default. (It's worth pointing out though that many parts of DirectShow itself are deprecated and haven't been updated in a few years.... would likely be better to go with something like an FFMPEG or VLC wrapper.)
10
General / Re: Compare code optimization of C and FreePascal !
« Last post by ykot on Today at 01:57:23 am »
Please note that the compiler does not unroll loops by default (except for MIPS in -O3 it seems, though I don't know why); you need to manually enable it with -OoLoopUnroll. But even then the contents of the loop you have are considered as too complex as only rather small loop contents will be unrolled (though one might argue that the compiler currently considers the loop content as more complex than it probably should).

-OoLoopUnroll does seem to do the job just fine, thanks for the tip!

Btw, maybe the code I posted yesterday can be rearranged so that one could use something like:
Code: Pascal  [Select]
  1.       r1:=v*m.m[0];
  2.       r2:=v*m.m[1];
  3.       r3=v*m.m[2];
  4.       r4:=v*m.m[3];
  5.       r1:=r1+r2;
  6.       r3:=r3+r4;
  7.       r1:=r1+r3;
  8.  

In the library the matrices are typically stored in row-major order, though column-major is common in legacy OpenGL; in either case, using transposed matrices is not a big issue.
The resulting assembly, however, looks amazing:

Code: [Select]
movq %rcx,%rax
movdqa (%rdx),%xmm0
mulps (%r8),%xmm0
movdqa (%rdx),%xmm0
mulps 16(%r8),%xmm0
movdqa (%rdx),%xmm0
mulps 32(%r8),%xmm0
movdqa (%rdx),%xmm0
mulps 48(%r8),%xmm0
movdqa (%rsp),%xmm0
addps 16(%rsp),%xmm0
movdqa 32(%rsp),%xmm0
addps 48(%rsp),%xmm0
movdqa (%rsp),%xmm0
addps 32(%rsp),%xmm0
vmovups (%rsp),%xmm0
vmovups %xmm0,(%rax)
leaq 72(%rsp),%rsp
ret

I have yet to check if the actual math is right, but it looks great, many thanks!

By the way, I'm not sure if "-Sv" (with the appropriate example that multiplies 4-sized arrays as if they were vectors) and "-OoLoopUnroll" are documented somewhere, because they seem to be very useful options.
Pages: [1] 2 3 ... 10

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus