Skip to content
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

Shader with missing bracket cause the rewriter to loop endlessly #75

Closed
nbentyNV opened this issue Jul 11, 2017 · 0 comments
Closed

Shader with missing bracket cause the rewriter to loop endlessly #75

nbentyNV opened this issue Jul 11, 2017 · 0 comments

Comments

@nbentyNV
Copy link
Collaborator

nbentyNV commented Jul 11, 2017

`struct LightCB
{
float3 vec3Val; // We're using 2 values. [0]: worldDir [1]: intensity
};

StructuredBuffer gLightIn;
AppendStructuredBuffer gLightOut;

[numthreads(1, 1, 1)]
void main()
{
uint numLights = 0;
uint stride;
gLightIn.GetDimensions(numLights, stride);

for (uint i = 0; i < numLights; i++)
// MISSING BRACKET
    gLightOut.Append(gLightIn[i]);
}

}`

tangent-vector added a commit to tangent-vector/slang that referenced this issue Jul 11, 2017
Fixes shader-slang#75

In order to avoid cascaded errors, I went ahead and made the parser refuse to skip past a `}` in recovery mode. The problem with this is that we fail to make forward progress if we are stuck on a `}` (this happens if you have an extra `}` at the global scope.
tangent-vector-personal pushed a commit that referenced this issue Jul 12, 2017
Make parser recovering more robust to avoid infinite loops
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant