Ejemplo n.º 1
0
        private Expression GetWriteColorOutputExpression(int location, Expression colorParam)
        {
            var        framebuffer = (SoftwareFramebuffer)m_context.m_RenderPassBeginInfo.framebuffer;
            var        imgView     = framebuffer.m_createInfo.pAttachments[m_context.m_CurrentSubpass.pColorAttachments[location].attachment];
            Expression fragCoord   = IntrospectionUtil.GetExpressionFor(() => internal_FragCoord);
            Expression call        = IntrospectionUtil.GetMethodCallExpression(imgView, "SetPixel", fragCoord, colorParam);

            return(call);
        }
Ejemplo n.º 2
0
        public static CompiledShaderModule Compile(VkPipelineShaderStageCreateInfo stageCreateInfo)
        {
            SoftwareShaderModule module = (SoftwareShaderModule)stageCreateInfo.module;
            string entryPointName       = stageCreateInfo.pName;

            CompiledShaderModule ret = new CompiledShaderModule();

            ret.instance   = module.GetNewInstance();
            ret.entryPoint = IntrospectionUtil.GetMethodCallExpression(ret.instance, entryPointName);
            return(ret);
        }
Ejemplo n.º 3
0
        private Expression GetReadSmothExpression(FieldInfo fieldInfo, Expression inputData)
        {
            string debugFieldName = string.Format("{0}.{1}", fieldInfo.DeclaringType.Name, fieldInfo.Name);

            try
            {
                return(IntrospectionUtil.GetMethodCallExpression(
                           this, nameof(ReadSmoth),
                           inputData
                           ));
            }
            catch (InvalidOperationException) { }

            DebugMsg(string.Format(
                         "WARNING: incompatible datatype {0} for fast interpolation for field {1}. Using slow-method instead.",
                         fieldInfo.FieldType.Name, debugFieldName));

            return(Expression.Convert(IntrospectionUtil.GetMethodCallExpression(
                                          this, nameof(ReadSmothDynamic),
                                          inputData
                                          ), fieldInfo.FieldType));
        }