Skip to content

Commit

Permalink
Merge pull request #2148 from JetBrains/net212-mte-reenable-hlsl-tests
Browse files Browse the repository at this point in the history
Reenable HLSL/ShaderLab tests
  • Loading branch information
citizenmatt authored Aug 17, 2021
2 parents e373dfc + 626f79e commit 17ed38e
Show file tree
Hide file tree
Showing 12 changed files with 275 additions and 108 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,12 @@ public ShaderContextHost(Lifetime lifetime, ISolution solution, IPsiFiles psiFil
mySolution = solution;
myPsiFiles = psiFiles;
myCppGlobalSymbolCache = cppGlobalSymbolCache;
myDocumentHost = DocumentHostBase.GetInstance(solution);
myShaderContextCache = shaderContextCache;
myShaderContextDataPresentationCache = shaderContextDataPresentationCache;

// This requires IResharperHostCoreFeaturesZone
myDocumentHost = DocumentHostBase.GetInstance(solution);

if (frontendBackendHost == null || myDocumentHost == null)
return;

Expand Down
3 changes: 2 additions & 1 deletion resharper/resharper-unity/src/Rider/Shaders/ZoneMarker.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using JetBrains.Application.BuildScript.Application.Zones;
using JetBrains.RdBackend.Common.Env;
using JetBrains.ReSharper.Plugins.Unity.HlslSupport;

namespace JetBrains.ReSharper.Plugins.Unity.Rider.Shaders
{
[ZoneMarker]
public class ZoneMarker : IRequire<ILanguageHlslSupportZone>
public class ZoneMarker : IRequire<ILanguageHlslSupportZone>, IRequire<IResharperHostCoreFeatureZone>
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@

half _Glossiness;
half _Metallic;
|fixed4|(0) _Color;
|fixed4|(0) |_Color|(1);

// Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
// See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
// #pragma instancing_options assumeuniformscaling
|UNITY_INSTANCING_BUFFER_START|(1)(Props)
|UNITY_INSTANCING_BUFFER_START|(2)(|Props|(3))
// put more per-instance properties here
|UNITY_INSTANCING_BUFFER_END|(2)(Props)
|UNITY_INSTANCING_BUFFER_END|(4)(|Props|(5))

void surf (Input IN, inout |SurfaceOutputStandard|(3) o) {
void surf (Input IN, inout |SurfaceOutputStandard|(6) |o|(7)) {
// Albedo comes from a texture tinted by color
|fixed4|(4) c = tex2D |(_MainTex, IN.uv_MainTex, 2)|(5) * _Color;
|fixed4|(8) |c|(9) = tex2D |(_MainTex, IN.uv_MainTex, 2)|(10) * _Color;
o.Albedo = c.rgb;
// Metallic and smoothness come from slider variables
o.Metallic = _Metallic;
Expand All @@ -48,8 +48,13 @@
}
---------------------------------------------------------
(0): ReSharper Error Highlighting: Cannot resolve symbol 'fixed4'
(1): ReSharper Error Highlighting: Cannot resolve symbol 'UNITY_INSTANCING_BUFFER_START'
(2): ReSharper Error Highlighting: Cannot resolve symbol 'UNITY_INSTANCING_BUFFER_END'
(3): ReSharper Error Highlighting: Cannot resolve symbol 'SurfaceOutputStandard'
(4): ReSharper Error Highlighting: Cannot resolve symbol 'fixed4'
(5): ReSharper Underlined Error Highlighting: None of the overloads accepts 3 arguments
(1): ReSharper Underlined Error Highlighting: This declarator has unknown type
(2): ReSharper Error Highlighting: Cannot resolve symbol 'UNITY_INSTANCING_BUFFER_START'
(3): ReSharper Underlined Error Highlighting: This declarator has unknown type
(4): ReSharper Error Highlighting: Cannot resolve symbol 'UNITY_INSTANCING_BUFFER_END'
(5): ReSharper Underlined Error Highlighting: This declarator has unknown type
(6): ReSharper Error Highlighting: Cannot resolve symbol 'SurfaceOutputStandard'
(7): ReSharper Underlined Error Highlighting: This declarator has unknown type
(8): ReSharper Error Highlighting: Cannot resolve symbol 'fixed4'
(9): ReSharper Underlined Error Highlighting: This declarator has unknown type
(10): ReSharper Underlined Error Highlighting: None of the overloads accepts 3 arguments
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@

half _Glossiness;
half _Metallic;
|fixed4|(0) _Color;
|fixed4|(0) |_Color|(1);

// Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
// See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
// #pragma instancing_options assumeuniformscaling
|UNITY_INSTANCING_BUFFER_START|(1)(Props)
|UNITY_INSTANCING_BUFFER_START|(2)(|Props|(3))
// put more per-instance properties here
|UNITY_INSTANCING_BUFFER_END|(2)(Props)
|UNITY_INSTANCING_BUFFER_END|(4)(|Props|(5))

void surf (Input |IN|(3), inout |SurfaceOutputStandard|(4) |o|(5)) {
void surf (Input |IN|(6), inout |SurfaceOutputStandard|(7) ||o|(8)|(9)) {

#if SHADER_TARGET > 40
// Albedo comes from a texture tinted by color
Expand All @@ -51,8 +51,12 @@
}
---------------------------------------------------------
(0): ReSharper Error Highlighting: Cannot resolve symbol 'fixed4'
(1): ReSharper Error Highlighting: Cannot resolve symbol 'UNITY_INSTANCING_BUFFER_START'
(2): ReSharper Error Highlighting: Cannot resolve symbol 'UNITY_INSTANCING_BUFFER_END'
(3): ReSharper Dead Code: Parameter 'IN' is never used
(4): ReSharper Error Highlighting: Cannot resolve symbol 'SurfaceOutputStandard'
(5): ReSharper Dead Code: Parameter 'o' is never used
(1): ReSharper Underlined Error Highlighting: This declarator has unknown type
(2): ReSharper Error Highlighting: Cannot resolve symbol 'UNITY_INSTANCING_BUFFER_START'
(3): ReSharper Underlined Error Highlighting: This declarator has unknown type
(4): ReSharper Error Highlighting: Cannot resolve symbol 'UNITY_INSTANCING_BUFFER_END'
(5): ReSharper Underlined Error Highlighting: This declarator has unknown type
(6): ReSharper Dead Code: Parameter 'IN' is never used
(7): ReSharper Error Highlighting: Cannot resolve symbol 'SurfaceOutputStandard'
(8): ReSharper Dead Code: Parameter 'o' is never used
(9): ReSharper Underlined Error Highlighting: This declarator has unknown type
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@

half _Glossiness;
half _Metallic;
|fixed4|(0) _Color;
|fixed4|(0) |_Color|(1);

// Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader.
// See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing.
// #pragma instancing_options assumeuniformscaling
|UNITY_INSTANCING_BUFFER_START|(1)(Props)
|UNITY_INSTANCING_BUFFER_START|(2)(|Props|(3))
// put more per-instance properties here
|UNITY_INSTANCING_BUFFER_END|(2)(Props)
|UNITY_INSTANCING_BUFFER_END|(4)(|Props|(5))

void surf (Input IN, inout |SurfaceOutputStandard|(3) o) {
void surf (Input IN, inout |SurfaceOutputStandard|(6) |o|(7)) {

#if SHADER_TARGET > 40
// Albedo comes from a texture tinted by color
|fixed4|(4) c = tex2D |(_MainTex, IN.uv_MainTex, 2)|(5) * _Color;
|fixed4|(8) |c|(9) = tex2D |(_MainTex, IN.uv_MainTex, 2)|(10) * _Color;
o.Albedo = c.rgb;
// Metallic and smoothness come from slider variables
o.Metallic = _Metallic;
Expand All @@ -50,8 +50,13 @@
}
---------------------------------------------------------
(0): ReSharper Error Highlighting: Cannot resolve symbol 'fixed4'
(1): ReSharper Error Highlighting: Cannot resolve symbol 'UNITY_INSTANCING_BUFFER_START'
(2): ReSharper Error Highlighting: Cannot resolve symbol 'UNITY_INSTANCING_BUFFER_END'
(3): ReSharper Error Highlighting: Cannot resolve symbol 'SurfaceOutputStandard'
(4): ReSharper Error Highlighting: Cannot resolve symbol 'fixed4'
(5): ReSharper Underlined Error Highlighting: None of the overloads accepts 3 arguments
(1): ReSharper Underlined Error Highlighting: This declarator has unknown type
(2): ReSharper Error Highlighting: Cannot resolve symbol 'UNITY_INSTANCING_BUFFER_START'
(3): ReSharper Underlined Error Highlighting: This declarator has unknown type
(4): ReSharper Error Highlighting: Cannot resolve symbol 'UNITY_INSTANCING_BUFFER_END'
(5): ReSharper Underlined Error Highlighting: This declarator has unknown type
(6): ReSharper Error Highlighting: Cannot resolve symbol 'SurfaceOutputStandard'
(7): ReSharper Underlined Error Highlighting: This declarator has unknown type
(8): ReSharper Error Highlighting: Cannot resolve symbol 'fixed4'
(9): ReSharper Underlined Error Highlighting: This declarator has unknown type
(10): ReSharper Underlined Error Highlighting: None of the overloads accepts 3 arguments

This file was deleted.

Loading

0 comments on commit 17ed38e

Please sign in to comment.