public void Accept(ShaderGeneratorContext context) { if (Texture is null) { throw new InvalidOperationException(); } ColorTexture = new Texture2D(ShaderResourceView.FromTexture2D(Texture, ConvertToLinear ? Texture.Format.ToSrgb() : Texture.Format)); context.ShaderResourceViews.Add(ShaderResourceView.FromTexture2D(Texture, ConvertToLinear ? Texture.Format.ToSrgb() : Texture.Format)); }
public void Accept(ShaderGeneratorContext context) { if (Texture is null) { throw new InvalidOperationException(); } ScalarTexture = new Texture2D(ShaderResourceView.FromTexture2D(Texture, ConvertToLinear ? Texture.Format.ToSrgb() : Texture.Format)); context.ShaderResourceViews.Add(ScalarTexture); colorChannelBuffer ??= GraphicsResource.CreateBuffer(context.GraphicsDevice, Channel, ResourceFlags.None, HeapType.Upload); context.ConstantBufferViews.Add(colorChannelBuffer.DefaultConstantBufferView); }