次の方法で共有


ShaderCompiler.AssembleFromFile Method (Stream, Int32, CompilerMacro , CompilerIncludeHandler, CompilerOptions, TargetPlatform)

Note

This method is available only when developing for Windows.

Compiles a shader from a stream containing shader assembly code (ASM), specifying the number of bytes in the stream.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

Syntax

public static CompiledShader AssembleFromFile (
         Stream shaderSourceCode,
         int numberBytes,
         CompilerMacro[] preprocessorDefines,
         CompilerIncludeHandler includeHandler,
         CompilerOptions options,
         TargetPlatform platform
)

Parameters

  • shaderSourceCode
    Stream that contains the shader data.
  • numberBytes
    The number of bytes in shaderSourceCode.
  • preprocessorDefines
    Describes preprocessor definitions used by an effect object.
  • includeHandler
    User-implemented interface to provide callbacks for #include directives during shader compilation.
  • options
    Compilation optimization options.
  • platform
    Target platform for the compilation.

Return Value

The compiled shader.

Exceptions

Exception type Condition
ArgumentNullException shaderSourceCode is null. The stream passed into this method cannot be null.
NotSupportedException shaderSourceCode is not readable. Streams passed into this method must be readable.
EndOfStreamException shaderSourceCode does not contain enough data to support this call.

See Also

Reference

ShaderCompiler Class
ShaderCompiler Members
Microsoft.Xna.Framework.Graphics Namespace

Platforms

Windows XP SP2, Windows Vista