3Dmigoto now open-source...
  75 / 143    
This is not really 3D related, but I'm trying to do a HUD toggle for Infinite Warfare. I've managed to make all HUD shaders toggle except one, it went "boop" when I marked it so assume it didn't export correctly. Anyway here's the shader in question, would really appreciate if someone could help me fix it (if that's even possible?) [code]// ---- Created with 3Dmigoto v1.2.43 on Mon Nov 07 21:06:24 2016 Texture2D<float4> t4 : register(t4); Texture2D<float4> t3 : register(t3); Texture2D<float4> t2 : register(t2); Texture3D<float4> t1 : register(t1); Texture2D<float4> t0 : register(t0); SamplerState s4_s : register(s4); SamplerState s3_s : register(s3); SamplerState s2_s : register(s2); SamplerState s1_s : register(s1); SamplerState s0_s : register(s0); cbuffer cb13 : register(b13) { float4 cb13[3]; } cbuffer cb2 : register(b2) { float4 cb2[24]; } // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( float4 v0 : SV_POSITION0, float4 v1 : COLOR0, float2 v2 : TEXCOORD0, float2 w2 : TEXCOORD11, float2 v3 : TEXCOORD12, float2 w3 : TEXCOORD16, out float4 o0 : SV_TARGET0) { float4 r0,r1,r2,r3,r4,r5,r6; uint4 bitmask, uiDest; float4 fDest; r0.x = cmp(0 < cb2[16].w); if (r0.x != 0) { r0.yz = cb2[16].yx * v0.yx; r0.yz = floor(r0.yz); r1.xy = float2(2.33999991,0.800000012) * cb2[17].zw; r0.w = frac(r1.x); r0.w = 0.100000001 + r0.w; r0.yz = r0.yz + r0.ww; r1.xz = float2(0.554549694,0.308517009) * r0.zy; r1.xz = frac(r1.xz); r0.yz = r0.zy * r1.xz + r0.yz; r0.y = r0.y * r0.z; r0.y = frac(r0.y); r0.y = 678.900024 * r0.y; r0.y = frac(r0.y); r0.z = cmp(r0.y < r1.y); r0.y = r0.y / r1.y; r0.y = r0.y * 2 + -1; r1.xy = ddx_coarse(v2.xy); r1.xy = cb2[17].xx * r1.xy; r0.yw = r1.xy * r0.yy + v2.xy; r0.yz = r0.zz ? r0.yw : v2.xy; } else { r0.yz = v2.xy; } r1.xyzw = t0.SampleBias(s0_s, r0.yz, cb2[23].y).xyzw; r1.xyzw = v1.xyzw * r1.xyzw; r0.y = t3.Sample(s3_s, w2.xy).x; r0.z = t4.Sample(s4_s, v3.xy).x; r0.y = r0.y * r0.z; r0.y = cb2[9].x * r0.y; r0.y = cb2[9].y * r0.y; r2.w = r1.w * r0.y; r0.y = cmp(r2.w == 0.000000); if (r0.y != 0) { if (-1 != 0) discard; } r0.yzw = r1.xyz * r1.xyz; r1.x = cmp(0 < cb2[13].x); if (r1.x != 0) { r1.xy = -cb2[15].xy + v0.xy; r1.xy = cb2[15].zw * r1.xy; r1.xyz = t2.SampleLevel(s2_s, r1.xy, cb2[13].x).xyz; r3.xyz = cmp(r1.xyz < cb13[0].xxx); r4.xyzw = r3.xxxx ? cb13[2].xyzw : cb13[1].xyzw; r1.xw = r4.xy * r1.xx + r4.zw; r4.x = saturate(r1.x / r1.w); r5.xyzw = r3.yyyy ? cb13[2].xyzw : cb13[1].xyzw; r1.xy = r5.xy * r1.yy + r5.zw; r4.y = saturate(r1.x / r1.y); r3.xyzw = r3.zzzz ? cb13[2].xyzw : cb13[1].xyzw; r1.xy = r3.xy * r1.zz + r3.zw; r4.z = saturate(r1.x / r1.y); r1.x = saturate(dot(r4.xyz, cb2[20].xyz)); r1.y = saturate(dot(r4.xyz, cb2[21].xyz)); r1.z = saturate(dot(r4.xyz, cb2[22].xyz)); r1.xyz = log2(r1.xyz); r1.xyz = float3(0.416666657,0.416666657,0.416666657) * r1.xyz; r1.xyz = exp2(r1.xyz); r1.xyz = r1.xyz * float3(1.05499995,1.05499995,1.05499995) + float3(-0.0549999997,-0.0549999997,-0.0549999997); r1.xyz = max(float3(0,0,0), r1.xyz); r1.xyz = r1.xyz * float3(0.96875,0.96875,0.96875) + float3(0.015625,0.015625,0.015625); r1.xyz = t1.SampleLevel(s1_s, r1.xyz, 0).xyz; r0.yzw = r1.xyz * r0.yzw; } r1.x = cmp(0 < cb2[14].w); if (r1.x != 0) { r1.x = (uint)cb2[14].z; r1.xy = (int2)r1.xx & int2(1,2); r1.zw = float2(1,0.5) * v0.xy; r1.zw = floor(r1.zw); r1.xz = r1.xx ? v0.xy : r1.zw; r1.z = cb2[14].y * r1.z; r1.y = r1.y ? 0 : r1.z; r1.x = r1.x + r1.y; r1.x = r1.x / cb2[14].x; r1.x = frac(r1.x); r1.xy = cmp(r1.xx < float2(0.333000004,0.666000009)); r1.zw = cb2[14].ww * float2(1,-1) + float2(1,1); r3.xy = cb2[14].ww * float2(-1,1) + float2(1,1); r3.yz = r1.yy ? r1.zw : r3.xy; r1.yzw = cb2[14].www * float3(1,-1,-1) + float3(1,1,1); r3.x = 1 + -cb2[14].w; r1.xyz = r1.xxx ? r1.yzw : r3.xyz; r0.yzw = r1.xyz * r0.yzw; } if (r0.x != 0) { r1.xyzw = cb2[16].xyzw * v0.xyxy; r1.xyz = floor(r1.xyz); r3.xyzw = float4(8,2.33999991,0.200000003,0.5) * cb2[17].wzww; r0.x = frac(r3.y); r0.x = 0.100000001 + r0.x; r1.xy = r1.yx + r0.xx; r4.xy = float2(0.554549694,0.308517009) * r1.yx; r4.xy = frac(r4.xy); r1.xy = r1.yx * r4.xy + r1.xy; r0.x = r1.x * r1.y; r0.x = frac(r0.x); r1.x = cmp(r0.x < r3.z); r4.xyz = float3(92.1419983,12.3450003,9.12300014) * r0.xxx; r4.xyz = frac(r4.xyz); r5.xz = r4.xx * r0.yw; r0.x = 1 + -r4.x; r5.y = r0.z * r0.x; r5.xyz = r1.xxx ? r5.xyz : r0.yzw; r0.x = cmp(r4.y < r3.w); r1.x = 0.333333343 * r1.z; r1.xw = frac(r1.xw); r1.xy = cmp(r1.xx < float2(0.330000013,0.660000026)); r6.yz = r1.yy ? float2(1,0.200000003) : float2(0.200000003,1); r6.x = 0.200000003; r1.xyz = r1.xxx ? float3(1,0.200000003,0.200000003) : r6.xyz; r1.xyz = r5.xyz * r1.xyz; r1.xyz = r0.xxx ? r1.xyz : r5.xyz; r0.x = r4.z * r4.z; r0.x = cb2[17].w * r0.x; r0.x = saturate(-r0.x * 3 + 1); r1.w = r1.w * 2 + -1; r3.x = saturate(r3.x); r1.w = -abs(r1.w) * r3.x + 1; r0.x = min(r1.w, r0.x); r2.w = r2.w * r0.x; r0.yzw = r1.xyz * r0.xxx; } r0.x = cmp(0 < cb2[12].x); if (r0.x != 0) { r1.xy = ddx_fine(v3.wz); r1.zw = ddy_fine(v3.wz); r0.x = r1.x * r1.w; r0.x = r1.y * r1.z + -r0.x; r0.x = 1 / r0.x; r3.xyzw = float4(1,-1,-1,1) * r1.zwxy; r1.xyzw = r3.xyzw * r0.xxxx; r0.x = dot(r1.xz, r1.xz); r3.x = sqrt(r0.x); r0.x = dot(r1.yw, r1.yw); r3.y = sqrt(r0.x); r1.xy = w3.xy * r3.xy; r1.zw = w3.xy * r3.xy + -r3.xy; r1.xy = max(-r1.xy, r1.zw); r1.zw = max(float2(0,0), r1.xy); r0.x = dot(r1.zw, r1.zw); r0.x = sqrt(r0.x); r1.x = max(r1.x, r1.y); r1.x = min(0, r1.x); r0.x = r1.x + r0.x; r0.x = -1 + r0.x; r0.x = saturate(-0.5 * r0.x); r1.x = r0.x * -2 + 3; r0.x = r0.x * r0.x; r0.x = r1.x * r0.x; r2.w = r2.w * r0.x; } r2.xyz = sqrt(r0.yzw); o0.xyzw = min(float4(32255,32255,32255,32255), r2.xyzw); return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) D3D Shader Disassembler // // using 3Dmigoto v1.2.43 on Mon Nov 07 21:06:24 2016 // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_POSITION 0 xyzw 0 POS float xy // COLOR 0 xyzw 1 NONE float xyzw // TEXCOORD 0 xy 2 NONE float xy // TEXCOORD 11 zw 2 NONE float zw // TEXCOORD 12 xy 3 NONE float xy // TEXCOORD 16 zw 3 NONE float zw // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_TARGET 0 xyzw 0 TARGET float xyzw // ps_5_0 dcl_globalFlags refactoringAllowed dcl_constantbuffer cb2[24], immediateIndexed dcl_constantbuffer cb13[3], immediateIndexed dcl_sampler s0, mode_default dcl_sampler s1, mode_default dcl_sampler s2, mode_default dcl_sampler s3, mode_default dcl_sampler s4, mode_default dcl_resource_texture2d (float,float,float,float) t0 dcl_resource_texture3d (float,float,float,float) t1 dcl_resource_texture2d (float,float,float,float) t2 dcl_resource_texture2d (float,float,float,float) t3 dcl_resource_texture2d (float,float,float,float) t4 dcl_input_ps_siv linear noperspective v0.xy, position dcl_input_ps linear v1.xyzw dcl_input_ps linear v2.xy dcl_input_ps linear v2.zw dcl_input_ps linear v3.xy dcl_input_ps linear v3.zw dcl_output o0.xyzw dcl_temps 7 lt r0.x, l(0.000000), cb2[16].w if_nz r0.x mul r0.yz, v0.yyxy, cb2[16].yyxy round_ni r0.yz, r0.yyzy mul r1.xy, cb2[17].zwzz, l(2.340000, 0.800000, 0.000000, 0.000000) frc r0.w, r1.x add r0.w, r0.w, l(0.100000) add r0.yz, r0.wwww, r0.yyzy mul r1.xz, r0.zzyz, l(0.554549694, 0.000000, 0.308517, 0.000000) frc r1.xz, r1.xxzx mad r0.yz, r0.zzyz, r1.xxzx, r0.yyzy mul r0.y, r0.z, r0.y frc r0.y, r0.y mul r0.y, r0.y, l(678.900024) frc r0.y, r0.y lt r0.z, r0.y, r1.y div r0.y, r0.y, r1.y mad r0.y, r0.y, l(2.000000), l(-1.000000) deriv_rtx_coarse r1.xy, v2.xyxx mul r1.xy, r1.xyxx, cb2[17].xxxx mad r0.yw, r1.xxxy, r0.yyyy, v2.xxxy movc r0.yz, r0.zzzz, r0.yywy, v2.xxyx else mov r0.yz, v2.xxyx endif sample_b_indexable(texture2d)(float,float,float,float) r1.xyzw, r0.yzyy, t0.xyzw, s0, cb2[23].y mul r1.xyzw, r1.xyzw, v1.xyzw sample_indexable(texture2d)(float,float,float,float) r0.y, v2.zwzz, t3.yxzw, s3 sample_indexable(texture2d)(float,float,float,float) r0.z, v3.xyxx, t4.yzxw, s4 mul r0.y, r0.z, r0.y mul r0.y, r0.y, cb2[9].x mul r0.y, r0.y, cb2[9].y mul r2.w, r0.y, r1.w eq r0.y, r2.w, l(0.000000) if_nz r0.y discard_nz l(-1) endif mul r0.yzw, r1.xxyz, r1.xxyz lt r1.x, l(0.000000), cb2[13].x if_nz r1.x add r1.xy, v0.xyxx, -cb2[15].xyxx mul r1.xy, r1.xyxx, cb2[15].zwzz sample_l_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t2.xyzw, s2, cb2[13].x lt r3.xyz, r1.xyzx, cb13[0].xxxx movc r4.xyzw, r3.xxxx, cb13[2].xyzw, cb13[1].xyzw mad r1.xw, r4.xxxy, r1.xxxx, r4.zzzw div_sat r4.x, r1.x, r1.w movc r5.xyzw, r3.yyyy, cb13[2].xyzw, cb13[1].xyzw mad r1.xy, r5.xyxx, r1.yyyy, r5.zwzz div_sat r4.y, r1.x, r1.y movc r3.xyzw, r3.zzzz, cb13[2].xyzw, cb13[1].xyzw mad r1.xy, r3.xyxx, r1.zzzz, r3.zwzz div_sat r4.z, r1.x, r1.y dp3_sat r1.x, r4.xyzx, cb2[20].xyzx dp3_sat r1.y, r4.xyzx, cb2[21].xyzx dp3_sat r1.z, r4.xyzx, cb2[22].xyzx log r1.xyz, r1.xyzx mul r1.xyz, r1.xyzx, l(0.416666657, 0.416666657, 0.416666657, 0.000000) exp r1.xyz, r1.xyzx mad r1.xyz, r1.xyzx, l(1.055000, 1.055000, 1.055000, 0.000000), l(-0.055000, -0.055000, -0.055000, 0.000000) max r1.xyz, r1.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000) mad r1.xyz, r1.xyzx, l(0.968750, 0.968750, 0.968750, 0.000000), l(0.015625, 0.015625, 0.015625, 0.000000) sample_l_indexable(texture3d)(float,float,float,float) r1.xyz, r1.xyzx, t1.xyzw, s1, l(0.000000) mul r0.yzw, r0.yyzw, r1.xxyz endif lt r1.x, l(0.000000), cb2[14].w if_nz r1.x ftou r1.x, cb2[14].z and r1.xy, r1.xxxx, l(1, 2, 0, 0) mul r1.zw, v0.xxxy, l(0.000000, 0.000000, 1.000000, 0.500000) round_ni r1.zw, r1.zzzw movc r1.xz, r1.xxxx, v0.xxyx, r1.zzwz mul r1.z, r1.z, cb2[14].y movc r1.y, r1.y, l(0), r1.z add r1.x, r1.y, r1.x div r1.x, r1.x, cb2[14].x frc r1.x, r1.x lt r1.xy, r1.xxxx, l(0.333000, 0.666000, 0.000000, 0.000000) mad r1.zw, cb2[14].wwww, l(0.000000, 0.000000, 1.000000, -1.000000), l(0.000000, 0.000000, 1.000000, 1.000000) mad r3.xy, cb2[14].wwww, l(-1.000000, 1.000000, 0.000000, 0.000000), l(1.000000, 1.000000, 0.000000, 0.000000) movc r3.yz, r1.yyyy, r1.zzwz, r3.xxyx mad r1.yzw, cb2[14].wwww, l(0.000000, 1.000000, -1.000000, -1.000000), l(0.000000, 1.000000, 1.000000, 1.000000) add r3.x, -cb2[14].w, l(1.000000) movc r1.xyz, r1.xxxx, r1.yzwy, r3.xyzx mul r0.yzw, r0.yyzw, r1.xxyz endif if_nz r0.x mul r1.xyzw, v0.xyxy, cb2[16].xyzw round_ni r1.xyz, r1.xyzx mul r3.xyzw, cb2[17].wzww, l(8.000000, 2.340000, 0.200000, 0.500000) frc r0.x, r3.y add r0.x, r0.x, l(0.100000) add r1.xy, r0.xxxx, r1.yxyy mul r4.xy, r1.yxyy, l(0.554549694, 0.308517, 0.000000, 0.000000) frc r4.xy, r4.xyxx mad r1.xy, r1.yxyy, r4.xyxx, r1.xyxx mul r0.x, r1.y, r1.x frc r0.x, r0.x lt r1.x, r0.x, r3.z mul r4.xyz, r0.xxxx, l(92.141998, 12.345000, 9.123000, 0.000000) frc r4.xyz, r4.xyzx mul r5.xz, r0.yywy, r4.xxxx add r0.x, -r4.x, l(1.000000) mul r5.y, r0.x, r0.z movc r5.xyz, r1.xxxx, r5.xyzx, r0.yzwy lt r0.x, r4.y, r3.w mul r1.x, r1.z, l(0.333333343) frc r1.xw, r1.xxxw lt r1.xy, r1.xxxx, l(0.330000, 0.660000, 0.000000, 0.000000) movc r6.yz, r1.yyyy, l(0,1.000000,0.200000,0), l(0,0.200000,1.000000,0) mov r6.x, l(0.200000) movc r1.xyz, r1.xxxx, l(1.000000,0.200000,0.200000,0), r6.xyzx mul r1.xyz, r1.xyzx, r5.xyzx movc r1.xyz, r0.xxxx, r1.xyzx, r5.xyzx mul r0.x, r4.z, r4.z mul r0.x, r0.x, cb2[17].w mad_sat r0.x, -r0.x, l(3.000000), l(1.000000) mad r1.w, r1.w, l(2.000000), l(-1.000000) mov_sat r3.x, r3.x mad r1.w, -|r1.w|, r3.x, l(1.000000) min r0.x, r0.x, r1.w mul r2.w, r0.x, r2.w mul r0.yzw, r0.xxxx, r1.xxyz endif lt r0.x, l(0.000000), cb2[12].x if_nz r0.x deriv_rtx_fine r1.xy, v3.wzww deriv_rty_fine r1.zw, v3.wwwz mul r0.x, r1.w, r1.x mad r0.x, r1.y, r1.z, -r0.x div r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x mul r3.xyzw, r1.zwxy, l(1.000000, -1.000000, -1.000000, 1.000000) mul r1.xyzw, r0.xxxx, r3.xyzw dp2 r0.x, r1.xzxx, r1.xzxx sqrt r3.x, r0.x dp2 r0.x, r1.ywyy, r1.ywyy sqrt r3.y, r0.x mul r1.xy, r3.xyxx, v3.zwzz mad r1.zw, v3.zzzw, r3.xxxy, -r3.xxxy max r1.xy, r1.zwzz, -r1.xyxx max r1.zw, r1.xxxy, l(0.000000, 0.000000, 0.000000, 0.000000) dp2 r0.x, r1.zwzz, r1.zwzz sqrt r0.x, r0.x max r1.x, r1.y, r1.x min r1.x, r1.x, l(0.000000) add r0.x, r0.x, r1.x add r0.x, r0.x, l(-1.000000) mul_sat r0.x, r0.x, l(-0.500000) mad r1.x, r0.x, l(-2.000000), l(3.000000) mul r0.x, r0.x, r0.x mul r0.x, r0.x, r1.x mul r2.w, r0.x, r2.w endif sqrt r2.xyz, r0.yzwy min o0.xyzw, r2.xyzw, l(32255.000000, 32255.000000, 32255.000000, 32255.000000) ret // Approximately 0 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/[/code]
This is not really 3D related, but I'm trying to do a HUD toggle for Infinite Warfare. I've managed to make all HUD shaders toggle except one, it went "boop" when I marked it so assume it didn't export correctly.

Anyway here's the shader in question, would really appreciate if someone could help me fix it (if that's even possible?)

// ---- Created with 3Dmigoto v1.2.43 on Mon Nov 07 21:06:24 2016
Texture2D<float4> t4 : register(t4);

Texture2D<float4> t3 : register(t3);

Texture2D<float4> t2 : register(t2);

Texture3D<float4> t1 : register(t1);

Texture2D<float4> t0 : register(t0);

SamplerState s4_s : register(s4);

SamplerState s3_s : register(s3);

SamplerState s2_s : register(s2);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

cbuffer cb13 : register(b13)
{
float4 cb13[3];
}

cbuffer cb2 : register(b2)
{
float4 cb2[24];
}




// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main(
float4 v0 : SV_POSITION0,
float4 v1 : COLOR0,
float2 v2 : TEXCOORD0,
float2 w2 : TEXCOORD11,
float2 v3 : TEXCOORD12,
float2 w3 : TEXCOORD16,
out float4 o0 : SV_TARGET0)
{
float4 r0,r1,r2,r3,r4,r5,r6;
uint4 bitmask, uiDest;
float4 fDest;

r0.x = cmp(0 < cb2[16].w);
if (r0.x != 0) {
r0.yz = cb2[16].yx * v0.yx;
r0.yz = floor(r0.yz);
r1.xy = float2(2.33999991,0.800000012) * cb2[17].zw;
r0.w = frac(r1.x);
r0.w = 0.100000001 + r0.w;
r0.yz = r0.yz + r0.ww;
r1.xz = float2(0.554549694,0.308517009) * r0.zy;
r1.xz = frac(r1.xz);
r0.yz = r0.zy * r1.xz + r0.yz;
r0.y = r0.y * r0.z;
r0.y = frac(r0.y);
r0.y = 678.900024 * r0.y;
r0.y = frac(r0.y);
r0.z = cmp(r0.y < r1.y);
r0.y = r0.y / r1.y;
r0.y = r0.y * 2 + -1;
r1.xy = ddx_coarse(v2.xy);
r1.xy = cb2[17].xx * r1.xy;
r0.yw = r1.xy * r0.yy + v2.xy;
r0.yz = r0.zz ? r0.yw : v2.xy;
} else {
r0.yz = v2.xy;
}
r1.xyzw = t0.SampleBias(s0_s, r0.yz, cb2[23].y).xyzw;
r1.xyzw = v1.xyzw * r1.xyzw;
r0.y = t3.Sample(s3_s, w2.xy).x;
r0.z = t4.Sample(s4_s, v3.xy).x;
r0.y = r0.y * r0.z;
r0.y = cb2[9].x * r0.y;
r0.y = cb2[9].y * r0.y;
r2.w = r1.w * r0.y;
r0.y = cmp(r2.w == 0.000000);
if (r0.y != 0) {
if (-1 != 0) discard;
}
r0.yzw = r1.xyz * r1.xyz;
r1.x = cmp(0 < cb2[13].x);
if (r1.x != 0) {
r1.xy = -cb2[15].xy + v0.xy;
r1.xy = cb2[15].zw * r1.xy;
r1.xyz = t2.SampleLevel(s2_s, r1.xy, cb2[13].x).xyz;
r3.xyz = cmp(r1.xyz < cb13[0].xxx);
r4.xyzw = r3.xxxx ? cb13[2].xyzw : cb13[1].xyzw;
r1.xw = r4.xy * r1.xx + r4.zw;
r4.x = saturate(r1.x / r1.w);
r5.xyzw = r3.yyyy ? cb13[2].xyzw : cb13[1].xyzw;
r1.xy = r5.xy * r1.yy + r5.zw;
r4.y = saturate(r1.x / r1.y);
r3.xyzw = r3.zzzz ? cb13[2].xyzw : cb13[1].xyzw;
r1.xy = r3.xy * r1.zz + r3.zw;
r4.z = saturate(r1.x / r1.y);
r1.x = saturate(dot(r4.xyz, cb2[20].xyz));
r1.y = saturate(dot(r4.xyz, cb2[21].xyz));
r1.z = saturate(dot(r4.xyz, cb2[22].xyz));
r1.xyz = log2(r1.xyz);
r1.xyz = float3(0.416666657,0.416666657,0.416666657) * r1.xyz;
r1.xyz = exp2(r1.xyz);
r1.xyz = r1.xyz * float3(1.05499995,1.05499995,1.05499995) + float3(-0.0549999997,-0.0549999997,-0.0549999997);
r1.xyz = max(float3(0,0,0), r1.xyz);
r1.xyz = r1.xyz * float3(0.96875,0.96875,0.96875) + float3(0.015625,0.015625,0.015625);
r1.xyz = t1.SampleLevel(s1_s, r1.xyz, 0).xyz;
r0.yzw = r1.xyz * r0.yzw;
}
r1.x = cmp(0 < cb2[14].w);
if (r1.x != 0) {
r1.x = (uint)cb2[14].z;
r1.xy = (int2)r1.xx & int2(1,2);
r1.zw = float2(1,0.5) * v0.xy;
r1.zw = floor(r1.zw);
r1.xz = r1.xx ? v0.xy : r1.zw;
r1.z = cb2[14].y * r1.z;
r1.y = r1.y ? 0 : r1.z;
r1.x = r1.x + r1.y;
r1.x = r1.x / cb2[14].x;
r1.x = frac(r1.x);
r1.xy = cmp(r1.xx < float2(0.333000004,0.666000009));
r1.zw = cb2[14].ww * float2(1,-1) + float2(1,1);
r3.xy = cb2[14].ww * float2(-1,1) + float2(1,1);
r3.yz = r1.yy ? r1.zw : r3.xy;
r1.yzw = cb2[14].www * float3(1,-1,-1) + float3(1,1,1);
r3.x = 1 + -cb2[14].w;
r1.xyz = r1.xxx ? r1.yzw : r3.xyz;
r0.yzw = r1.xyz * r0.yzw;
}
if (r0.x != 0) {
r1.xyzw = cb2[16].xyzw * v0.xyxy;
r1.xyz = floor(r1.xyz);
r3.xyzw = float4(8,2.33999991,0.200000003,0.5) * cb2[17].wzww;
r0.x = frac(r3.y);
r0.x = 0.100000001 + r0.x;
r1.xy = r1.yx + r0.xx;
r4.xy = float2(0.554549694,0.308517009) * r1.yx;
r4.xy = frac(r4.xy);
r1.xy = r1.yx * r4.xy + r1.xy;
r0.x = r1.x * r1.y;
r0.x = frac(r0.x);
r1.x = cmp(r0.x < r3.z);
r4.xyz = float3(92.1419983,12.3450003,9.12300014) * r0.xxx;
r4.xyz = frac(r4.xyz);
r5.xz = r4.xx * r0.yw;
r0.x = 1 + -r4.x;
r5.y = r0.z * r0.x;
r5.xyz = r1.xxx ? r5.xyz : r0.yzw;
r0.x = cmp(r4.y < r3.w);
r1.x = 0.333333343 * r1.z;
r1.xw = frac(r1.xw);
r1.xy = cmp(r1.xx < float2(0.330000013,0.660000026));
r6.yz = r1.yy ? float2(1,0.200000003) : float2(0.200000003,1);
r6.x = 0.200000003;
r1.xyz = r1.xxx ? float3(1,0.200000003,0.200000003) : r6.xyz;
r1.xyz = r5.xyz * r1.xyz;
r1.xyz = r0.xxx ? r1.xyz : r5.xyz;
r0.x = r4.z * r4.z;
r0.x = cb2[17].w * r0.x;
r0.x = saturate(-r0.x * 3 + 1);
r1.w = r1.w * 2 + -1;
r3.x = saturate(r3.x);
r1.w = -abs(r1.w) * r3.x + 1;
r0.x = min(r1.w, r0.x);
r2.w = r2.w * r0.x;
r0.yzw = r1.xyz * r0.xxx;
}
r0.x = cmp(0 < cb2[12].x);
if (r0.x != 0) {
r1.xy = ddx_fine(v3.wz);
r1.zw = ddy_fine(v3.wz);
r0.x = r1.x * r1.w;
r0.x = r1.y * r1.z + -r0.x;
r0.x = 1 / r0.x;
r3.xyzw = float4(1,-1,-1,1) * r1.zwxy;
r1.xyzw = r3.xyzw * r0.xxxx;
r0.x = dot(r1.xz, r1.xz);
r3.x = sqrt(r0.x);
r0.x = dot(r1.yw, r1.yw);
r3.y = sqrt(r0.x);
r1.xy = w3.xy * r3.xy;
r1.zw = w3.xy * r3.xy + -r3.xy;
r1.xy = max(-r1.xy, r1.zw);
r1.zw = max(float2(0,0), r1.xy);
r0.x = dot(r1.zw, r1.zw);
r0.x = sqrt(r0.x);
r1.x = max(r1.x, r1.y);
r1.x = min(0, r1.x);
r0.x = r1.x + r0.x;
r0.x = -1 + r0.x;
r0.x = saturate(-0.5 * r0.x);
r1.x = r0.x * -2 + 3;
r0.x = r0.x * r0.x;
r0.x = r1.x * r0.x;
r2.w = r2.w * r0.x;
}
r2.xyz = sqrt(r0.yzw);
o0.xyzw = min(float4(32255,32255,32255,32255), r2.xyzw);
return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
// using 3Dmigoto v1.2.43 on Mon Nov 07 21:06:24 2016
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float xy
// COLOR 0 xyzw 1 NONE float xyzw
// TEXCOORD 0 xy 2 NONE float xy
// TEXCOORD 11 zw 2 NONE float zw
// TEXCOORD 12 xy 3 NONE float xy
// TEXCOORD 16 zw 3 NONE float zw
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET 0 xyzw 0 TARGET float xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb2[24], immediateIndexed
dcl_constantbuffer cb13[3], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s4, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture3d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_input_ps linear v1.xyzw
dcl_input_ps linear v2.xy
dcl_input_ps linear v2.zw
dcl_input_ps linear v3.xy
dcl_input_ps linear v3.zw
dcl_output o0.xyzw
dcl_temps 7
lt r0.x, l(0.000000), cb2[16].w
if_nz r0.x
mul r0.yz, v0.yyxy, cb2[16].yyxy
round_ni r0.yz, r0.yyzy
mul r1.xy, cb2[17].zwzz, l(2.340000, 0.800000, 0.000000, 0.000000)
frc r0.w, r1.x
add r0.w, r0.w, l(0.100000)
add r0.yz, r0.wwww, r0.yyzy
mul r1.xz, r0.zzyz, l(0.554549694, 0.000000, 0.308517, 0.000000)
frc r1.xz, r1.xxzx
mad r0.yz, r0.zzyz, r1.xxzx, r0.yyzy
mul r0.y, r0.z, r0.y
frc r0.y, r0.y
mul r0.y, r0.y, l(678.900024)
frc r0.y, r0.y
lt r0.z, r0.y, r1.y
div r0.y, r0.y, r1.y
mad r0.y, r0.y, l(2.000000), l(-1.000000)
deriv_rtx_coarse r1.xy, v2.xyxx
mul r1.xy, r1.xyxx, cb2[17].xxxx
mad r0.yw, r1.xxxy, r0.yyyy, v2.xxxy
movc r0.yz, r0.zzzz, r0.yywy, v2.xxyx
else
mov r0.yz, v2.xxyx
endif
sample_b_indexable(texture2d)(float,float,float,float) r1.xyzw, r0.yzyy, t0.xyzw, s0, cb2[23].y
mul r1.xyzw, r1.xyzw, v1.xyzw
sample_indexable(texture2d)(float,float,float,float) r0.y, v2.zwzz, t3.yxzw, s3
sample_indexable(texture2d)(float,float,float,float) r0.z, v3.xyxx, t4.yzxw, s4
mul r0.y, r0.z, r0.y
mul r0.y, r0.y, cb2[9].x
mul r0.y, r0.y, cb2[9].y
mul r2.w, r0.y, r1.w
eq r0.y, r2.w, l(0.000000)
if_nz r0.y
discard_nz l(-1)
endif
mul r0.yzw, r1.xxyz, r1.xxyz
lt r1.x, l(0.000000), cb2[13].x
if_nz r1.x
add r1.xy, v0.xyxx, -cb2[15].xyxx
mul r1.xy, r1.xyxx, cb2[15].zwzz
sample_l_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t2.xyzw, s2, cb2[13].x
lt r3.xyz, r1.xyzx, cb13[0].xxxx
movc r4.xyzw, r3.xxxx, cb13[2].xyzw, cb13[1].xyzw
mad r1.xw, r4.xxxy, r1.xxxx, r4.zzzw
div_sat r4.x, r1.x, r1.w
movc r5.xyzw, r3.yyyy, cb13[2].xyzw, cb13[1].xyzw
mad r1.xy, r5.xyxx, r1.yyyy, r5.zwzz
div_sat r4.y, r1.x, r1.y
movc r3.xyzw, r3.zzzz, cb13[2].xyzw, cb13[1].xyzw
mad r1.xy, r3.xyxx, r1.zzzz, r3.zwzz
div_sat r4.z, r1.x, r1.y
dp3_sat r1.x, r4.xyzx, cb2[20].xyzx
dp3_sat r1.y, r4.xyzx, cb2[21].xyzx
dp3_sat r1.z, r4.xyzx, cb2[22].xyzx
log r1.xyz, r1.xyzx
mul r1.xyz, r1.xyzx, l(0.416666657, 0.416666657, 0.416666657, 0.000000)
exp r1.xyz, r1.xyzx
mad r1.xyz, r1.xyzx, l(1.055000, 1.055000, 1.055000, 0.000000), l(-0.055000, -0.055000, -0.055000, 0.000000)
max r1.xyz, r1.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mad r1.xyz, r1.xyzx, l(0.968750, 0.968750, 0.968750, 0.000000), l(0.015625, 0.015625, 0.015625, 0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r1.xyz, r1.xyzx, t1.xyzw, s1, l(0.000000)
mul r0.yzw, r0.yyzw, r1.xxyz
endif
lt r1.x, l(0.000000), cb2[14].w
if_nz r1.x
ftou r1.x, cb2[14].z
and r1.xy, r1.xxxx, l(1, 2, 0, 0)
mul r1.zw, v0.xxxy, l(0.000000, 0.000000, 1.000000, 0.500000)
round_ni r1.zw, r1.zzzw
movc r1.xz, r1.xxxx, v0.xxyx, r1.zzwz
mul r1.z, r1.z, cb2[14].y
movc r1.y, r1.y, l(0), r1.z
add r1.x, r1.y, r1.x
div r1.x, r1.x, cb2[14].x
frc r1.x, r1.x
lt r1.xy, r1.xxxx, l(0.333000, 0.666000, 0.000000, 0.000000)
mad r1.zw, cb2[14].wwww, l(0.000000, 0.000000, 1.000000, -1.000000), l(0.000000, 0.000000, 1.000000, 1.000000)
mad r3.xy, cb2[14].wwww, l(-1.000000, 1.000000, 0.000000, 0.000000), l(1.000000, 1.000000, 0.000000, 0.000000)
movc r3.yz, r1.yyyy, r1.zzwz, r3.xxyx
mad r1.yzw, cb2[14].wwww, l(0.000000, 1.000000, -1.000000, -1.000000), l(0.000000, 1.000000, 1.000000, 1.000000)
add r3.x, -cb2[14].w, l(1.000000)
movc r1.xyz, r1.xxxx, r1.yzwy, r3.xyzx
mul r0.yzw, r0.yyzw, r1.xxyz
endif
if_nz r0.x
mul r1.xyzw, v0.xyxy, cb2[16].xyzw
round_ni r1.xyz, r1.xyzx
mul r3.xyzw, cb2[17].wzww, l(8.000000, 2.340000, 0.200000, 0.500000)
frc r0.x, r3.y
add r0.x, r0.x, l(0.100000)
add r1.xy, r0.xxxx, r1.yxyy
mul r4.xy, r1.yxyy, l(0.554549694, 0.308517, 0.000000, 0.000000)
frc r4.xy, r4.xyxx
mad r1.xy, r1.yxyy, r4.xyxx, r1.xyxx
mul r0.x, r1.y, r1.x
frc r0.x, r0.x
lt r1.x, r0.x, r3.z
mul r4.xyz, r0.xxxx, l(92.141998, 12.345000, 9.123000, 0.000000)
frc r4.xyz, r4.xyzx
mul r5.xz, r0.yywy, r4.xxxx
add r0.x, -r4.x, l(1.000000)
mul r5.y, r0.x, r0.z
movc r5.xyz, r1.xxxx, r5.xyzx, r0.yzwy
lt r0.x, r4.y, r3.w
mul r1.x, r1.z, l(0.333333343)
frc r1.xw, r1.xxxw
lt r1.xy, r1.xxxx, l(0.330000, 0.660000, 0.000000, 0.000000)
movc r6.yz, r1.yyyy, l(0,1.000000,0.200000,0), l(0,0.200000,1.000000,0)
mov r6.x, l(0.200000)
movc r1.xyz, r1.xxxx, l(1.000000,0.200000,0.200000,0), r6.xyzx
mul r1.xyz, r1.xyzx, r5.xyzx
movc r1.xyz, r0.xxxx, r1.xyzx, r5.xyzx
mul r0.x, r4.z, r4.z
mul r0.x, r0.x, cb2[17].w
mad_sat r0.x, -r0.x, l(3.000000), l(1.000000)
mad r1.w, r1.w, l(2.000000), l(-1.000000)
mov_sat r3.x, r3.x
mad r1.w, -|r1.w|, r3.x, l(1.000000)
min r0.x, r0.x, r1.w
mul r2.w, r0.x, r2.w
mul r0.yzw, r0.xxxx, r1.xxyz
endif
lt r0.x, l(0.000000), cb2[12].x
if_nz r0.x
deriv_rtx_fine r1.xy, v3.wzww
deriv_rty_fine r1.zw, v3.wwwz
mul r0.x, r1.w, r1.x
mad r0.x, r1.y, r1.z, -r0.x
div r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x
mul r3.xyzw, r1.zwxy, l(1.000000, -1.000000, -1.000000, 1.000000)
mul r1.xyzw, r0.xxxx, r3.xyzw
dp2 r0.x, r1.xzxx, r1.xzxx
sqrt r3.x, r0.x
dp2 r0.x, r1.ywyy, r1.ywyy
sqrt r3.y, r0.x
mul r1.xy, r3.xyxx, v3.zwzz
mad r1.zw, v3.zzzw, r3.xxxy, -r3.xxxy
max r1.xy, r1.zwzz, -r1.xyxx
max r1.zw, r1.xxxy, l(0.000000, 0.000000, 0.000000, 0.000000)
dp2 r0.x, r1.zwzz, r1.zwzz
sqrt r0.x, r0.x
max r1.x, r1.y, r1.x
min r1.x, r1.x, l(0.000000)
add r0.x, r0.x, r1.x
add r0.x, r0.x, l(-1.000000)
mul_sat r0.x, r0.x, l(-0.500000)
mad r1.x, r0.x, l(-2.000000), l(3.000000)
mul r0.x, r0.x, r0.x
mul r0.x, r0.x, r1.x
mul r2.w, r0.x, r2.w
endif
sqrt r2.xyz, r0.yzwy
min o0.xyzw, r2.xyzw, l(32255.000000, 32255.000000, 32255.000000, 32255.000000)
ret
// Approximately 0 instruction slots used

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

1080 Ti - i7 5820k - 16Gb RAM - Win 10 version 1607 - ASUS VG236H (1920x1080@120Hz)

Posted 11/08/2016 06:04 PM   
[quote="Jan-Itor"]Anyway here's the shader in question, would really appreciate if someone could help me fix it (if that's even possible?) [/quote] The problem is in lines 180 and 181. It's trying to use v3.wz, but v3 is defined as float2 (it can only have x and y). Change those lines to [code] r1.xy = ddx_fine(w3.yx); r1.zw = ddy_fine(w3.yx); [/code] Try that.
Jan-Itor said:Anyway here's the shader in question, would really appreciate if someone could help me fix it (if that's even possible?)


The problem is in lines 180 and 181. It's trying to use v3.wz, but v3 is defined as float2 (it can only have x and y). Change those lines to

r1.xy = ddx_fine(w3.yx);
r1.zw = ddy_fine(w3.yx);


Try that.

CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: MSI GeForce RTX 2080Ti Gaming X Trio
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com

Posted 11/08/2016 06:43 PM   
[quote="masterotaku"][quote="Jan-Itor"]Anyway here's the shader in question, would really appreciate if someone could help me fix it (if that's even possible?) [/quote] The problem is in lines 180 and 181. It's trying to use v3.wz, but v3 is defined as float2 (it can only have x and y). Change those lines to [code] r1.xy = ddx_fine(w3.yx); r1.zw = ddy_fine(w3.yx); [/code] Try that. [/quote] That worked, thanks a lot!
masterotaku said:
Jan-Itor said:Anyway here's the shader in question, would really appreciate if someone could help me fix it (if that's even possible?)


The problem is in lines 180 and 181. It's trying to use v3.wz, but v3 is defined as float2 (it can only have x and y). Change those lines to

r1.xy = ddx_fine(w3.yx);
r1.zw = ddy_fine(w3.yx);


Try that.


That worked, thanks a lot!

1080 Ti - i7 5820k - 16Gb RAM - Win 10 version 1607 - ASUS VG236H (1920x1080@120Hz)

Posted 11/08/2016 07:24 PM   
Hello, I'm starting to use 3Dmigoto and run into some shaders that are available as assembly only. Looking into existing fixes I found some "reasm" files and copied the declarations [code] dcl_resource_texture2d (float,float,float,float) t125 ld_indexable(texture2d)(float,float,float,float) r9.xyzw, l(0, 0, 0, 0), t125.xyzw [/code] into the asm shader. The "dcl_temps" directive was increased from 9 to 10. The rest of the shader is fixed similar as in Helixmod. If I now start the game, the fixed shader is not loaded and the log files shows the following error: [code] error X3000: unrecognized identifier 'dcl_globalFlags' [/code] If I remove the errornous line, I the the following: [code] error X3000: unrecognized identifier 'dcl_constantbuffer' [/code] From that I guess that 3Dmigoto tries to compile a HLSL shader instead of asm. What is the correct way to use asm shaders with 3Dmigoto?
Hello,

I'm starting to use 3Dmigoto and run into some shaders that are available as assembly only.
Looking into existing fixes I found some "reasm" files and copied the declarations
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r9.xyzw, l(0, 0, 0, 0), t125.xyzw

into the asm shader. The "dcl_temps" directive was increased from 9 to 10.
The rest of the shader is fixed similar as in Helixmod.

If I now start the game, the fixed shader is not loaded and the log files shows the following error:
error X3000: unrecognized identifier 'dcl_globalFlags'

If I remove the errornous line, I the the following:
error X3000: unrecognized identifier 'dcl_constantbuffer'

From that I guess that 3Dmigoto tries to compile a HLSL shader instead of asm.

What is the correct way to use asm shaders with 3Dmigoto?
HLSL files are named: xxxxxxxxxxxxxxxx-ys_replace.txt Assembly files are named: xxxxxxxxxxxxxxxx-ys.txt The reasm files were from the early days of the assembler to allow us to check that it actually assembled what we wrote, but that code was removed from 3DMigoto after we got cmd_Decompiler*, so maybe that is why it thinks they are HLSL (they weren't really supposed to be shipped, but a bunch of fixes included them anyway). * The assembler has a number of gotchas if your code looks like it was written by a human instead of a machine - if something isn't behaving as you expect, use cmd_Decompiler to assemble and disassemble it then compare that to what you wrote looking for missing instructions. cmd_Decompiler is on the 3DMigoto releases page.
HLSL files are named:
xxxxxxxxxxxxxxxx-ys_replace.txt

Assembly files are named:
xxxxxxxxxxxxxxxx-ys.txt

The reasm files were from the early days of the assembler to allow us to check that it actually assembled what we wrote, but that code was removed from 3DMigoto after we got cmd_Decompiler*, so maybe that is why it thinks they are HLSL (they weren't really supposed to be shipped, but a bunch of fixes included them anyway).

* The assembler has a number of gotchas if your code looks like it was written by a human instead of a machine - if something isn't behaving as you expect, use cmd_Decompiler to assemble and disassemble it then compare that to what you wrote looking for missing instructions. cmd_Decompiler is on the 3DMigoto releases page.

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

Posted 11/10/2016 05:05 PM   
Trying to use it in Dishonored 2, want to get rid of some shaders, specifically white trail effect on weapon swings because why not? Maybe some other shaders too. But when I try to start the game, this shows up: D3D11CreateDeviceAndSwapChain FAILED with error (-214702809). Please check your GPU is compatible with DirectX 11.1. Also, if you're under Windows 7, please check you've installed the Windows Platform Update I use a single GTX 1080 Anyone have any tips? Also tried reverting to an older version, version 1.1.14, and a new error message appeared that said "failed to request directX 11.1 device"
Trying to use it in Dishonored 2, want to get rid of some shaders, specifically white trail effect on weapon swings because why not? Maybe some other shaders too.

But when I try to start the game, this shows up:

D3D11CreateDeviceAndSwapChain FAILED with error (-214702809). Please check your GPU is compatible with DirectX 11.1. Also, if you're under Windows 7, please check you've installed the Windows Platform Update

I use a single GTX 1080

Anyone have any tips?


Also tried reverting to an older version, version 1.1.14, and a new error message appeared that said

"failed to request directX 11.1 device"

Posted 11/10/2016 11:56 PM   
Try enabling allow_create_device=2
Try enabling allow_create_device=2

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

Posted 11/11/2016 03:26 AM   
[quote="DarkStarSword"]Try enabling allow_create_device=2[/quote] How? And what version of 3dmigoto should I use when doing this? Do I add the line "allow_create_device=2" somewhere in the d3dx ini? EDIT: I think I figured it out. Added it right at the top under the systems setting, and it showed up in the d3d11 log. But it didn't fix anything
DarkStarSword said:Try enabling allow_create_device=2


How? And what version of 3dmigoto should I use when doing this?

Do I add the line "allow_create_device=2" somewhere in the d3dx ini?


EDIT: I think I figured it out. Added it right at the top under the systems setting, and it showed up in the d3d11 log.

But it didn't fix anything

Posted 11/11/2016 04:39 AM   
In general always use the latest version of 3DMigoto unless you have a good reason to do otherwise (and if you do find you need to use an old version, let us know because that means there has been a regression). There's documentation in the template d3dx.ini about the allow_ options - try the other combinations that it recommends to see if any of them make a difference. If nothing works, enable calls=1, debug=1 and unbuffered=1 under [Logging] and send us the resulting d3d11_log.txt file.
In general always use the latest version of 3DMigoto unless you have a good reason to do otherwise (and if you do find you need to use an old version, let us know because that means there has been a regression). There's documentation in the template d3dx.ini about the allow_ options - try the other combinations that it recommends to see if any of them make a difference. If nothing works, enable calls=1, debug=1 and unbuffered=1 under [Logging] and send us the resulting d3d11_log.txt file.

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

Posted 11/11/2016 07:52 AM   
[quote="DarkStarSword"]HLSL files are named: xxxxxxxxxxxxxxxx-ys_replace.txt Assembly files are named: xxxxxxxxxxxxxxxx-ys.txt[/quote] Thanks, DarkStarSword. It works now.
DarkStarSword said:HLSL files are named:
xxxxxxxxxxxxxxxx-ys_replace.txt

Assembly files are named:
xxxxxxxxxxxxxxxx-ys.txt

Thanks, DarkStarSword. It works now.
[quote="DarkStarSword"]In general always use the latest version of 3DMigoto unless you have a good reason to do otherwise (and if you do find you need to use an old version, let us know because that means there has been a regression). There's documentation in the template d3dx.ini about the allow_ options - try the other combinations that it recommends to see if any of them make a difference. If nothing works, enable calls=1, debug=1 and unbuffered=1 under [Logging] and send us the resulting d3d11_log.txt file.[/quote] Ok, here http://textuploader.com/d5fl2
DarkStarSword said:In general always use the latest version of 3DMigoto unless you have a good reason to do otherwise (and if you do find you need to use an old version, let us know because that means there has been a regression). There's documentation in the template d3dx.ini about the allow_ options - try the other combinations that it recommends to see if any of them make a difference. If nothing works, enable calls=1, debug=1 and unbuffered=1 under [Logging] and send us the resulting d3d11_log.txt file.



Ok, here


http://textuploader.com/d5fl2

Posted 11/11/2016 08:02 PM   
I observed some strange behaviour in the 3Dmigoto assembler: In my fix, I have to copy a constant buffer (for FOV) from the parent VS to the asm pixel shader. The target register is cb13 and frame analysis shows that the copying works. If I try to access the new cb from asm, the line seems to be silently ignored. There are no errors in the log. In the fix, the x-correction has to be multiplied by 10*FOV. According to frame analysis, cb13[1].x contains about 0.15. This is the code I used: [code] ... dcl_constantbuffer cb13[214], immediateIndexed dcl_resource_texture2d (float,float,float,float) t125 ld_indexable(texture2d)(float,float,float,float) r9.xyzw, l(0, 0, 0, 0), t125.xyzw mul r10.x, cb13[1].x, l(10) ... // Later, the fix is multiplied with r10.x [/code] If a set r10.x to 1.5 with [code]mov r10.x, l(1.5)[/code]everything works (for a single FOV). During further experiments, I found some more lines that don't work as well, eg: [code] mov r10.x, l(0.15) mov r10.y, l(10) mul r10.x, r10.x, r10.y // r10.x should contain 1.5 but fix shows no effect // or mov r10.xyzw, l(0.15, 10, 0, 0) mul r10.x, r10.x, r10.y // r10.x should contain 1.5 but fix shows no effect [/code] I read about various assembler bugs [url=https://github.com/bo3b/3Dmigoto/issues/36]here[/url], so I unindented all lines but without success. Have I found a new bug or did I missed some other asm gotcha ?
I observed some strange behaviour in the 3Dmigoto assembler:

In my fix, I have to copy a constant buffer (for FOV) from the parent VS to the asm pixel shader. The target register is cb13 and frame analysis shows that the copying works. If I try to access the new cb from asm, the line seems to be silently ignored. There are no errors in the log.

In the fix, the x-correction has to be multiplied by 10*FOV. According to frame analysis, cb13[1].x contains about 0.15.

This is the code I used:
...
dcl_constantbuffer cb13[214], immediateIndexed
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r9.xyzw, l(0, 0, 0, 0), t125.xyzw

mul r10.x, cb13[1].x, l(10)
...
// Later, the fix is multiplied with r10.x

If a set r10.x to 1.5 with
mov r10.x, l(1.5)
everything works (for a single FOV).

During further experiments, I found some more lines that don't work as well, eg:
mov r10.x, l(0.15)
mov r10.y, l(10)
mul r10.x, r10.x, r10.y // r10.x should contain 1.5 but fix shows no effect

// or
mov r10.xyzw, l(0.15, 10, 0, 0)
mul r10.x, r10.x, r10.y // r10.x should contain 1.5 but fix shows no effect

I read about various assembler bugs here, so I unindented all lines but without success. Have I found a new bug or did I missed some other asm gotcha ?
[quote="Wolfmeister101"][quote="DarkStarSword"]In general always use the latest version of 3DMigoto unless you have a good reason to do otherwise (and if you do find you need to use an old version, let us know because that means there has been a regression). There's documentation in the template d3dx.ini about the allow_ options - try the other combinations that it recommends to see if any of them make a difference. If nothing works, enable calls=1, debug=1 and unbuffered=1 under [Logging] and send us the resulting d3d11_log.txt file.[/quote] Ok, here http://textuploader.com/d5fl2[/quote] Thanks, I see the problem - this will need an update to 3DMigoto to allow another code path, and I have a feeling this may open up a bunch of previously untested code paths that have likely bit-rotted away. @Bo3b - I'm heading off to bed shortly, so if you were keen on looking at this don't wait for me. It might be worth grabbing this game for the shared accounts as one Bo3b and I can use for testing the platform update code paths.
Wolfmeister101 said:
DarkStarSword said:In general always use the latest version of 3DMigoto unless you have a good reason to do otherwise (and if you do find you need to use an old version, let us know because that means there has been a regression). There's documentation in the template d3dx.ini about the allow_ options - try the other combinations that it recommends to see if any of them make a difference. If nothing works, enable calls=1, debug=1 and unbuffered=1 under [Logging] and send us the resulting d3d11_log.txt file.



Ok, here


http://textuploader.com/d5fl2



Thanks, I see the problem - this will need an update to 3DMigoto to allow another code path, and I have a feeling this may open up a bunch of previously untested code paths that have likely bit-rotted away. @Bo3b - I'm heading off to bed shortly, so if you were keen on looking at this don't wait for me. It might be worth grabbing this game for the shared accounts as one Bo3b and I can use for testing the platform update code paths.

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

Posted 11/12/2016 04:03 PM   
[quote="mx-2"]I observed some strange behaviour in the 3Dmigoto assembler:[/quote]Yep, the assembler is pretty special that way ;-) [quote]In my fix, I have to copy a constant buffer (for FOV) from the parent VS to the asm pixel shader. The target register is cb13 and frame analysis shows that the copying works.[/quote]While not relevant to your problem at hand, be aware that cb12 in the vertex shader is used by the 3D Vision driver (it is how it passes separation and convergence to any shader it has modified), and if you try to use it it will appear to work and even show up in the frame analysis dumps, but the GPU will get a completely different constant buffer. Hence, I always use cb13, cb11, cb10, etc. skipping cb12. This is also the cause of one of the problems in Ark: Survival Evolved as the sky effects use cb12 (easy to fix with 3DMigoto by reassigning it to another constant buffer). [quote]If I try to access the new cb from asm, the line seems to be silently ignored. There are no errors in the log.[/quote]Yeah, the assembler either works, silently drops an instruction (try a typo in an opcode), crashes the game (try using too few parameters in an instruction), or enters an infinite loop (try using a bracket in an indented comment) hanging the game (of course the shader itself may contain an infinite loop crashing the GPU/game, but that one is not an assembler issue). It doesn't have any logging or produce any errors - we ultimately would like to replace it with one designed to handle human input more robustly, but the current one works so long as you are careful, so... not a high priority. [quote]In the fix, the x-correction has to be multiplied by 10*FOV. According to frame analysis, cb13[1].x contains about 0.15. This is the code I used:[/quote] [code] mul r10.x, cb13[1].x, l(10) [/code] [/quote]There's your problem - in DX11 assembly l(10) and l(10.0) are very different things and it is important not to mix them up - l(10) would produce an integer representation of 10 that when interpreted as a float would be 1.4e-44, which is definitely not what you want. Sometimes we use l(0) where we technically should have used l(0.0), but that is a special case as both will produce 0x00000000. I ran that through cmd_Decompiler (cmd_Decompiler -a foo.txt; cmd_Decompiler -d foo.shdr; diff -u foo.txt foo.asm) and you can see what happened: [code] mul r10.x, cb13[1].x, l(1.401298464E-044) [/code]
mx-2 said:I observed some strange behaviour in the 3Dmigoto assembler:
Yep, the assembler is pretty special that way ;-)

In my fix, I have to copy a constant buffer (for FOV) from the parent VS to the asm pixel shader. The target register is cb13 and frame analysis shows that the copying works.
While not relevant to your problem at hand, be aware that cb12 in the vertex shader is used by the 3D Vision driver (it is how it passes separation and convergence to any shader it has modified), and if you try to use it it will appear to work and even show up in the frame analysis dumps, but the GPU will get a completely different constant buffer. Hence, I always use cb13, cb11, cb10, etc. skipping cb12. This is also the cause of one of the problems in Ark: Survival Evolved as the sky effects use cb12 (easy to fix with 3DMigoto by reassigning it to another constant buffer).

If I try to access the new cb from asm, the line seems to be silently ignored. There are no errors in the log.
Yeah, the assembler either works, silently drops an instruction (try a typo in an opcode), crashes the game (try using too few parameters in an instruction), or enters an infinite loop (try using a bracket in an indented comment) hanging the game (of course the shader itself may contain an infinite loop crashing the GPU/game, but that one is not an assembler issue). It doesn't have any logging or produce any errors - we ultimately would like to replace it with one designed to handle human input more robustly, but the current one works so long as you are careful, so... not a high priority.

In the fix, the x-correction has to be multiplied by 10*FOV. According to frame analysis, cb13[1].x contains about 0.15.

This is the code I used:


mul r10.x, cb13[1].x, l(10)

There's your problem - in DX11 assembly l(10) and l(10.0) are very different things and it is important not to mix them up - l(10) would produce an integer representation of 10 that when interpreted as a float would be 1.4e-44, which is definitely not what you want. Sometimes we use l(0) where we technically should have used l(0.0), but that is a special case as both will produce 0x00000000.

I ran that through cmd_Decompiler (cmd_Decompiler -a foo.txt; cmd_Decompiler -d foo.shdr; diff -u foo.txt foo.asm) and you can see what happened:
mul r10.x, cb13[1].x, l(1.401298464E-044)

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

Posted 11/12/2016 04:27 PM   
[quote="DarkStarSword"][quote="Wolfmeister101"]Ok, here http://textuploader.com/d5fl2[/quote] Thanks, I see the problem - this will need an update to 3DMigoto to allow another code path, and I have a feeling this may open up a bunch of previously untested code paths that have likely bit-rotted away. @Bo3b - I'm heading off to bed shortly, so if you were keen on looking at this don't wait for me. It might be worth grabbing this game for the shared accounts as one Bo3b and I can use for testing the platform update code paths. [/quote] Can you try with 3DMigoto 1.2.46 with the new allow_platform_update=1 option? I have done literally no testing on this - it is just a quick change that you can try before I hit the sack, so it wouldn't surprise me at all if it doesn't work or something else breaks - please test and report back.
DarkStarSword said:
Wolfmeister101 said:Ok, here

http://textuploader.com/d5fl2


Thanks, I see the problem - this will need an update to 3DMigoto to allow another code path, and I have a feeling this may open up a bunch of previously untested code paths that have likely bit-rotted away. @Bo3b - I'm heading off to bed shortly, so if you were keen on looking at this don't wait for me. It might be worth grabbing this game for the shared accounts as one Bo3b and I can use for testing the platform update code paths.

Can you try with 3DMigoto 1.2.46 with the new allow_platform_update=1 option?

I have done literally no testing on this - it is just a quick change that you can try before I hit the sack, so it wouldn't surprise me at all if it doesn't work or something else breaks - please test and report back.

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

Posted 11/12/2016 05:26 PM   
  75 / 143    
Scroll To Top