Windows fixes

This commit is contained in:
Jack Andersen 2019-02-23 22:42:33 -10:00
parent bff1dbbf66
commit 1b31a8fbc3
3 changed files with 20 additions and 22 deletions

View File

@ -56,10 +56,10 @@ set(RUNTIME_SOURCES_A
${AUTOMAPPER_SOURCES} ${AUTOMAPPER_SOURCES}
${CAMERA_SOURCES} ${CAMERA_SOURCES}
${CHARACTER_SOURCES} ${CHARACTER_SOURCES}
${COLLISION_SOURCES}) ${COLLISION_SOURCES}
${GRAPHICS_SOURCES})
set(RUNTIME_SOURCES_B set(RUNTIME_SOURCES_B
${GRAPHICS_SOURCES}
${GUISYS_SOURCES} ${GUISYS_SOURCES}
${INPUT_SOURCES} ${INPUT_SOURCES}
${PARTICLE_SOURCES} ${PARTICLE_SOURCES}

View File

@ -88,17 +88,17 @@ void main()
struct VertData struct VertData
{ {
float4 posIn : POSITION; float4 posIn : POSITION;
float4 uvIn : UV; float4 uvIn : UV0;
float4 uvNoiseIn : UV1;
}; };
cbuffer ThermalColdUniform : register(b0) cbuffer ThermalColdUniform : register(b0)
{ {
float4x4 shiftMtx;
float4x4 indMtx; float4x4 indMtx;
float4 shiftScale;
float4 colorReg0; float4 colorReg0;
float4 colorReg1; float4 colorReg1;
float4 colorReg2; float4 colorReg2;
float randOff;
}; };
struct VertToFrag struct VertToFrag
@ -109,8 +109,8 @@ struct VertToFrag
float4 colorReg1 : COLORREG1; float4 colorReg1 : COLORREG1;
float4 colorReg2 : COLORREG2; float4 colorReg2 : COLORREG2;
float2 sceneUv : SCENEUV; float2 sceneUv : SCENEUV;
float2 shiftUv : SHIFTUV; float2 noiseUv : NOISEUV;
float2 shiftScale : SHIFTSCALE; float randOff : RANDOFF;
}; };
VertToFrag main(in VertData v) VertToFrag main(in VertData v)
@ -121,9 +121,8 @@ VertToFrag main(in VertData v)
vtf.colorReg1 = colorReg1; vtf.colorReg1 = colorReg1;
vtf.colorReg2 = colorReg2; vtf.colorReg2 = colorReg2;
vtf.sceneUv = v.uvIn.xy; vtf.sceneUv = v.uvIn.xy;
vtf.sceneUv.y = 1.0 - vtf.sceneUv.y; vtf.noiseUv = v.uvNoiseIn.xy;
vtf.shiftUv = (mul(float3x3(shiftMtx[0].xyz, shiftMtx[1].xyz, shiftMtx[2].xyz), v.uvIn.xyz)).xy; vtf.randOff = randOff;
vtf.shiftScale = shiftScale.xy;
vtf.position = float4(v.posIn.xyz, 1.0); vtf.position = float4(v.posIn.xyz, 1.0);
return vtf; return vtf;
} }
@ -140,8 +139,8 @@ struct VertToFrag
float4 colorReg1 : COLORREG1; float4 colorReg1 : COLORREG1;
float4 colorReg2 : COLORREG2; float4 colorReg2 : COLORREG2;
float2 sceneUv : SCENEUV; float2 sceneUv : SCENEUV;
float2 shiftUv : SHIFTUV; float2 noiseUv : NOISEUV;
float2 shiftScale : SHIFTSCALE; float randOff : RANDOFF;
}; };
static int3 Lookup8BPP(float2 uv, float randOff) static int3 Lookup8BPP(float2 uv, float randOff)
@ -171,16 +170,16 @@ struct VertData
{ {
float4 posIn [[ attribute(0) ]]; float4 posIn [[ attribute(0) ]];
float4 uvIn [[ attribute(1) ]]; float4 uvIn [[ attribute(1) ]];
float4 uvNoiseIn [[ attribute(2) ]];
}; };
struct ThermalColdUniform struct ThermalColdUniform
{ {
float4x4 shiftMtx;
float4x4 indMtx; float4x4 indMtx;
float4 shiftScale;
float4 colorReg0; float4 colorReg0;
float4 colorReg1; float4 colorReg1;
float4 colorReg2; float4 colorReg2;
float randOff;
}; };
struct VertToFrag struct VertToFrag
@ -193,8 +192,8 @@ struct VertToFrag
float4 colorReg1; float4 colorReg1;
float4 colorReg2; float4 colorReg2;
float2 sceneUv; float2 sceneUv;
float2 shiftUv; float2 noiseUv;
float2 shiftScale; float randOff;
}; };
vertex VertToFrag vmain(VertData v [[ stage_in ]], constant ThermalColdUniform& tcu [[ buffer(2) ]]) vertex VertToFrag vmain(VertData v [[ stage_in ]], constant ThermalColdUniform& tcu [[ buffer(2) ]])
@ -207,9 +206,8 @@ vertex VertToFrag vmain(VertData v [[ stage_in ]], constant ThermalColdUniform&
vtf.colorReg1 = tcu.colorReg1; vtf.colorReg1 = tcu.colorReg1;
vtf.colorReg2 = tcu.colorReg2; vtf.colorReg2 = tcu.colorReg2;
vtf.sceneUv = v.uvIn.xy; vtf.sceneUv = v.uvIn.xy;
vtf.sceneUv.y = 1.0 - vtf.sceneUv.y; vtf.noiseUv = v.uvNoiseIn.xy;
vtf.shiftUv = (float3x3(tcu.shiftMtx[0].xyz, tcu.shiftMtx[1].xyz, tcu.shiftMtx[2].xyz) * v.uvIn.xyz).xy; vtf.randOff = tcu.randOff;
vtf.shiftScale = tcu.shiftScale.xy;
vtf.position = float4(v.posIn.xyz, 1.0); vtf.position = float4(v.posIn.xyz, 1.0);
return vtf; return vtf;
} }
@ -225,8 +223,8 @@ struct VertToFrag
float4 colorReg1; float4 colorReg1;
float4 colorReg2; float4 colorReg2;
float2 sceneUv; float2 sceneUv;
float2 shiftUv; float2 noiseUv;
float2 shiftScale; float randOff;
}; };
static uint2 Lookup8BPP(float2 uv, float randOff) static uint2 Lookup8BPP(float2 uv, float randOff)

@ -1 +1 @@
Subproject commit 075a4d41db39d25240d2eac548459d9fddebff33 Subproject commit 935f781e03a7f23b17d202ce8740a4b32a06140a