internal void RequestCompile(string shaderCode, string sShaderType, OnCompilationFinished compilationFinishedHandler, string documentDir) { StartGlThreadOnce(); while (compileRequests.TryTake(out _)) { ; //remove pending compiles } var data = new CompileData(shaderCode, sShaderType, compilationFinishedHandler, documentDir); compileRequests.TryAdd(data); //put compile on request list }
internal void RequestCompile(string shaderCode, string sShaderType, OnCompilationFinished compilationFinishedHandler, string documentDir) { StartGlThreadOnce(); //conversion if (!mappingContentTypeToShaderType.TryGetValue(sShaderType, out ShaderType shaderType)) { shaderType = ShaderType.FragmentShader; } while (compileRequests.TryTake(out CompileData dataOld)) { ; //remove pending compiles } var data = new CompileData { ShaderCode = shaderCode, ShaderType = shaderType, DocumentDir = documentDir, CompilationFinished = compilationFinishedHandler }; compileRequests.TryAdd(data); //put compile on request list }