When were control flow features added to CoreImage? - ios

I remember in years prior (under the Unsupported Items header) that I could not use if for while when writing CoreImage kernels, but now I can (under the Control Flow header).
What version of macOS and iOS first allow this language style?
Note that I do see the different copyright years, but that's not definitive as to what version of the OS it correlates to.

I was watching the 2015 WWDC videos and found that it was noted as a new feature for that convention. Seeing as OS X 10.11 was released 30 September 2015, it would be logical that that would be the first OS release that supported this feature.

Related

How to detect Windows 11 using Delphi 10.3.3

I use TOSVersion.ToString function (uses SysUtils) to detect Windows version. However this is what I get in Windows11:
Windows 10 (Version 10.0, Build 21996, 64-bit Edition)
Is there any reliable way to detect Windows 11? I'm using Delphi 10.3.3.
UPDATE: Windows 11 is officially released and I tried again.
Here is what I get:
Windows 10 (Version 10.0, Build 22000, 64-bit Edition)
As Remy pointed out: using the WinAPI you risk of being in some compatibility mode, resulting in getting a version reported that is lower than the actual.
One alternative is to check the file version of expected files, i.e.
%windir%\system32\ntoskrnl.exe or
%windir%\explorer.exe
using GetFileVersionInfo() and VerQueryValue() - the HiWord(dwFileVersionLS)
should be 22000 or higher (according to Windows NT build/release number).
Another is to look in the Registry under HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ at the text values CurrentBuild and CurrentBuildNumber, checking if the highest of both is 22000 or higher.
David already wrote a detailled answer in Checking Windows version on W10 with even more alternatives, although concentrating on the high/low version numbers, not the build. But WMI might help.
(This only works in retrospective with confirmed knowledge.) Check which API exports are available: the idea is that specific functions were introduced with specific Windows releases/versions, so if importing fails for one you know you're on a version below. An outdated example and an outdated list of minimum versions per function will give you an idea. Now you "only" have to find out which new functions are introduced with Windows 11.
Those are all not bulletproof, but you could combine them and then draw conclusions. And after all that you can still try your approach to parse texts instead of relying on numbers only. It also shows how easily you can manipulate your system into reporting different versions as per which method is used.
Official major version number for Windows 11 is 10.
The official build number for the public preview of Windows 11 is
10.0.22000.168
Earlier builds:
10.0.22000.71
10.0.22000.65
10.0.22000.51
Microsoft Windows 11 FAQ
If you want to detect Preview versions, earliest build number was 10.0.22000.51 Windows 11 version history
TOSVersion relies on some hard coded names and logic to return OS name. You will have to implement your own detection, copy and modify TOSVersion record or make wrapper around it, where you can use existing logic for older versions and implement check based on Windows 11 build number to detect Windows 11.
For other general issues and approaches in detecting OS version you can refer to AmigoJack's answer
Except the very weak, atleast for me, solution of considering Windows 10 builds greater than 22000, such as Windows 11, the only solution I found which is actually working is the WMIs Win32_OperatingSystem class - Caption property.
On my dev Win10 machine, it gives the following string: Microsoft Windows 10 Pro.
On my another dev machine, with Win11 installed, the same function gives: Microsoft Windows 11 Pro.
The difference is in string values - "10" vs "11"- but this is at least something far better than the "build greater than" solution.
C# and C++ work well.
The simplest way is to get the version of Kernel32.dll and if Major Version is 10 and Build Version is >= 22000 then you have Windows 11.
See my code here: How can I find the Windows product name in Windows 11?

Availability of older Metal Feature Set Table documents?

Does anyone know of the availability of older versions of Apple's Metal Feature Set Table document?
The current Metal 3.0 document references only the beta MTLGPUFamily and MTLSoftwareVersion enums...and does not document the older MTLFeatureSet enum...which is needed to determine runtime feature availability on devices running current and earlier macOS and iOS versions.
To the best of my knowledge, the Metal Feature Set Tables for 2017 and 2018 are no longer hosted by Apple.

Add DirectX-9 to inno-setup installer

I have an old software that uses DirectX 9. It's quite obsolete but there are still people using it.
Win10 does not come with DX9 preinstalled and I want to add it to my installer. So far I see that there's a large (100mb) DX package from Microsoft that contains all the versions and builds of DX9 and 10. (http://www.microsoft.com/downloads/en/details.aspx?FamilyID=2da43d38-db71-4c1b-bc6a-9b6652cd92a3&displaylang=en)
Among the many version, I see, for example, "Jun2010_d3dx9_43_x86.cab" that contains the .dll, .cat and .inf. I'd say that this is sufficient for what I need so I'd add this to my program's installer (inno-setup).
I am a bit outdated on DX and DLLs knowledge. Can someone give some pointers on how to proceed and if it's right installing only one of that dll?
Thanks!
DirectX 9.0c does in fact come with Windows 10. Starting with Windows XP Service Pack 2, the "DirectX End-user Runtime" never installs DirectX on any version of Windows. The only way to update "DirectX" is to install a Service Pack, a Windows Update, or move to a new version of Windows.
See Not So Direct Setup for the full story here.
Your old application, however, likely does rely on some optional side-by-side components like D3DX9, D3DX10, D3DX11, XAudio2_7, XInput1_3, D3DCompile #43, Managed DirectX 1.1, or other thing that is only deployed by the legacy DirectX End-User Runtime. In that case, you should download the latest DXSETUP package (the April 2011 refresh of the end-of-life DirectX SDK June 2010 release on MSDN).
You can then configure a minimal package that will deploy just the DLLs you actually use. For example, if you used the D3DX9 June 2010 DirectX SDK for a 32-bit application, but that's all you needed, you can get away with an install package of just:
dxsetup.exe
dsetup32.dll
dsetup.dll
dxupdate.cab
Jun2010_d3dx9_43_x86.cab
Of course, if your application is old enough to be using a previous version of D3DX9, then you need to figure that out and use the right .cab.
See Where is the DirectX SDK? as well.

Is there a API to know current iOS/Mac is 64bit OS or 32 bit OS?

Do you know any API can tell me the bitness of current OS(iOS and MacOSX)? can we assume MacOSX is 64bit?
In general, you can assume OS X is 64-bit based on the OS version.
(more specifically the Cocoa version.)
More importantly, you have to ask yourself what you are trying to accomplish.
In general, the Frameworks protect you from needing to think about this most of the time, especially in Objective-C land.
If you stay in Objective-C land, you can go simple with macros:
CGFLOAT_IS_DOUBLE (from CGGeometry.h)
NSObjCRuntime.h defines NSInteger and NSUInteger.
The macro LP64 found there indicates 64-bit integers
https://developer.apple.com/library/Mac/DOCUMENTATION/Cocoa/Conceptual/Cocoa64BitGuide/64BitChangesCocoa/64BitChangesCocoa.html
In general if you try to use NSInteger, NSUInteger and CGFloat, you don't need to think about it.
If you want to know more specifically about the core C type sizes, you want to learn about the standard models created. LP64 ILP64 LLP64 ILP32 LP32
These indicate what to expect. You can't really actually assume there is one model for 64-bit.
You can have different integer and float max lengths depending on architecture.
Depending on system, you could even have an emulation of a type length.
http://www.unix.org/version2/whatsnew/lp64_wp.html
These are defined with macros like LP64
You can find these in CFBase.h
But the real question is still, what are you trying to do?
Please check this. This may help you.
You can see which kernel you are using in System Profiler:
Choose About This Mac from the Apple () menu.
Click More Info.
Select Software in the Contents pane.
Look for "64-bit Kernel and Extensions: Yes (or No)" under the System Software Overview heading.
These Macs use the 64-bit kernel by default in Mac OS X v10.6.
Mac Pro (Mid 2010)
MacBook Pro (Early 2011)
iMac (21.5-inch and 27-inch, Mid 2011)
These Macs use the 64-bit kernel by default in Mac OS X Server v10.6 (they can also use the 64-bit kernel in Mac OS X v10.6, but do not use it by default).
Xserve (Early 2008) and later
Mac Pro (Early 2008) and later
Mac mini (Mid 2010)
These Macs support the 64-bit kernel, but do not use it by default.
iMac (Early 2008) and later
MacBook Pro (Early 2008 through Mid 2010)

Target a commonly-available runtime version of Direct3D

I would like to add Direct3D as an optional graphics backend of a 2D game to get around DirectDraw's limitations (such as the horrid DirectDraw emulation in Windows 8).
Can I do this in such a way that the majority of users would not need to install anything? I noticed that Windows XP comes with some Direct3D files, can I target that version of the runtime?
According to John McCaskey, a software engineer on Steam:
Games which don't use the D3DX helpers (such as Source engine games) don't require running the annoying installer on first launch as they only depend on major d3d9/10/11 versions being installed. However, games that do use D3DX must run it as it's the only way Microsoft has allowed for distributing and checking the version info on the files.
Thus, using Direct3D 9 (d3d9.h) directly should be fine, assuming the user has some version of DirectX 9 installed.
Source: Why Steam Makes You Reinstall DirectX - Rock, Paper, Shotgun

Resources