Beispiel #1
0
        public ShaderProgram Translate(out ShaderProgramInfo shaderProgramInfo, TranslatorContext other = null)
        {
            FunctionCode[] code = EmitShader(_cfg, _config);

            if (other != null)
            {
                _config.SetUsedFeature(other._config.UsedFeatures);
                TextureHandlesForCache.UnionWith(other.TextureHandlesForCache);

                code = Combine(EmitShader(other._cfg, other._config), code);
            }

            return(Translator.Translate(code, _config, out shaderProgramInfo));
        }
Beispiel #2
0
 private static void ScanForBindless(BasicBlock[] blocks, ShaderConfig config)
 {
     for (int blkIndex = 0; blkIndex < blocks.Length; blkIndex++)
     {
         // Right now the guest shader cache cannot handle bindless textures correctly.
         for (LinkedListNode <INode> node = blocks[blkIndex].Operations.First; node != null; node = node.Next)
         {
             if (node.Value is TextureOperation texOp && (texOp.Flags & TextureFlags.Bindless) != 0)
             {
                 config.SetUsedFeature(FeatureFlags.Bindless);
                 break;
             }
         }
     }
 }
Beispiel #3
0
        public ShaderProgram Translate(out ShaderProgramInfo shaderProgramInfo)
        {
            FunctionCode[] code = EmitShader(_cfg, _config);

            if (_configA != null)
            {
                FunctionCode[] codeA = EmitShader(_cfgA, _configA);

                _config.SetUsedFeature(_configA.UsedFeatures);

                code = Combine(codeA, code);
            }

            return(Translator.Translate(code, _config, out shaderProgramInfo, SizeA));
        }