Commit f9694885 by Nicolas Capens Committed by Nicolas Capens

Fix shader call stack size mismatch

https://swiftshader-review.googlesource.com/c/SwiftShader/+/16328 increased the maximum call depth validated by the GLSL ES compiler, without increasing the stack size supported by our back-end. The sw::MAX_SHADER_CALL_STACK_SIZE of the back-end is now statically passed to an es2::MAX_SHADER_CALL_STACK_SIZE (has to remain equal or smaller) and then passed to the GLSL compiler's resources limits. Bug b/123587120 Change-Id: I9a56d5b4e980dc0881c238669d2b786bb3c855e3 Reviewed-on: https://swiftshader-review.googlesource.com/c/24628Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent eea21ba1
......@@ -100,7 +100,7 @@ namespace sw
MAX_SHADER_CALL_SITES = 2048,
MAX_SHADER_NESTED_LOOPS = 4,
MAX_SHADER_NESTED_IFS = 24 + 24,
MAX_SHADER_CALL_STACK_SIZE = 16,
MAX_SHADER_CALL_STACK_SIZE = 64,
MAX_SHADER_ENABLE_STACK_SIZE = 1 + 24,
};
}
......
......@@ -105,6 +105,7 @@ enum
MAX_UNIFORM_BUFFER_BINDINGS = sw::MAX_UNIFORM_BUFFER_BINDINGS,
UNIFORM_BUFFER_OFFSET_ALIGNMENT = 4,
NUM_PROGRAM_BINARY_FORMATS = 0,
MAX_SHADER_CALL_STACK_SIZE = sw::MAX_SHADER_CALL_STACK_SIZE,
};
const GLenum compressedTextureFormats[] =
......
......@@ -183,7 +183,7 @@ TranslatorASM *Shader::createCompiler(GLenum shaderType)
resources.OES_EGL_image_external_essl3 = 1;
resources.EXT_draw_buffers = 1;
resources.ARB_texture_rectangle = 1;
resources.MaxCallStackDepth = 64;
resources.MaxCallStackDepth = MAX_SHADER_CALL_STACK_SIZE;
assembler->Init(resources);
return assembler;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment