Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Direct3D11 creates garbage #508

Open
ripwin opened this issue May 7, 2023 · 0 comments
Open

Direct3D11 creates garbage #508

ripwin opened this issue May 7, 2023 · 0 comments

Comments

@ripwin
Copy link

ripwin commented May 7, 2023

Hi,

There seems to be an issue with Direct3D11. I have the following code

public sealed class Application : IDisposable
{
    private readonly Sdl2Window _window;
    private readonly GraphicsDevice _graphicsDevice;
    private readonly CommandList _commandList;

    public Application(string title, int width, int height, int x, int y)
    {
        var windowCreateInfo = new WindowCreateInfo()
        {
            X = x,
            Y = y,
            WindowWidth = width,
            WindowHeight = height,
            WindowTitle = title,
        };

        _window = VeldridStartup.CreateWindow(ref windowCreateInfo);

        var options = new GraphicsDeviceOptions
        {
            PreferStandardClipSpaceYDirection = true,
            PreferDepthRangeZeroToOne = true,
        };

        _graphicsDevice = VeldridStartup.CreateGraphicsDevice(_window, options, GraphicsBackend.Direct3D11);
        _commandList = _graphicsDevice.ResourceFactory.CreateCommandList();
    }

    public void Dispose() => _graphicsDevice.Dispose();

    public void Run()
    {
        while (_window.Exists)
        {
            _window.PumpEvents();

            Draw();
        }
    }

    private void Draw()
    {
        _commandList.Begin();
        _commandList.SetFramebuffer(_graphicsDevice.SwapchainFramebuffer);
        _commandList.ClearColorTarget(0, RgbaFloat.Black);
        _commandList.End();
        _graphicsDevice.SubmitCommands(_commandList);
        _graphicsDevice.SwapBuffers();
    }
}
using var application = new Application("Sandbox", 640, 360, 100, 100);
application.Run();

Veldrid_Direct3D11

I don't have this behavior with Vulkan :

Veldrid_Vulkan

And I don't know if I did something wrong with this minimal configuration.

I'm working with :

  • VS 2022
  • net6.0
  • Veldrid 4.9.0
  • Windows 10 64bit
  • NVIDIA GeForce GTX 1060 6GB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant