private static PipelineLayoutDescription CreatePipelineLayoutDescription() { return(new PipelineLayoutDescription { Entries = new[] { // TextureCB PipelineLayoutEntry.CreateResource( ShaderStageVisibility.Pixel, ResourceType.ConstantBuffer, 0), // Texture PipelineLayoutEntry.CreateResourceView( ShaderStageVisibility.Pixel, ResourceType.Texture, 0, 1) }, StaticSamplerStates = new[] { new StaticSamplerDescription( ShaderStageVisibility.Pixel, 0, new SamplerStateDescription(SamplerFilter.MinMagMipPoint)) } }); }
private static PipelineLayoutDescription CreatePipelineLayoutDescription(int numTextures) { return(new PipelineLayoutDescription { Entries = new[] { // TransformCB PipelineLayoutEntry.CreateResource( ShaderStageVisibility.Vertex, ResourceType.ConstantBuffer, 0), // LightingCB PipelineLayoutEntry.CreateResource( ShaderStageVisibility.Pixel, ResourceType.ConstantBuffer, 0), // TileData PipelineLayoutEntry.CreateResourceView( ShaderStageVisibility.Pixel, ResourceType.Texture, 0, 1), // CliffDetails PipelineLayoutEntry.CreateResourceView( ShaderStageVisibility.Pixel, ResourceType.StructuredBuffer, 1, 1), // TextureDetails PipelineLayoutEntry.CreateResourceView( ShaderStageVisibility.Pixel, ResourceType.StructuredBuffer, 2, 1), // Textures PipelineLayoutEntry.CreateResourceView( ShaderStageVisibility.Pixel, ResourceType.StructuredBuffer, 3, numTextures) }, StaticSamplerStates = new[] { new StaticSamplerDescription( ShaderStageVisibility.Pixel, 0, new SamplerStateDescription(SamplerFilter.Anisotropic)) } }); }
private static PipelineLayoutDescription CreatePipelineLayoutDescription() { return(new PipelineLayoutDescription { Entries = new[] { // PerDrawCB PipelineLayoutEntry.CreateResource( ShaderStageVisibility.Pixel, ResourceType.ConstantBuffer, 1), // MeshTransformCB PipelineLayoutEntry.CreateResource( ShaderStageVisibility.Vertex, ResourceType.ConstantBuffer, 0), // SkinningBuffer PipelineLayoutEntry.CreateResource( ShaderStageVisibility.Vertex, ResourceType.StructuredBuffer, 0), // LightingCB PipelineLayoutEntry.CreateResource( ShaderStageVisibility.Pixel, ResourceType.ConstantBuffer, 0), // Sorted in descending frequency of updating // MaterialIndices PipelineLayoutEntry.CreateResourceView( ShaderStageVisibility.Vertex, ResourceType.StructuredBuffer, 1, 1), // TextureIndices PipelineLayoutEntry.CreateResourceView( ShaderStageVisibility.Pixel, ResourceType.StructuredBuffer, 1, 1), // Materials PipelineLayoutEntry.CreateResourceView( ShaderStageVisibility.Pixel, ResourceType.StructuredBuffer, 0, 1), // Textures PipelineLayoutEntry.CreateResourceView( ShaderStageVisibility.Pixel, ResourceType.Texture, 2, MaxTextures), }, StaticSamplerStates = new[] { new StaticSamplerDescription( ShaderStageVisibility.Pixel, 0, new SamplerStateDescription(SamplerFilter.Anisotropic)) } }); }