3Dmigoto now open-source...
  114 / 143    
So the problem is the "Texture2D<float4> MaterialParams_srv.Layer0Diffuse_0 : register(t70);" line... I don't know how to solve that now, but: What if you do the toggle in the vertex shader instead of the pixel shader? You would also be able to make a transition animation like I do with my fixes. Instead of using an "if" condition to discard the pixel shader, use a variable as a multiplier in o0.x (the x axis of the output of SV_Position0 in your case). Make it 1 by default and make a toggle to 0 with some transition time. You may have to separate the axes if you only want to do an "x" collapse. You are also using an old 3Dmigoto build. 1.2.67 has better CPU performance.
So the problem is the "Texture2D<float4> MaterialParams_srv.Layer0Diffuse_0 : register(t70);" line... I don't know how to solve that now, but:

What if you do the toggle in the vertex shader instead of the pixel shader? You would also be able to make a transition animation like I do with my fixes. Instead of using an "if" condition to discard the pixel shader, use a variable as a multiplier in o0.x (the x axis of the output of SV_Position0 in your case). Make it 1 by default and make a toggle to 0 with some transition time. You may have to separate the axes if you only want to do an "x" collapse.

You are also using an old 3Dmigoto build. 1.2.67 has better CPU performance.

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/07/2017 09:50 PM   
[quote="masterotaku"]So the problem is the "Texture2D<float4> MaterialParams_srv.Layer0Diffuse_0 : register(t70);" line... I don't know how to solve that now, but: What if you do the toggle in the vertex shader instead of the pixel shader? You would also be able to make a transition animation like I do with my fixes. Instead of using an "if" condition to discard the pixel shader, use a variable as a multiplier in o0.x (the x axis of the output of SV_Position0 in your case). Make it 1 by default and make a toggle to 0 with some transition time. You may have to separate the axes if you only want to do an "x" collapse. You are also using an old 3Dmigoto build. 1.2.67 has better CPU performance.[/quote] I get a similar error with the vertex shader: [i]b9f391996aadaf7d-vs_replace.txt(241,18-66): error X3000: syntax error: unexpected token 'InstanceParams_instancing_ClusterVertexDataStatic'[/i] [code]// ---- Created with 3Dmigoto v1.2.67 on Wed Nov 08 07:25:34 2017 cbuffer PassParams_cbuffer : register(b1) { struct { float4 eyePosition; float4 eyePositionPrevFrame; float4 eyeDirection; float4 eyeDirectionPrevFrame; float4x4 viewToWorld; float4x4 viewToWorldPrevFrame; float4x4 worldToView; float4x4 worldToViewPrevFrame; float4x4 projMatrix; float4x4 viewProj; float4x4 viewNoTranslationProj; float4x4 viewProjPrevFrame; float4x4 viewNoTranslationProjPrevFrame; float4 viewTranslation; float4 viewTranslationPrevFrame; float4 vPosToUV; float4 viewportScaleOffset; float4 zFrontBackValue; float4 clipPlane; float4 frustumPlanes[4]; float4 globalLightingScale; float4 viewSpaceLightingBackWS; float4 projectorPosition; float4 prevProjectorPosition; float4 pixelPatchingParams; float gradientAdjustMipBias; float thinGeomAAPixelScale; uint layerIndex; uint globalCubeMapIndex; uint dynamicGBufferCubeMapIndex; uint alphaDitherEnabled; uint TAADitherEnabled; float CameraTAAFadeStartDist; struct { } materialTable; struct { float4x4 ClipXYZToViewPos; float4x4 ClipXYZToWorldPos; float4 ClipZToViewZ; } RevProjParams; struct { } refraction; struct { } deferredcommon; struct { } motionVector; struct { float4 XYScaleBias; float4 ForwardMappingParams; float2 ZProject; float4 BackwardMappingParams; float CloudShadowGIDensity; } combinedCloudShadow; struct { } AmbientLighting; struct { float4 volumeInvTransZ; float4 volumeTexScale; float4 volumeTexBias; float4 sunColor; float4 sunColorByOneOverPi; } fog; struct { float3 InvDepthParams; } underwater; struct { float4 VposToClusterXY; float4 ClipPosToClusterXY; float4 ClusterTransZ; uint HighClusterW; uint HighClusterWH; } clusteredLightsEvaluate; struct { } waterStamperTextures; struct { float3 maxCC; } waterCustomMeshParams; struct { } videoAndScreenshot; struct { } rainRipples; struct { } cookieShadows; struct { } nearShadows; struct { float FarShadowBlendRatio; } farShadows; struct { } commonShadows; struct { float2 WorldToUVOffset; float2 WorldToUVScale; float2 ReferenceWorldXY; float FadeStart; float Radius; } grassForce; } PassParams_constants : packoffset(c0); } cbuffer InstanceParams_cbuffer : register(b3) { struct { float4x4 world; float4x4 worldPrevFrame; float4x4 worldViewProj; float4x4 worldViewProjPrevFrame; float4 dissolveFactor; float LODBlendFactor; float wetnessBias; float alphaTestValue; uint materialTableIndex; uint instanceOffset; uint CameraTAADither; struct { struct { int4 offsets; } instanceBatchSetupConsts; } instancing; } InstanceParams_constants : packoffset(c0); } cbuffer MaterialParams_cbuffer : register(b2) { struct { struct { float4 blendXYAlphaTestTwoSided; } defaults; float4 VertexQuadMin_6; float4 VertexScale_89; float4 VertexOffset_92; float4 VertexQuadMax_16; float4 AlphaClampFallof_2; float4 UseVertexAlpha_4; float4 UseScreenAlpha_5; float4 UseLayer1AlphaGrayScale_7; float4 AlphaClampMin_9; float4 AlphaClampIsLayer01Alpha_10; float4 UseLayer1Alpha_11; float4 Layer0DiffuseUVIsClamp_13; float4 Layer0DiffuseIsBC4_14; float4 Layer1AlphaIsBC4_15; float4 Layer1AlphaUVIsClamp_17; float4 Layer0DiffuseIs9SS_18; float4 OcclusionAlpha_20; float4 OcclusionAlphaStepValue_21; float4 Layer0DiffuseIsScreenSpace_22; float4 Layer0DiffuseIsInvert_23; float4 Layer0ColorIsAdd_24; float4 ScreenAlphaTop_25; float4 ScreenAlphaFallout_26; float4 ScreenAlphaBottom_27; float4 AlphaBoost_28; float4 Mipmap_30; float3x3 Layer0DiffuseUV_8_matrix; float3x3 Layer1AlphaUV_12_matrix; } MaterialParams_constants : packoffset(c0); } Buffer<float4> InstanceParams_instancing_instanceData : register(t81); StructuredBuffer<InstanceParams_instancing_ClusterVertexDataStatic> InstanceParams_instancing_ClusterVertexDataStatic : register(t82); // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( uint v0 : POSITION0, uint v1 : SV_VertexID0, out float4 o0 : SV_Position0, out float4 o1 : TEXCOORD0, out float4 o2 : COLOR0, out float4 o3 : TEXCOORD1, out float4 o4 : TEXCOORD2, out float4 o5 : TEXCOORD3, out float4 o6 : TEXCOORD4, out uint o7 : InstanceID0) { // Needs manual fix for instruction: // unknown dcl_: dcl_resource_structured t82, 4 // Needs manual fix for instruction: // unknown dcl_: dcl_input_sgv v1.x, vertex_id float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11; uint4 bitmask, uiDest; float4 fDest; r0.xyz = abs(MaterialParams_constants.VertexQuadMax_16.xyz) + abs(MaterialParams_constants.VertexQuadMin_6.xyz); r0.xyz = r0.xyz * float3(0.5,0.5,0.5) + float3(1.1920929e-007,1.00000012,1.1920929e-007); r0.xyz = MaterialParams_constants.VertexOffset_92.xyz / r0.xyz; r0.w = (uint)v0.x << 3; r0.w = (uint)r0.w >> 2; r0.w = (int)r0.w + (int)InstanceParams_constants.instancing.instanceBatchSetupConsts.offsets.y; r1.x = (int)r0.w + 1; r0.w = InstanceParams_instancing_instanceData.Load(r0.w).y; r1.x = InstanceParams_instancing_instanceData.Load(r1.x).y; r1.x = mad((int)v1.x, 7, (int)r1.x); // Known bad code for instruction (needs manual fix): ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx r2.y = InstanceParams_instancing_instanceData[]..swiz; r3.xyzw = (int4)r1.xxxx + int4(1,2,3,4); r1.xy = (int2)r1.xx + int2(5,6); // Known bad code for instruction (needs manual fix): ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r3.x, l(0), t82.xxxx r2.w = InstanceParams_instancing_instanceData[]..swiz; r2.xz = (uint2)r2.yw << int2(16,16); r2.xyzw = (uint4)r2.xyzw >> int4(16,16,16,16); r2.xyz = (int3)r2.www * (int3)r2.xyz; r2.xyz = (int3)r2.xyz; r4.xyz = float3(3.05175781e-005,3.05175781e-005,3.05175781e-005) * r2.xyz; r5.xyz = r4.xyz * MaterialParams_constants.VertexScale_89.xyz + r0.xyz; r0.xy = (int2)r0.ww + int2(1,2); r6.xyzw = InstanceParams_instancing_instanceData.Load(r0.w).xyzw; r7.xyzw = InstanceParams_instancing_instanceData.Load(r0.x).xyzw; r0.xyzw = InstanceParams_instancing_instanceData.Load(r0.y).xyzw; r2.y = r7.w; r2.z = r0.w; r2.x = r6.w; r8.xyz = -PassParams_constants.viewTranslation.xyz + r2.xyz; r8.w = 1; r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m00_m10_m20_m30); r5.w = 1; r2.y = r7.x; r2.z = r0.x; r2.x = r6.x; r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20); r10.y = r7.y; r10.z = r0.y; r10.x = r6.y; r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20); r11.y = r7.z; r11.z = r0.z; r11.x = r6.z; r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20); o0.x = dot(r5.xyzw, r9.xyzw); r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m01_m11_m21_m31); r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21); r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21); r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21); o0.y = dot(r5.xyzw, r9.xyzw); r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m02_m12_m22_m32); r8.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m03_m13_m23_m33); r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22); r8.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23); r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22); r8.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23); r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22); r8.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23); o0.w = dot(r5.xyzw, r8.xyzw); o0.z = dot(r5.xyzw, r9.xyzw); // Known bad code for instruction (needs manual fix): ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx r2.y = InstanceParams_instancing_instanceData[]..swiz; // Known bad code for instruction (needs manual fix): ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.w, r1.y, l(0), t82.xxxx r1.w = InstanceParams_instancing_instanceData[]..swiz; r2.x = (uint)r2.y << 16; r1.xy = (uint2)r2.xy >> int2(16,16); r1.xy = (int2)r1.xy; o1.xy = float2(0.000488288701,0.000488288701) * r1.xy; r1.z = (uint)r1.w << 16; r1.xy = (uint2)r1.zw >> int2(16,16); r1.xy = (int2)r1.xy; o1.zw = float2(0.000488288701,0.000488288701) * r1.xy; // Known bad code for instruction (needs manual fix): ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.w, l(0), t82.xxxx r1.x = InstanceParams_instancing_instanceData[]..swiz; r1.yzw = (uint3)r1.xxx >> int3(8,16,24); r1.xyzw = (int4)r1.xyzw & int4(255,255,255,255); r1.xyzw = (uint4)r1.xyzw; o2.xyzw = float4(0.00392156886,0.00392156886,0.00392156886,0.00392156886) * r1.xyzw; r4.w = 1; o3.y = dot(r4.xyzw, r7.xyzw); o3.z = dot(r4.xyzw, r0.xyzw); o3.x = dot(r4.xyzw, r6.xyzw); o3.w = 1; // Known bad code for instruction (needs manual fix): ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.z, l(0), t82.xxxx r1.x = InstanceParams_instancing_instanceData[]..swiz; // Known bad code for instruction (needs manual fix): ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r3.y, l(0), t82.xxxx r2.x = InstanceParams_instancing_instanceData[]..swiz; r1.yz = (uint2)r1.xx >> int2(8,16); r1.xyz = (int3)r1.xyz & int3(255,255,255); r1.xyz = (uint3)r1.xyz; r1.xyz = float3(-127,-127,-127) + r1.xyz; r1.xyz = float3(0.00787401572,0.00787401572,0.00787401572) * r1.xyz; o4.y = dot(r1.xyz, r7.xyz); o4.z = dot(r1.xyz, r0.xyz); o4.x = dot(r1.xyz, r6.xyz); o4.w = 0; r0.w = cmp(0 < (int)r2.w); r1.w = cmp((int)r2.w < 0); r0.w = (int)-r0.w + (int)r1.w; r0.w = (int)r0.w; r2.yz = (uint2)r2.xx >> int2(8,16); r2.xyz = (int3)r2.xyz & int3(255,255,255); r2.xyz = (uint3)r2.xyz; r2.xyz = float3(-127,-127,-127) + r2.xyz; r2.xyz = float3(0.00787401572,0.00787401572,0.00787401572) * r2.xyz; r3.xyz = r2.zxy * r1.yzx; r1.xyz = r2.yzx * r1.zxy + -r3.xyz; r1.xyz = r1.xyz * r0.www; o5.x = dot(r1.xyz, r6.xyz); o6.x = dot(r2.xyz, r6.xyz); o5.y = dot(r1.xyz, r7.xyz); o6.y = dot(r2.xyz, r7.xyz); o6.z = dot(r2.xyz, r0.xyz); o5.z = dot(r1.xyz, r0.xyz); o5.w = 0; o6.w = 0; o7.x = v0.x; return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) HLSL Shader Compiler 10.1 // // using 3Dmigoto v1.2.67 on Wed Nov 08 07:25:34 2017 // // // Buffer Definitions: // // cbuffer PassParams_cbuffer // { // // struct PassParams_Constants // { // // float4 eyePosition; // Offset: 0 // float4 eyePositionPrevFrame; // Offset: 16 // float4 eyeDirection; // Offset: 32 // float4 eyeDirectionPrevFrame; // Offset: 48 // float4x4 viewToWorld; // Offset: 64 // float4x4 viewToWorldPrevFrame; // Offset: 128 // float4x4 worldToView; // Offset: 192 // float4x4 worldToViewPrevFrame; // Offset: 256 // float4x4 projMatrix; // Offset: 320 // float4x4 viewProj; // Offset: 384 // float4x4 viewNoTranslationProj;// Offset: 448 // float4x4 viewProjPrevFrame; // Offset: 512 // float4x4 viewNoTranslationProjPrevFrame;// Offset: 576 // float4 viewTranslation; // Offset: 640 // float4 viewTranslationPrevFrame;// Offset: 656 // float4 vPosToUV; // Offset: 672 // float4 viewportScaleOffset; // Offset: 688 // float4 zFrontBackValue; // Offset: 704 // float4 clipPlane; // Offset: 720 // float4 frustumPlanes[4]; // Offset: 736 // float4 globalLightingScale; // Offset: 800 // float4 viewSpaceLightingBackWS;// Offset: 816 // float4 projectorPosition; // Offset: 832 // float4 prevProjectorPosition; // Offset: 848 // float4 pixelPatchingParams; // Offset: 864 // float gradientAdjustMipBias; // Offset: 880 // float thinGeomAAPixelScale; // Offset: 884 // uint layerIndex; // Offset: 888 // uint globalCubeMapIndex; // Offset: 892 // uint dynamicGBufferCubeMapIndex;// Offset: 896 // uint alphaDitherEnabled; // Offset: 900 // uint TAADitherEnabled; // Offset: 904 // float CameraTAAFadeStartDist; // Offset: 908 // // struct MaterialTable_Constants // { // // } materialTable; // Offset: 4294967292 // // struct ReverseProjParams_Constants // { // // float4x4 ClipXYZToViewPos; // Offset: 912 // float4x4 ClipXYZToWorldPos;// Offset: 976 // float4 ClipZToViewZ; // Offset: 1040 // // } RevProjParams; // Offset: 912 // // struct RefractionParams_Constants // { // // } refraction; // Offset: 4294967292 // // struct DeferredCommonParams_Constants // { // // } deferredcommon; // Offset: 4294967292 // // struct MotionVectorParams_Constants // { // // } motionVector; // Offset: 4294967292 // // struct CombinedCloudShadow_Constants // { // // float4 XYScaleBias; // Offset: 1056 // float4 ForwardMappingParams;// Offset: 1072 // float2 ZProject; // Offset: 1088 // float4 BackwardMappingParams;// Offset: 1104 // float CloudShadowGIDensity;// Offset: 1120 // // } combinedCloudShadow; // Offset: 1056 // // struct AmbientLightingParams_Constants // { // // } AmbientLighting; // Offset: 4294967292 // // struct VolumetricFogParams_Constants // { // // float4 volumeInvTransZ; // Offset: 1136 // float4 volumeTexScale; // Offset: 1152 // float4 volumeTexBias; // Offset: 1168 // float4 sunColor; // Offset: 1184 // float4 sunColorByOneOverPi;// Offset: 1200 // // } fog; // Offset: 1136 // // struct UnderwaterLightingParams_Constants // { // // float3 InvDepthParams; // Offset: 1216 // // } underwater; // Offset: 1216 // // struct ClusteredLightsEvaluateParams_Constants // { // // float4 VposToClusterXY; // Offset: 1232 // float4 ClipPosToClusterXY; // Offset: 1248 // float4 ClusterTransZ; // Offset: 1264 // uint HighClusterW; // Offset: 1280 // uint HighClusterWH; // Offset: 1284 // // } clusteredLightsEvaluate; // Offset: 1232 // // struct WaterStamperTextureParams_Constants // { // // } waterStamperTextures; // Offset: 4294967292 // // struct WaterCustomMeshParams_Constants // { // // float3 maxCC; // Offset: 1296 // // } waterCustomMeshParams; // Offset: 1296 // // struct VideoAndScreenshotParams_Constants // { // // } videoAndScreenshot; // Offset: 4294967292 // // struct RainRipplesParams_Constants // { // // } rainRipples; // Offset: 4294967292 // // struct CookieShadowParams_Constants // { // // } cookieShadows; // Offset: 4294967292 // // struct NearShadowParams_Constants // { // // } nearShadows; // Offset: 4294967292 // // struct FarShadowParams_Constants // { // // float FarShadowBlendRatio; // Offset: 1312 // // } farShadows; // Offset: 1312 // // struct CommonShadowParams_Constants // { // // } commonShadows; // Offset: 4294967292 // // struct GrassForceSamplingParams_Constants // { // // float2 WorldToUVOffset; // Offset: 1328 // float2 WorldToUVScale; // Offset: 1336 // float2 ReferenceWorldXY; // Offset: 1344 // float FadeStart; // Offset: 1352 // float Radius; // Offset: 1356 // // } grassForce; // Offset: 1328 // // } PassParams_constants; // Offset: 0 Size: 1360 // // } // // cbuffer InstanceParams_cbuffer // { // // struct InstanceParams_Constants // { // // float4x4 world; // Offset: 0 // float4x4 worldPrevFrame; // Offset: 64 // float4x4 worldViewProj; // Offset: 128 // float4x4 worldViewProjPrevFrame;// Offset: 192 // float4 dissolveFactor; // Offset: 256 // float LODBlendFactor; // Offset: 272 // float wetnessBias; // Offset: 276 // float alphaTestValue; // Offset: 280 // uint materialTableIndex; // Offset: 284 // uint instanceOffset; // Offset: 288 // uint CameraTAADither; // Offset: 292 // // struct InstancingParams_Constants // { // // struct InstanceBatchSetupConsts_Constants // { // // int4 offsets; // Offset: 304 // // } instanceBatchSetupConsts;// Offset: 304 // // } instancing; // Offset: 304 // // } InstanceParams_constants; // Offset: 0 Size: 320 // // } // // cbuffer MaterialParams_cbuffer // { // // struct MaterialParams_Constants // { // // struct DefaultMaterialConsts // { // // float4 blendXYAlphaTestTwoSided;// Offset: 0 // // } defaults; // Offset: 0 // float4 VertexQuadMin_6; // Offset: 16 // float4 VertexScale_89; // Offset: 32 // float4 VertexOffset_92; // Offset: 48 // float4 VertexQuadMax_16; // Offset: 64 // float4 AlphaClampFallof_2; // Offset: 80 // float4 UseVertexAlpha_4; // Offset: 96 // float4 UseScreenAlpha_5; // Offset: 112 // float4 UseLayer1AlphaGrayScale_7;// Offset: 128 // float4 AlphaClampMin_9; // Offset: 144 // float4 AlphaClampIsLayer01Alpha_10;// Offset: 160 // float4 UseLayer1Alpha_11; // Offset: 176 // float4 Layer0DiffuseUVIsClamp_13;// Offset: 192 // float4 Layer0DiffuseIsBC4_14; // Offset: 208 // float4 Layer1AlphaIsBC4_15; // Offset: 224 // float4 Layer1AlphaUVIsClamp_17;// Offset: 240 // float4 Layer0DiffuseIs9SS_18; // Offset: 256 // float4 OcclusionAlpha_20; // Offset: 272 // float4 OcclusionAlphaStepValue_21;// Offset: 288 // float4 Layer0DiffuseIsScreenSpace_22;// Offset: 304 // float4 Layer0DiffuseIsInvert_23;// Offset: 320 // float4 Layer0ColorIsAdd_24; // Offset: 336 // float4 ScreenAlphaTop_25; // Offset: 352 // float4 ScreenAlphaFallout_26; // Offset: 368 // float4 ScreenAlphaBottom_27; // Offset: 384 // float4 AlphaBoost_28; // Offset: 400 // float4 Mipmap_30; // Offset: 416 // float3x3 Layer0DiffuseUV_8_matrix;// Offset: 432 // float3x3 Layer1AlphaUV_12_matrix;// Offset: 480 // // } MaterialParams_constants; // Offset: 0 Size: 524 // // } // // Resource bind info for InstanceParams_instancing_ClusterVertexDataStatic // { // // uint $Element; // Offset: 0 Size: 4 // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // InstanceParams_instancing_instanceData texture float4 buf 81 1 // InstanceParams_instancing_ClusterVertexDataStatic texture struct r/o 82 1 // PassParams_cbuffer cbuffer NA NA 1 1 // MaterialParams_cbuffer cbuffer NA NA 2 1 // InstanceParams_cbuffer cbuffer NA NA 3 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // POSITION 0 x 0 NONE uint x // SV_VertexID 0 x 1 VERTID uint x // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Position 0 xyzw 0 POS float xyzw // TEXCOORD 0 xyzw 1 NONE float xyzw // COLOR 0 xyzw 2 NONE float xyzw // TEXCOORD 1 xyzw 3 NONE float xyzw // TEXCOORD 2 xyzw 4 NONE float xyzw // TEXCOORD 3 xyzw 5 NONE float xyzw // TEXCOORD 4 xyzw 6 NONE float xyzw // InstanceID 0 x 7 NONE uint x // vs_5_0 dcl_globalFlags refactoringAllowed dcl_constantbuffer cb1[41], immediateIndexed dcl_constantbuffer cb3[20], immediateIndexed dcl_constantbuffer cb2[5], immediateIndexed dcl_resource_buffer (float,float,float,float) t81 dcl_resource_structured t82, 4 dcl_input v0.x dcl_input_sgv v1.x, vertex_id dcl_output_siv o0.xyzw, position dcl_output o1.xyzw dcl_output o2.xyzw dcl_output o3.xyzw dcl_output o4.xyzw dcl_output o5.xyzw dcl_output o6.xyzw dcl_output o7.x dcl_temps 12 add r0.xyz, |cb2[1].xyzx|, |cb2[4].xyzx| mad r0.xyz, r0.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(1.192092896E-007, 1.00000012, 1.192092896E-007, 0.000000) div r0.xyz, cb2[3].xyzx, r0.xyzx ishl r0.w, v0.x, l(3) ushr r0.w, r0.w, l(2) iadd r0.w, r0.w, cb3[19].y iadd r1.x, r0.w, l(1) ld_indexable(buffer)(float,float,float,float) r0.w, r0.wwww, t81.xzwy ld_indexable(buffer)(float,float,float,float) r1.x, r1.xxxx, t81.yxzw imad r1.x, v1.x, l(7), r1.x ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx iadd r3.xyzw, r1.xxxx, l(1, 2, 3, 4) iadd r1.xy, r1.xxxx, l(5, 6, 0, 0) ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r3.x, l(0), t82.xxxx ishl r2.xz, r2.yywy, l(16, 0, 16, 0) ishr r2.xyzw, r2.xyzw, l(16, 16, 16, 16) imul null, r2.xyz, r2.wwww, r2.xyzx itof r2.xyz, r2.xyzx mul r4.xyz, r2.xyzx, l(0.0000305175781, 0.0000305175781, 0.0000305175781, 0.000000) mad r5.xyz, r4.xyzx, cb2[2].xyzx, r0.xyzx iadd r0.xy, r0.wwww, l(1, 2, 0, 0) ld_indexable(buffer)(float,float,float,float) r6.xyzw, r0.wwww, t81.xyzw ld_indexable(buffer)(float,float,float,float) r7.xyzw, r0.xxxx, t81.xyzw ld_indexable(buffer)(float,float,float,float) r0.xyzw, r0.yyyy, t81.xyzw mov r2.y, r7.w mov r2.z, r0.w mov r2.x, r6.w add r8.xyz, r2.xyzx, -cb1[40].xyzx mov r8.w, l(1.000000) dp4 r9.w, r8.xyzw, cb1[28].xyzw mov r5.w, l(1.000000) mov r2.y, r7.x mov r2.z, r0.x mov r2.x, r6.x dp3 r9.x, r2.xyzx, cb1[28].xyzx mov r10.y, r7.y mov r10.z, r0.y mov r10.x, r6.y dp3 r9.y, r10.xyzx, cb1[28].xyzx mov r11.y, r7.z mov r11.z, r0.z mov r11.x, r6.z dp3 r9.z, r11.xyzx, cb1[28].xyzx dp4 o0.x, r5.xyzw, r9.xyzw dp4 r9.w, r8.xyzw, cb1[29].xyzw dp3 r9.x, r2.xyzx, cb1[29].xyzx dp3 r9.y, r10.xyzx, cb1[29].xyzx dp3 r9.z, r11.xyzx, cb1[29].xyzx dp4 o0.y, r5.xyzw, r9.xyzw dp4 r9.w, r8.xyzw, cb1[30].xyzw dp4 r8.w, r8.xyzw, cb1[31].xyzw dp3 r9.x, r2.xyzx, cb1[30].xyzx dp3 r8.x, r2.xyzx, cb1[31].xyzx dp3 r9.y, r10.xyzx, cb1[30].xyzx dp3 r8.y, r10.xyzx, cb1[31].xyzx dp3 r9.z, r11.xyzx, cb1[30].xyzx dp3 r8.z, r11.xyzx, cb1[31].xyzx dp4 o0.w, r5.xyzw, r8.xyzw dp4 o0.z, r5.xyzw, r9.xyzw ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.w, r1.y, l(0), t82.xxxx ishl r2.x, r2.y, l(16) ishr r1.xy, r2.xyxx, l(16, 16, 0, 0) itof r1.xy, r1.xyxx mul o1.xy, r1.xyxx, l(0.000488288701, 0.000488288701, 0.000000, 0.000000) ishl r1.z, r1.w, l(16) ishr r1.xy, r1.zwzz, l(16, 16, 0, 0) itof r1.xy, r1.xyxx mul o1.zw, r1.xxxy, l(0.000000, 0.000000, 0.000488288701, 0.000488288701) ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.w, l(0), t82.xxxx ushr r1.yzw, r1.xxxx, l(0, 8, 16, 24) and r1.xyzw, r1.xyzw, l(255, 255, 255, 255) utof r1.xyzw, r1.xyzw mul o2.xyzw, r1.xyzw, l(0.00392156886, 0.00392156886, 0.00392156886, 0.00392156886) mov r4.w, l(1.000000) dp4 o3.y, r4.xyzw, r7.xyzw dp4 o3.z, r4.xyzw, r0.xyzw dp4 o3.x, r4.xyzw, r6.xyzw mov o3.w, l(1.000000) ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.z, l(0), t82.xxxx ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r3.y, l(0), t82.xxxx ushr r1.yz, r1.xxxx, l(0, 8, 16, 0) and r1.xyz, r1.xyzx, l(255, 255, 255, 0) utof r1.xyz, r1.xyzx add r1.xyz, r1.xyzx, l(-127.000000, -127.000000, -127.000000, 0.000000) mul r1.xyz, r1.xyzx, l(0.00787401572, 0.00787401572, 0.00787401572, 0.000000) dp3 o4.y, r1.xyzx, r7.xyzx dp3 o4.z, r1.xyzx, r0.xyzx dp3 o4.x, r1.xyzx, r6.xyzx mov o4.w, l(0) ilt r0.w, l(0), r2.w ilt r1.w, r2.w, l(0) iadd r0.w, -r0.w, r1.w itof r0.w, r0.w ushr r2.yz, r2.xxxx, l(0, 8, 16, 0) and r2.xyz, r2.xyzx, l(255, 255, 255, 0) utof r2.xyz, r2.xyzx add r2.xyz, r2.xyzx, l(-127.000000, -127.000000, -127.000000, 0.000000) mul r2.xyz, r2.xyzx, l(0.00787401572, 0.00787401572, 0.00787401572, 0.000000) mul r3.xyz, r1.yzxy, r2.zxyz mad r1.xyz, r2.yzxy, r1.zxyz, -r3.xyzx mul r1.xyz, r0.wwww, r1.xyzx dp3 o5.x, r1.xyzx, r6.xyzx dp3 o6.x, r2.xyzx, r6.xyzx dp3 o5.y, r1.xyzx, r7.xyzx dp3 o6.y, r2.xyzx, r7.xyzx dp3 o6.z, r2.xyzx, r0.xyzx dp3 o5.z, r1.xyzx, r0.xyzx mov o5.w, l(0) mov o6.w, l(0) mov o7.x, v0.x ret // Approximately 112 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ [/code] I'm not sure what a transition animation is though.
masterotaku said:So the problem is the "Texture2D<float4> MaterialParams_srv.Layer0Diffuse_0 : register(t70);" line... I don't know how to solve that now, but:

What if you do the toggle in the vertex shader instead of the pixel shader? You would also be able to make a transition animation like I do with my fixes. Instead of using an "if" condition to discard the pixel shader, use a variable as a multiplier in o0.x (the x axis of the output of SV_Position0 in your case). Make it 1 by default and make a toggle to 0 with some transition time. You may have to separate the axes if you only want to do an "x" collapse.

You are also using an old 3Dmigoto build. 1.2.67 has better CPU performance.


I get a similar error with the vertex shader:

b9f391996aadaf7d-vs_replace.txt(241,18-66): error X3000: syntax error: unexpected token 'InstanceParams_instancing_ClusterVertexDataStatic'

// ---- Created with 3Dmigoto v1.2.67 on Wed Nov 08 07:25:34 2017

cbuffer PassParams_cbuffer : register(b1)
{

struct
{
float4 eyePosition;
float4 eyePositionPrevFrame;
float4 eyeDirection;
float4 eyeDirectionPrevFrame;
float4x4 viewToWorld;
float4x4 viewToWorldPrevFrame;
float4x4 worldToView;
float4x4 worldToViewPrevFrame;
float4x4 projMatrix;
float4x4 viewProj;
float4x4 viewNoTranslationProj;
float4x4 viewProjPrevFrame;
float4x4 viewNoTranslationProjPrevFrame;
float4 viewTranslation;
float4 viewTranslationPrevFrame;
float4 vPosToUV;
float4 viewportScaleOffset;
float4 zFrontBackValue;
float4 clipPlane;
float4 frustumPlanes[4];
float4 globalLightingScale;
float4 viewSpaceLightingBackWS;
float4 projectorPosition;
float4 prevProjectorPosition;
float4 pixelPatchingParams;
float gradientAdjustMipBias;
float thinGeomAAPixelScale;
uint layerIndex;
uint globalCubeMapIndex;
uint dynamicGBufferCubeMapIndex;
uint alphaDitherEnabled;
uint TAADitherEnabled;
float CameraTAAFadeStartDist;

struct
{
} materialTable;


struct
{
float4x4 ClipXYZToViewPos;
float4x4 ClipXYZToWorldPos;
float4 ClipZToViewZ;
} RevProjParams;


struct
{
} refraction;


struct
{
} deferredcommon;


struct
{
} motionVector;


struct
{
float4 XYScaleBias;
float4 ForwardMappingParams;
float2 ZProject;
float4 BackwardMappingParams;
float CloudShadowGIDensity;
} combinedCloudShadow;


struct
{
} AmbientLighting;


struct
{
float4 volumeInvTransZ;
float4 volumeTexScale;
float4 volumeTexBias;
float4 sunColor;
float4 sunColorByOneOverPi;
} fog;


struct
{
float3 InvDepthParams;
} underwater;


struct
{
float4 VposToClusterXY;
float4 ClipPosToClusterXY;
float4 ClusterTransZ;
uint HighClusterW;
uint HighClusterWH;
} clusteredLightsEvaluate;


struct
{
} waterStamperTextures;


struct
{
float3 maxCC;
} waterCustomMeshParams;


struct
{
} videoAndScreenshot;


struct
{
} rainRipples;


struct
{
} cookieShadows;


struct
{
} nearShadows;


struct
{
float FarShadowBlendRatio;
} farShadows;


struct
{
} commonShadows;


struct
{
float2 WorldToUVOffset;
float2 WorldToUVScale;
float2 ReferenceWorldXY;
float FadeStart;
float Radius;
} grassForce;

} PassParams_constants : packoffset(c0);

}

cbuffer InstanceParams_cbuffer : register(b3)
{

struct
{
float4x4 world;
float4x4 worldPrevFrame;
float4x4 worldViewProj;
float4x4 worldViewProjPrevFrame;
float4 dissolveFactor;
float LODBlendFactor;
float wetnessBias;
float alphaTestValue;
uint materialTableIndex;
uint instanceOffset;
uint CameraTAADither;

struct
{

struct
{
int4 offsets;
} instanceBatchSetupConsts;

} instancing;

} InstanceParams_constants : packoffset(c0);

}

cbuffer MaterialParams_cbuffer : register(b2)
{

struct
{

struct
{
float4 blendXYAlphaTestTwoSided;
} defaults;

float4 VertexQuadMin_6;
float4 VertexScale_89;
float4 VertexOffset_92;
float4 VertexQuadMax_16;
float4 AlphaClampFallof_2;
float4 UseVertexAlpha_4;
float4 UseScreenAlpha_5;
float4 UseLayer1AlphaGrayScale_7;
float4 AlphaClampMin_9;
float4 AlphaClampIsLayer01Alpha_10;
float4 UseLayer1Alpha_11;
float4 Layer0DiffuseUVIsClamp_13;
float4 Layer0DiffuseIsBC4_14;
float4 Layer1AlphaIsBC4_15;
float4 Layer1AlphaUVIsClamp_17;
float4 Layer0DiffuseIs9SS_18;
float4 OcclusionAlpha_20;
float4 OcclusionAlphaStepValue_21;
float4 Layer0DiffuseIsScreenSpace_22;
float4 Layer0DiffuseIsInvert_23;
float4 Layer0ColorIsAdd_24;
float4 ScreenAlphaTop_25;
float4 ScreenAlphaFallout_26;
float4 ScreenAlphaBottom_27;
float4 AlphaBoost_28;
float4 Mipmap_30;
float3x3 Layer0DiffuseUV_8_matrix;
float3x3 Layer1AlphaUV_12_matrix;
} MaterialParams_constants : packoffset(c0);

}

Buffer<float4> InstanceParams_instancing_instanceData : register(t81);
StructuredBuffer<InstanceParams_instancing_ClusterVertexDataStatic> InstanceParams_instancing_ClusterVertexDataStatic : register(t82);


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


void main(
uint v0 : POSITION0,
uint v1 : SV_VertexID0,
out float4 o0 : SV_Position0,
out float4 o1 : TEXCOORD0,
out float4 o2 : COLOR0,
out float4 o3 : TEXCOORD1,
out float4 o4 : TEXCOORD2,
out float4 o5 : TEXCOORD3,
out float4 o6 : TEXCOORD4,
out uint o7 : InstanceID0)
{
// Needs manual fix for instruction:
// unknown dcl_: dcl_resource_structured t82, 4
// Needs manual fix for instruction:
// unknown dcl_: dcl_input_sgv v1.x, vertex_id
float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11;
uint4 bitmask, uiDest;
float4 fDest;

r0.xyz = abs(MaterialParams_constants.VertexQuadMax_16.xyz) + abs(MaterialParams_constants.VertexQuadMin_6.xyz);
r0.xyz = r0.xyz * float3(0.5,0.5,0.5) + float3(1.1920929e-007,1.00000012,1.1920929e-007);
r0.xyz = MaterialParams_constants.VertexOffset_92.xyz / r0.xyz;
r0.w = (uint)v0.x << 3;
r0.w = (uint)r0.w >> 2;
r0.w = (int)r0.w + (int)InstanceParams_constants.instancing.instanceBatchSetupConsts.offsets.y;
r1.x = (int)r0.w + 1;
r0.w = InstanceParams_instancing_instanceData.Load(r0.w).y;
r1.x = InstanceParams_instancing_instanceData.Load(r1.x).y;
r1.x = mad((int)v1.x, 7, (int)r1.x);
// Known bad code for instruction (needs manual fix):
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx
r2.y = InstanceParams_instancing_instanceData[]..swiz;
r3.xyzw = (int4)r1.xxxx + int4(1,2,3,4);
r1.xy = (int2)r1.xx + int2(5,6);
// Known bad code for instruction (needs manual fix):
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r3.x, l(0), t82.xxxx
r2.w = InstanceParams_instancing_instanceData[]..swiz;
r2.xz = (uint2)r2.yw << int2(16,16);
r2.xyzw = (uint4)r2.xyzw >> int4(16,16,16,16);
r2.xyz = (int3)r2.www * (int3)r2.xyz;
r2.xyz = (int3)r2.xyz;
r4.xyz = float3(3.05175781e-005,3.05175781e-005,3.05175781e-005) * r2.xyz;
r5.xyz = r4.xyz * MaterialParams_constants.VertexScale_89.xyz + r0.xyz;
r0.xy = (int2)r0.ww + int2(1,2);
r6.xyzw = InstanceParams_instancing_instanceData.Load(r0.w).xyzw;
r7.xyzw = InstanceParams_instancing_instanceData.Load(r0.x).xyzw;
r0.xyzw = InstanceParams_instancing_instanceData.Load(r0.y).xyzw;
r2.y = r7.w;
r2.z = r0.w;
r2.x = r6.w;
r8.xyz = -PassParams_constants.viewTranslation.xyz + r2.xyz;
r8.w = 1;
r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m00_m10_m20_m30);
r5.w = 1;
r2.y = r7.x;
r2.z = r0.x;
r2.x = r6.x;
r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20);
r10.y = r7.y;
r10.z = r0.y;
r10.x = r6.y;
r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20);
r11.y = r7.z;
r11.z = r0.z;
r11.x = r6.z;
r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20);
o0.x = dot(r5.xyzw, r9.xyzw);
r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m01_m11_m21_m31);
r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21);
r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21);
r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21);
o0.y = dot(r5.xyzw, r9.xyzw);
r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m02_m12_m22_m32);
r8.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m03_m13_m23_m33);
r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22);
r8.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23);
r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22);
r8.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23);
r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22);
r8.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23);
o0.w = dot(r5.xyzw, r8.xyzw);
o0.z = dot(r5.xyzw, r9.xyzw);
// Known bad code for instruction (needs manual fix):
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx
r2.y = InstanceParams_instancing_instanceData[]..swiz;
// Known bad code for instruction (needs manual fix):
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.w, r1.y, l(0), t82.xxxx
r1.w = InstanceParams_instancing_instanceData[]..swiz;
r2.x = (uint)r2.y << 16;
r1.xy = (uint2)r2.xy >> int2(16,16);
r1.xy = (int2)r1.xy;
o1.xy = float2(0.000488288701,0.000488288701) * r1.xy;
r1.z = (uint)r1.w << 16;
r1.xy = (uint2)r1.zw >> int2(16,16);
r1.xy = (int2)r1.xy;
o1.zw = float2(0.000488288701,0.000488288701) * r1.xy;
// Known bad code for instruction (needs manual fix):
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.w, l(0), t82.xxxx
r1.x = InstanceParams_instancing_instanceData[]..swiz;
r1.yzw = (uint3)r1.xxx >> int3(8,16,24);
r1.xyzw = (int4)r1.xyzw & int4(255,255,255,255);
r1.xyzw = (uint4)r1.xyzw;
o2.xyzw = float4(0.00392156886,0.00392156886,0.00392156886,0.00392156886) * r1.xyzw;
r4.w = 1;
o3.y = dot(r4.xyzw, r7.xyzw);
o3.z = dot(r4.xyzw, r0.xyzw);
o3.x = dot(r4.xyzw, r6.xyzw);
o3.w = 1;
// Known bad code for instruction (needs manual fix):
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.z, l(0), t82.xxxx
r1.x = InstanceParams_instancing_instanceData[]..swiz;
// Known bad code for instruction (needs manual fix):
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r3.y, l(0), t82.xxxx
r2.x = InstanceParams_instancing_instanceData[]..swiz;
r1.yz = (uint2)r1.xx >> int2(8,16);
r1.xyz = (int3)r1.xyz & int3(255,255,255);
r1.xyz = (uint3)r1.xyz;
r1.xyz = float3(-127,-127,-127) + r1.xyz;
r1.xyz = float3(0.00787401572,0.00787401572,0.00787401572) * r1.xyz;
o4.y = dot(r1.xyz, r7.xyz);
o4.z = dot(r1.xyz, r0.xyz);
o4.x = dot(r1.xyz, r6.xyz);
o4.w = 0;
r0.w = cmp(0 < (int)r2.w);
r1.w = cmp((int)r2.w < 0);
r0.w = (int)-r0.w + (int)r1.w;
r0.w = (int)r0.w;
r2.yz = (uint2)r2.xx >> int2(8,16);
r2.xyz = (int3)r2.xyz & int3(255,255,255);
r2.xyz = (uint3)r2.xyz;
r2.xyz = float3(-127,-127,-127) + r2.xyz;
r2.xyz = float3(0.00787401572,0.00787401572,0.00787401572) * r2.xyz;
r3.xyz = r2.zxy * r1.yzx;
r1.xyz = r2.yzx * r1.zxy + -r3.xyz;
r1.xyz = r1.xyz * r0.www;
o5.x = dot(r1.xyz, r6.xyz);
o6.x = dot(r2.xyz, r6.xyz);
o5.y = dot(r1.xyz, r7.xyz);
o6.y = dot(r2.xyz, r7.xyz);
o6.z = dot(r2.xyz, r0.xyz);
o5.z = dot(r1.xyz, r0.xyz);
o5.w = 0;
o6.w = 0;
o7.x = v0.x;
return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
// using 3Dmigoto v1.2.67 on Wed Nov 08 07:25:34 2017
//
//
// Buffer Definitions:
//
// cbuffer PassParams_cbuffer
// {
//
// struct PassParams_Constants
// {
//
// float4 eyePosition; // Offset: 0
// float4 eyePositionPrevFrame; // Offset: 16
// float4 eyeDirection; // Offset: 32
// float4 eyeDirectionPrevFrame; // Offset: 48
// float4x4 viewToWorld; // Offset: 64
// float4x4 viewToWorldPrevFrame; // Offset: 128
// float4x4 worldToView; // Offset: 192
// float4x4 worldToViewPrevFrame; // Offset: 256
// float4x4 projMatrix; // Offset: 320
// float4x4 viewProj; // Offset: 384
// float4x4 viewNoTranslationProj;// Offset: 448
// float4x4 viewProjPrevFrame; // Offset: 512
// float4x4 viewNoTranslationProjPrevFrame;// Offset: 576
// float4 viewTranslation; // Offset: 640
// float4 viewTranslationPrevFrame;// Offset: 656
// float4 vPosToUV; // Offset: 672
// float4 viewportScaleOffset; // Offset: 688
// float4 zFrontBackValue; // Offset: 704
// float4 clipPlane; // Offset: 720
// float4 frustumPlanes[4]; // Offset: 736
// float4 globalLightingScale; // Offset: 800
// float4 viewSpaceLightingBackWS;// Offset: 816
// float4 projectorPosition; // Offset: 832
// float4 prevProjectorPosition; // Offset: 848
// float4 pixelPatchingParams; // Offset: 864
// float gradientAdjustMipBias; // Offset: 880
// float thinGeomAAPixelScale; // Offset: 884
// uint layerIndex; // Offset: 888
// uint globalCubeMapIndex; // Offset: 892
// uint dynamicGBufferCubeMapIndex;// Offset: 896
// uint alphaDitherEnabled; // Offset: 900
// uint TAADitherEnabled; // Offset: 904
// float CameraTAAFadeStartDist; // Offset: 908
//
// struct MaterialTable_Constants
// {
//
// } materialTable; // Offset: 4294967292
//
// struct ReverseProjParams_Constants
// {
//
// float4x4 ClipXYZToViewPos; // Offset: 912
// float4x4 ClipXYZToWorldPos;// Offset: 976
// float4 ClipZToViewZ; // Offset: 1040
//
// } RevProjParams; // Offset: 912
//
// struct RefractionParams_Constants
// {
//
// } refraction; // Offset: 4294967292
//
// struct DeferredCommonParams_Constants
// {
//
// } deferredcommon; // Offset: 4294967292
//
// struct MotionVectorParams_Constants
// {
//
// } motionVector; // Offset: 4294967292
//
// struct CombinedCloudShadow_Constants
// {
//
// float4 XYScaleBias; // Offset: 1056
// float4 ForwardMappingParams;// Offset: 1072
// float2 ZProject; // Offset: 1088
// float4 BackwardMappingParams;// Offset: 1104
// float CloudShadowGIDensity;// Offset: 1120
//
// } combinedCloudShadow; // Offset: 1056
//
// struct AmbientLightingParams_Constants
// {
//
// } AmbientLighting; // Offset: 4294967292
//
// struct VolumetricFogParams_Constants
// {
//
// float4 volumeInvTransZ; // Offset: 1136
// float4 volumeTexScale; // Offset: 1152
// float4 volumeTexBias; // Offset: 1168
// float4 sunColor; // Offset: 1184
// float4 sunColorByOneOverPi;// Offset: 1200
//
// } fog; // Offset: 1136
//
// struct UnderwaterLightingParams_Constants
// {
//
// float3 InvDepthParams; // Offset: 1216
//
// } underwater; // Offset: 1216
//
// struct ClusteredLightsEvaluateParams_Constants
// {
//
// float4 VposToClusterXY; // Offset: 1232
// float4 ClipPosToClusterXY; // Offset: 1248
// float4 ClusterTransZ; // Offset: 1264
// uint HighClusterW; // Offset: 1280
// uint HighClusterWH; // Offset: 1284
//
// } clusteredLightsEvaluate; // Offset: 1232
//
// struct WaterStamperTextureParams_Constants
// {
//
// } waterStamperTextures; // Offset: 4294967292
//
// struct WaterCustomMeshParams_Constants
// {
//
// float3 maxCC; // Offset: 1296
//
// } waterCustomMeshParams; // Offset: 1296
//
// struct VideoAndScreenshotParams_Constants
// {
//
// } videoAndScreenshot; // Offset: 4294967292
//
// struct RainRipplesParams_Constants
// {
//
// } rainRipples; // Offset: 4294967292
//
// struct CookieShadowParams_Constants
// {
//
// } cookieShadows; // Offset: 4294967292
//
// struct NearShadowParams_Constants
// {
//
// } nearShadows; // Offset: 4294967292
//
// struct FarShadowParams_Constants
// {
//
// float FarShadowBlendRatio; // Offset: 1312
//
// } farShadows; // Offset: 1312
//
// struct CommonShadowParams_Constants
// {
//
// } commonShadows; // Offset: 4294967292
//
// struct GrassForceSamplingParams_Constants
// {
//
// float2 WorldToUVOffset; // Offset: 1328
// float2 WorldToUVScale; // Offset: 1336
// float2 ReferenceWorldXY; // Offset: 1344
// float FadeStart; // Offset: 1352
// float Radius; // Offset: 1356
//
// } grassForce; // Offset: 1328
//
// } PassParams_constants; // Offset: 0 Size: 1360
//
// }
//
// cbuffer InstanceParams_cbuffer
// {
//
// struct InstanceParams_Constants
// {
//
// float4x4 world; // Offset: 0
// float4x4 worldPrevFrame; // Offset: 64
// float4x4 worldViewProj; // Offset: 128
// float4x4 worldViewProjPrevFrame;// Offset: 192
// float4 dissolveFactor; // Offset: 256
// float LODBlendFactor; // Offset: 272
// float wetnessBias; // Offset: 276
// float alphaTestValue; // Offset: 280
// uint materialTableIndex; // Offset: 284
// uint instanceOffset; // Offset: 288
// uint CameraTAADither; // Offset: 292
//
// struct InstancingParams_Constants
// {
//
// struct InstanceBatchSetupConsts_Constants
// {
//
// int4 offsets; // Offset: 304
//
// } instanceBatchSetupConsts;// Offset: 304
//
// } instancing; // Offset: 304
//
// } InstanceParams_constants; // Offset: 0 Size: 320
//
// }
//
// cbuffer MaterialParams_cbuffer
// {
//
// struct MaterialParams_Constants
// {
//
// struct DefaultMaterialConsts
// {
//
// float4 blendXYAlphaTestTwoSided;// Offset: 0
//
// } defaults; // Offset: 0
// float4 VertexQuadMin_6; // Offset: 16
// float4 VertexScale_89; // Offset: 32
// float4 VertexOffset_92; // Offset: 48
// float4 VertexQuadMax_16; // Offset: 64
// float4 AlphaClampFallof_2; // Offset: 80
// float4 UseVertexAlpha_4; // Offset: 96
// float4 UseScreenAlpha_5; // Offset: 112
// float4 UseLayer1AlphaGrayScale_7;// Offset: 128
// float4 AlphaClampMin_9; // Offset: 144
// float4 AlphaClampIsLayer01Alpha_10;// Offset: 160
// float4 UseLayer1Alpha_11; // Offset: 176
// float4 Layer0DiffuseUVIsClamp_13;// Offset: 192
// float4 Layer0DiffuseIsBC4_14; // Offset: 208
// float4 Layer1AlphaIsBC4_15; // Offset: 224
// float4 Layer1AlphaUVIsClamp_17;// Offset: 240
// float4 Layer0DiffuseIs9SS_18; // Offset: 256
// float4 OcclusionAlpha_20; // Offset: 272
// float4 OcclusionAlphaStepValue_21;// Offset: 288
// float4 Layer0DiffuseIsScreenSpace_22;// Offset: 304
// float4 Layer0DiffuseIsInvert_23;// Offset: 320
// float4 Layer0ColorIsAdd_24; // Offset: 336
// float4 ScreenAlphaTop_25; // Offset: 352
// float4 ScreenAlphaFallout_26; // Offset: 368
// float4 ScreenAlphaBottom_27; // Offset: 384
// float4 AlphaBoost_28; // Offset: 400
// float4 Mipmap_30; // Offset: 416
// float3x3 Layer0DiffuseUV_8_matrix;// Offset: 432
// float3x3 Layer1AlphaUV_12_matrix;// Offset: 480
//
// } MaterialParams_constants; // Offset: 0 Size: 524
//
// }
//
// Resource bind info for InstanceParams_instancing_ClusterVertexDataStatic
// {
//
// uint $Element; // Offset: 0 Size: 4
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// InstanceParams_instancing_instanceData texture float4 buf 81 1
// InstanceParams_instancing_ClusterVertexDataStatic texture struct r/o 82 1
// PassParams_cbuffer cbuffer NA NA 1 1
// MaterialParams_cbuffer cbuffer NA NA 2 1
// InstanceParams_cbuffer cbuffer NA NA 3 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION 0 x 0 NONE uint x
// SV_VertexID 0 x 1 VERTID uint x
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float xyzw
// TEXCOORD 0 xyzw 1 NONE float xyzw
// COLOR 0 xyzw 2 NONE float xyzw
// TEXCOORD 1 xyzw 3 NONE float xyzw
// TEXCOORD 2 xyzw 4 NONE float xyzw
// TEXCOORD 3 xyzw 5 NONE float xyzw
// TEXCOORD 4 xyzw 6 NONE float xyzw
// InstanceID 0 x 7 NONE uint x
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[41], immediateIndexed
dcl_constantbuffer cb3[20], immediateIndexed
dcl_constantbuffer cb2[5], immediateIndexed
dcl_resource_buffer (float,float,float,float) t81
dcl_resource_structured t82, 4
dcl_input v0.x
dcl_input_sgv v1.x, vertex_id
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.x
dcl_temps 12
add r0.xyz, |cb2[1].xyzx|, |cb2[4].xyzx|
mad r0.xyz, r0.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(1.192092896E-007, 1.00000012, 1.192092896E-007, 0.000000)
div r0.xyz, cb2[3].xyzx, r0.xyzx
ishl r0.w, v0.x, l(3)
ushr r0.w, r0.w, l(2)
iadd r0.w, r0.w, cb3[19].y
iadd r1.x, r0.w, l(1)
ld_indexable(buffer)(float,float,float,float) r0.w, r0.wwww, t81.xzwy
ld_indexable(buffer)(float,float,float,float) r1.x, r1.xxxx, t81.yxzw
imad r1.x, v1.x, l(7), r1.x
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx
iadd r3.xyzw, r1.xxxx, l(1, 2, 3, 4)
iadd r1.xy, r1.xxxx, l(5, 6, 0, 0)
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r3.x, l(0), t82.xxxx
ishl r2.xz, r2.yywy, l(16, 0, 16, 0)
ishr r2.xyzw, r2.xyzw, l(16, 16, 16, 16)
imul null, r2.xyz, r2.wwww, r2.xyzx
itof r2.xyz, r2.xyzx
mul r4.xyz, r2.xyzx, l(0.0000305175781, 0.0000305175781, 0.0000305175781, 0.000000)
mad r5.xyz, r4.xyzx, cb2[2].xyzx, r0.xyzx
iadd r0.xy, r0.wwww, l(1, 2, 0, 0)
ld_indexable(buffer)(float,float,float,float) r6.xyzw, r0.wwww, t81.xyzw
ld_indexable(buffer)(float,float,float,float) r7.xyzw, r0.xxxx, t81.xyzw
ld_indexable(buffer)(float,float,float,float) r0.xyzw, r0.yyyy, t81.xyzw
mov r2.y, r7.w
mov r2.z, r0.w
mov r2.x, r6.w
add r8.xyz, r2.xyzx, -cb1[40].xyzx
mov r8.w, l(1.000000)
dp4 r9.w, r8.xyzw, cb1[28].xyzw
mov r5.w, l(1.000000)
mov r2.y, r7.x
mov r2.z, r0.x
mov r2.x, r6.x
dp3 r9.x, r2.xyzx, cb1[28].xyzx
mov r10.y, r7.y
mov r10.z, r0.y
mov r10.x, r6.y
dp3 r9.y, r10.xyzx, cb1[28].xyzx
mov r11.y, r7.z
mov r11.z, r0.z
mov r11.x, r6.z
dp3 r9.z, r11.xyzx, cb1[28].xyzx
dp4 o0.x, r5.xyzw, r9.xyzw
dp4 r9.w, r8.xyzw, cb1[29].xyzw
dp3 r9.x, r2.xyzx, cb1[29].xyzx
dp3 r9.y, r10.xyzx, cb1[29].xyzx
dp3 r9.z, r11.xyzx, cb1[29].xyzx
dp4 o0.y, r5.xyzw, r9.xyzw
dp4 r9.w, r8.xyzw, cb1[30].xyzw
dp4 r8.w, r8.xyzw, cb1[31].xyzw
dp3 r9.x, r2.xyzx, cb1[30].xyzx
dp3 r8.x, r2.xyzx, cb1[31].xyzx
dp3 r9.y, r10.xyzx, cb1[30].xyzx
dp3 r8.y, r10.xyzx, cb1[31].xyzx
dp3 r9.z, r11.xyzx, cb1[30].xyzx
dp3 r8.z, r11.xyzx, cb1[31].xyzx
dp4 o0.w, r5.xyzw, r8.xyzw
dp4 o0.z, r5.xyzw, r9.xyzw
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.w, r1.y, l(0), t82.xxxx
ishl r2.x, r2.y, l(16)
ishr r1.xy, r2.xyxx, l(16, 16, 0, 0)
itof r1.xy, r1.xyxx
mul o1.xy, r1.xyxx, l(0.000488288701, 0.000488288701, 0.000000, 0.000000)
ishl r1.z, r1.w, l(16)
ishr r1.xy, r1.zwzz, l(16, 16, 0, 0)
itof r1.xy, r1.xyxx
mul o1.zw, r1.xxxy, l(0.000000, 0.000000, 0.000488288701, 0.000488288701)
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.w, l(0), t82.xxxx
ushr r1.yzw, r1.xxxx, l(0, 8, 16, 24)
and r1.xyzw, r1.xyzw, l(255, 255, 255, 255)
utof r1.xyzw, r1.xyzw
mul o2.xyzw, r1.xyzw, l(0.00392156886, 0.00392156886, 0.00392156886, 0.00392156886)
mov r4.w, l(1.000000)
dp4 o3.y, r4.xyzw, r7.xyzw
dp4 o3.z, r4.xyzw, r0.xyzw
dp4 o3.x, r4.xyzw, r6.xyzw
mov o3.w, l(1.000000)
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.z, l(0), t82.xxxx
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r3.y, l(0), t82.xxxx
ushr r1.yz, r1.xxxx, l(0, 8, 16, 0)
and r1.xyz, r1.xyzx, l(255, 255, 255, 0)
utof r1.xyz, r1.xyzx
add r1.xyz, r1.xyzx, l(-127.000000, -127.000000, -127.000000, 0.000000)
mul r1.xyz, r1.xyzx, l(0.00787401572, 0.00787401572, 0.00787401572, 0.000000)
dp3 o4.y, r1.xyzx, r7.xyzx
dp3 o4.z, r1.xyzx, r0.xyzx
dp3 o4.x, r1.xyzx, r6.xyzx
mov o4.w, l(0)
ilt r0.w, l(0), r2.w
ilt r1.w, r2.w, l(0)
iadd r0.w, -r0.w, r1.w
itof r0.w, r0.w
ushr r2.yz, r2.xxxx, l(0, 8, 16, 0)
and r2.xyz, r2.xyzx, l(255, 255, 255, 0)
utof r2.xyz, r2.xyzx
add r2.xyz, r2.xyzx, l(-127.000000, -127.000000, -127.000000, 0.000000)
mul r2.xyz, r2.xyzx, l(0.00787401572, 0.00787401572, 0.00787401572, 0.000000)
mul r3.xyz, r1.yzxy, r2.zxyz
mad r1.xyz, r2.yzxy, r1.zxyz, -r3.xyzx
mul r1.xyz, r0.wwww, r1.xyzx
dp3 o5.x, r1.xyzx, r6.xyzx
dp3 o6.x, r2.xyzx, r6.xyzx
dp3 o5.y, r1.xyzx, r7.xyzx
dp3 o6.y, r2.xyzx, r7.xyzx
dp3 o6.z, r2.xyzx, r0.xyzx
dp3 o5.z, r1.xyzx, r0.xyzx
mov o5.w, l(0)
mov o6.w, l(0)
mov o7.x, v0.x
ret
// Approximately 112 instruction slots used

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


I'm not sure what a transition animation is though.

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

Posted 11/08/2017 06:31 AM   
Oh. That VS needs fixing. The ASM version should be fine to use, I think, if you know how to do it. I'm on my phone so I can't write examples. About transition animations, what I mean is this: No transition: - HUD if on (1). - Press hotkey. - HUD is off (0). With transition: - HUD is on (1). - Press hotkey. - HUD starts to squish towards the centre (0.9). - And more (0.7). ... - And more (0.1). - HUD is off (0). I think it changes once per frame (someone correct me if I'm wrong). I use that because it funny to watch, in some way similar to turning off a CRT TV. It also helps for things like changing HUD depth, or convergence.
Oh. That VS needs fixing. The ASM version should be fine to use, I think, if you know how to do it. I'm on my phone so I can't write examples.

About transition animations, what I mean is this:

No transition:

- HUD if on (1).
- Press hotkey.
- HUD is off (0).

With transition:

- HUD is on (1).
- Press hotkey.
- HUD starts to squish towards the centre (0.9).
- And more (0.7).
...
- And more (0.1).
- HUD is off (0).

I think it changes once per frame (someone correct me if I'm wrong). I use that because it funny to watch, in some way similar to turning off a CRT TV. It also helps for things like changing HUD depth, or convergence.

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/2017 02:25 PM   
Ah I see :) I would rather do it the regular on/off way though.
Ah I see :)

I would rather do it the regular on/off way though.

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

Posted 11/08/2017 04:52 PM   
So here is a question that I can't find an answer ^_^ I know that for VS: "dcl_constantbuffer cb12[0], immediateIndexed" is enough to make the shader MONO. But, how do I do it for a PS? Putting this code in a PS still makes it stereo. However, if I mark the shader as MONO, I get the intended result. Am I looking at the wrong cbuffer? ^_^
So here is a question that I can't find an answer ^_^

I know that for VS: "dcl_constantbuffer cb12[0], immediateIndexed" is enough to make the shader MONO.
But, how do I do it for a PS? Putting this code in a PS still makes it stereo.
However, if I mark the shader as MONO, I get the intended result.

Am I looking at the wrong cbuffer?

^_^

1x Palit RTX 2080Ti Pro Gaming OC(watercooled and overclocked to hell)
3x 3D Vision Ready Asus VG278HE monitors (5760x1080).
Intel i9 9900K (overclocked to 5.3 and watercooled ofc).
Asus Maximus XI Hero Mobo.
16 GB Team Group T-Force Dark Pro DDR4 @ 3600.
Lots of Disks:
- Raid 0 - 256GB Sandisk Extreme SSD.
- Raid 0 - WD Black - 2TB.
- SanDisk SSD PLUS 480 GB.
- Intel 760p 256GB M.2 PCIe NVMe SSD.
Creative Sound Blaster Z.
Windows 10 x64 Pro.
etc


My website with my fixes and OpenGL to 3D Vision wrapper:
http://3dsurroundgaming.com

(If you like some of the stuff that I've done and want to donate something, you can do it with PayPal at tavyhome@gmail.com)

Posted 11/09/2017 01:04 AM   
@DetectiveJohnKimble: Here is a hand-fixed version of that VS. You can replace the text with this one, and it will compile and run. Check if it's broken in some other way using the F9 show-original command. But I expect this should work. [code]// ---- Created with 3Dmigoto v1.2.67 on Wed Nov 08 07:25:34 2017 cbuffer PassParams_cbuffer : register(b1) { struct { float4 eyePosition; float4 eyePositionPrevFrame; float4 eyeDirection; float4 eyeDirectionPrevFrame; float4x4 viewToWorld; float4x4 viewToWorldPrevFrame; float4x4 worldToView; float4x4 worldToViewPrevFrame; float4x4 projMatrix; float4x4 viewProj; float4x4 viewNoTranslationProj; float4x4 viewProjPrevFrame; float4x4 viewNoTranslationProjPrevFrame; float4 viewTranslation; float4 viewTranslationPrevFrame; float4 vPosToUV; float4 viewportScaleOffset; float4 zFrontBackValue; float4 clipPlane; float4 frustumPlanes[4]; float4 globalLightingScale; float4 viewSpaceLightingBackWS; float4 projectorPosition; float4 prevProjectorPosition; float4 pixelPatchingParams; float gradientAdjustMipBias; float thinGeomAAPixelScale; uint layerIndex; uint globalCubeMapIndex; uint dynamicGBufferCubeMapIndex; uint alphaDitherEnabled; uint TAADitherEnabled; float CameraTAAFadeStartDist; struct { } materialTable; struct { float4x4 ClipXYZToViewPos; float4x4 ClipXYZToWorldPos; float4 ClipZToViewZ; } RevProjParams; struct { } refraction; struct { } deferredcommon; struct { } motionVector; struct { float4 XYScaleBias; float4 ForwardMappingParams; float2 ZProject; float4 BackwardMappingParams; float CloudShadowGIDensity; } combinedCloudShadow; struct { } AmbientLighting; struct { float4 volumeInvTransZ; float4 volumeTexScale; float4 volumeTexBias; float4 sunColor; float4 sunColorByOneOverPi; } fog; struct { float3 InvDepthParams; } underwater; struct { float4 VposToClusterXY; float4 ClipPosToClusterXY; float4 ClusterTransZ; uint HighClusterW; uint HighClusterWH; } clusteredLightsEvaluate; struct { } waterStamperTextures; struct { float3 maxCC; } waterCustomMeshParams; struct { } videoAndScreenshot; struct { } rainRipples; struct { } cookieShadows; struct { } nearShadows; struct { float FarShadowBlendRatio; } farShadows; struct { } commonShadows; struct { float2 WorldToUVOffset; float2 WorldToUVScale; float2 ReferenceWorldXY; float FadeStart; float Radius; } grassForce; } PassParams_constants : packoffset(c0); } cbuffer InstanceParams_cbuffer : register(b3) { struct { float4x4 world; float4x4 worldPrevFrame; float4x4 worldViewProj; float4x4 worldViewProjPrevFrame; float4 dissolveFactor; float LODBlendFactor; float wetnessBias; float alphaTestValue; uint materialTableIndex; uint instanceOffset; uint CameraTAADither; struct { struct { int4 offsets; } instanceBatchSetupConsts; } instancing; } InstanceParams_constants : packoffset(c0); } cbuffer MaterialParams_cbuffer : register(b2) { struct { struct { float4 blendXYAlphaTestTwoSided; } defaults; float4 VertexQuadMin_6; float4 VertexScale_89; float4 VertexOffset_92; float4 VertexQuadMax_16; float4 AlphaClampFallof_2; float4 UseVertexAlpha_4; float4 UseScreenAlpha_5; float4 UseLayer1AlphaGrayScale_7; float4 AlphaClampMin_9; float4 AlphaClampIsLayer01Alpha_10; float4 UseLayer1Alpha_11; float4 Layer0DiffuseUVIsClamp_13; float4 Layer0DiffuseIsBC4_14; float4 Layer1AlphaIsBC4_15; float4 Layer1AlphaUVIsClamp_17; float4 Layer0DiffuseIs9SS_18; float4 OcclusionAlpha_20; float4 OcclusionAlphaStepValue_21; float4 Layer0DiffuseIsScreenSpace_22; float4 Layer0DiffuseIsInvert_23; float4 Layer0ColorIsAdd_24; float4 ScreenAlphaTop_25; float4 ScreenAlphaFallout_26; float4 ScreenAlphaBottom_27; float4 AlphaBoost_28; float4 Mipmap_30; float3x3 Layer0DiffuseUV_8_matrix; float3x3 Layer1AlphaUV_12_matrix; } MaterialParams_constants : packoffset(c0); } Buffer<float4> InstanceParams_instancing_instanceData : register(t81); // Resource bind info for InstanceParams_instancing_ClusterVertexDataStatic // { // // uint $Element; // Offset: 0 Size: 4 // // } //StructuredBuffer<InstanceParams_instancing_ClusterVertexDataStatic> InstanceParams_instancing_ClusterVertexDataStatic : register(t82); StructuredBuffer<uint> InstanceParams_instancing_ClusterVertexDataStatic : register(t82); // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( uint v0 : POSITION0, uint v1 : SV_VertexID0, out float4 o0 : SV_Position0, out float4 o1 : TEXCOORD0, out float4 o2 : COLOR0, out float4 o3 : TEXCOORD1, out float4 o4 : TEXCOORD2, out float4 o5 : TEXCOORD3, out float4 o6 : TEXCOORD4, out uint o7 : InstanceID0) { // Needs manual fix for instruction: // unknown dcl_: dcl_resource_structured t82, 4 // Needs manual fix for instruction: // unknown dcl_: dcl_input_sgv v1.x, vertex_id float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11; uint4 bitmask, uiDest; float4 fDest; r0.xyz = abs(MaterialParams_constants.VertexQuadMax_16.xyz) + abs(MaterialParams_constants.VertexQuadMin_6.xyz); r0.xyz = r0.xyz * float3(0.5,0.5,0.5) + float3(1.1920929e-007,1.00000012,1.1920929e-007); r0.xyz = MaterialParams_constants.VertexOffset_92.xyz / r0.xyz; r0.w = (uint)v0.x << 3; r0.w = (uint)r0.w >> 2; r0.w = (int)r0.w + (int)InstanceParams_constants.instancing.instanceBatchSetupConsts.offsets.y; r1.x = (int)r0.w + 1; r0.w = InstanceParams_instancing_instanceData.Load(r0.w).y; r1.x = InstanceParams_instancing_instanceData.Load(r1.x).y; r1.x = mad((int)v1.x, 7, (int)r1.x); // Known bad code for instruction (needs manual fix): // ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx r2.y = InstanceParams_instancing_ClusterVertexDataStatic[r1.x]; r3.xyzw = (int4)r1.xxxx + int4(1,2,3,4); r1.xy = (int2)r1.xx + int2(5,6); // Known bad code for instruction (needs manual fix): // ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r3.x, l(0), t82.xxxx r2.w = InstanceParams_instancing_ClusterVertexDataStatic[r3.x]; r2.xz = (uint2)r2.yw << int2(16,16); r2.xyzw = (uint4)r2.xyzw >> int4(16,16,16,16); r2.xyz = (int3)r2.www * (int3)r2.xyz; r2.xyz = (int3)r2.xyz; r4.xyz = float3(3.05175781e-005,3.05175781e-005,3.05175781e-005) * r2.xyz; r5.xyz = r4.xyz * MaterialParams_constants.VertexScale_89.xyz + r0.xyz; r0.xy = (int2)r0.ww + int2(1,2); r6.xyzw = InstanceParams_instancing_instanceData.Load(r0.w).xyzw; r7.xyzw = InstanceParams_instancing_instanceData.Load(r0.x).xyzw; r0.xyzw = InstanceParams_instancing_instanceData.Load(r0.y).xyzw; r2.y = r7.w; r2.z = r0.w; r2.x = r6.w; r8.xyz = -PassParams_constants.viewTranslation.xyz + r2.xyz; r8.w = 1; r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m00_m10_m20_m30); r5.w = 1; r2.y = r7.x; r2.z = r0.x; r2.x = r6.x; r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20); r10.y = r7.y; r10.z = r0.y; r10.x = r6.y; r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20); r11.y = r7.z; r11.z = r0.z; r11.x = r6.z; r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20); o0.x = dot(r5.xyzw, r9.xyzw); r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m01_m11_m21_m31); r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21); r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21); r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21); o0.y = dot(r5.xyzw, r9.xyzw); r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m02_m12_m22_m32); r8.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m03_m13_m23_m33); r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22); r8.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23); r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22); r8.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23); r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22); r8.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23); o0.w = dot(r5.xyzw, r8.xyzw); o0.z = dot(r5.xyzw, r9.xyzw); // Known bad code for instruction (needs manual fix): // ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx r2.y = InstanceParams_instancing_ClusterVertexDataStatic[r1.x]; // Known bad code for instruction (needs manual fix): // ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.w, r1.y, l(0), t82.xxxx r1.w = InstanceParams_instancing_ClusterVertexDataStatic[r1.y]; r2.x = (uint)r2.y << 16; r1.xy = (uint2)r2.xy >> int2(16,16); r1.xy = (int2)r1.xy; o1.xy = float2(0.000488288701,0.000488288701) * r1.xy; r1.z = (uint)r1.w << 16; r1.xy = (uint2)r1.zw >> int2(16,16); r1.xy = (int2)r1.xy; o1.zw = float2(0.000488288701,0.000488288701) * r1.xy; // Known bad code for instruction (needs manual fix): // ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.w, l(0), t82.xxxx r1.x = InstanceParams_instancing_ClusterVertexDataStatic[r3.w]; r1.yzw = (uint3)r1.xxx >> int3(8,16,24); r1.xyzw = (int4)r1.xyzw & int4(255,255,255,255); r1.xyzw = (uint4)r1.xyzw; o2.xyzw = float4(0.00392156886,0.00392156886,0.00392156886,0.00392156886) * r1.xyzw; r4.w = 1; o3.y = dot(r4.xyzw, r7.xyzw); o3.z = dot(r4.xyzw, r0.xyzw); o3.x = dot(r4.xyzw, r6.xyzw); o3.w = 1; // Known bad code for instruction (needs manual fix): // ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.z, l(0), t82.xxxx r1.x = InstanceParams_instancing_ClusterVertexDataStatic[r3.z]; // Known bad code for instruction (needs manual fix): // ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r3.y, l(0), t82.xxxx r2.x = InstanceParams_instancing_ClusterVertexDataStatic[r3.y]; r1.yz = (uint2)r1.xx >> int2(8,16); r1.xyz = (int3)r1.xyz & int3(255,255,255); r1.xyz = (uint3)r1.xyz; r1.xyz = float3(-127,-127,-127) + r1.xyz; r1.xyz = float3(0.00787401572,0.00787401572,0.00787401572) * r1.xyz; o4.y = dot(r1.xyz, r7.xyz); o4.z = dot(r1.xyz, r0.xyz); o4.x = dot(r1.xyz, r6.xyz); o4.w = 0; r0.w = cmp(0 < (int)r2.w); r1.w = cmp((int)r2.w < 0); r0.w = (int)-r0.w + (int)r1.w; r0.w = (int)r0.w; r2.yz = (uint2)r2.xx >> int2(8,16); r2.xyz = (int3)r2.xyz & int3(255,255,255); r2.xyz = (uint3)r2.xyz; r2.xyz = float3(-127,-127,-127) + r2.xyz; r2.xyz = float3(0.00787401572,0.00787401572,0.00787401572) * r2.xyz; r3.xyz = r2.zxy * r1.yzx; r1.xyz = r2.yzx * r1.zxy + -r3.xyz; r1.xyz = r1.xyz * r0.www; o5.x = dot(r1.xyz, r6.xyz); o6.x = dot(r2.xyz, r6.xyz); o5.y = dot(r1.xyz, r7.xyz); o6.y = dot(r2.xyz, r7.xyz); o6.z = dot(r2.xyz, r0.xyz); o5.z = dot(r1.xyz, r0.xyz); o5.w = 0; o6.w = 0; o7.x = v0.x; return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) HLSL Shader Compiler 10.1 // // using 3Dmigoto v1.2.67 on Wed Nov 08 07:25:34 2017 // // // Buffer Definitions: // // cbuffer PassParams_cbuffer // { // // struct PassParams_Constants // { // // float4 eyePosition; // Offset: 0 // float4 eyePositionPrevFrame; // Offset: 16 // float4 eyeDirection; // Offset: 32 // float4 eyeDirectionPrevFrame; // Offset: 48 // float4x4 viewToWorld; // Offset: 64 // float4x4 viewToWorldPrevFrame; // Offset: 128 // float4x4 worldToView; // Offset: 192 // float4x4 worldToViewPrevFrame; // Offset: 256 // float4x4 projMatrix; // Offset: 320 // float4x4 viewProj; // Offset: 384 // float4x4 viewNoTranslationProj;// Offset: 448 // float4x4 viewProjPrevFrame; // Offset: 512 // float4x4 viewNoTranslationProjPrevFrame;// Offset: 576 // float4 viewTranslation; // Offset: 640 // float4 viewTranslationPrevFrame;// Offset: 656 // float4 vPosToUV; // Offset: 672 // float4 viewportScaleOffset; // Offset: 688 // float4 zFrontBackValue; // Offset: 704 // float4 clipPlane; // Offset: 720 // float4 frustumPlanes[4]; // Offset: 736 // float4 globalLightingScale; // Offset: 800 // float4 viewSpaceLightingBackWS;// Offset: 816 // float4 projectorPosition; // Offset: 832 // float4 prevProjectorPosition; // Offset: 848 // float4 pixelPatchingParams; // Offset: 864 // float gradientAdjustMipBias; // Offset: 880 // float thinGeomAAPixelScale; // Offset: 884 // uint layerIndex; // Offset: 888 // uint globalCubeMapIndex; // Offset: 892 // uint dynamicGBufferCubeMapIndex;// Offset: 896 // uint alphaDitherEnabled; // Offset: 900 // uint TAADitherEnabled; // Offset: 904 // float CameraTAAFadeStartDist; // Offset: 908 // // struct MaterialTable_Constants // { // // } materialTable; // Offset: 4294967292 // // struct ReverseProjParams_Constants // { // // float4x4 ClipXYZToViewPos; // Offset: 912 // float4x4 ClipXYZToWorldPos;// Offset: 976 // float4 ClipZToViewZ; // Offset: 1040 // // } RevProjParams; // Offset: 912 // // struct RefractionParams_Constants // { // // } refraction; // Offset: 4294967292 // // struct DeferredCommonParams_Constants // { // // } deferredcommon; // Offset: 4294967292 // // struct MotionVectorParams_Constants // { // // } motionVector; // Offset: 4294967292 // // struct CombinedCloudShadow_Constants // { // // float4 XYScaleBias; // Offset: 1056 // float4 ForwardMappingParams;// Offset: 1072 // float2 ZProject; // Offset: 1088 // float4 BackwardMappingParams;// Offset: 1104 // float CloudShadowGIDensity;// Offset: 1120 // // } combinedCloudShadow; // Offset: 1056 // // struct AmbientLightingParams_Constants // { // // } AmbientLighting; // Offset: 4294967292 // // struct VolumetricFogParams_Constants // { // // float4 volumeInvTransZ; // Offset: 1136 // float4 volumeTexScale; // Offset: 1152 // float4 volumeTexBias; // Offset: 1168 // float4 sunColor; // Offset: 1184 // float4 sunColorByOneOverPi;// Offset: 1200 // // } fog; // Offset: 1136 // // struct UnderwaterLightingParams_Constants // { // // float3 InvDepthParams; // Offset: 1216 // // } underwater; // Offset: 1216 // // struct ClusteredLightsEvaluateParams_Constants // { // // float4 VposToClusterXY; // Offset: 1232 // float4 ClipPosToClusterXY; // Offset: 1248 // float4 ClusterTransZ; // Offset: 1264 // uint HighClusterW; // Offset: 1280 // uint HighClusterWH; // Offset: 1284 // // } clusteredLightsEvaluate; // Offset: 1232 // // struct WaterStamperTextureParams_Constants // { // // } waterStamperTextures; // Offset: 4294967292 // // struct WaterCustomMeshParams_Constants // { // // float3 maxCC; // Offset: 1296 // // } waterCustomMeshParams; // Offset: 1296 // // struct VideoAndScreenshotParams_Constants // { // // } videoAndScreenshot; // Offset: 4294967292 // // struct RainRipplesParams_Constants // { // // } rainRipples; // Offset: 4294967292 // // struct CookieShadowParams_Constants // { // // } cookieShadows; // Offset: 4294967292 // // struct NearShadowParams_Constants // { // // } nearShadows; // Offset: 4294967292 // // struct FarShadowParams_Constants // { // // float FarShadowBlendRatio; // Offset: 1312 // // } farShadows; // Offset: 1312 // // struct CommonShadowParams_Constants // { // // } commonShadows; // Offset: 4294967292 // // struct GrassForceSamplingParams_Constants // { // // float2 WorldToUVOffset; // Offset: 1328 // float2 WorldToUVScale; // Offset: 1336 // float2 ReferenceWorldXY; // Offset: 1344 // float FadeStart; // Offset: 1352 // float Radius; // Offset: 1356 // // } grassForce; // Offset: 1328 // // } PassParams_constants; // Offset: 0 Size: 1360 // // } // // cbuffer InstanceParams_cbuffer // { // // struct InstanceParams_Constants // { // // float4x4 world; // Offset: 0 // float4x4 worldPrevFrame; // Offset: 64 // float4x4 worldViewProj; // Offset: 128 // float4x4 worldViewProjPrevFrame;// Offset: 192 // float4 dissolveFactor; // Offset: 256 // float LODBlendFactor; // Offset: 272 // float wetnessBias; // Offset: 276 // float alphaTestValue; // Offset: 280 // uint materialTableIndex; // Offset: 284 // uint instanceOffset; // Offset: 288 // uint CameraTAADither; // Offset: 292 // // struct InstancingParams_Constants // { // // struct InstanceBatchSetupConsts_Constants // { // // int4 offsets; // Offset: 304 // // } instanceBatchSetupConsts;// Offset: 304 // // } instancing; // Offset: 304 // // } InstanceParams_constants; // Offset: 0 Size: 320 // // } // // cbuffer MaterialParams_cbuffer // { // // struct MaterialParams_Constants // { // // struct DefaultMaterialConsts // { // // float4 blendXYAlphaTestTwoSided;// Offset: 0 // // } defaults; // Offset: 0 // float4 VertexQuadMin_6; // Offset: 16 // float4 VertexScale_89; // Offset: 32 // float4 VertexOffset_92; // Offset: 48 // float4 VertexQuadMax_16; // Offset: 64 // float4 AlphaClampFallof_2; // Offset: 80 // float4 UseVertexAlpha_4; // Offset: 96 // float4 UseScreenAlpha_5; // Offset: 112 // float4 UseLayer1AlphaGrayScale_7;// Offset: 128 // float4 AlphaClampMin_9; // Offset: 144 // float4 AlphaClampIsLayer01Alpha_10;// Offset: 160 // float4 UseLayer1Alpha_11; // Offset: 176 // float4 Layer0DiffuseUVIsClamp_13;// Offset: 192 // float4 Layer0DiffuseIsBC4_14; // Offset: 208 // float4 Layer1AlphaIsBC4_15; // Offset: 224 // float4 Layer1AlphaUVIsClamp_17;// Offset: 240 // float4 Layer0DiffuseIs9SS_18; // Offset: 256 // float4 OcclusionAlpha_20; // Offset: 272 // float4 OcclusionAlphaStepValue_21;// Offset: 288 // float4 Layer0DiffuseIsScreenSpace_22;// Offset: 304 // float4 Layer0DiffuseIsInvert_23;// Offset: 320 // float4 Layer0ColorIsAdd_24; // Offset: 336 // float4 ScreenAlphaTop_25; // Offset: 352 // float4 ScreenAlphaFallout_26; // Offset: 368 // float4 ScreenAlphaBottom_27; // Offset: 384 // float4 AlphaBoost_28; // Offset: 400 // float4 Mipmap_30; // Offset: 416 // float3x3 Layer0DiffuseUV_8_matrix;// Offset: 432 // float3x3 Layer1AlphaUV_12_matrix;// Offset: 480 // // } MaterialParams_constants; // Offset: 0 Size: 524 // // } // // Resource bind info for InstanceParams_instancing_ClusterVertexDataStatic // { // // uint $Element; // Offset: 0 Size: 4 // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // InstanceParams_instancing_instanceData texture float4 buf 81 1 // InstanceParams_instancing_ClusterVertexDataStatic texture struct r/o 82 1 // PassParams_cbuffer cbuffer NA NA 1 1 // MaterialParams_cbuffer cbuffer NA NA 2 1 // InstanceParams_cbuffer cbuffer NA NA 3 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // POSITION 0 x 0 NONE uint x // SV_VertexID 0 x 1 VERTID uint x // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Position 0 xyzw 0 POS float xyzw // TEXCOORD 0 xyzw 1 NONE float xyzw // COLOR 0 xyzw 2 NONE float xyzw // TEXCOORD 1 xyzw 3 NONE float xyzw // TEXCOORD 2 xyzw 4 NONE float xyzw // TEXCOORD 3 xyzw 5 NONE float xyzw // TEXCOORD 4 xyzw 6 NONE float xyzw // InstanceID 0 x 7 NONE uint x // vs_5_0 dcl_globalFlags refactoringAllowed dcl_constantbuffer cb1[41], immediateIndexed dcl_constantbuffer cb3[20], immediateIndexed dcl_constantbuffer cb2[5], immediateIndexed dcl_resource_buffer (float,float,float,float) t81 dcl_resource_structured t82, 4 dcl_input v0.x dcl_input_sgv v1.x, vertex_id dcl_output_siv o0.xyzw, position dcl_output o1.xyzw dcl_output o2.xyzw dcl_output o3.xyzw dcl_output o4.xyzw dcl_output o5.xyzw dcl_output o6.xyzw dcl_output o7.x dcl_temps 12 add r0.xyz, |cb2[1].xyzx|, |cb2[4].xyzx| mad r0.xyz, r0.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(1.192092896E-007, 1.00000012, 1.192092896E-007, 0.000000) div r0.xyz, cb2[3].xyzx, r0.xyzx ishl r0.w, v0.x, l(3) ushr r0.w, r0.w, l(2) iadd r0.w, r0.w, cb3[19].y iadd r1.x, r0.w, l(1) ld_indexable(buffer)(float,float,float,float) r0.w, r0.wwww, t81.xzwy ld_indexable(buffer)(float,float,float,float) r1.x, r1.xxxx, t81.yxzw imad r1.x, v1.x, l(7), r1.x ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx iadd r3.xyzw, r1.xxxx, l(1, 2, 3, 4) iadd r1.xy, r1.xxxx, l(5, 6, 0, 0) ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r3.x, l(0), t82.xxxx ishl r2.xz, r2.yywy, l(16, 0, 16, 0) ishr r2.xyzw, r2.xyzw, l(16, 16, 16, 16) imul null, r2.xyz, r2.wwww, r2.xyzx itof r2.xyz, r2.xyzx mul r4.xyz, r2.xyzx, l(0.0000305175781, 0.0000305175781, 0.0000305175781, 0.000000) mad r5.xyz, r4.xyzx, cb2[2].xyzx, r0.xyzx iadd r0.xy, r0.wwww, l(1, 2, 0, 0) ld_indexable(buffer)(float,float,float,float) r6.xyzw, r0.wwww, t81.xyzw ld_indexable(buffer)(float,float,float,float) r7.xyzw, r0.xxxx, t81.xyzw ld_indexable(buffer)(float,float,float,float) r0.xyzw, r0.yyyy, t81.xyzw mov r2.y, r7.w mov r2.z, r0.w mov r2.x, r6.w add r8.xyz, r2.xyzx, -cb1[40].xyzx mov r8.w, l(1.000000) dp4 r9.w, r8.xyzw, cb1[28].xyzw mov r5.w, l(1.000000) mov r2.y, r7.x mov r2.z, r0.x mov r2.x, r6.x dp3 r9.x, r2.xyzx, cb1[28].xyzx mov r10.y, r7.y mov r10.z, r0.y mov r10.x, r6.y dp3 r9.y, r10.xyzx, cb1[28].xyzx mov r11.y, r7.z mov r11.z, r0.z mov r11.x, r6.z dp3 r9.z, r11.xyzx, cb1[28].xyzx dp4 o0.x, r5.xyzw, r9.xyzw dp4 r9.w, r8.xyzw, cb1[29].xyzw dp3 r9.x, r2.xyzx, cb1[29].xyzx dp3 r9.y, r10.xyzx, cb1[29].xyzx dp3 r9.z, r11.xyzx, cb1[29].xyzx dp4 o0.y, r5.xyzw, r9.xyzw dp4 r9.w, r8.xyzw, cb1[30].xyzw dp4 r8.w, r8.xyzw, cb1[31].xyzw dp3 r9.x, r2.xyzx, cb1[30].xyzx dp3 r8.x, r2.xyzx, cb1[31].xyzx dp3 r9.y, r10.xyzx, cb1[30].xyzx dp3 r8.y, r10.xyzx, cb1[31].xyzx dp3 r9.z, r11.xyzx, cb1[30].xyzx dp3 r8.z, r11.xyzx, cb1[31].xyzx dp4 o0.w, r5.xyzw, r8.xyzw dp4 o0.z, r5.xyzw, r9.xyzw ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.w, r1.y, l(0), t82.xxxx ishl r2.x, r2.y, l(16) ishr r1.xy, r2.xyxx, l(16, 16, 0, 0) itof r1.xy, r1.xyxx mul o1.xy, r1.xyxx, l(0.000488288701, 0.000488288701, 0.000000, 0.000000) ishl r1.z, r1.w, l(16) ishr r1.xy, r1.zwzz, l(16, 16, 0, 0) itof r1.xy, r1.xyxx mul o1.zw, r1.xxxy, l(0.000000, 0.000000, 0.000488288701, 0.000488288701) ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.w, l(0), t82.xxxx ushr r1.yzw, r1.xxxx, l(0, 8, 16, 24) and r1.xyzw, r1.xyzw, l(255, 255, 255, 255) utof r1.xyzw, r1.xyzw mul o2.xyzw, r1.xyzw, l(0.00392156886, 0.00392156886, 0.00392156886, 0.00392156886) mov r4.w, l(1.000000) dp4 o3.y, r4.xyzw, r7.xyzw dp4 o3.z, r4.xyzw, r0.xyzw dp4 o3.x, r4.xyzw, r6.xyzw mov o3.w, l(1.000000) ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.z, l(0), t82.xxxx ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r3.y, l(0), t82.xxxx ushr r1.yz, r1.xxxx, l(0, 8, 16, 0) and r1.xyz, r1.xyzx, l(255, 255, 255, 0) utof r1.xyz, r1.xyzx add r1.xyz, r1.xyzx, l(-127.000000, -127.000000, -127.000000, 0.000000) mul r1.xyz, r1.xyzx, l(0.00787401572, 0.00787401572, 0.00787401572, 0.000000) dp3 o4.y, r1.xyzx, r7.xyzx dp3 o4.z, r1.xyzx, r0.xyzx dp3 o4.x, r1.xyzx, r6.xyzx mov o4.w, l(0) ilt r0.w, l(0), r2.w ilt r1.w, r2.w, l(0) iadd r0.w, -r0.w, r1.w itof r0.w, r0.w ushr r2.yz, r2.xxxx, l(0, 8, 16, 0) and r2.xyz, r2.xyzx, l(255, 255, 255, 0) utof r2.xyz, r2.xyzx add r2.xyz, r2.xyzx, l(-127.000000, -127.000000, -127.000000, 0.000000) mul r2.xyz, r2.xyzx, l(0.00787401572, 0.00787401572, 0.00787401572, 0.000000) mul r3.xyz, r1.yzxy, r2.zxyz mad r1.xyz, r2.yzxy, r1.zxyz, -r3.xyzx mul r1.xyz, r0.wwww, r1.xyzx dp3 o5.x, r1.xyzx, r6.xyzx dp3 o6.x, r2.xyzx, r6.xyzx dp3 o5.y, r1.xyzx, r7.xyzx dp3 o6.y, r2.xyzx, r7.xyzx dp3 o6.z, r2.xyzx, r0.xyzx dp3 o5.z, r1.xyzx, r0.xyzx mov o5.w, l(0) mov o6.w, l(0) mov o7.x, v0.x ret // Approximately 112 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ [/code]
@DetectiveJohnKimble: Here is a hand-fixed version of that VS. You can replace the text with this one, and it will compile and run. Check if it's broken in some other way using the F9 show-original command. But I expect this should work.

// ---- Created with 3Dmigoto v1.2.67 on Wed Nov 08 07:25:34 2017

cbuffer PassParams_cbuffer : register(b1)
{

struct
{
float4 eyePosition;
float4 eyePositionPrevFrame;
float4 eyeDirection;
float4 eyeDirectionPrevFrame;
float4x4 viewToWorld;
float4x4 viewToWorldPrevFrame;
float4x4 worldToView;
float4x4 worldToViewPrevFrame;
float4x4 projMatrix;
float4x4 viewProj;
float4x4 viewNoTranslationProj;
float4x4 viewProjPrevFrame;
float4x4 viewNoTranslationProjPrevFrame;
float4 viewTranslation;
float4 viewTranslationPrevFrame;
float4 vPosToUV;
float4 viewportScaleOffset;
float4 zFrontBackValue;
float4 clipPlane;
float4 frustumPlanes[4];
float4 globalLightingScale;
float4 viewSpaceLightingBackWS;
float4 projectorPosition;
float4 prevProjectorPosition;
float4 pixelPatchingParams;
float gradientAdjustMipBias;
float thinGeomAAPixelScale;
uint layerIndex;
uint globalCubeMapIndex;
uint dynamicGBufferCubeMapIndex;
uint alphaDitherEnabled;
uint TAADitherEnabled;
float CameraTAAFadeStartDist;

struct
{
} materialTable;


struct
{
float4x4 ClipXYZToViewPos;
float4x4 ClipXYZToWorldPos;
float4 ClipZToViewZ;
} RevProjParams;


struct
{
} refraction;


struct
{
} deferredcommon;


struct
{
} motionVector;


struct
{
float4 XYScaleBias;
float4 ForwardMappingParams;
float2 ZProject;
float4 BackwardMappingParams;
float CloudShadowGIDensity;
} combinedCloudShadow;


struct
{
} AmbientLighting;


struct
{
float4 volumeInvTransZ;
float4 volumeTexScale;
float4 volumeTexBias;
float4 sunColor;
float4 sunColorByOneOverPi;
} fog;


struct
{
float3 InvDepthParams;
} underwater;


struct
{
float4 VposToClusterXY;
float4 ClipPosToClusterXY;
float4 ClusterTransZ;
uint HighClusterW;
uint HighClusterWH;
} clusteredLightsEvaluate;


struct
{
} waterStamperTextures;


struct
{
float3 maxCC;
} waterCustomMeshParams;


struct
{
} videoAndScreenshot;


struct
{
} rainRipples;


struct
{
} cookieShadows;


struct
{
} nearShadows;


struct
{
float FarShadowBlendRatio;
} farShadows;


struct
{
} commonShadows;


struct
{
float2 WorldToUVOffset;
float2 WorldToUVScale;
float2 ReferenceWorldXY;
float FadeStart;
float Radius;
} grassForce;

} PassParams_constants : packoffset(c0);

}

cbuffer InstanceParams_cbuffer : register(b3)
{

struct
{
float4x4 world;
float4x4 worldPrevFrame;
float4x4 worldViewProj;
float4x4 worldViewProjPrevFrame;
float4 dissolveFactor;
float LODBlendFactor;
float wetnessBias;
float alphaTestValue;
uint materialTableIndex;
uint instanceOffset;
uint CameraTAADither;

struct
{

struct
{
int4 offsets;
} instanceBatchSetupConsts;

} instancing;

} InstanceParams_constants : packoffset(c0);

}

cbuffer MaterialParams_cbuffer : register(b2)
{

struct
{

struct
{
float4 blendXYAlphaTestTwoSided;
} defaults;

float4 VertexQuadMin_6;
float4 VertexScale_89;
float4 VertexOffset_92;
float4 VertexQuadMax_16;
float4 AlphaClampFallof_2;
float4 UseVertexAlpha_4;
float4 UseScreenAlpha_5;
float4 UseLayer1AlphaGrayScale_7;
float4 AlphaClampMin_9;
float4 AlphaClampIsLayer01Alpha_10;
float4 UseLayer1Alpha_11;
float4 Layer0DiffuseUVIsClamp_13;
float4 Layer0DiffuseIsBC4_14;
float4 Layer1AlphaIsBC4_15;
float4 Layer1AlphaUVIsClamp_17;
float4 Layer0DiffuseIs9SS_18;
float4 OcclusionAlpha_20;
float4 OcclusionAlphaStepValue_21;
float4 Layer0DiffuseIsScreenSpace_22;
float4 Layer0DiffuseIsInvert_23;
float4 Layer0ColorIsAdd_24;
float4 ScreenAlphaTop_25;
float4 ScreenAlphaFallout_26;
float4 ScreenAlphaBottom_27;
float4 AlphaBoost_28;
float4 Mipmap_30;
float3x3 Layer0DiffuseUV_8_matrix;
float3x3 Layer1AlphaUV_12_matrix;
} MaterialParams_constants : packoffset(c0);

}

Buffer<float4> InstanceParams_instancing_instanceData : register(t81);

// Resource bind info for InstanceParams_instancing_ClusterVertexDataStatic
// {
//
// uint $Element; // Offset: 0 Size: 4
//
// }
//StructuredBuffer<InstanceParams_instancing_ClusterVertexDataStatic> InstanceParams_instancing_ClusterVertexDataStatic : register(t82);
StructuredBuffer<uint> InstanceParams_instancing_ClusterVertexDataStatic : register(t82);


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


void main(
uint v0 : POSITION0,
uint v1 : SV_VertexID0,
out float4 o0 : SV_Position0,
out float4 o1 : TEXCOORD0,
out float4 o2 : COLOR0,
out float4 o3 : TEXCOORD1,
out float4 o4 : TEXCOORD2,
out float4 o5 : TEXCOORD3,
out float4 o6 : TEXCOORD4,
out uint o7 : InstanceID0)
{
// Needs manual fix for instruction:
// unknown dcl_: dcl_resource_structured t82, 4
// Needs manual fix for instruction:
// unknown dcl_: dcl_input_sgv v1.x, vertex_id
float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11;
uint4 bitmask, uiDest;
float4 fDest;

r0.xyz = abs(MaterialParams_constants.VertexQuadMax_16.xyz) + abs(MaterialParams_constants.VertexQuadMin_6.xyz);
r0.xyz = r0.xyz * float3(0.5,0.5,0.5) + float3(1.1920929e-007,1.00000012,1.1920929e-007);
r0.xyz = MaterialParams_constants.VertexOffset_92.xyz / r0.xyz;
r0.w = (uint)v0.x << 3;
r0.w = (uint)r0.w >> 2;
r0.w = (int)r0.w + (int)InstanceParams_constants.instancing.instanceBatchSetupConsts.offsets.y;
r1.x = (int)r0.w + 1;
r0.w = InstanceParams_instancing_instanceData.Load(r0.w).y;
r1.x = InstanceParams_instancing_instanceData.Load(r1.x).y;
r1.x = mad((int)v1.x, 7, (int)r1.x);

// Known bad code for instruction (needs manual fix):
// ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx
r2.y = InstanceParams_instancing_ClusterVertexDataStatic[r1.x];

r3.xyzw = (int4)r1.xxxx + int4(1,2,3,4);
r1.xy = (int2)r1.xx + int2(5,6);

// Known bad code for instruction (needs manual fix):
// ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r3.x, l(0), t82.xxxx
r2.w = InstanceParams_instancing_ClusterVertexDataStatic[r3.x];

r2.xz = (uint2)r2.yw << int2(16,16);
r2.xyzw = (uint4)r2.xyzw >> int4(16,16,16,16);
r2.xyz = (int3)r2.www * (int3)r2.xyz;
r2.xyz = (int3)r2.xyz;
r4.xyz = float3(3.05175781e-005,3.05175781e-005,3.05175781e-005) * r2.xyz;
r5.xyz = r4.xyz * MaterialParams_constants.VertexScale_89.xyz + r0.xyz;
r0.xy = (int2)r0.ww + int2(1,2);
r6.xyzw = InstanceParams_instancing_instanceData.Load(r0.w).xyzw;
r7.xyzw = InstanceParams_instancing_instanceData.Load(r0.x).xyzw;
r0.xyzw = InstanceParams_instancing_instanceData.Load(r0.y).xyzw;
r2.y = r7.w;
r2.z = r0.w;
r2.x = r6.w;
r8.xyz = -PassParams_constants.viewTranslation.xyz + r2.xyz;
r8.w = 1;
r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m00_m10_m20_m30);
r5.w = 1;
r2.y = r7.x;
r2.z = r0.x;
r2.x = r6.x;
r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20);
r10.y = r7.y;
r10.z = r0.y;
r10.x = r6.y;
r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20);
r11.y = r7.z;
r11.z = r0.z;
r11.x = r6.z;
r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20);
o0.x = dot(r5.xyzw, r9.xyzw);
r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m01_m11_m21_m31);
r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21);
r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21);
r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21);
o0.y = dot(r5.xyzw, r9.xyzw);
r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m02_m12_m22_m32);
r8.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m03_m13_m23_m33);
r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22);
r8.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23);
r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22);
r8.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23);
r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22);
r8.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23);
o0.w = dot(r5.xyzw, r8.xyzw);
o0.z = dot(r5.xyzw, r9.xyzw);

// Known bad code for instruction (needs manual fix):
// ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx
r2.y = InstanceParams_instancing_ClusterVertexDataStatic[r1.x];

// Known bad code for instruction (needs manual fix):
// ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.w, r1.y, l(0), t82.xxxx
r1.w = InstanceParams_instancing_ClusterVertexDataStatic[r1.y];

r2.x = (uint)r2.y << 16;
r1.xy = (uint2)r2.xy >> int2(16,16);
r1.xy = (int2)r1.xy;
o1.xy = float2(0.000488288701,0.000488288701) * r1.xy;
r1.z = (uint)r1.w << 16;
r1.xy = (uint2)r1.zw >> int2(16,16);
r1.xy = (int2)r1.xy;
o1.zw = float2(0.000488288701,0.000488288701) * r1.xy;

// Known bad code for instruction (needs manual fix):
// ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.w, l(0), t82.xxxx
r1.x = InstanceParams_instancing_ClusterVertexDataStatic[r3.w];

r1.yzw = (uint3)r1.xxx >> int3(8,16,24);
r1.xyzw = (int4)r1.xyzw & int4(255,255,255,255);
r1.xyzw = (uint4)r1.xyzw;
o2.xyzw = float4(0.00392156886,0.00392156886,0.00392156886,0.00392156886) * r1.xyzw;
r4.w = 1;
o3.y = dot(r4.xyzw, r7.xyzw);
o3.z = dot(r4.xyzw, r0.xyzw);
o3.x = dot(r4.xyzw, r6.xyzw);
o3.w = 1;

// Known bad code for instruction (needs manual fix):
// ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.z, l(0), t82.xxxx
r1.x = InstanceParams_instancing_ClusterVertexDataStatic[r3.z];

// Known bad code for instruction (needs manual fix):
// ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r3.y, l(0), t82.xxxx
r2.x = InstanceParams_instancing_ClusterVertexDataStatic[r3.y];

r1.yz = (uint2)r1.xx >> int2(8,16);
r1.xyz = (int3)r1.xyz & int3(255,255,255);
r1.xyz = (uint3)r1.xyz;
r1.xyz = float3(-127,-127,-127) + r1.xyz;
r1.xyz = float3(0.00787401572,0.00787401572,0.00787401572) * r1.xyz;
o4.y = dot(r1.xyz, r7.xyz);
o4.z = dot(r1.xyz, r0.xyz);
o4.x = dot(r1.xyz, r6.xyz);
o4.w = 0;
r0.w = cmp(0 < (int)r2.w);
r1.w = cmp((int)r2.w < 0);
r0.w = (int)-r0.w + (int)r1.w;
r0.w = (int)r0.w;
r2.yz = (uint2)r2.xx >> int2(8,16);
r2.xyz = (int3)r2.xyz & int3(255,255,255);
r2.xyz = (uint3)r2.xyz;
r2.xyz = float3(-127,-127,-127) + r2.xyz;
r2.xyz = float3(0.00787401572,0.00787401572,0.00787401572) * r2.xyz;
r3.xyz = r2.zxy * r1.yzx;
r1.xyz = r2.yzx * r1.zxy + -r3.xyz;
r1.xyz = r1.xyz * r0.www;
o5.x = dot(r1.xyz, r6.xyz);
o6.x = dot(r2.xyz, r6.xyz);
o5.y = dot(r1.xyz, r7.xyz);
o6.y = dot(r2.xyz, r7.xyz);
o6.z = dot(r2.xyz, r0.xyz);
o5.z = dot(r1.xyz, r0.xyz);
o5.w = 0;
o6.w = 0;
o7.x = v0.x;
return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
// using 3Dmigoto v1.2.67 on Wed Nov 08 07:25:34 2017
//
//
// Buffer Definitions:
//
// cbuffer PassParams_cbuffer
// {
//
// struct PassParams_Constants
// {
//
// float4 eyePosition; // Offset: 0
// float4 eyePositionPrevFrame; // Offset: 16
// float4 eyeDirection; // Offset: 32
// float4 eyeDirectionPrevFrame; // Offset: 48
// float4x4 viewToWorld; // Offset: 64
// float4x4 viewToWorldPrevFrame; // Offset: 128
// float4x4 worldToView; // Offset: 192
// float4x4 worldToViewPrevFrame; // Offset: 256
// float4x4 projMatrix; // Offset: 320
// float4x4 viewProj; // Offset: 384
// float4x4 viewNoTranslationProj;// Offset: 448
// float4x4 viewProjPrevFrame; // Offset: 512
// float4x4 viewNoTranslationProjPrevFrame;// Offset: 576
// float4 viewTranslation; // Offset: 640
// float4 viewTranslationPrevFrame;// Offset: 656
// float4 vPosToUV; // Offset: 672
// float4 viewportScaleOffset; // Offset: 688
// float4 zFrontBackValue; // Offset: 704
// float4 clipPlane; // Offset: 720
// float4 frustumPlanes[4]; // Offset: 736
// float4 globalLightingScale; // Offset: 800
// float4 viewSpaceLightingBackWS;// Offset: 816
// float4 projectorPosition; // Offset: 832
// float4 prevProjectorPosition; // Offset: 848
// float4 pixelPatchingParams; // Offset: 864
// float gradientAdjustMipBias; // Offset: 880
// float thinGeomAAPixelScale; // Offset: 884
// uint layerIndex; // Offset: 888
// uint globalCubeMapIndex; // Offset: 892
// uint dynamicGBufferCubeMapIndex;// Offset: 896
// uint alphaDitherEnabled; // Offset: 900
// uint TAADitherEnabled; // Offset: 904
// float CameraTAAFadeStartDist; // Offset: 908
//
// struct MaterialTable_Constants
// {
//
// } materialTable; // Offset: 4294967292
//
// struct ReverseProjParams_Constants
// {
//
// float4x4 ClipXYZToViewPos; // Offset: 912
// float4x4 ClipXYZToWorldPos;// Offset: 976
// float4 ClipZToViewZ; // Offset: 1040
//
// } RevProjParams; // Offset: 912
//
// struct RefractionParams_Constants
// {
//
// } refraction; // Offset: 4294967292
//
// struct DeferredCommonParams_Constants
// {
//
// } deferredcommon; // Offset: 4294967292
//
// struct MotionVectorParams_Constants
// {
//
// } motionVector; // Offset: 4294967292
//
// struct CombinedCloudShadow_Constants
// {
//
// float4 XYScaleBias; // Offset: 1056
// float4 ForwardMappingParams;// Offset: 1072
// float2 ZProject; // Offset: 1088
// float4 BackwardMappingParams;// Offset: 1104
// float CloudShadowGIDensity;// Offset: 1120
//
// } combinedCloudShadow; // Offset: 1056
//
// struct AmbientLightingParams_Constants
// {
//
// } AmbientLighting; // Offset: 4294967292
//
// struct VolumetricFogParams_Constants
// {
//
// float4 volumeInvTransZ; // Offset: 1136
// float4 volumeTexScale; // Offset: 1152
// float4 volumeTexBias; // Offset: 1168
// float4 sunColor; // Offset: 1184
// float4 sunColorByOneOverPi;// Offset: 1200
//
// } fog; // Offset: 1136
//
// struct UnderwaterLightingParams_Constants
// {
//
// float3 InvDepthParams; // Offset: 1216
//
// } underwater; // Offset: 1216
//
// struct ClusteredLightsEvaluateParams_Constants
// {
//
// float4 VposToClusterXY; // Offset: 1232
// float4 ClipPosToClusterXY; // Offset: 1248
// float4 ClusterTransZ; // Offset: 1264
// uint HighClusterW; // Offset: 1280
// uint HighClusterWH; // Offset: 1284
//
// } clusteredLightsEvaluate; // Offset: 1232
//
// struct WaterStamperTextureParams_Constants
// {
//
// } waterStamperTextures; // Offset: 4294967292
//
// struct WaterCustomMeshParams_Constants
// {
//
// float3 maxCC; // Offset: 1296
//
// } waterCustomMeshParams; // Offset: 1296
//
// struct VideoAndScreenshotParams_Constants
// {
//
// } videoAndScreenshot; // Offset: 4294967292
//
// struct RainRipplesParams_Constants
// {
//
// } rainRipples; // Offset: 4294967292
//
// struct CookieShadowParams_Constants
// {
//
// } cookieShadows; // Offset: 4294967292
//
// struct NearShadowParams_Constants
// {
//
// } nearShadows; // Offset: 4294967292
//
// struct FarShadowParams_Constants
// {
//
// float FarShadowBlendRatio; // Offset: 1312
//
// } farShadows; // Offset: 1312
//
// struct CommonShadowParams_Constants
// {
//
// } commonShadows; // Offset: 4294967292
//
// struct GrassForceSamplingParams_Constants
// {
//
// float2 WorldToUVOffset; // Offset: 1328
// float2 WorldToUVScale; // Offset: 1336
// float2 ReferenceWorldXY; // Offset: 1344
// float FadeStart; // Offset: 1352
// float Radius; // Offset: 1356
//
// } grassForce; // Offset: 1328
//
// } PassParams_constants; // Offset: 0 Size: 1360
//
// }
//
// cbuffer InstanceParams_cbuffer
// {
//
// struct InstanceParams_Constants
// {
//
// float4x4 world; // Offset: 0
// float4x4 worldPrevFrame; // Offset: 64
// float4x4 worldViewProj; // Offset: 128
// float4x4 worldViewProjPrevFrame;// Offset: 192
// float4 dissolveFactor; // Offset: 256
// float LODBlendFactor; // Offset: 272
// float wetnessBias; // Offset: 276
// float alphaTestValue; // Offset: 280
// uint materialTableIndex; // Offset: 284
// uint instanceOffset; // Offset: 288
// uint CameraTAADither; // Offset: 292
//
// struct InstancingParams_Constants
// {
//
// struct InstanceBatchSetupConsts_Constants
// {
//
// int4 offsets; // Offset: 304
//
// } instanceBatchSetupConsts;// Offset: 304
//
// } instancing; // Offset: 304
//
// } InstanceParams_constants; // Offset: 0 Size: 320
//
// }
//
// cbuffer MaterialParams_cbuffer
// {
//
// struct MaterialParams_Constants
// {
//
// struct DefaultMaterialConsts
// {
//
// float4 blendXYAlphaTestTwoSided;// Offset: 0
//
// } defaults; // Offset: 0
// float4 VertexQuadMin_6; // Offset: 16
// float4 VertexScale_89; // Offset: 32
// float4 VertexOffset_92; // Offset: 48
// float4 VertexQuadMax_16; // Offset: 64
// float4 AlphaClampFallof_2; // Offset: 80
// float4 UseVertexAlpha_4; // Offset: 96
// float4 UseScreenAlpha_5; // Offset: 112
// float4 UseLayer1AlphaGrayScale_7;// Offset: 128
// float4 AlphaClampMin_9; // Offset: 144
// float4 AlphaClampIsLayer01Alpha_10;// Offset: 160
// float4 UseLayer1Alpha_11; // Offset: 176
// float4 Layer0DiffuseUVIsClamp_13;// Offset: 192
// float4 Layer0DiffuseIsBC4_14; // Offset: 208
// float4 Layer1AlphaIsBC4_15; // Offset: 224
// float4 Layer1AlphaUVIsClamp_17;// Offset: 240
// float4 Layer0DiffuseIs9SS_18; // Offset: 256
// float4 OcclusionAlpha_20; // Offset: 272
// float4 OcclusionAlphaStepValue_21;// Offset: 288
// float4 Layer0DiffuseIsScreenSpace_22;// Offset: 304
// float4 Layer0DiffuseIsInvert_23;// Offset: 320
// float4 Layer0ColorIsAdd_24; // Offset: 336
// float4 ScreenAlphaTop_25; // Offset: 352
// float4 ScreenAlphaFallout_26; // Offset: 368
// float4 ScreenAlphaBottom_27; // Offset: 384
// float4 AlphaBoost_28; // Offset: 400
// float4 Mipmap_30; // Offset: 416
// float3x3 Layer0DiffuseUV_8_matrix;// Offset: 432
// float3x3 Layer1AlphaUV_12_matrix;// Offset: 480
//
// } MaterialParams_constants; // Offset: 0 Size: 524
//
// }
//
// Resource bind info for InstanceParams_instancing_ClusterVertexDataStatic
// {
//
// uint $Element; // Offset: 0 Size: 4
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// InstanceParams_instancing_instanceData texture float4 buf 81 1
// InstanceParams_instancing_ClusterVertexDataStatic texture struct r/o 82 1
// PassParams_cbuffer cbuffer NA NA 1 1
// MaterialParams_cbuffer cbuffer NA NA 2 1
// InstanceParams_cbuffer cbuffer NA NA 3 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION 0 x 0 NONE uint x
// SV_VertexID 0 x 1 VERTID uint x
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float xyzw
// TEXCOORD 0 xyzw 1 NONE float xyzw
// COLOR 0 xyzw 2 NONE float xyzw
// TEXCOORD 1 xyzw 3 NONE float xyzw
// TEXCOORD 2 xyzw 4 NONE float xyzw
// TEXCOORD 3 xyzw 5 NONE float xyzw
// TEXCOORD 4 xyzw 6 NONE float xyzw
// InstanceID 0 x 7 NONE uint x
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[41], immediateIndexed
dcl_constantbuffer cb3[20], immediateIndexed
dcl_constantbuffer cb2[5], immediateIndexed
dcl_resource_buffer (float,float,float,float) t81
dcl_resource_structured t82, 4
dcl_input v0.x
dcl_input_sgv v1.x, vertex_id
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.x
dcl_temps 12
add r0.xyz, |cb2[1].xyzx|, |cb2[4].xyzx|
mad r0.xyz, r0.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(1.192092896E-007, 1.00000012, 1.192092896E-007, 0.000000)
div r0.xyz, cb2[3].xyzx, r0.xyzx
ishl r0.w, v0.x, l(3)
ushr r0.w, r0.w, l(2)
iadd r0.w, r0.w, cb3[19].y
iadd r1.x, r0.w, l(1)
ld_indexable(buffer)(float,float,float,float) r0.w, r0.wwww, t81.xzwy
ld_indexable(buffer)(float,float,float,float) r1.x, r1.xxxx, t81.yxzw
imad r1.x, v1.x, l(7), r1.x
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx
iadd r3.xyzw, r1.xxxx, l(1, 2, 3, 4)
iadd r1.xy, r1.xxxx, l(5, 6, 0, 0)
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r3.x, l(0), t82.xxxx
ishl r2.xz, r2.yywy, l(16, 0, 16, 0)
ishr r2.xyzw, r2.xyzw, l(16, 16, 16, 16)
imul null, r2.xyz, r2.wwww, r2.xyzx
itof r2.xyz, r2.xyzx
mul r4.xyz, r2.xyzx, l(0.0000305175781, 0.0000305175781, 0.0000305175781, 0.000000)
mad r5.xyz, r4.xyzx, cb2[2].xyzx, r0.xyzx
iadd r0.xy, r0.wwww, l(1, 2, 0, 0)
ld_indexable(buffer)(float,float,float,float) r6.xyzw, r0.wwww, t81.xyzw
ld_indexable(buffer)(float,float,float,float) r7.xyzw, r0.xxxx, t81.xyzw
ld_indexable(buffer)(float,float,float,float) r0.xyzw, r0.yyyy, t81.xyzw
mov r2.y, r7.w
mov r2.z, r0.w
mov r2.x, r6.w
add r8.xyz, r2.xyzx, -cb1[40].xyzx
mov r8.w, l(1.000000)
dp4 r9.w, r8.xyzw, cb1[28].xyzw
mov r5.w, l(1.000000)
mov r2.y, r7.x
mov r2.z, r0.x
mov r2.x, r6.x
dp3 r9.x, r2.xyzx, cb1[28].xyzx
mov r10.y, r7.y
mov r10.z, r0.y
mov r10.x, r6.y
dp3 r9.y, r10.xyzx, cb1[28].xyzx
mov r11.y, r7.z
mov r11.z, r0.z
mov r11.x, r6.z
dp3 r9.z, r11.xyzx, cb1[28].xyzx
dp4 o0.x, r5.xyzw, r9.xyzw
dp4 r9.w, r8.xyzw, cb1[29].xyzw
dp3 r9.x, r2.xyzx, cb1[29].xyzx
dp3 r9.y, r10.xyzx, cb1[29].xyzx
dp3 r9.z, r11.xyzx, cb1[29].xyzx
dp4 o0.y, r5.xyzw, r9.xyzw
dp4 r9.w, r8.xyzw, cb1[30].xyzw
dp4 r8.w, r8.xyzw, cb1[31].xyzw
dp3 r9.x, r2.xyzx, cb1[30].xyzx
dp3 r8.x, r2.xyzx, cb1[31].xyzx
dp3 r9.y, r10.xyzx, cb1[30].xyzx
dp3 r8.y, r10.xyzx, cb1[31].xyzx
dp3 r9.z, r11.xyzx, cb1[30].xyzx
dp3 r8.z, r11.xyzx, cb1[31].xyzx
dp4 o0.w, r5.xyzw, r8.xyzw
dp4 o0.z, r5.xyzw, r9.xyzw
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.w, r1.y, l(0), t82.xxxx
ishl r2.x, r2.y, l(16)
ishr r1.xy, r2.xyxx, l(16, 16, 0, 0)
itof r1.xy, r1.xyxx
mul o1.xy, r1.xyxx, l(0.000488288701, 0.000488288701, 0.000000, 0.000000)
ishl r1.z, r1.w, l(16)
ishr r1.xy, r1.zwzz, l(16, 16, 0, 0)
itof r1.xy, r1.xyxx
mul o1.zw, r1.xxxy, l(0.000000, 0.000000, 0.000488288701, 0.000488288701)
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.w, l(0), t82.xxxx
ushr r1.yzw, r1.xxxx, l(0, 8, 16, 24)
and r1.xyzw, r1.xyzw, l(255, 255, 255, 255)
utof r1.xyzw, r1.xyzw
mul o2.xyzw, r1.xyzw, l(0.00392156886, 0.00392156886, 0.00392156886, 0.00392156886)
mov r4.w, l(1.000000)
dp4 o3.y, r4.xyzw, r7.xyzw
dp4 o3.z, r4.xyzw, r0.xyzw
dp4 o3.x, r4.xyzw, r6.xyzw
mov o3.w, l(1.000000)
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.z, l(0), t82.xxxx
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r3.y, l(0), t82.xxxx
ushr r1.yz, r1.xxxx, l(0, 8, 16, 0)
and r1.xyz, r1.xyzx, l(255, 255, 255, 0)
utof r1.xyz, r1.xyzx
add r1.xyz, r1.xyzx, l(-127.000000, -127.000000, -127.000000, 0.000000)
mul r1.xyz, r1.xyzx, l(0.00787401572, 0.00787401572, 0.00787401572, 0.000000)
dp3 o4.y, r1.xyzx, r7.xyzx
dp3 o4.z, r1.xyzx, r0.xyzx
dp3 o4.x, r1.xyzx, r6.xyzx
mov o4.w, l(0)
ilt r0.w, l(0), r2.w
ilt r1.w, r2.w, l(0)
iadd r0.w, -r0.w, r1.w
itof r0.w, r0.w
ushr r2.yz, r2.xxxx, l(0, 8, 16, 0)
and r2.xyz, r2.xyzx, l(255, 255, 255, 0)
utof r2.xyz, r2.xyzx
add r2.xyz, r2.xyzx, l(-127.000000, -127.000000, -127.000000, 0.000000)
mul r2.xyz, r2.xyzx, l(0.00787401572, 0.00787401572, 0.00787401572, 0.000000)
mul r3.xyz, r1.yzxy, r2.zxyz
mad r1.xyz, r2.yzxy, r1.zxyz, -r3.xyzx
mul r1.xyz, r0.wwww, r1.xyzx
dp3 o5.x, r1.xyzx, r6.xyzx
dp3 o6.x, r2.xyzx, r6.xyzx
dp3 o5.y, r1.xyzx, r7.xyzx
dp3 o6.y, r2.xyzx, r7.xyzx
dp3 o6.z, r2.xyzx, r0.xyzx
dp3 o5.z, r1.xyzx, r0.xyzx
mov o5.w, l(0)
mov o6.w, l(0)
mov o7.x, v0.x
ret
// Approximately 112 instruction slots used

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

Acer H5360 (1280x720@120Hz) - ASUS VG248QE with GSync mod - 3D Vision 1&2 - Driver 372.54
GTX 970 - i5-4670K@4.2GHz - 12GB RAM - Win7x64+evilKB2670838 - 4 Disk X25 RAID
SAGER NP9870-S - GTX 980 - i7-6700K - Win10 Pro 1607
Latest 3Dmigoto Release
Bo3b's School for ShaderHackers

Posted 11/09/2017 01:24 AM   
[quote="bo3b"]@DetectiveJohnKimble: Here is a hand-fixed version of that VS. You can replace the text with this one, and it will compile and run. Check if it's broken in some other way using the F9 show-original command. But I expect this should work.[/quote] Thanks for looking in to it. But this gave me another error: [i]b9f391996aadaf7d-vs_replace.txt(240,7): error X3000: syntax error: unexpected token '&'[/i] Maybe the pixel shader is easier to fix?
bo3b said:@DetectiveJohnKimble: Here is a hand-fixed version of that VS. You can replace the text with this one, and it will compile and run. Check if it's broken in some other way using the F9 show-original command. But I expect this should work.


Thanks for looking in to it. But this gave me another error:

b9f391996aadaf7d-vs_replace.txt(240,7): error X3000: syntax error: unexpected token '&'

Maybe the pixel shader is easier to fix?

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

Posted 11/09/2017 07:07 AM   
[quote="DetectiveJohnKimble"][quote="bo3b"]@DetectiveJohnKimble: Here is a hand-fixed version of that VS. You can replace the text with this one, and it will compile and run. Check if it's broken in some other way using the F9 show-original command. But I expect this should work.[/quote] Thanks for looking in to it. But this gave me another error: [i]b9f391996aadaf7d-vs_replace.txt(240,7): error X3000: syntax error: unexpected token '&'[/i] Maybe the pixel shader is easier to fix?[/quote] Not sure how you copy/pasted the code, but that is wrong. There is no Ampersand in the original code I posted, and it compiles for me using fxc without error. VS is easier to fix, and that seemed like a better match for your scenario based on masterotaku's suggestion. Some of these are easy to hand fix. These are pretty simple, only about 10 minutes of effort. The one I did recently for DHR for TheEvilWithin2 was very hard, and took me 6 hours. But since it led to his breakthrough on how to fix the game, easily worth it.
DetectiveJohnKimble said:
bo3b said:@DetectiveJohnKimble: Here is a hand-fixed version of that VS. You can replace the text with this one, and it will compile and run. Check if it's broken in some other way using the F9 show-original command. But I expect this should work.


Thanks for looking in to it. But this gave me another error:

b9f391996aadaf7d-vs_replace.txt(240,7): error X3000: syntax error: unexpected token '&'

Maybe the pixel shader is easier to fix?

Not sure how you copy/pasted the code, but that is wrong. There is no Ampersand in the original code I posted, and it compiles for me using fxc without error.

VS is easier to fix, and that seemed like a better match for your scenario based on masterotaku's suggestion.


Some of these are easy to hand fix. These are pretty simple, only about 10 minutes of effort. The one I did recently for DHR for TheEvilWithin2 was very hard, and took me 6 hours. But since it led to his breakthrough on how to fix the game, easily worth it.

Acer H5360 (1280x720@120Hz) - ASUS VG248QE with GSync mod - 3D Vision 1&2 - Driver 372.54
GTX 970 - i5-4670K@4.2GHz - 12GB RAM - Win7x64+evilKB2670838 - 4 Disk X25 RAID
SAGER NP9870-S - GTX 980 - i7-6700K - Win10 Pro 1607
Latest 3Dmigoto Release
Bo3b's School for ShaderHackers

Posted 11/09/2017 11:12 PM   
[quote="bo3b"] Not sure how you copy/pasted the code, but that is wrong. There is no Ampersand in the original code I posted, and it compiles for me using fxc without error. VS is easier to fix, and that seemed like a better match for your scenario based on masterotaku's suggestion. Some of these are easy to hand fix. These are pretty simple, only about 10 minutes of effort. The one I did recently for DHR for TheEvilWithin2 was very hard, and took me 6 hours. But since it led to his breakthrough on how to fix the game, easily worth it.[/quote] Yeah I definitely copied it wrong the first time, sorry about that. This time I don't get any error messages, but I can't get it to toggle correctly. The shader seems to be off when I start the game and I get some funky visual glitches. This is the shader with the toggle code I added, can you see if I did something wrong? (Toggle code starts at line 278) [code]// ---- Created with 3Dmigoto v1.2.67 on Wed Nov 08 07:25:34 2017 cbuffer PassParams_cbuffer : register(b1) { struct { float4 eyePosition; float4 eyePositionPrevFrame; float4 eyeDirection; float4 eyeDirectionPrevFrame; float4x4 viewToWorld; float4x4 viewToWorldPrevFrame; float4x4 worldToView; float4x4 worldToViewPrevFrame; float4x4 projMatrix; float4x4 viewProj; float4x4 viewNoTranslationProj; float4x4 viewProjPrevFrame; float4x4 viewNoTranslationProjPrevFrame; float4 viewTranslation; float4 viewTranslationPrevFrame; float4 vPosToUV; float4 viewportScaleOffset; float4 zFrontBackValue; float4 clipPlane; float4 frustumPlanes[4]; float4 globalLightingScale; float4 viewSpaceLightingBackWS; float4 projectorPosition; float4 prevProjectorPosition; float4 pixelPatchingParams; float gradientAdjustMipBias; float thinGeomAAPixelScale; uint layerIndex; uint globalCubeMapIndex; uint dynamicGBufferCubeMapIndex; uint alphaDitherEnabled; uint TAADitherEnabled; float CameraTAAFadeStartDist; struct { } materialTable; struct { float4x4 ClipXYZToViewPos; float4x4 ClipXYZToWorldPos; float4 ClipZToViewZ; } RevProjParams; struct { } refraction; struct { } deferredcommon; struct { } motionVector; struct { float4 XYScaleBias; float4 ForwardMappingParams; float2 ZProject; float4 BackwardMappingParams; float CloudShadowGIDensity; } combinedCloudShadow; struct { } AmbientLighting; struct { float4 volumeInvTransZ; float4 volumeTexScale; float4 volumeTexBias; float4 sunColor; float4 sunColorByOneOverPi; } fog; struct { float3 InvDepthParams; } underwater; struct { float4 VposToClusterXY; float4 ClipPosToClusterXY; float4 ClusterTransZ; uint HighClusterW; uint HighClusterWH; } clusteredLightsEvaluate; struct { } waterStamperTextures; struct { float3 maxCC; } waterCustomMeshParams; struct { } videoAndScreenshot; struct { } rainRipples; struct { } cookieShadows; struct { } nearShadows; struct { float FarShadowBlendRatio; } farShadows; struct { } commonShadows; struct { float2 WorldToUVOffset; float2 WorldToUVScale; float2 ReferenceWorldXY; float FadeStart; float Radius; } grassForce; } PassParams_constants : packoffset(c0); } cbuffer InstanceParams_cbuffer : register(b3) { struct { float4x4 world; float4x4 worldPrevFrame; float4x4 worldViewProj; float4x4 worldViewProjPrevFrame; float4 dissolveFactor; float LODBlendFactor; float wetnessBias; float alphaTestValue; uint materialTableIndex; uint instanceOffset; uint CameraTAADither; struct { struct { int4 offsets; } instanceBatchSetupConsts; } instancing; } InstanceParams_constants : packoffset(c0); } cbuffer MaterialParams_cbuffer : register(b2) { struct { struct { float4 blendXYAlphaTestTwoSided; } defaults; float4 VertexQuadMin_6; float4 VertexScale_89; float4 VertexOffset_92; float4 VertexQuadMax_16; float4 AlphaClampFallof_2; float4 UseVertexAlpha_4; float4 UseScreenAlpha_5; float4 UseLayer1AlphaGrayScale_7; float4 AlphaClampMin_9; float4 AlphaClampIsLayer01Alpha_10; float4 UseLayer1Alpha_11; float4 Layer0DiffuseUVIsClamp_13; float4 Layer0DiffuseIsBC4_14; float4 Layer1AlphaIsBC4_15; float4 Layer1AlphaUVIsClamp_17; float4 Layer0DiffuseIs9SS_18; float4 OcclusionAlpha_20; float4 OcclusionAlphaStepValue_21; float4 Layer0DiffuseIsScreenSpace_22; float4 Layer0DiffuseIsInvert_23; float4 Layer0ColorIsAdd_24; float4 ScreenAlphaTop_25; float4 ScreenAlphaFallout_26; float4 ScreenAlphaBottom_27; float4 AlphaBoost_28; float4 Mipmap_30; float3x3 Layer0DiffuseUV_8_matrix; float3x3 Layer1AlphaUV_12_matrix; } MaterialParams_constants : packoffset(c0); } Buffer<float4> InstanceParams_instancing_instanceData : register(t81); // Resource bind info for InstanceParams_instancing_ClusterVertexDataStatic // { // // uint $Element; // Offset: 0 Size: 4 // // } //StructuredBuffer<InstanceParams_instancing_ClusterVertexDataStatic> InstanceParams_instancing_ClusterVertexDataStatic : register(t82); StructuredBuffer<uint> InstanceParams_instancing_ClusterVertexDataStatic : register(t82); // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( uint v0 : POSITION0, uint v1 : SV_VertexID0, out float4 o0 : SV_Position0, out float4 o1 : TEXCOORD0, out float4 o2 : COLOR0, out float4 o3 : TEXCOORD1, out float4 o4 : TEXCOORD2, out float4 o5 : TEXCOORD3, out float4 o6 : TEXCOORD4, out uint o7 : InstanceID0) { // Needs manual fix for instruction: // unknown dcl_: dcl_resource_structured t82, 4 // Needs manual fix for instruction: // unknown dcl_: dcl_input_sgv v1.x, vertex_id float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11; uint4 bitmask, uiDest; float4 fDest; float4 params = IniParams.Load(0); if (params.x == 0) { o0 = 0; o1 = 0; o2 = 0; o3 = 0; o4 = 0; o5 = 0; o6 = 0; o7 = 0; return; } else { r0.xyz = abs(MaterialParams_constants.VertexQuadMax_16.xyz) + abs(MaterialParams_constants.VertexQuadMin_6.xyz); r0.xyz = r0.xyz * float3(0.5,0.5,0.5) + float3(1.1920929e-007,1.00000012,1.1920929e-007); r0.xyz = MaterialParams_constants.VertexOffset_92.xyz / r0.xyz; r0.w = (uint)v0.x << 3; r0.w = (uint)r0.w >> 2; r0.w = (int)r0.w + (int)InstanceParams_constants.instancing.instanceBatchSetupConsts.offsets.y; r1.x = (int)r0.w + 1; r0.w = InstanceParams_instancing_instanceData.Load(r0.w).y; r1.x = InstanceParams_instancing_instanceData.Load(r1.x).y; r1.x = mad((int)v1.x, 7, (int)r1.x); // Known bad code for instruction (needs manual fix): // ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx r2.y = InstanceParams_instancing_ClusterVertexDataStatic[r1.x]; r3.xyzw = (int4)r1.xxxx + int4(1,2,3,4); r1.xy = (int2)r1.xx + int2(5,6); // Known bad code for instruction (needs manual fix): // ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r3.x, l(0), t82.xxxx r2.w = InstanceParams_instancing_ClusterVertexDataStatic[r3.x]; r2.xz = (uint2)r2.yw << int2(16,16); r2.xyzw = (uint4)r2.xyzw >> int4(16,16,16,16); r2.xyz = (int3)r2.www * (int3)r2.xyz; r2.xyz = (int3)r2.xyz; r4.xyz = float3(3.05175781e-005,3.05175781e-005,3.05175781e-005) * r2.xyz; r5.xyz = r4.xyz * MaterialParams_constants.VertexScale_89.xyz + r0.xyz; r0.xy = (int2)r0.ww + int2(1,2); r6.xyzw = InstanceParams_instancing_instanceData.Load(r0.w).xyzw; r7.xyzw = InstanceParams_instancing_instanceData.Load(r0.x).xyzw; r0.xyzw = InstanceParams_instancing_instanceData.Load(r0.y).xyzw; r2.y = r7.w; r2.z = r0.w; r2.x = r6.w; r8.xyz = -PassParams_constants.viewTranslation.xyz + r2.xyz; r8.w = 1; r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m00_m10_m20_m30); r5.w = 1; r2.y = r7.x; r2.z = r0.x; r2.x = r6.x; r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20); r10.y = r7.y; r10.z = r0.y; r10.x = r6.y; r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20); r11.y = r7.z; r11.z = r0.z; r11.x = r6.z; r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20); o0.x = dot(r5.xyzw, r9.xyzw); r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m01_m11_m21_m31); r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21); r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21); r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21); o0.y = dot(r5.xyzw, r9.xyzw); r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m02_m12_m22_m32); r8.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m03_m13_m23_m33); r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22); r8.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23); r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22); r8.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23); r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22); r8.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23); o0.w = dot(r5.xyzw, r8.xyzw); o0.z = dot(r5.xyzw, r9.xyzw); // Known bad code for instruction (needs manual fix): // ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx r2.y = InstanceParams_instancing_ClusterVertexDataStatic[r1.x]; // Known bad code for instruction (needs manual fix): // ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.w, r1.y, l(0), t82.xxxx r1.w = InstanceParams_instancing_ClusterVertexDataStatic[r1.y]; r2.x = (uint)r2.y << 16; r1.xy = (uint2)r2.xy >> int2(16,16); r1.xy = (int2)r1.xy; o1.xy = float2(0.000488288701,0.000488288701) * r1.xy; r1.z = (uint)r1.w << 16; r1.xy = (uint2)r1.zw >> int2(16,16); r1.xy = (int2)r1.xy; o1.zw = float2(0.000488288701,0.000488288701) * r1.xy; // Known bad code for instruction (needs manual fix): // ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.w, l(0), t82.xxxx r1.x = InstanceParams_instancing_ClusterVertexDataStatic[r3.w]; r1.yzw = (uint3)r1.xxx >> int3(8,16,24); r1.xyzw = (int4)r1.xyzw & int4(255,255,255,255); r1.xyzw = (uint4)r1.xyzw; o2.xyzw = float4(0.00392156886,0.00392156886,0.00392156886,0.00392156886) * r1.xyzw; r4.w = 1; o3.y = dot(r4.xyzw, r7.xyzw); o3.z = dot(r4.xyzw, r0.xyzw); o3.x = dot(r4.xyzw, r6.xyzw); o3.w = 1; // Known bad code for instruction (needs manual fix): // ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.z, l(0), t82.xxxx r1.x = InstanceParams_instancing_ClusterVertexDataStatic[r3.z]; // Known bad code for instruction (needs manual fix): // ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r3.y, l(0), t82.xxxx r2.x = InstanceParams_instancing_ClusterVertexDataStatic[r3.y]; r1.yz = (uint2)r1.xx >> int2(8,16); r1.xyz = (int3)r1.xyz & int3(255,255,255); r1.xyz = (uint3)r1.xyz; r1.xyz = float3(-127,-127,-127) + r1.xyz; r1.xyz = float3(0.00787401572,0.00787401572,0.00787401572) * r1.xyz; o4.y = dot(r1.xyz, r7.xyz); o4.z = dot(r1.xyz, r0.xyz); o4.x = dot(r1.xyz, r6.xyz); o4.w = 0; r0.w = cmp(0 < (int)r2.w); r1.w = cmp((int)r2.w < 0); r0.w = (int)-r0.w + (int)r1.w; r0.w = (int)r0.w; r2.yz = (uint2)r2.xx >> int2(8,16); r2.xyz = (int3)r2.xyz & int3(255,255,255); r2.xyz = (uint3)r2.xyz; r2.xyz = float3(-127,-127,-127) + r2.xyz; r2.xyz = float3(0.00787401572,0.00787401572,0.00787401572) * r2.xyz; r3.xyz = r2.zxy * r1.yzx; r1.xyz = r2.yzx * r1.zxy + -r3.xyz; r1.xyz = r1.xyz * r0.www; o5.x = dot(r1.xyz, r6.xyz); o6.x = dot(r2.xyz, r6.xyz); o5.y = dot(r1.xyz, r7.xyz); o6.y = dot(r2.xyz, r7.xyz); o6.z = dot(r2.xyz, r0.xyz); o5.z = dot(r1.xyz, r0.xyz); o5.w = 0; o6.w = 0; o7.x = v0.x; return; } } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) HLSL Shader Compiler 10.1 // // using 3Dmigoto v1.2.67 on Wed Nov 08 07:25:34 2017 // // // Buffer Definitions: // // cbuffer PassParams_cbuffer // { // // struct PassParams_Constants // { // // float4 eyePosition; // Offset: 0 // float4 eyePositionPrevFrame; // Offset: 16 // float4 eyeDirection; // Offset: 32 // float4 eyeDirectionPrevFrame; // Offset: 48 // float4x4 viewToWorld; // Offset: 64 // float4x4 viewToWorldPrevFrame; // Offset: 128 // float4x4 worldToView; // Offset: 192 // float4x4 worldToViewPrevFrame; // Offset: 256 // float4x4 projMatrix; // Offset: 320 // float4x4 viewProj; // Offset: 384 // float4x4 viewNoTranslationProj;// Offset: 448 // float4x4 viewProjPrevFrame; // Offset: 512 // float4x4 viewNoTranslationProjPrevFrame;// Offset: 576 // float4 viewTranslation; // Offset: 640 // float4 viewTranslationPrevFrame;// Offset: 656 // float4 vPosToUV; // Offset: 672 // float4 viewportScaleOffset; // Offset: 688 // float4 zFrontBackValue; // Offset: 704 // float4 clipPlane; // Offset: 720 // float4 frustumPlanes[4]; // Offset: 736 // float4 globalLightingScale; // Offset: 800 // float4 viewSpaceLightingBackWS;// Offset: 816 // float4 projectorPosition; // Offset: 832 // float4 prevProjectorPosition; // Offset: 848 // float4 pixelPatchingParams; // Offset: 864 // float gradientAdjustMipBias; // Offset: 880 // float thinGeomAAPixelScale; // Offset: 884 // uint layerIndex; // Offset: 888 // uint globalCubeMapIndex; // Offset: 892 // uint dynamicGBufferCubeMapIndex;// Offset: 896 // uint alphaDitherEnabled; // Offset: 900 // uint TAADitherEnabled; // Offset: 904 // float CameraTAAFadeStartDist; // Offset: 908 // // struct MaterialTable_Constants // { // // } materialTable; // Offset: 4294967292 // // struct ReverseProjParams_Constants // { // // float4x4 ClipXYZToViewPos; // Offset: 912 // float4x4 ClipXYZToWorldPos;// Offset: 976 // float4 ClipZToViewZ; // Offset: 1040 // // } RevProjParams; // Offset: 912 // // struct RefractionParams_Constants // { // // } refraction; // Offset: 4294967292 // // struct DeferredCommonParams_Constants // { // // } deferredcommon; // Offset: 4294967292 // // struct MotionVectorParams_Constants // { // // } motionVector; // Offset: 4294967292 // // struct CombinedCloudShadow_Constants // { // // float4 XYScaleBias; // Offset: 1056 // float4 ForwardMappingParams;// Offset: 1072 // float2 ZProject; // Offset: 1088 // float4 BackwardMappingParams;// Offset: 1104 // float CloudShadowGIDensity;// Offset: 1120 // // } combinedCloudShadow; // Offset: 1056 // // struct AmbientLightingParams_Constants // { // // } AmbientLighting; // Offset: 4294967292 // // struct VolumetricFogParams_Constants // { // // float4 volumeInvTransZ; // Offset: 1136 // float4 volumeTexScale; // Offset: 1152 // float4 volumeTexBias; // Offset: 1168 // float4 sunColor; // Offset: 1184 // float4 sunColorByOneOverPi;// Offset: 1200 // // } fog; // Offset: 1136 // // struct UnderwaterLightingParams_Constants // { // // float3 InvDepthParams; // Offset: 1216 // // } underwater; // Offset: 1216 // // struct ClusteredLightsEvaluateParams_Constants // { // // float4 VposToClusterXY; // Offset: 1232 // float4 ClipPosToClusterXY; // Offset: 1248 // float4 ClusterTransZ; // Offset: 1264 // uint HighClusterW; // Offset: 1280 // uint HighClusterWH; // Offset: 1284 // // } clusteredLightsEvaluate; // Offset: 1232 // // struct WaterStamperTextureParams_Constants // { // // } waterStamperTextures; // Offset: 4294967292 // // struct WaterCustomMeshParams_Constants // { // // float3 maxCC; // Offset: 1296 // // } waterCustomMeshParams; // Offset: 1296 // // struct VideoAndScreenshotParams_Constants // { // // } videoAndScreenshot; // Offset: 4294967292 // // struct RainRipplesParams_Constants // { // // } rainRipples; // Offset: 4294967292 // // struct CookieShadowParams_Constants // { // // } cookieShadows; // Offset: 4294967292 // // struct NearShadowParams_Constants // { // // } nearShadows; // Offset: 4294967292 // // struct FarShadowParams_Constants // { // // float FarShadowBlendRatio; // Offset: 1312 // // } farShadows; // Offset: 1312 // // struct CommonShadowParams_Constants // { // // } commonShadows; // Offset: 4294967292 // // struct GrassForceSamplingParams_Constants // { // // float2 WorldToUVOffset; // Offset: 1328 // float2 WorldToUVScale; // Offset: 1336 // float2 ReferenceWorldXY; // Offset: 1344 // float FadeStart; // Offset: 1352 // float Radius; // Offset: 1356 // // } grassForce; // Offset: 1328 // // } PassParams_constants; // Offset: 0 Size: 1360 // // } // // cbuffer InstanceParams_cbuffer // { // // struct InstanceParams_Constants // { // // float4x4 world; // Offset: 0 // float4x4 worldPrevFrame; // Offset: 64 // float4x4 worldViewProj; // Offset: 128 // float4x4 worldViewProjPrevFrame;// Offset: 192 // float4 dissolveFactor; // Offset: 256 // float LODBlendFactor; // Offset: 272 // float wetnessBias; // Offset: 276 // float alphaTestValue; // Offset: 280 // uint materialTableIndex; // Offset: 284 // uint instanceOffset; // Offset: 288 // uint CameraTAADither; // Offset: 292 // // struct InstancingParams_Constants // { // // struct InstanceBatchSetupConsts_Constants // { // // int4 offsets; // Offset: 304 // // } instanceBatchSetupConsts;// Offset: 304 // // } instancing; // Offset: 304 // // } InstanceParams_constants; // Offset: 0 Size: 320 // // } // // cbuffer MaterialParams_cbuffer // { // // struct MaterialParams_Constants // { // // struct DefaultMaterialConsts // { // // float4 blendXYAlphaTestTwoSided;// Offset: 0 // // } defaults; // Offset: 0 // float4 VertexQuadMin_6; // Offset: 16 // float4 VertexScale_89; // Offset: 32 // float4 VertexOffset_92; // Offset: 48 // float4 VertexQuadMax_16; // Offset: 64 // float4 AlphaClampFallof_2; // Offset: 80 // float4 UseVertexAlpha_4; // Offset: 96 // float4 UseScreenAlpha_5; // Offset: 112 // float4 UseLayer1AlphaGrayScale_7;// Offset: 128 // float4 AlphaClampMin_9; // Offset: 144 // float4 AlphaClampIsLayer01Alpha_10;// Offset: 160 // float4 UseLayer1Alpha_11; // Offset: 176 // float4 Layer0DiffuseUVIsClamp_13;// Offset: 192 // float4 Layer0DiffuseIsBC4_14; // Offset: 208 // float4 Layer1AlphaIsBC4_15; // Offset: 224 // float4 Layer1AlphaUVIsClamp_17;// Offset: 240 // float4 Layer0DiffuseIs9SS_18; // Offset: 256 // float4 OcclusionAlpha_20; // Offset: 272 // float4 OcclusionAlphaStepValue_21;// Offset: 288 // float4 Layer0DiffuseIsScreenSpace_22;// Offset: 304 // float4 Layer0DiffuseIsInvert_23;// Offset: 320 // float4 Layer0ColorIsAdd_24; // Offset: 336 // float4 ScreenAlphaTop_25; // Offset: 352 // float4 ScreenAlphaFallout_26; // Offset: 368 // float4 ScreenAlphaBottom_27; // Offset: 384 // float4 AlphaBoost_28; // Offset: 400 // float4 Mipmap_30; // Offset: 416 // float3x3 Layer0DiffuseUV_8_matrix;// Offset: 432 // float3x3 Layer1AlphaUV_12_matrix;// Offset: 480 // // } MaterialParams_constants; // Offset: 0 Size: 524 // // } // // Resource bind info for InstanceParams_instancing_ClusterVertexDataStatic // { // // uint $Element; // Offset: 0 Size: 4 // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // InstanceParams_instancing_instanceData texture float4 buf 81 1 // InstanceParams_instancing_ClusterVertexDataStatic texture struct r/o 82 1 // PassParams_cbuffer cbuffer NA NA 1 1 // MaterialParams_cbuffer cbuffer NA NA 2 1 // InstanceParams_cbuffer cbuffer NA NA 3 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // POSITION 0 x 0 NONE uint x // SV_VertexID 0 x 1 VERTID uint x // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Position 0 xyzw 0 POS float xyzw // TEXCOORD 0 xyzw 1 NONE float xyzw // COLOR 0 xyzw 2 NONE float xyzw // TEXCOORD 1 xyzw 3 NONE float xyzw // TEXCOORD 2 xyzw 4 NONE float xyzw // TEXCOORD 3 xyzw 5 NONE float xyzw // TEXCOORD 4 xyzw 6 NONE float xyzw // InstanceID 0 x 7 NONE uint x // vs_5_0 dcl_globalFlags refactoringAllowed dcl_constantbuffer cb1[41], immediateIndexed dcl_constantbuffer cb3[20], immediateIndexed dcl_constantbuffer cb2[5], immediateIndexed dcl_resource_buffer (float,float,float,float) t81 dcl_resource_structured t82, 4 dcl_input v0.x dcl_input_sgv v1.x, vertex_id dcl_output_siv o0.xyzw, position dcl_output o1.xyzw dcl_output o2.xyzw dcl_output o3.xyzw dcl_output o4.xyzw dcl_output o5.xyzw dcl_output o6.xyzw dcl_output o7.x dcl_temps 12 add r0.xyz, |cb2[1].xyzx|, |cb2[4].xyzx| mad r0.xyz, r0.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(1.192092896E-007, 1.00000012, 1.192092896E-007, 0.000000) div r0.xyz, cb2[3].xyzx, r0.xyzx ishl r0.w, v0.x, l(3) ushr r0.w, r0.w, l(2) iadd r0.w, r0.w, cb3[19].y iadd r1.x, r0.w, l(1) ld_indexable(buffer)(float,float,float,float) r0.w, r0.wwww, t81.xzwy ld_indexable(buffer)(float,float,float,float) r1.x, r1.xxxx, t81.yxzw imad r1.x, v1.x, l(7), r1.x ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx iadd r3.xyzw, r1.xxxx, l(1, 2, 3, 4) iadd r1.xy, r1.xxxx, l(5, 6, 0, 0) ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r3.x, l(0), t82.xxxx ishl r2.xz, r2.yywy, l(16, 0, 16, 0) ishr r2.xyzw, r2.xyzw, l(16, 16, 16, 16) imul null, r2.xyz, r2.wwww, r2.xyzx itof r2.xyz, r2.xyzx mul r4.xyz, r2.xyzx, l(0.0000305175781, 0.0000305175781, 0.0000305175781, 0.000000) mad r5.xyz, r4.xyzx, cb2[2].xyzx, r0.xyzx iadd r0.xy, r0.wwww, l(1, 2, 0, 0) ld_indexable(buffer)(float,float,float,float) r6.xyzw, r0.wwww, t81.xyzw ld_indexable(buffer)(float,float,float,float) r7.xyzw, r0.xxxx, t81.xyzw ld_indexable(buffer)(float,float,float,float) r0.xyzw, r0.yyyy, t81.xyzw mov r2.y, r7.w mov r2.z, r0.w mov r2.x, r6.w add r8.xyz, r2.xyzx, -cb1[40].xyzx mov r8.w, l(1.000000) dp4 r9.w, r8.xyzw, cb1[28].xyzw mov r5.w, l(1.000000) mov r2.y, r7.x mov r2.z, r0.x mov r2.x, r6.x dp3 r9.x, r2.xyzx, cb1[28].xyzx mov r10.y, r7.y mov r10.z, r0.y mov r10.x, r6.y dp3 r9.y, r10.xyzx, cb1[28].xyzx mov r11.y, r7.z mov r11.z, r0.z mov r11.x, r6.z dp3 r9.z, r11.xyzx, cb1[28].xyzx dp4 o0.x, r5.xyzw, r9.xyzw dp4 r9.w, r8.xyzw, cb1[29].xyzw dp3 r9.x, r2.xyzx, cb1[29].xyzx dp3 r9.y, r10.xyzx, cb1[29].xyzx dp3 r9.z, r11.xyzx, cb1[29].xyzx dp4 o0.y, r5.xyzw, r9.xyzw dp4 r9.w, r8.xyzw, cb1[30].xyzw dp4 r8.w, r8.xyzw, cb1[31].xyzw dp3 r9.x, r2.xyzx, cb1[30].xyzx dp3 r8.x, r2.xyzx, cb1[31].xyzx dp3 r9.y, r10.xyzx, cb1[30].xyzx dp3 r8.y, r10.xyzx, cb1[31].xyzx dp3 r9.z, r11.xyzx, cb1[30].xyzx dp3 r8.z, r11.xyzx, cb1[31].xyzx dp4 o0.w, r5.xyzw, r8.xyzw dp4 o0.z, r5.xyzw, r9.xyzw ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.w, r1.y, l(0), t82.xxxx ishl r2.x, r2.y, l(16) ishr r1.xy, r2.xyxx, l(16, 16, 0, 0) itof r1.xy, r1.xyxx mul o1.xy, r1.xyxx, l(0.000488288701, 0.000488288701, 0.000000, 0.000000) ishl r1.z, r1.w, l(16) ishr r1.xy, r1.zwzz, l(16, 16, 0, 0) itof r1.xy, r1.xyxx mul o1.zw, r1.xxxy, l(0.000000, 0.000000, 0.000488288701, 0.000488288701) ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.w, l(0), t82.xxxx ushr r1.yzw, r1.xxxx, l(0, 8, 16, 24) and r1.xyzw, r1.xyzw, l(255, 255, 255, 255) utof r1.xyzw, r1.xyzw mul o2.xyzw, r1.xyzw, l(0.00392156886, 0.00392156886, 0.00392156886, 0.00392156886) mov r4.w, l(1.000000) dp4 o3.y, r4.xyzw, r7.xyzw dp4 o3.z, r4.xyzw, r0.xyzw dp4 o3.x, r4.xyzw, r6.xyzw mov o3.w, l(1.000000) ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.z, l(0), t82.xxxx ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r3.y, l(0), t82.xxxx ushr r1.yz, r1.xxxx, l(0, 8, 16, 0) and r1.xyz, r1.xyzx, l(255, 255, 255, 0) utof r1.xyz, r1.xyzx add r1.xyz, r1.xyzx, l(-127.000000, -127.000000, -127.000000, 0.000000) mul r1.xyz, r1.xyzx, l(0.00787401572, 0.00787401572, 0.00787401572, 0.000000) dp3 o4.y, r1.xyzx, r7.xyzx dp3 o4.z, r1.xyzx, r0.xyzx dp3 o4.x, r1.xyzx, r6.xyzx mov o4.w, l(0) ilt r0.w, l(0), r2.w ilt r1.w, r2.w, l(0) iadd r0.w, -r0.w, r1.w itof r0.w, r0.w ushr r2.yz, r2.xxxx, l(0, 8, 16, 0) and r2.xyz, r2.xyzx, l(255, 255, 255, 0) utof r2.xyz, r2.xyzx add r2.xyz, r2.xyzx, l(-127.000000, -127.000000, -127.000000, 0.000000) mul r2.xyz, r2.xyzx, l(0.00787401572, 0.00787401572, 0.00787401572, 0.000000) mul r3.xyz, r1.yzxy, r2.zxyz mad r1.xyz, r2.yzxy, r1.zxyz, -r3.xyzx mul r1.xyz, r0.wwww, r1.xyzx dp3 o5.x, r1.xyzx, r6.xyzx dp3 o6.x, r2.xyzx, r6.xyzx dp3 o5.y, r1.xyzx, r7.xyzx dp3 o6.y, r2.xyzx, r7.xyzx dp3 o6.z, r2.xyzx, r0.xyzx dp3 o5.z, r1.xyzx, r0.xyzx mov o5.w, l(0) mov o6.w, l(0) mov o7.x, v0.x ret // Approximately 112 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/[/code]
bo3b said:
Not sure how you copy/pasted the code, but that is wrong. There is no Ampersand in the original code I posted, and it compiles for me using fxc without error.

VS is easier to fix, and that seemed like a better match for your scenario based on masterotaku's suggestion.


Some of these are easy to hand fix. These are pretty simple, only about 10 minutes of effort. The one I did recently for DHR for TheEvilWithin2 was very hard, and took me 6 hours. But since it led to his breakthrough on how to fix the game, easily worth it.


Yeah I definitely copied it wrong the first time, sorry about that.

This time I don't get any error messages, but I can't get it to toggle correctly. The shader seems to be off when I start the game and I get some funky visual glitches.

This is the shader with the toggle code I added, can you see if I did something wrong?

(Toggle code starts at line 278)

// ---- Created with 3Dmigoto v1.2.67 on Wed Nov 08 07:25:34 2017

cbuffer PassParams_cbuffer : register(b1)
{

struct
{
float4 eyePosition;
float4 eyePositionPrevFrame;
float4 eyeDirection;
float4 eyeDirectionPrevFrame;
float4x4 viewToWorld;
float4x4 viewToWorldPrevFrame;
float4x4 worldToView;
float4x4 worldToViewPrevFrame;
float4x4 projMatrix;
float4x4 viewProj;
float4x4 viewNoTranslationProj;
float4x4 viewProjPrevFrame;
float4x4 viewNoTranslationProjPrevFrame;
float4 viewTranslation;
float4 viewTranslationPrevFrame;
float4 vPosToUV;
float4 viewportScaleOffset;
float4 zFrontBackValue;
float4 clipPlane;
float4 frustumPlanes[4];
float4 globalLightingScale;
float4 viewSpaceLightingBackWS;
float4 projectorPosition;
float4 prevProjectorPosition;
float4 pixelPatchingParams;
float gradientAdjustMipBias;
float thinGeomAAPixelScale;
uint layerIndex;
uint globalCubeMapIndex;
uint dynamicGBufferCubeMapIndex;
uint alphaDitherEnabled;
uint TAADitherEnabled;
float CameraTAAFadeStartDist;

struct
{
} materialTable;


struct
{
float4x4 ClipXYZToViewPos;
float4x4 ClipXYZToWorldPos;
float4 ClipZToViewZ;
} RevProjParams;


struct
{
} refraction;


struct
{
} deferredcommon;


struct
{
} motionVector;


struct
{
float4 XYScaleBias;
float4 ForwardMappingParams;
float2 ZProject;
float4 BackwardMappingParams;
float CloudShadowGIDensity;
} combinedCloudShadow;


struct
{
} AmbientLighting;


struct
{
float4 volumeInvTransZ;
float4 volumeTexScale;
float4 volumeTexBias;
float4 sunColor;
float4 sunColorByOneOverPi;
} fog;


struct
{
float3 InvDepthParams;
} underwater;


struct
{
float4 VposToClusterXY;
float4 ClipPosToClusterXY;
float4 ClusterTransZ;
uint HighClusterW;
uint HighClusterWH;
} clusteredLightsEvaluate;


struct
{
} waterStamperTextures;


struct
{
float3 maxCC;
} waterCustomMeshParams;


struct
{
} videoAndScreenshot;


struct
{
} rainRipples;


struct
{
} cookieShadows;


struct
{
} nearShadows;


struct
{
float FarShadowBlendRatio;
} farShadows;


struct
{
} commonShadows;


struct
{
float2 WorldToUVOffset;
float2 WorldToUVScale;
float2 ReferenceWorldXY;
float FadeStart;
float Radius;
} grassForce;

} PassParams_constants : packoffset(c0);

}

cbuffer InstanceParams_cbuffer : register(b3)
{

struct
{
float4x4 world;
float4x4 worldPrevFrame;
float4x4 worldViewProj;
float4x4 worldViewProjPrevFrame;
float4 dissolveFactor;
float LODBlendFactor;
float wetnessBias;
float alphaTestValue;
uint materialTableIndex;
uint instanceOffset;
uint CameraTAADither;

struct
{

struct
{
int4 offsets;
} instanceBatchSetupConsts;

} instancing;

} InstanceParams_constants : packoffset(c0);

}

cbuffer MaterialParams_cbuffer : register(b2)
{

struct
{

struct
{
float4 blendXYAlphaTestTwoSided;
} defaults;

float4 VertexQuadMin_6;
float4 VertexScale_89;
float4 VertexOffset_92;
float4 VertexQuadMax_16;
float4 AlphaClampFallof_2;
float4 UseVertexAlpha_4;
float4 UseScreenAlpha_5;
float4 UseLayer1AlphaGrayScale_7;
float4 AlphaClampMin_9;
float4 AlphaClampIsLayer01Alpha_10;
float4 UseLayer1Alpha_11;
float4 Layer0DiffuseUVIsClamp_13;
float4 Layer0DiffuseIsBC4_14;
float4 Layer1AlphaIsBC4_15;
float4 Layer1AlphaUVIsClamp_17;
float4 Layer0DiffuseIs9SS_18;
float4 OcclusionAlpha_20;
float4 OcclusionAlphaStepValue_21;
float4 Layer0DiffuseIsScreenSpace_22;
float4 Layer0DiffuseIsInvert_23;
float4 Layer0ColorIsAdd_24;
float4 ScreenAlphaTop_25;
float4 ScreenAlphaFallout_26;
float4 ScreenAlphaBottom_27;
float4 AlphaBoost_28;
float4 Mipmap_30;
float3x3 Layer0DiffuseUV_8_matrix;
float3x3 Layer1AlphaUV_12_matrix;
} MaterialParams_constants : packoffset(c0);

}

Buffer<float4> InstanceParams_instancing_instanceData : register(t81);

// Resource bind info for InstanceParams_instancing_ClusterVertexDataStatic
// {
//
// uint $Element; // Offset: 0 Size: 4
//
// }
//StructuredBuffer<InstanceParams_instancing_ClusterVertexDataStatic> InstanceParams_instancing_ClusterVertexDataStatic : register(t82);
StructuredBuffer<uint> InstanceParams_instancing_ClusterVertexDataStatic : register(t82);


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


void main(
uint v0 : POSITION0,
uint v1 : SV_VertexID0,
out float4 o0 : SV_Position0,
out float4 o1 : TEXCOORD0,
out float4 o2 : COLOR0,
out float4 o3 : TEXCOORD1,
out float4 o4 : TEXCOORD2,
out float4 o5 : TEXCOORD3,
out float4 o6 : TEXCOORD4,
out uint o7 : InstanceID0)
{
// Needs manual fix for instruction:
// unknown dcl_: dcl_resource_structured t82, 4
// Needs manual fix for instruction:
// unknown dcl_: dcl_input_sgv v1.x, vertex_id
float4 r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11;
uint4 bitmask, uiDest;
float4 fDest;

float4 params = IniParams.Load(0);
if (params.x == 0)
{
o0 = 0;
o1 = 0;
o2 = 0;
o3 = 0;
o4 = 0;
o5 = 0;
o6 = 0;
o7 = 0;
return;
} else {

r0.xyz = abs(MaterialParams_constants.VertexQuadMax_16.xyz) + abs(MaterialParams_constants.VertexQuadMin_6.xyz);
r0.xyz = r0.xyz * float3(0.5,0.5,0.5) + float3(1.1920929e-007,1.00000012,1.1920929e-007);
r0.xyz = MaterialParams_constants.VertexOffset_92.xyz / r0.xyz;
r0.w = (uint)v0.x << 3;
r0.w = (uint)r0.w >> 2;
r0.w = (int)r0.w + (int)InstanceParams_constants.instancing.instanceBatchSetupConsts.offsets.y;
r1.x = (int)r0.w + 1;
r0.w = InstanceParams_instancing_instanceData.Load(r0.w).y;
r1.x = InstanceParams_instancing_instanceData.Load(r1.x).y;
r1.x = mad((int)v1.x, 7, (int)r1.x);

// Known bad code for instruction (needs manual fix):
// ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx
r2.y = InstanceParams_instancing_ClusterVertexDataStatic[r1.x];

r3.xyzw = (int4)r1.xxxx + int4(1,2,3,4);
r1.xy = (int2)r1.xx + int2(5,6);

// Known bad code for instruction (needs manual fix):
// ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r3.x, l(0), t82.xxxx
r2.w = InstanceParams_instancing_ClusterVertexDataStatic[r3.x];

r2.xz = (uint2)r2.yw << int2(16,16);
r2.xyzw = (uint4)r2.xyzw >> int4(16,16,16,16);
r2.xyz = (int3)r2.www * (int3)r2.xyz;
r2.xyz = (int3)r2.xyz;
r4.xyz = float3(3.05175781e-005,3.05175781e-005,3.05175781e-005) * r2.xyz;
r5.xyz = r4.xyz * MaterialParams_constants.VertexScale_89.xyz + r0.xyz;
r0.xy = (int2)r0.ww + int2(1,2);
r6.xyzw = InstanceParams_instancing_instanceData.Load(r0.w).xyzw;
r7.xyzw = InstanceParams_instancing_instanceData.Load(r0.x).xyzw;
r0.xyzw = InstanceParams_instancing_instanceData.Load(r0.y).xyzw;
r2.y = r7.w;
r2.z = r0.w;
r2.x = r6.w;
r8.xyz = -PassParams_constants.viewTranslation.xyz + r2.xyz;
r8.w = 1;
r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m00_m10_m20_m30);
r5.w = 1;
r2.y = r7.x;
r2.z = r0.x;
r2.x = r6.x;
r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20);
r10.y = r7.y;
r10.z = r0.y;
r10.x = r6.y;
r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20);
r11.y = r7.z;
r11.z = r0.z;
r11.x = r6.z;
r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m00_m10_m20);
o0.x = dot(r5.xyzw, r9.xyzw);
r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m01_m11_m21_m31);
r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21);
r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21);
r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m01_m11_m21);
o0.y = dot(r5.xyzw, r9.xyzw);
r9.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m02_m12_m22_m32);
r8.w = dot(r8.xyzw, PassParams_constants.viewNoTranslationProj._m03_m13_m23_m33);
r9.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22);
r8.x = dot(r2.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23);
r9.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22);
r8.y = dot(r10.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23);
r9.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m02_m12_m22);
r8.z = dot(r11.xyz, PassParams_constants.viewNoTranslationProj._m03_m13_m23);
o0.w = dot(r5.xyzw, r8.xyzw);
o0.z = dot(r5.xyzw, r9.xyzw);

// Known bad code for instruction (needs manual fix):
// ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx
r2.y = InstanceParams_instancing_ClusterVertexDataStatic[r1.x];

// Known bad code for instruction (needs manual fix):
// ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.w, r1.y, l(0), t82.xxxx
r1.w = InstanceParams_instancing_ClusterVertexDataStatic[r1.y];

r2.x = (uint)r2.y << 16;
r1.xy = (uint2)r2.xy >> int2(16,16);
r1.xy = (int2)r1.xy;
o1.xy = float2(0.000488288701,0.000488288701) * r1.xy;
r1.z = (uint)r1.w << 16;
r1.xy = (uint2)r1.zw >> int2(16,16);
r1.xy = (int2)r1.xy;
o1.zw = float2(0.000488288701,0.000488288701) * r1.xy;

// Known bad code for instruction (needs manual fix):
// ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.w, l(0), t82.xxxx
r1.x = InstanceParams_instancing_ClusterVertexDataStatic[r3.w];

r1.yzw = (uint3)r1.xxx >> int3(8,16,24);
r1.xyzw = (int4)r1.xyzw & int4(255,255,255,255);
r1.xyzw = (uint4)r1.xyzw;
o2.xyzw = float4(0.00392156886,0.00392156886,0.00392156886,0.00392156886) * r1.xyzw;
r4.w = 1;
o3.y = dot(r4.xyzw, r7.xyzw);
o3.z = dot(r4.xyzw, r0.xyzw);
o3.x = dot(r4.xyzw, r6.xyzw);
o3.w = 1;

// Known bad code for instruction (needs manual fix):
// ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.z, l(0), t82.xxxx
r1.x = InstanceParams_instancing_ClusterVertexDataStatic[r3.z];

// Known bad code for instruction (needs manual fix):
// ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r3.y, l(0), t82.xxxx
r2.x = InstanceParams_instancing_ClusterVertexDataStatic[r3.y];

r1.yz = (uint2)r1.xx >> int2(8,16);
r1.xyz = (int3)r1.xyz & int3(255,255,255);
r1.xyz = (uint3)r1.xyz;
r1.xyz = float3(-127,-127,-127) + r1.xyz;
r1.xyz = float3(0.00787401572,0.00787401572,0.00787401572) * r1.xyz;
o4.y = dot(r1.xyz, r7.xyz);
o4.z = dot(r1.xyz, r0.xyz);
o4.x = dot(r1.xyz, r6.xyz);
o4.w = 0;
r0.w = cmp(0 < (int)r2.w);
r1.w = cmp((int)r2.w < 0);
r0.w = (int)-r0.w + (int)r1.w;
r0.w = (int)r0.w;
r2.yz = (uint2)r2.xx >> int2(8,16);
r2.xyz = (int3)r2.xyz & int3(255,255,255);
r2.xyz = (uint3)r2.xyz;
r2.xyz = float3(-127,-127,-127) + r2.xyz;
r2.xyz = float3(0.00787401572,0.00787401572,0.00787401572) * r2.xyz;
r3.xyz = r2.zxy * r1.yzx;
r1.xyz = r2.yzx * r1.zxy + -r3.xyz;
r1.xyz = r1.xyz * r0.www;
o5.x = dot(r1.xyz, r6.xyz);
o6.x = dot(r2.xyz, r6.xyz);
o5.y = dot(r1.xyz, r7.xyz);
o6.y = dot(r2.xyz, r7.xyz);
o6.z = dot(r2.xyz, r0.xyz);
o5.z = dot(r1.xyz, r0.xyz);
o5.w = 0;
o6.w = 0;
o7.x = v0.x;
return;
}
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
// using 3Dmigoto v1.2.67 on Wed Nov 08 07:25:34 2017
//
//
// Buffer Definitions:
//
// cbuffer PassParams_cbuffer
// {
//
// struct PassParams_Constants
// {
//
// float4 eyePosition; // Offset: 0
// float4 eyePositionPrevFrame; // Offset: 16
// float4 eyeDirection; // Offset: 32
// float4 eyeDirectionPrevFrame; // Offset: 48
// float4x4 viewToWorld; // Offset: 64
// float4x4 viewToWorldPrevFrame; // Offset: 128
// float4x4 worldToView; // Offset: 192
// float4x4 worldToViewPrevFrame; // Offset: 256
// float4x4 projMatrix; // Offset: 320
// float4x4 viewProj; // Offset: 384
// float4x4 viewNoTranslationProj;// Offset: 448
// float4x4 viewProjPrevFrame; // Offset: 512
// float4x4 viewNoTranslationProjPrevFrame;// Offset: 576
// float4 viewTranslation; // Offset: 640
// float4 viewTranslationPrevFrame;// Offset: 656
// float4 vPosToUV; // Offset: 672
// float4 viewportScaleOffset; // Offset: 688
// float4 zFrontBackValue; // Offset: 704
// float4 clipPlane; // Offset: 720
// float4 frustumPlanes[4]; // Offset: 736
// float4 globalLightingScale; // Offset: 800
// float4 viewSpaceLightingBackWS;// Offset: 816
// float4 projectorPosition; // Offset: 832
// float4 prevProjectorPosition; // Offset: 848
// float4 pixelPatchingParams; // Offset: 864
// float gradientAdjustMipBias; // Offset: 880
// float thinGeomAAPixelScale; // Offset: 884
// uint layerIndex; // Offset: 888
// uint globalCubeMapIndex; // Offset: 892
// uint dynamicGBufferCubeMapIndex;// Offset: 896
// uint alphaDitherEnabled; // Offset: 900
// uint TAADitherEnabled; // Offset: 904
// float CameraTAAFadeStartDist; // Offset: 908
//
// struct MaterialTable_Constants
// {
//
// } materialTable; // Offset: 4294967292
//
// struct ReverseProjParams_Constants
// {
//
// float4x4 ClipXYZToViewPos; // Offset: 912
// float4x4 ClipXYZToWorldPos;// Offset: 976
// float4 ClipZToViewZ; // Offset: 1040
//
// } RevProjParams; // Offset: 912
//
// struct RefractionParams_Constants
// {
//
// } refraction; // Offset: 4294967292
//
// struct DeferredCommonParams_Constants
// {
//
// } deferredcommon; // Offset: 4294967292
//
// struct MotionVectorParams_Constants
// {
//
// } motionVector; // Offset: 4294967292
//
// struct CombinedCloudShadow_Constants
// {
//
// float4 XYScaleBias; // Offset: 1056
// float4 ForwardMappingParams;// Offset: 1072
// float2 ZProject; // Offset: 1088
// float4 BackwardMappingParams;// Offset: 1104
// float CloudShadowGIDensity;// Offset: 1120
//
// } combinedCloudShadow; // Offset: 1056
//
// struct AmbientLightingParams_Constants
// {
//
// } AmbientLighting; // Offset: 4294967292
//
// struct VolumetricFogParams_Constants
// {
//
// float4 volumeInvTransZ; // Offset: 1136
// float4 volumeTexScale; // Offset: 1152
// float4 volumeTexBias; // Offset: 1168
// float4 sunColor; // Offset: 1184
// float4 sunColorByOneOverPi;// Offset: 1200
//
// } fog; // Offset: 1136
//
// struct UnderwaterLightingParams_Constants
// {
//
// float3 InvDepthParams; // Offset: 1216
//
// } underwater; // Offset: 1216
//
// struct ClusteredLightsEvaluateParams_Constants
// {
//
// float4 VposToClusterXY; // Offset: 1232
// float4 ClipPosToClusterXY; // Offset: 1248
// float4 ClusterTransZ; // Offset: 1264
// uint HighClusterW; // Offset: 1280
// uint HighClusterWH; // Offset: 1284
//
// } clusteredLightsEvaluate; // Offset: 1232
//
// struct WaterStamperTextureParams_Constants
// {
//
// } waterStamperTextures; // Offset: 4294967292
//
// struct WaterCustomMeshParams_Constants
// {
//
// float3 maxCC; // Offset: 1296
//
// } waterCustomMeshParams; // Offset: 1296
//
// struct VideoAndScreenshotParams_Constants
// {
//
// } videoAndScreenshot; // Offset: 4294967292
//
// struct RainRipplesParams_Constants
// {
//
// } rainRipples; // Offset: 4294967292
//
// struct CookieShadowParams_Constants
// {
//
// } cookieShadows; // Offset: 4294967292
//
// struct NearShadowParams_Constants
// {
//
// } nearShadows; // Offset: 4294967292
//
// struct FarShadowParams_Constants
// {
//
// float FarShadowBlendRatio; // Offset: 1312
//
// } farShadows; // Offset: 1312
//
// struct CommonShadowParams_Constants
// {
//
// } commonShadows; // Offset: 4294967292
//
// struct GrassForceSamplingParams_Constants
// {
//
// float2 WorldToUVOffset; // Offset: 1328
// float2 WorldToUVScale; // Offset: 1336
// float2 ReferenceWorldXY; // Offset: 1344
// float FadeStart; // Offset: 1352
// float Radius; // Offset: 1356
//
// } grassForce; // Offset: 1328
//
// } PassParams_constants; // Offset: 0 Size: 1360
//
// }
//
// cbuffer InstanceParams_cbuffer
// {
//
// struct InstanceParams_Constants
// {
//
// float4x4 world; // Offset: 0
// float4x4 worldPrevFrame; // Offset: 64
// float4x4 worldViewProj; // Offset: 128
// float4x4 worldViewProjPrevFrame;// Offset: 192
// float4 dissolveFactor; // Offset: 256
// float LODBlendFactor; // Offset: 272
// float wetnessBias; // Offset: 276
// float alphaTestValue; // Offset: 280
// uint materialTableIndex; // Offset: 284
// uint instanceOffset; // Offset: 288
// uint CameraTAADither; // Offset: 292
//
// struct InstancingParams_Constants
// {
//
// struct InstanceBatchSetupConsts_Constants
// {
//
// int4 offsets; // Offset: 304
//
// } instanceBatchSetupConsts;// Offset: 304
//
// } instancing; // Offset: 304
//
// } InstanceParams_constants; // Offset: 0 Size: 320
//
// }
//
// cbuffer MaterialParams_cbuffer
// {
//
// struct MaterialParams_Constants
// {
//
// struct DefaultMaterialConsts
// {
//
// float4 blendXYAlphaTestTwoSided;// Offset: 0
//
// } defaults; // Offset: 0
// float4 VertexQuadMin_6; // Offset: 16
// float4 VertexScale_89; // Offset: 32
// float4 VertexOffset_92; // Offset: 48
// float4 VertexQuadMax_16; // Offset: 64
// float4 AlphaClampFallof_2; // Offset: 80
// float4 UseVertexAlpha_4; // Offset: 96
// float4 UseScreenAlpha_5; // Offset: 112
// float4 UseLayer1AlphaGrayScale_7;// Offset: 128
// float4 AlphaClampMin_9; // Offset: 144
// float4 AlphaClampIsLayer01Alpha_10;// Offset: 160
// float4 UseLayer1Alpha_11; // Offset: 176
// float4 Layer0DiffuseUVIsClamp_13;// Offset: 192
// float4 Layer0DiffuseIsBC4_14; // Offset: 208
// float4 Layer1AlphaIsBC4_15; // Offset: 224
// float4 Layer1AlphaUVIsClamp_17;// Offset: 240
// float4 Layer0DiffuseIs9SS_18; // Offset: 256
// float4 OcclusionAlpha_20; // Offset: 272
// float4 OcclusionAlphaStepValue_21;// Offset: 288
// float4 Layer0DiffuseIsScreenSpace_22;// Offset: 304
// float4 Layer0DiffuseIsInvert_23;// Offset: 320
// float4 Layer0ColorIsAdd_24; // Offset: 336
// float4 ScreenAlphaTop_25; // Offset: 352
// float4 ScreenAlphaFallout_26; // Offset: 368
// float4 ScreenAlphaBottom_27; // Offset: 384
// float4 AlphaBoost_28; // Offset: 400
// float4 Mipmap_30; // Offset: 416
// float3x3 Layer0DiffuseUV_8_matrix;// Offset: 432
// float3x3 Layer1AlphaUV_12_matrix;// Offset: 480
//
// } MaterialParams_constants; // Offset: 0 Size: 524
//
// }
//
// Resource bind info for InstanceParams_instancing_ClusterVertexDataStatic
// {
//
// uint $Element; // Offset: 0 Size: 4
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// InstanceParams_instancing_instanceData texture float4 buf 81 1
// InstanceParams_instancing_ClusterVertexDataStatic texture struct r/o 82 1
// PassParams_cbuffer cbuffer NA NA 1 1
// MaterialParams_cbuffer cbuffer NA NA 2 1
// InstanceParams_cbuffer cbuffer NA NA 3 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION 0 x 0 NONE uint x
// SV_VertexID 0 x 1 VERTID uint x
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float xyzw
// TEXCOORD 0 xyzw 1 NONE float xyzw
// COLOR 0 xyzw 2 NONE float xyzw
// TEXCOORD 1 xyzw 3 NONE float xyzw
// TEXCOORD 2 xyzw 4 NONE float xyzw
// TEXCOORD 3 xyzw 5 NONE float xyzw
// TEXCOORD 4 xyzw 6 NONE float xyzw
// InstanceID 0 x 7 NONE uint x
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[41], immediateIndexed
dcl_constantbuffer cb3[20], immediateIndexed
dcl_constantbuffer cb2[5], immediateIndexed
dcl_resource_buffer (float,float,float,float) t81
dcl_resource_structured t82, 4
dcl_input v0.x
dcl_input_sgv v1.x, vertex_id
dcl_output_siv o0.xyzw, position
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.xyzw
dcl_output o4.xyzw
dcl_output o5.xyzw
dcl_output o6.xyzw
dcl_output o7.x
dcl_temps 12
add r0.xyz, |cb2[1].xyzx|, |cb2[4].xyzx|
mad r0.xyz, r0.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(1.192092896E-007, 1.00000012, 1.192092896E-007, 0.000000)
div r0.xyz, cb2[3].xyzx, r0.xyzx
ishl r0.w, v0.x, l(3)
ushr r0.w, r0.w, l(2)
iadd r0.w, r0.w, cb3[19].y
iadd r1.x, r0.w, l(1)
ld_indexable(buffer)(float,float,float,float) r0.w, r0.wwww, t81.xzwy
ld_indexable(buffer)(float,float,float,float) r1.x, r1.xxxx, t81.yxzw
imad r1.x, v1.x, l(7), r1.x
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx
iadd r3.xyzw, r1.xxxx, l(1, 2, 3, 4)
iadd r1.xy, r1.xxxx, l(5, 6, 0, 0)
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.w, r3.x, l(0), t82.xxxx
ishl r2.xz, r2.yywy, l(16, 0, 16, 0)
ishr r2.xyzw, r2.xyzw, l(16, 16, 16, 16)
imul null, r2.xyz, r2.wwww, r2.xyzx
itof r2.xyz, r2.xyzx
mul r4.xyz, r2.xyzx, l(0.0000305175781, 0.0000305175781, 0.0000305175781, 0.000000)
mad r5.xyz, r4.xyzx, cb2[2].xyzx, r0.xyzx
iadd r0.xy, r0.wwww, l(1, 2, 0, 0)
ld_indexable(buffer)(float,float,float,float) r6.xyzw, r0.wwww, t81.xyzw
ld_indexable(buffer)(float,float,float,float) r7.xyzw, r0.xxxx, t81.xyzw
ld_indexable(buffer)(float,float,float,float) r0.xyzw, r0.yyyy, t81.xyzw
mov r2.y, r7.w
mov r2.z, r0.w
mov r2.x, r6.w
add r8.xyz, r2.xyzx, -cb1[40].xyzx
mov r8.w, l(1.000000)
dp4 r9.w, r8.xyzw, cb1[28].xyzw
mov r5.w, l(1.000000)
mov r2.y, r7.x
mov r2.z, r0.x
mov r2.x, r6.x
dp3 r9.x, r2.xyzx, cb1[28].xyzx
mov r10.y, r7.y
mov r10.z, r0.y
mov r10.x, r6.y
dp3 r9.y, r10.xyzx, cb1[28].xyzx
mov r11.y, r7.z
mov r11.z, r0.z
mov r11.x, r6.z
dp3 r9.z, r11.xyzx, cb1[28].xyzx
dp4 o0.x, r5.xyzw, r9.xyzw
dp4 r9.w, r8.xyzw, cb1[29].xyzw
dp3 r9.x, r2.xyzx, cb1[29].xyzx
dp3 r9.y, r10.xyzx, cb1[29].xyzx
dp3 r9.z, r11.xyzx, cb1[29].xyzx
dp4 o0.y, r5.xyzw, r9.xyzw
dp4 r9.w, r8.xyzw, cb1[30].xyzw
dp4 r8.w, r8.xyzw, cb1[31].xyzw
dp3 r9.x, r2.xyzx, cb1[30].xyzx
dp3 r8.x, r2.xyzx, cb1[31].xyzx
dp3 r9.y, r10.xyzx, cb1[30].xyzx
dp3 r8.y, r10.xyzx, cb1[31].xyzx
dp3 r9.z, r11.xyzx, cb1[30].xyzx
dp3 r8.z, r11.xyzx, cb1[31].xyzx
dp4 o0.w, r5.xyzw, r8.xyzw
dp4 o0.z, r5.xyzw, r9.xyzw
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.y, r1.x, l(0), t82.xxxx
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.w, r1.y, l(0), t82.xxxx
ishl r2.x, r2.y, l(16)
ishr r1.xy, r2.xyxx, l(16, 16, 0, 0)
itof r1.xy, r1.xyxx
mul o1.xy, r1.xyxx, l(0.000488288701, 0.000488288701, 0.000000, 0.000000)
ishl r1.z, r1.w, l(16)
ishr r1.xy, r1.zwzz, l(16, 16, 0, 0)
itof r1.xy, r1.xyxx
mul o1.zw, r1.xxxy, l(0.000000, 0.000000, 0.000488288701, 0.000488288701)
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.w, l(0), t82.xxxx
ushr r1.yzw, r1.xxxx, l(0, 8, 16, 24)
and r1.xyzw, r1.xyzw, l(255, 255, 255, 255)
utof r1.xyzw, r1.xyzw
mul o2.xyzw, r1.xyzw, l(0.00392156886, 0.00392156886, 0.00392156886, 0.00392156886)
mov r4.w, l(1.000000)
dp4 o3.y, r4.xyzw, r7.xyzw
dp4 o3.z, r4.xyzw, r0.xyzw
dp4 o3.x, r4.xyzw, r6.xyzw
mov o3.w, l(1.000000)
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r1.x, r3.z, l(0), t82.xxxx
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r2.x, r3.y, l(0), t82.xxxx
ushr r1.yz, r1.xxxx, l(0, 8, 16, 0)
and r1.xyz, r1.xyzx, l(255, 255, 255, 0)
utof r1.xyz, r1.xyzx
add r1.xyz, r1.xyzx, l(-127.000000, -127.000000, -127.000000, 0.000000)
mul r1.xyz, r1.xyzx, l(0.00787401572, 0.00787401572, 0.00787401572, 0.000000)
dp3 o4.y, r1.xyzx, r7.xyzx
dp3 o4.z, r1.xyzx, r0.xyzx
dp3 o4.x, r1.xyzx, r6.xyzx
mov o4.w, l(0)
ilt r0.w, l(0), r2.w
ilt r1.w, r2.w, l(0)
iadd r0.w, -r0.w, r1.w
itof r0.w, r0.w
ushr r2.yz, r2.xxxx, l(0, 8, 16, 0)
and r2.xyz, r2.xyzx, l(255, 255, 255, 0)
utof r2.xyz, r2.xyzx
add r2.xyz, r2.xyzx, l(-127.000000, -127.000000, -127.000000, 0.000000)
mul r2.xyz, r2.xyzx, l(0.00787401572, 0.00787401572, 0.00787401572, 0.000000)
mul r3.xyz, r1.yzxy, r2.zxyz
mad r1.xyz, r2.yzxy, r1.zxyz, -r3.xyzx
mul r1.xyz, r0.wwww, r1.xyzx
dp3 o5.x, r1.xyzx, r6.xyzx
dp3 o6.x, r2.xyzx, r6.xyzx
dp3 o5.y, r1.xyzx, r7.xyzx
dp3 o6.y, r2.xyzx, r7.xyzx
dp3 o6.z, r2.xyzx, r0.xyzx
dp3 o5.z, r1.xyzx, r0.xyzx
mov o5.w, l(0)
mov o6.w, l(0)
mov o7.x, v0.x
ret
// Approximately 112 instruction slots used

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

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

Posted 11/10/2017 07:26 AM   
Hello, I updated my mod for IL2 BoS : http://helixmod.blogspot.fr/2015/07/il2-battle-of-stalingrad-updated.html, it works for both 3Dvision and VR. I made the label masking by [list] [.]creating a resource from a new output (o7) made in the airframe PS[/.] [.]inject it as a texture 2D in the PS shader that draw the labels and use a texture.Load() instruction to check if the o7 output airframe has been drawn or not for the current pixel. If cockpit frame then I disable label drawing for the pixel [/.] [/list] I wonder if I could use a stencil buffer method to make the label masking, and so avoid the Load() call...It looks like it should be possible with the 3dmigoto function, but I have no idea of how to do it...
Hello,
I updated my mod for IL2 BoS : http://helixmod.blogspot.fr/2015/07/il2-battle-of-stalingrad-updated.html, it works for both 3Dvision and VR.
I made the label masking by
  • creating a resource from a new output (o7) made in the airframe PS
  • inject it as a texture 2D in the PS shader that draw the labels and use a texture.Load() instruction to check if the o7 output airframe has been drawn or not for the current pixel. If cockpit frame then I disable label drawing for the pixel

I wonder if I could use a stencil buffer method to make the label masking, and so avoid the Load() call...It looks like it should be possible with the 3dmigoto function, but I have no idea of how to do it...

Posted 11/11/2017 11:13 PM   
You probably can, but I'm not sure it would buy you anything compared to the method you are already using. We have some support for manipulating the stencil buffer in 3DMigoto, though beware that this has only had limited testing so there could be bugs: - If you are defining a new custom resource with a [Resource] section you can use format=D32_FLOAT_S8X24_UINT or format=D24_UNORM_S8_UINT to get a stencil buffer, choosing whichever is appropriate for the depth format the game uses. You will of course also need to either copy or copy_desc it from an existing resource, or specify enough additional parameters to allow 3DMigoto to synthesise it (e.g. type=Texture2D, width=..., height=..., mips=1, msaa=1, array=1). For what you are doing you probably want to use "copy" or "copy_desc". - You can override the format of a depth buffer that the game creates with a [TextureOverride] section to add a stencil buffer with either of the above format= options. This requires a game restart to take effect. - You can use a [CustomShader] section to configure the output merger depth/stencil state to use the stencil buffer however you see fit. You can either use this with your own custom shaders if you intend to use the stencil buffer with new draw calls, or use "draw=from_caller" and "handling=skip" to transfer the draw call from the game to your modified environment if you intend to modify an existing draw call. There are quite a few options for the output merger depth/stencil state: depth_enable = 1 depth_write_mask = all/zero (literally one of these words) depth_func = <comparison_func> stencil_enable = 1 stencil_read_mask = 0xff (any hex value up to 0xff) stencil_write_mask = 0xff stencil_front = <comparison_func> <both_pass_op> <depth_fail_op> <stencil_fail_op> stencil_back = <comparison_func> <both_pass_op> <depth_fail_op> <stencil_fail_op> stencil_ref = 42 depth_stencil_state_merge = 1: If you specify *any* of the above options than they will *all* be set together. By default any you don't specify will get the default values from MSDN, but this option will tell 3DMigoto to use the values from the game instead (recommended to make things a little easier if you are transferring a draw call). <comparison_func> is one of "never", "less", "equal", "less_equal", "greater", "not_equal", "greater_equal", "always" The three pass/fail ops are one of "keep", "zero", "replace", "incr_sat", "decr_sat", "invert", "incr", "decr" Refer to MSDN for the meanings of these settings. - You can clear the stencil side of a depth/stencil buffer with "clear = stencil oD" to clear the currently bound stencil buffer or "clear = stencil ResourceFoo" to clear a custom resource. If you omit the "stencil" keyword 3DMigoto will clear both the depth and stencil sides of the buffer, or use the "depth" keyword to only clear the depth side. By default it will clear to 0, but you can specify an alternate value, e.g. "clear = oD stencil 255" to clear just the stencil side to 255 or "clear = oD 1.0 255" to also clear the depth side to 1.0. This is new in 3DMigoto 1.2.67. Beware that if you never actually bind a custom resource to an oD slot 3DMigoto will not be able to clear the buffer as a depth/stencil buffer (and will either try other methods or fail). This should not really be a problem in practice, but if you were to comment out the line that binds the buffer for some reason than a seemingly unrelated clear line could start failing. One thing that is missing from 3DMigoto at the moment is the ability to access the stencil side of the buffer when binding it as a render target or texture - in those cases 3DMigoto currently configures the view to access only the depth side of the buffer, but in the future we will have a "stencil" keyword to do the opposite (and it should be possible to bind depth and stencil views of the same buffer simultaneously in different slots).
You probably can, but I'm not sure it would buy you anything compared to the method you are already using. We have some support for manipulating the stencil buffer in 3DMigoto, though beware that this has only had limited testing so there could be bugs:

- If you are defining a new custom resource with a [Resource] section you can use format=D32_FLOAT_S8X24_UINT or format=D24_UNORM_S8_UINT to get a stencil buffer, choosing whichever is appropriate for the depth format the game uses.

You will of course also need to either copy or copy_desc it from an existing resource, or specify enough additional parameters to allow 3DMigoto to synthesise it (e.g. type=Texture2D, width=..., height=..., mips=1, msaa=1, array=1). For what you are doing you probably want to use "copy" or "copy_desc".

- You can override the format of a depth buffer that the game creates with a [TextureOverride] section to add a stencil buffer with either of the above format= options. This requires a game restart to take effect.

- You can use a [CustomShader] section to configure the output merger depth/stencil state to use the stencil buffer however you see fit. You can either use this with your own custom shaders if you intend to use the stencil buffer with new draw calls, or use "draw=from_caller" and "handling=skip" to transfer the draw call from the game to your modified environment if you intend to modify an existing draw call.

There are quite a few options for the output merger depth/stencil state:
depth_enable = 1
depth_write_mask = all/zero (literally one of these words)
depth_func = <comparison_func>
stencil_enable = 1
stencil_read_mask = 0xff (any hex value up to 0xff)
stencil_write_mask = 0xff
stencil_front = <comparison_func> <both_pass_op> <depth_fail_op> <stencil_fail_op>
stencil_back = <comparison_func> <both_pass_op> <depth_fail_op> <stencil_fail_op>
stencil_ref = 42
depth_stencil_state_merge = 1: If you specify *any* of the above options than they will *all* be set together. By default any you don't specify will get the default values from MSDN, but this option will tell 3DMigoto to use the values from the game instead (recommended to make things a little easier if you are transferring a draw call).

<comparison_func> is one of "never", "less", "equal", "less_equal", "greater", "not_equal", "greater_equal", "always"

The three pass/fail ops are one of "keep", "zero", "replace", "incr_sat", "decr_sat", "invert", "incr", "decr"

Refer to MSDN for the meanings of these settings.

- You can clear the stencil side of a depth/stencil buffer with "clear = stencil oD" to clear the currently bound stencil buffer or "clear = stencil ResourceFoo" to clear a custom resource. If you omit the "stencil" keyword 3DMigoto will clear both the depth and stencil sides of the buffer, or use the "depth" keyword to only clear the depth side. By default it will clear to 0, but you can specify an alternate value, e.g. "clear = oD stencil 255" to clear just the stencil side to 255 or "clear = oD 1.0 255" to also clear the depth side to 1.0. This is new in 3DMigoto 1.2.67.

Beware that if you never actually bind a custom resource to an oD slot 3DMigoto will not be able to clear the buffer as a depth/stencil buffer (and will either try other methods or fail). This should not really be a problem in practice, but if you were to comment out the line that binds the buffer for some reason than a seemingly unrelated clear line could start failing.

One thing that is missing from 3DMigoto at the moment is the ability to access the stencil side of the buffer when binding it as a render target or texture - in those cases 3DMigoto currently configures the view to access only the depth side of the buffer, but in the future we will have a "stencil" keyword to do the opposite (and it should be possible to bind depth and stencil views of the same buffer simultaneously in different slots).

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/13/2017 10:43 PM   
@DetectiveJohnKimble: I'm not sure I understand exactly what you are wanting to do, but for this code, I would recommend not changing the other parameters. To disable, set the o0 to 0, not all of them. The key part is that [i]out float4 o0 : SV_Position0,[/i] which is o0. If you set position to zero, then the pixel shader has nothing to work with. This is explained in fair depth in my ShaderHacker class, so if you haven't looked at that, you need to. Even though the class talks about DX9, the principles are the same. Not this: [code] float4 params = IniParams.Load(0); if (params.x == 0) { o0 = 0; o1 = 0; o2 = 0; o3 = 0; o4 = 0; o5 = 0; o6 = 0; o7 = 0; return; } else { [/code] Just: [code] float4 params = IniParams.Load(0); if (params.x == 0) { o0 = 0; return; } else { [/code]
@DetectiveJohnKimble: I'm not sure I understand exactly what you are wanting to do, but for this code, I would recommend not changing the other parameters. To disable, set the o0 to 0, not all of them.

The key part is that out float4 o0 : SV_Position0,
which is o0. If you set position to zero, then the pixel shader has nothing to work with. This is explained in fair depth in my ShaderHacker class, so if you haven't looked at that, you need to. Even though the class talks about DX9, the principles are the same.

Not this:
float4 params = IniParams.Load(0);
if (params.x == 0)
{
o0 = 0;
o1 = 0;
o2 = 0;
o3 = 0;
o4 = 0;
o5 = 0;
o6 = 0;
o7 = 0;
return;
} else {


Just:
float4 params = IniParams.Load(0);
if (params.x == 0)
{
o0 = 0;
return;
} else {

Acer H5360 (1280x720@120Hz) - ASUS VG248QE with GSync mod - 3D Vision 1&2 - Driver 372.54
GTX 970 - i5-4670K@4.2GHz - 12GB RAM - Win7x64+evilKB2670838 - 4 Disk X25 RAID
SAGER NP9870-S - GTX 980 - i7-6700K - Win10 Pro 1607
Latest 3Dmigoto Release
Bo3b's School for ShaderHackers

Posted 11/14/2017 07:53 AM   
[quote="bo3b"]@DetectiveJohnKimble: I'm not sure I understand exactly what you are wanting to do, but for this code, I would recommend not changing the other parameters. To disable, set the o0 to 0, not all of them.[/quote] I'm trying to make the shader toggle on/off. It's the HUD in AC Origins so basically this is meant to be a hotkey for turning the HUD on and off. [quote="bo3b"]The key part is that [i]out float4 o0 : SV_Position0,[/i] which is o0. If you set position to zero, then the pixel shader has nothing to work with. This is explained in fair depth in my ShaderHacker class, so if you haven't looked at that, you need to. Even though the class talks about DX9, the principles are the same. Just: [code] float4 params = IniParams.Load(0); if (params.x == 0) { o0 = 0; return; } else { [/code][/quote] Hmm, this gives me the same result as before.
bo3b said:@DetectiveJohnKimble: I'm not sure I understand exactly what you are wanting to do, but for this code, I would recommend not changing the other parameters. To disable, set the o0 to 0, not all of them.


I'm trying to make the shader toggle on/off. It's the HUD in AC Origins so basically this is meant to be a hotkey for turning the HUD on and off.

bo3b said:The key part is that out float4 o0 : SV_Position0,
which is o0. If you set position to zero, then the pixel shader has nothing to work with. This is explained in fair depth in my ShaderHacker class, so if you haven't looked at that, you need to. Even though the class talks about DX9, the principles are the same.

Just:
float4 params = IniParams.Load(0);
if (params.x == 0)
{
o0 = 0;
return;
} else {


Hmm, this gives me the same result as before.

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

Posted 11/14/2017 12:01 PM   
Try: [code] float4 params = IniParams.Load(0); if (params.x == 0) { discard; } [/code] Setting the output to zero may not be equivalent to skipping the shader depending on the output merger state, but the discard instruction should always be equivalent regardless of state.
Try:

float4 params = IniParams.Load(0);
if (params.x == 0)
{
discard;
}


Setting the output to zero may not be equivalent to skipping the shader depending on the output merger state, but the discard instruction should always be equivalent regardless of state.

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/14/2017 12:09 PM   
Can you discard a vertex shader? I thought it wasn't possible, but it's something that I didn't actually try since 2015 when I was starting learning HLSL. Unrelated to all if this, one of the strange things I learned while fixing Hitman 1 and 2 was that in Shader Model 4, in ASM, comparisons are done differently (compared to DX9 fixes) if they aren't just checking if something is zero or non zero. Storing comparisons in a register and then checking if they were zero or non zero (true/false) wasn't intuitive at first, but then it allowed a lot of quick and effortless changes in the code. Fun stuff.
Can you discard a vertex shader? I thought it wasn't possible, but it's something that I didn't actually try since 2015 when I was starting learning HLSL.

Unrelated to all if this, one of the strange things I learned while fixing Hitman 1 and 2 was that in Shader Model 4, in ASM, comparisons are done differently (compared to DX9 fixes) if they aren't just checking if something is zero or non zero. Storing comparisons in a register and then checking if they were zero or non zero (true/false) wasn't intuitive at first, but then it allowed a lot of quick and effortless changes in the code. Fun stuff.

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/14/2017 12:58 PM   
  114 / 143    
Scroll To Top