diff --git a/renderdoc/data/glsl/debuguniforms.h b/renderdoc/data/glsl/debuguniforms.h index 345e4fb7c..922798e33 100644 --- a/renderdoc/data/glsl/debuguniforms.h +++ b/renderdoc/data/glsl/debuguniforms.h @@ -266,4 +266,4 @@ INST_NAME(texdisplay); #define MESH_TRIANGLE_STRIP 2 #define MESH_TRIANGLE_FAN 3 #define MESH_TRIANGLE_LIST_ADJ 4 -#define MESH_TRIANGLE_STRIP_ADJ 5 \ No newline at end of file +#define MESH_TRIANGLE_STRIP_ADJ 5 diff --git a/renderdoc/data/hlsl/debugcbuffers.h b/renderdoc/data/hlsl/debugcbuffers.h index 177f2dda2..917b22885 100644 --- a/renderdoc/data/hlsl/debugcbuffers.h +++ b/renderdoc/data/hlsl/debugcbuffers.h @@ -161,4 +161,4 @@ cbuffer HistogramCBufferData REG(b0) #define MESH_TRIANGLE_LIST 1 #define MESH_TRIANGLE_STRIP 2 #define MESH_TRIANGLE_LIST_ADJ 3 -#define MESH_TRIANGLE_STRIP_ADJ 4 \ No newline at end of file +#define MESH_TRIANGLE_STRIP_ADJ 4 diff --git a/renderdoc/data/hlsl/mesh.hlsl b/renderdoc/data/hlsl/mesh.hlsl index ecc6ce682..161db9310 100644 --- a/renderdoc/data/hlsl/mesh.hlsl +++ b/renderdoc/data/hlsl/mesh.hlsl @@ -68,38 +68,38 @@ wireframeV2F RENDERDOC_MeshVS(meshA2V IN, uint vid : SV_VertexID) [maxvertexcount(3)] void RENDERDOC_MeshGS(triangle wireframeV2F input[3], inout TriangleStream TriStream) { - wireframeV2F output; + wireframeV2F output; - float4 faceEdgeA = mul(input[1].pos, InvProj) - mul(input[0].pos, InvProj); - float4 faceEdgeB = mul(input[2].pos, InvProj) - mul(input[0].pos, InvProj); - float3 faceNormal = normalize( cross(faceEdgeA.xyz, faceEdgeB.xyz) ); + float4 faceEdgeA = mul(input[1].pos, InvProj) - mul(input[0].pos, InvProj); + float4 faceEdgeB = mul(input[2].pos, InvProj) - mul(input[0].pos, InvProj); + float3 faceNormal = normalize( cross(faceEdgeA.xyz, faceEdgeB.xyz) ); - for(int i=0; i<3; i++) - { - output.pos = input[i].pos; - output.norm = faceNormal; - output.secondary = input[i].secondary; - TriStream.Append(output); - } - TriStream.RestartStrip(); + for(int i=0; i<3; i++) + { + output.pos = input[i].pos; + output.norm = faceNormal; + output.secondary = input[i].secondary; + TriStream.Append(output); + } + TriStream.RestartStrip(); } float4 RENDERDOC_MeshPS(wireframeV2F IN) : SV_Target0 { - uint type = OutputDisplayFormat; + uint type = OutputDisplayFormat; - if(type == MESHDISPLAY_SECONDARY) - return float4(IN.secondary.xyz, 1); - else if(type == MESHDISPLAY_SECONDARY_ALPHA) - return float4(IN.secondary.www, 1); - else if(type == MESHDISPLAY_FACELIT) - { - float3 lightDir = normalize(float3(0, -0.3f, -1)); + if(type == MESHDISPLAY_SECONDARY) + return float4(IN.secondary.xyz, 1); + else if(type == MESHDISPLAY_SECONDARY_ALPHA) + return float4(IN.secondary.www, 1); + else if(type == MESHDISPLAY_FACELIT) + { + float3 lightDir = normalize(float3(0, -0.3f, -1)); - return float4(WireframeColour.xyz*abs(dot(lightDir, IN.norm)), 1); - } - else //if(type == MESHDISPLAY_SOLID) - return float4(WireframeColour.xyz, 1); + return float4(WireframeColour.xyz*abs(dot(lightDir, IN.norm)), 1); + } + else //if(type == MESHDISPLAY_SOLID) + return float4(WireframeColour.xyz, 1); } wireframeV2F RENDERDOC_WireframeVS(float3 pos : POSITION, uint vid : SV_VertexID) @@ -279,8 +279,8 @@ void defaultPath(uint threadID) float4 wpos = mul(pos, PickMVP); - if (PickUnproject == 1) - wpos.xyz /= wpos.www; + if (PickUnproject == 1) + wpos.xyz /= wpos.www; wpos.xy *= float2(1.0f, -1.0f);