change backend selection behavior
parent
f3eacbf776
commit
43cd8f0182
|
@ -11,7 +11,7 @@ namespace MoonWorks.Test
|
|||
private Sampler sampler;
|
||||
private GpuBuffer vertexBuffer;
|
||||
|
||||
public BasicComputeGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public BasicComputeGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
// Create the compute pipeline that writes texture data
|
||||
ShaderModule fillTextureComputeShaderModule = new ShaderModule(
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace MoonWorks.Test
|
|||
private GpuBuffer vertexBuffer;
|
||||
private Texture depthStencilTexture;
|
||||
|
||||
public BasicStencilGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public BasicStencilGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
// Load the shaders
|
||||
ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("PositionColor.vert"));
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace MoonWorks.Test
|
|||
private bool useSmallViewport;
|
||||
private bool useScissorRect;
|
||||
|
||||
public BasicTriangleGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public BasicTriangleGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
Logger.LogInfo("Press Left to toggle wireframe mode\nPress Down to toggle small viewport\nPress Right to toggle scissor rect");
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ namespace MoonWorks.Test
|
|||
{
|
||||
class ClearScreenGame : Game
|
||||
{
|
||||
public ClearScreenGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true) { }
|
||||
public ClearScreenGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true) { }
|
||||
|
||||
protected override void Update(System.TimeSpan delta) { }
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace MoonWorks.Test
|
|||
{
|
||||
private Window secondaryWindow;
|
||||
|
||||
public ClearScreen_MultiWindowGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public ClearScreen_MultiWindowGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
var (windowX, windowY) = MainWindow.Position;
|
||||
MainWindow.SetPosition(windowX - 360, windowY);
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace MoonWorks.Test
|
|||
|
||||
private int currentTextureIndex;
|
||||
|
||||
public CompressedTexturesGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public CompressedTexturesGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
Logger.LogInfo("Press Left and Right to cycle between textures");
|
||||
Logger.LogInfo("Setting texture to: " + textureNames[0]);
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace MoonWorks.Test
|
|||
}
|
||||
}
|
||||
|
||||
public ComputeUniformsGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public ComputeUniformsGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
// Create the compute pipeline that writes texture data
|
||||
ShaderModule gradientTextureComputeShaderModule = new ShaderModule(
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace MoonWorks.Test
|
|||
private Texture textureSmallCopy;
|
||||
private Sampler sampler;
|
||||
|
||||
public unsafe CopyTextureGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public unsafe CopyTextureGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
// Load the shaders
|
||||
ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuad.vert"));
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace MoonWorks.Test
|
|||
cubemapUploader.Dispose();
|
||||
}
|
||||
|
||||
public CubeGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public CubeGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
ShaderModule cubeVertShaderModule = new ShaderModule(
|
||||
GraphicsDevice,
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace MoonWorks.Test
|
|||
|
||||
private bool useClockwiseWinding;
|
||||
|
||||
public CullFaceGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public CullFaceGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
Logger.LogInfo("Press Down to toggle the winding order of the triangles (default is counter-clockwise)");
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace MoonWorks.Test
|
|||
|
||||
private SampleCount currentSampleCount = SampleCount.Four;
|
||||
|
||||
public DepthMSAAGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public DepthMSAAGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
Logger.LogInfo("Press Left and Right to cycle between sample counts");
|
||||
Logger.LogInfo("Setting sample count to: " + currentSampleCount);
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace MoonWorks.Test
|
|||
private GpuBuffer vertexBuffer;
|
||||
private GpuBuffer drawBuffer;
|
||||
|
||||
public DrawIndirectGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public DrawIndirectGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
// Load the shaders
|
||||
ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("PositionColor.vert"));
|
||||
|
|
|
@ -6,7 +6,7 @@ namespace MoonWorks.Test
|
|||
{
|
||||
class GetBufferDataGame : Game
|
||||
{
|
||||
public GetBufferDataGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public GetBufferDataGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
var vertices = new System.Span<PositionVertex>(
|
||||
[
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace MoonWorks.Test
|
|||
private bool useVertexOffset;
|
||||
private bool useIndexOffset;
|
||||
|
||||
public InstancingAndOffsetsGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public InstancingAndOffsetsGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
Logger.LogInfo("Press Left to toggle vertex offset\nPress Right to toggle index offset");
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace MoonWorks.Test
|
|||
|
||||
private SampleCount currentSampleCount = SampleCount.Four;
|
||||
|
||||
public MSAAGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public MSAAGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
Logger.LogInfo("Press Left and Right to cycle between sample counts");
|
||||
Logger.LogInfo("Setting sample count to: " + currentSampleCount);
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace MoonWorks.Test
|
|||
|
||||
private SampleCount currentSampleCount = SampleCount.Four;
|
||||
|
||||
public MSAACubeGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public MSAACubeGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
Logger.LogInfo("Press Down to view the other side of the cubemap");
|
||||
Logger.LogInfo("Press Left and Right to cycle between sample counts");
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -4,7 +4,8 @@ namespace MoonWorks.Test
|
|||
{
|
||||
public static class TestUtils
|
||||
{
|
||||
public static Backend Backend = Backend.Vulkan; // change this to test different backends
|
||||
// change this to test different backends
|
||||
public static Backend[] PreferredBackends = [Backend.Vulkan, Backend.D3D11];
|
||||
|
||||
public static WindowCreateInfo GetStandardWindowCreateInfo()
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace MoonWorks.Test
|
|||
private Texture[] textures = new Texture[4];
|
||||
private Sampler sampler;
|
||||
|
||||
public RenderTexture2DGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public RenderTexture2DGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
// Load the shaders
|
||||
ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuad.vert"));
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace MoonWorks.Test
|
|||
}
|
||||
}
|
||||
|
||||
public RenderTexture2DArrayGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public RenderTexture2DArrayGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
// Load the shaders
|
||||
ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuad.vert"));
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace MoonWorks.Test
|
|||
Color.Purple,
|
||||
};
|
||||
|
||||
public RenderTextureCubeGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public RenderTextureCubeGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
Logger.LogInfo("Press Down to view the other side of the cubemap");
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace MoonWorks.Test
|
|||
}
|
||||
}
|
||||
|
||||
public RenderTextureMipmapsGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public RenderTextureMipmapsGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
Logger.LogInfo("Press Left and Right to shrink/expand the scale of the quad");
|
||||
Logger.LogInfo("Press Down to cycle through sampler states");
|
||||
|
|
|
@ -7,7 +7,7 @@ namespace MoonWorks.Test
|
|||
{
|
||||
private GraphicsPipeline fillPipeline;
|
||||
|
||||
public StoreLoadGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public StoreLoadGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("RawTriangle.vert"));
|
||||
ShaderModule fragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("SolidColor.frag"));
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace MoonWorks.Test
|
|||
}
|
||||
}
|
||||
|
||||
public Texture3DGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public Texture3DGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
Logger.LogInfo("Press Left and Right to cycle between depth slices");
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace MoonWorks.Test
|
|||
}
|
||||
}
|
||||
|
||||
public RenderTexture3DGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public RenderTexture3DGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
// Load the shaders
|
||||
ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuad.vert"));
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace MoonWorks.Test
|
|||
|
||||
private float scale = 0.5f;
|
||||
|
||||
public TextureMipmapsGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public TextureMipmapsGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
Logger.LogInfo("Press Left and Right to shrink/expand the scale of the quad");
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace MoonWorks.Test
|
|||
}
|
||||
}
|
||||
|
||||
public TexturedAnimatedQuadGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public TexturedAnimatedQuadGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
// Load the shaders
|
||||
ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuadWithMatrix.vert"));
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace MoonWorks.Test
|
|||
|
||||
private System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch();
|
||||
|
||||
public TexturedQuadGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public TexturedQuadGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
Logger.LogInfo("Press Left and Right to cycle between sampler states");
|
||||
Logger.LogInfo("Setting sampler state to: " + samplerNames[0]);
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace MoonWorks.Test
|
|||
private GraphicsPipeline pipeline;
|
||||
private GpuBuffer vertexBuffer;
|
||||
|
||||
public TriangleVertexBufferGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public TriangleVertexBufferGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
// Load the shaders
|
||||
ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("PositionColor.vert"));
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace MoonWorks.Test
|
|||
private Texture texture;
|
||||
private Sampler sampler;
|
||||
|
||||
public VertexSamplerGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public VertexSamplerGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
// Load the shaders
|
||||
ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("PositionSampler.vert"));
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace MoonWorks.Test
|
|||
private Video.VideoAV1 video;
|
||||
private VideoPlayer videoPlayer;
|
||||
|
||||
public VideoPlayerGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public VideoPlayerGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
// Load the shaders
|
||||
ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuad.vert"));
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace MoonWorks.Test
|
|||
new Res(3840, 2160),
|
||||
};
|
||||
|
||||
public WindowResizingGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.Backend, 60, true)
|
||||
public WindowResizingGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true)
|
||||
{
|
||||
ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("RawTriangle.vert"));
|
||||
ShaderModule fragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("SolidColor.frag"));
|
||||
|
|
Loading…
Reference in New Issue