* * *

Recent Posts

Pages: [1] 2 3 ... 10
1
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?
2
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.
3
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.
4
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.
5
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.)
6
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.
7
RichMemo / Re: Paragraph Formatting and Syriac fonts
« Last post by skalogryz on Today at 01:45:13 am »
Unfortunately, LineSpacing is the only option. There no APIs exposed to control the characters layout.

What you could try is inserting a character of a different height into the line.
That would cause the line to get some extra height.

It's a hacky way of doing things, but it is something to try.
8
FPSpreadsheet / I Can't Delete Rows??
« Last post by shobits1 on Today at 01:30:46 am »
I have workbook with two worksheet (Results, Config).

The problem is when ever I try to Delete Row from wsResults using :
Code: Pascal  [Select]
  1. wsResults.DeleteRow(iRow);

I get this exception:
Quote
Unknown Identifier: CONFIG!C4

I think the problem is within the expression parser, but I have 0 experience here; could you please fix this asap (or at least guide me to fix it).

BTW: the worksheet Results rely on Config worksheet to get some info, though it's obvious (the error message).

9
General / Re: The future of Free Pascal
« Last post by Akira1364 on Today at 01:30:03 am »
It was a DELL Inspiron 9100. This link shows the specs... 3.2Ghz.
   http://uk.pcmag.com/dell-inspiron-9100/28273/review/dell-inspiron-9100

Oh dear. P4. Most people rather forget that period :-)

Yeah... "3.2 ghz". Extra emphasis on the quotation marks!  ;)

I can't imagine how hot that thing must have gotten after running for a few hours. Also, why would you even bother upgrading the RAM on a machine that still has a terrible, terrible GPU like a Mobile Radeon 9700 (with a whopping 128 MB of VRAM!)
10
Mac OS X / Re: Compiling a GUI app on macOS
« Last post by Phil on Today at 01:14:57 am »
Phi and Alextp, when I said the GUI was broken and usuable, what I meant that the app was unresponsive: some panels could not be moved, and some buttons could not be clicked.

You did create the app bundle, right? That's a folder with an .app extension that contains Info.plist file, your executable, etc.

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