Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
local ui = Engine.ui | |
local CheatList = ui:VBox() | |
local cheatMission = function (loaded) | |
local cheats = { | |
{'Add cash', function () Game.player:AddMoney(100000) end}, | |
{'Refuel (prop tank)', function () Game.player:SetFuelPercent() end}, |
#include <immintrin.h> | |
#include <intrin.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
union Mat44 { | |
float m[4][4]; | |
__m128 row[4]; | |
}; |
function Space:SpawnShipTest(range) | |
ship = Space.SpawnShip("eagle_lrf", range, range) | |
ship:AddEquip("DRIVE_CLASS1") | |
ship:AddEquip("AUTOPILOT") | |
ship:AddEquip("WATER", 7) | |
targ = Game.player:GetNavTarget() | |
ship:AIFlyTo(targ) | |
Game.player:SetNavTarget(ship) | |
end |
Weird rendering problem: | |
We need to render a 3D object such that the z values getting passed on to depth test/write for all pixels | |
are all exactly the same value (constant per batch), and we need to be able to choose that value freely. | |
This is what we'd like to do, but it doesn't work: | |
// at the end of the VS | |
out.pos.z = ourZValue * out.pos.w; |
Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
why doesn't radfft support AVX on PC?
So there's two separate issues here: using instructions added in AVX and using 256-bit wide vectors. The former turns out to be much easier than the latter for our use case.
Problem number 1 was that you positively need to put AVX code in a separate file with different compiler settings (/arch:AVX for VC++, -mavx for GCC/Clang) that make all SSE code emitted also use VEX encoding, and at the time radfft was written there was no way in CDep to set compiler flags for just one file, just for the overall build.
[There's the GCC "target" annotations on individual funcs, which in principle fix this, but I ran into nasty problems with this for several compiler versions, and VC++ has no equivalent, so we're not currently using that and just sticking with different compilation units.]
The other issue is to do with CPU power management.