Lazarus
Programming => Graphics and Multimedia => Graphics => Topic started by: abtaylr on June 14, 2016, 08:12:40 pm
-
I am having difficulty with BGRABitmap. I downloaded the latest version 8.9.2 after opening in Package -> Open Package File, I attempt to compile but I have received numerous errors:
bgradefaultbitmap.pas(2821,3) Error: Asm: [movq mem??,reg64] invalid combination of opcode and operands
I haven't found the offending asm code. I wonder if the problem might be a compiler flag setting -- e.g. AT&T vs. Intel.
-
The errors are all within the file BGRAdefaultbitmap.pas . There are about 25 of them.
procedure TBGRADefaultBitmap.FillQuadLinearColor(pt1, pt2, pt3, pt4: TPointF;
c1, c2, c3, c4: TBGRAPixel);
. . . .
FillTriangleLinearColor(pt1,pt2,center, c1,c2,centerColor);
FillTriangleLinearColor(pt2,pt3,center, c2,c3,centerColor);
FillTriangleLinearColor(pt3,pt4,center, c3,c4,centerColor);
FillTriangleLinearColor(pt4,pt1,center, c4,c1,centerColor);
end;
procedure TBGRADefaultBitmap.FillQuadLinearMappingLightness(pt1, pt2, pt3,
pt4: TPointF; texture: IBGRAScanner; tex1, tex2, tex3, tex4: TPointF; light1,
light2, light3, light4: word; TextureInterpolation: Boolean);
. . . .
FillTriangleLinearMappingLightness(pt1,pt2,center, texture,tex1,tex2,centerTex, light1,light2,centerLight, TextureInterpolation);
FillTriangleLinearMappingLightness(pt2,pt3,center, texture,tex2,tex3,centerTex, light2,light3,centerLight, TextureInterpolation);
FillTriangleLinearMappingLightness(pt3,pt4,center, texture,tex3,tex4,centerTex, light3,light4,centerLight, TextureInterpolation);
FillTriangleLinearMappingLightness(pt4,pt1,center, texture,tex4,tex1,centerTex, light4,light1,centerLight, TextureInterpolation);
end;
procedure BGRAGradientFill(bmp: TBGRACustomBitmap; x, y, x2, y2: integer;
c1, c2: TBGRAPixel; gtype: TGradientType; o1, o2: TPointF; mode: TDrawMode;
gammaColorCorrection: boolean = True; Sinus: Boolean=False);
begin
bmp.GradientFill(x,y,x2,y2,c1,c2,gtype,o1,o2,mode,gammaColorCorrection,sinus);
end;
I am running Kubuntu 16.04 64bit
-
While tracing back through the code, I came upon BGRAPoligonAliased.pas which shows Intel code.
-
When I have encountered Intel code previously in Lazarus, I have had to convert over to AT&T to get passed the problem. I have looked at the compiler flags, but don't see one dealing with AT&T vs. Intel. I noticed that this version has only been released earlier today. There might be a problem in the release -- small error somewhere, etc. Hopefully, the developer can take a look.
-
In problematic unit, add {$asmmode intel} after {$mode <x>}{$H+} switches.
-
I have the same error in my own code:
/home/runner/work/ApusGameEngine/ApusGameEngine/Apus.Engine.ShadersGL.pas(639,3) Error: (8007) Asm: [movq mem??,reg64] invalid combination of opcode and operands
however, there is no ASM code in that unit. Moreover, this happens only when the target is Linux and at the GitHub servers only: https://github.com/Cooler2/ApusGameEngine/runs/4908563676?check_suite_focus=true
The same Lazarus version on my own PC compiles the code without errors, so it looks very strange.