Skip to content

Fix switch shader compilation #111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#define MAX_IBL_SAMPLE_CNT 89
#endif

RWTexture2D<float4> output; // [MAX_SAMPLE_CNT x UNITY_SPECCUBE_LOD_STEPS]
RWTexture2D<float4> outputResult; // [MAX_SAMPLE_CNT x UNITY_SPECCUBE_LOD_STEPS]

#pragma kernel ComputeGgxIblSampleData

Expand All @@ -33,7 +33,7 @@ void ComputeGgxIblSampleData(uint3 groupThreadId : SV_GroupThreadID)

if (sampleIndex >= sampleCount)
{
output[texCoord] = float4(0, 0, 0, 0);
outputResult[texCoord] = float4(0, 0, 0, 0);
return;
}

Expand Down Expand Up @@ -82,6 +82,6 @@ void ComputeGgxIblSampleData(uint3 groupThreadId : SV_GroupThreadID)
float pdf = 0.25 * D_GGX(NdotH, roughness);
float omegaS = rcp(sampleCount) * rcp(pdf);

output[texCoord] = float4(localL, omegaS);
outputResult[texCoord] = float4(localL, omegaS);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public override void Initialize(CommandBuffer cmd)

void InitializeGgxIblSampleData(CommandBuffer cmd)
{
m_ComputeGgxIblSampleDataCS.SetTexture(m_ComputeGgxIblSampleDataKernel, "output", m_GgxIblSampleData);
m_ComputeGgxIblSampleDataCS.SetTexture(m_ComputeGgxIblSampleDataKernel, "outputResult", m_GgxIblSampleData);
cmd.DispatchCompute(m_ComputeGgxIblSampleDataCS, m_ComputeGgxIblSampleDataKernel, 1, 1, 1);
}

Expand Down