Compare commits
13 Commits
84197b6c42
...
d612e8538a
Author | SHA1 | Date |
---|---|---|
|
d612e8538a | |
|
1916415fb4 | |
|
72573219ed | |
|
10db4f95c8 | |
|
9704072ab2 | |
|
c04d021237 | |
|
b81780e258 | |
|
e52fe60657 | |
|
b39526ca90 | |
|
88d9119830 | |
|
05de9a4066 | |
|
b1d30a9e6c | |
|
030745361b |
|
@ -24,13 +24,4 @@
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<EmbeddedResource Include="src\Video\Shaders\Compiled\FullscreenVert.spv">
|
|
||||||
<LogicalName>MoonWorks.Shaders.FullscreenVert.spv</LogicalName>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<EmbeddedResource Include="src\Video\Shaders\Compiled\YUV2RGBAFrag.spv">
|
|
||||||
<LogicalName>MoonWorks.Shaders.YUV2RGBAFrag.spv</LogicalName>
|
|
||||||
</EmbeddedResource>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 1643061386177f62b516ccaad0ea04607cae2333
|
Subproject commit 52d3355120cba2025fac67499ee3c669e5347809
|
|
@ -71,7 +71,7 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
renderPassActive = true;
|
renderPassActive = true;
|
||||||
currentSampleCount = colorAttachmentInfo.SampleCount;
|
currentSampleCount = colorAttachmentInfo.Texture.SampleCount;
|
||||||
colorFormatOne = colorAttachmentInfo.Texture.Format;
|
colorFormatOne = colorAttachmentInfo.Texture.Format;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
renderPassActive = true;
|
renderPassActive = true;
|
||||||
currentSampleCount = colorAttachmentInfoOne.SampleCount;
|
currentSampleCount = colorAttachmentInfoOne.Texture.SampleCount;
|
||||||
colorFormatOne = colorAttachmentInfoOne.Texture.Format;
|
colorFormatOne = colorAttachmentInfoOne.Texture.Format;
|
||||||
colorFormatTwo = colorAttachmentInfoTwo.Texture.Format;
|
colorFormatTwo = colorAttachmentInfoTwo.Texture.Format;
|
||||||
#endif
|
#endif
|
||||||
|
@ -159,7 +159,7 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
renderPassActive = true;
|
renderPassActive = true;
|
||||||
currentSampleCount = colorAttachmentInfoOne.SampleCount;
|
currentSampleCount = colorAttachmentInfoOne.Texture.SampleCount;
|
||||||
colorFormatOne = colorAttachmentInfoOne.Texture.Format;
|
colorFormatOne = colorAttachmentInfoOne.Texture.Format;
|
||||||
colorFormatTwo = colorAttachmentInfoTwo.Texture.Format;
|
colorFormatTwo = colorAttachmentInfoTwo.Texture.Format;
|
||||||
colorFormatThree = colorAttachmentInfoThree.Texture.Format;
|
colorFormatThree = colorAttachmentInfoThree.Texture.Format;
|
||||||
|
@ -215,7 +215,7 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
renderPassActive = true;
|
renderPassActive = true;
|
||||||
currentSampleCount = colorAttachmentInfoOne.SampleCount;
|
currentSampleCount = colorAttachmentInfoOne.Texture.SampleCount;
|
||||||
colorFormatOne = colorAttachmentInfoOne.Texture.Format;
|
colorFormatOne = colorAttachmentInfoOne.Texture.Format;
|
||||||
colorFormatTwo = colorAttachmentInfoTwo.Texture.Format;
|
colorFormatTwo = colorAttachmentInfoTwo.Texture.Format;
|
||||||
colorFormatThree = colorAttachmentInfoThree.Texture.Format;
|
colorFormatThree = colorAttachmentInfoThree.Texture.Format;
|
||||||
|
@ -285,7 +285,7 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
renderPassActive = true;
|
renderPassActive = true;
|
||||||
currentSampleCount = colorAttachmentInfo.SampleCount;
|
currentSampleCount = colorAttachmentInfo.Texture.SampleCount;
|
||||||
colorFormatOne = colorAttachmentInfo.Texture.Format;
|
colorFormatOne = colorAttachmentInfo.Texture.Format;
|
||||||
depthStencilFormat = depthStencilAttachmentInfo.Texture.Format;
|
depthStencilFormat = depthStencilAttachmentInfo.Texture.Format;
|
||||||
#endif
|
#endif
|
||||||
|
@ -332,7 +332,7 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
renderPassActive = true;
|
renderPassActive = true;
|
||||||
currentSampleCount = colorAttachmentInfoOne.SampleCount;
|
currentSampleCount = colorAttachmentInfoOne.Texture.SampleCount;
|
||||||
colorFormatOne = colorAttachmentInfoOne.Texture.Format;
|
colorFormatOne = colorAttachmentInfoOne.Texture.Format;
|
||||||
colorFormatTwo = colorAttachmentInfoTwo.Texture.Format;
|
colorFormatTwo = colorAttachmentInfoTwo.Texture.Format;
|
||||||
depthStencilFormat = depthStencilAttachmentInfo.Texture.Format;
|
depthStencilFormat = depthStencilAttachmentInfo.Texture.Format;
|
||||||
|
@ -387,7 +387,7 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
renderPassActive = true;
|
renderPassActive = true;
|
||||||
currentSampleCount = colorAttachmentInfoOne.SampleCount;
|
currentSampleCount = colorAttachmentInfoOne.Texture.SampleCount;
|
||||||
colorFormatOne = colorAttachmentInfoOne.Texture.Format;
|
colorFormatOne = colorAttachmentInfoOne.Texture.Format;
|
||||||
colorFormatTwo = colorAttachmentInfoTwo.Texture.Format;
|
colorFormatTwo = colorAttachmentInfoTwo.Texture.Format;
|
||||||
colorFormatThree = colorAttachmentInfoThree.Texture.Format;
|
colorFormatThree = colorAttachmentInfoThree.Texture.Format;
|
||||||
|
@ -450,7 +450,7 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
renderPassActive = true;
|
renderPassActive = true;
|
||||||
currentSampleCount = colorAttachmentInfoOne.SampleCount;
|
currentSampleCount = colorAttachmentInfoOne.Texture.SampleCount;
|
||||||
colorFormatOne = colorAttachmentInfoOne.Texture.Format;
|
colorFormatOne = colorAttachmentInfoOne.Texture.Format;
|
||||||
colorFormatTwo = colorAttachmentInfoTwo.Texture.Format;
|
colorFormatTwo = colorAttachmentInfoTwo.Texture.Format;
|
||||||
colorFormatThree = colorAttachmentInfoThree.Texture.Format;
|
colorFormatThree = colorAttachmentInfoThree.Texture.Format;
|
||||||
|
@ -1489,7 +1489,6 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Draws using instanced rendering.
|
/// Draws using instanced rendering.
|
||||||
/// It is an error to call this method unless two vertex buffers have been bound.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="baseVertex">The starting index offset for the vertex buffer.</param>
|
/// <param name="baseVertex">The starting index offset for the vertex buffer.</param>
|
||||||
/// <param name="startIndex">The starting index offset for the index buffer.</param>
|
/// <param name="startIndex">The starting index offset for the index buffer.</param>
|
||||||
|
@ -2047,7 +2046,7 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
private void AssertSameSampleCount(ColorAttachmentInfo a, ColorAttachmentInfo b)
|
private void AssertSameSampleCount(ColorAttachmentInfo a, ColorAttachmentInfo b)
|
||||||
{
|
{
|
||||||
if (a.SampleCount != b.SampleCount)
|
if (a.Texture.SampleCount != b.Texture.SampleCount)
|
||||||
{
|
{
|
||||||
throw new System.ArgumentException("All color attachments in a render pass must have the same SampleCount!");
|
throw new System.ArgumentException("All color attachments in a render pass must have the same SampleCount!");
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,6 @@ namespace MoonWorks.Graphics
|
||||||
public SDL2.SDL.SDL_WindowFlags WindowFlags => (SDL2.SDL.SDL_WindowFlags) windowFlags;
|
public SDL2.SDL.SDL_WindowFlags WindowFlags => (SDL2.SDL.SDL_WindowFlags) windowFlags;
|
||||||
|
|
||||||
// Built-in video pipeline
|
// Built-in video pipeline
|
||||||
private ShaderModule VideoVertexShader { get; }
|
|
||||||
private ShaderModule VideoFragmentShader { get; }
|
|
||||||
internal GraphicsPipeline VideoPipeline { get; }
|
internal GraphicsPipeline VideoPipeline { get; }
|
||||||
|
|
||||||
public bool IsDisposed { get; private set; }
|
public bool IsDisposed { get; private set; }
|
||||||
|
@ -25,8 +23,7 @@ namespace MoonWorks.Graphics
|
||||||
public GraphicsDevice(
|
public GraphicsDevice(
|
||||||
Backend preferredBackend,
|
Backend preferredBackend,
|
||||||
bool debugMode
|
bool debugMode
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
Backend = (Backend) Refresh.Refresh_SelectBackend((Refresh.Backend) preferredBackend, out windowFlags);
|
Backend = (Backend) Refresh.Refresh_SelectBackend((Refresh.Backend) preferredBackend, out windowFlags);
|
||||||
|
|
||||||
if (Backend == Backend.Invalid)
|
if (Backend == Backend.Invalid)
|
||||||
|
@ -38,25 +35,43 @@ namespace MoonWorks.Graphics
|
||||||
Conversions.BoolToByte(debugMode)
|
Conversions.BoolToByte(debugMode)
|
||||||
);
|
);
|
||||||
|
|
||||||
VideoVertexShader = new ShaderModule(this, GetEmbeddedResource("MoonWorks.Shaders.FullscreenVert.spv"));
|
// Check for optional video shaders
|
||||||
VideoFragmentShader = new ShaderModule(this, GetEmbeddedResource("MoonWorks.Shaders.YUV2RGBAFrag.spv"));
|
string basePath = SDL2.SDL.SDL_GetBasePath();
|
||||||
|
string videoVertPath = Path.Combine(basePath, "video_fullscreen.refresh");
|
||||||
|
string videoFragPath = Path.Combine(basePath, "video_yuv2rgba.refresh");
|
||||||
|
if (File.Exists(videoVertPath) && File.Exists(videoFragPath))
|
||||||
|
{
|
||||||
|
ShaderModule videoVertShader = new ShaderModule(this, videoVertPath);
|
||||||
|
ShaderModule videoFragShader = new ShaderModule(this, videoFragPath);
|
||||||
|
|
||||||
VideoPipeline = new GraphicsPipeline(
|
VideoPipeline = new GraphicsPipeline(
|
||||||
this,
|
this,
|
||||||
new GraphicsPipelineCreateInfo
|
new GraphicsPipelineCreateInfo
|
||||||
{
|
{
|
||||||
AttachmentInfo = new GraphicsPipelineAttachmentInfo(
|
AttachmentInfo = new GraphicsPipelineAttachmentInfo(
|
||||||
new ColorAttachmentDescription(TextureFormat.R8G8B8A8, ColorAttachmentBlendState.None)
|
new ColorAttachmentDescription(
|
||||||
),
|
TextureFormat.R8G8B8A8,
|
||||||
DepthStencilState = DepthStencilState.Disable,
|
ColorAttachmentBlendState.None
|
||||||
VertexShaderInfo = GraphicsShaderInfo.Create(VideoVertexShader, "main", 0),
|
)
|
||||||
FragmentShaderInfo = GraphicsShaderInfo.Create(VideoFragmentShader, "main", 3),
|
),
|
||||||
VertexInputState = VertexInputState.Empty,
|
DepthStencilState = DepthStencilState.Disable,
|
||||||
RasterizerState = RasterizerState.CCW_CullNone,
|
VertexShaderInfo = GraphicsShaderInfo.Create(
|
||||||
PrimitiveType = PrimitiveType.TriangleList,
|
videoVertShader,
|
||||||
MultisampleState = MultisampleState.None
|
"main",
|
||||||
}
|
0
|
||||||
);
|
),
|
||||||
|
FragmentShaderInfo = GraphicsShaderInfo.Create(
|
||||||
|
videoFragShader,
|
||||||
|
"main",
|
||||||
|
3
|
||||||
|
),
|
||||||
|
VertexInputState = VertexInputState.Empty,
|
||||||
|
RasterizerState = RasterizerState.CCW_CullNone,
|
||||||
|
PrimitiveType = PrimitiveType.TriangleList,
|
||||||
|
MultisampleState = MultisampleState.None
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ClaimWindow(Window window, PresentMode presentMode)
|
public bool ClaimWindow(Window window, PresentMode presentMode)
|
||||||
|
@ -102,7 +117,7 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
public CommandBuffer AcquireCommandBuffer()
|
public CommandBuffer AcquireCommandBuffer()
|
||||||
{
|
{
|
||||||
return new CommandBuffer(this, Refresh.Refresh_AcquireCommandBuffer(Handle, 0));
|
return new CommandBuffer(this, Refresh.Refresh_AcquireCommandBuffer(Handle));
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe void Submit(CommandBuffer commandBuffer)
|
public unsafe void Submit(CommandBuffer commandBuffer)
|
||||||
|
@ -214,11 +229,6 @@ namespace MoonWorks.Graphics
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Stream GetEmbeddedResource(string name)
|
|
||||||
{
|
|
||||||
return typeof(GraphicsDevice).Assembly.GetManifestResourceStream(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void Dispose(bool disposing)
|
protected virtual void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
if (!IsDisposed)
|
if (!IsDisposed)
|
||||||
|
|
|
@ -181,7 +181,6 @@ namespace MoonWorks.Graphics
|
||||||
public uint Depth;
|
public uint Depth;
|
||||||
public uint Layer;
|
public uint Layer;
|
||||||
public uint Level;
|
public uint Level;
|
||||||
public SampleCount SampleCount;
|
|
||||||
public Color ClearColor;
|
public Color ClearColor;
|
||||||
public LoadOp LoadOp;
|
public LoadOp LoadOp;
|
||||||
public StoreOp StoreOp;
|
public StoreOp StoreOp;
|
||||||
|
@ -189,15 +188,12 @@ namespace MoonWorks.Graphics
|
||||||
public ColorAttachmentInfo(
|
public ColorAttachmentInfo(
|
||||||
Texture texture,
|
Texture texture,
|
||||||
Color clearColor,
|
Color clearColor,
|
||||||
SampleCount sampleCount = SampleCount.One,
|
|
||||||
StoreOp storeOp = StoreOp.Store
|
StoreOp storeOp = StoreOp.Store
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
Texture = texture;
|
Texture = texture;
|
||||||
Depth = 0;
|
Depth = 0;
|
||||||
Layer = 0;
|
Layer = 0;
|
||||||
Level = 0;
|
Level = 0;
|
||||||
SampleCount = sampleCount;
|
|
||||||
ClearColor = clearColor;
|
ClearColor = clearColor;
|
||||||
LoadOp = LoadOp.Clear;
|
LoadOp = LoadOp.Clear;
|
||||||
StoreOp = storeOp;
|
StoreOp = storeOp;
|
||||||
|
@ -206,15 +202,12 @@ namespace MoonWorks.Graphics
|
||||||
public ColorAttachmentInfo(
|
public ColorAttachmentInfo(
|
||||||
Texture texture,
|
Texture texture,
|
||||||
LoadOp loadOp = LoadOp.DontCare,
|
LoadOp loadOp = LoadOp.DontCare,
|
||||||
SampleCount sampleCount = SampleCount.One,
|
|
||||||
StoreOp storeOp = StoreOp.Store
|
StoreOp storeOp = StoreOp.Store
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
Texture = texture;
|
Texture = texture;
|
||||||
Depth = 0;
|
Depth = 0;
|
||||||
Layer = 0;
|
Layer = 0;
|
||||||
Level = 0;
|
Level = 0;
|
||||||
SampleCount = sampleCount;
|
|
||||||
ClearColor = Color.White;
|
ClearColor = Color.White;
|
||||||
LoadOp = loadOp;
|
LoadOp = loadOp;
|
||||||
StoreOp = storeOp;
|
StoreOp = storeOp;
|
||||||
|
@ -228,7 +221,6 @@ namespace MoonWorks.Graphics
|
||||||
depth = Depth,
|
depth = Depth,
|
||||||
layer = Layer,
|
layer = Layer,
|
||||||
level = Level,
|
level = Level,
|
||||||
sampleCount = (Refresh.SampleCount) SampleCount,
|
|
||||||
clearColor = new Refresh.Vec4
|
clearColor = new Refresh.Vec4
|
||||||
{
|
{
|
||||||
x = ClearColor.R / 255f,
|
x = ClearColor.R / 255f,
|
||||||
|
|
|
@ -5,7 +5,7 @@ using System.IO;
|
||||||
namespace MoonWorks.Graphics
|
namespace MoonWorks.Graphics
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shader modules expect input in SPIR-V bytecode format.
|
/// Shader modules expect input in Refresh bytecode format.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ShaderModule : GraphicsResource
|
public class ShaderModule : GraphicsResource
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,6 +15,7 @@ namespace MoonWorks.Graphics
|
||||||
public TextureFormat Format { get; internal set; }
|
public TextureFormat Format { get; internal set; }
|
||||||
public bool IsCube { get; }
|
public bool IsCube { get; }
|
||||||
public uint LevelCount { get; }
|
public uint LevelCount { get; }
|
||||||
|
public SampleCount SampleCount { get; }
|
||||||
public TextureUsageFlags UsageFlags { get; }
|
public TextureUsageFlags UsageFlags { get; }
|
||||||
|
|
||||||
// FIXME: this allocates a delegate instance
|
// FIXME: this allocates a delegate instance
|
||||||
|
@ -39,13 +40,14 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
var byteCount = (uint) (width * height * channels);
|
var byteCount = (uint) (width * height * channels);
|
||||||
|
|
||||||
TextureCreateInfo textureCreateInfo;
|
TextureCreateInfo textureCreateInfo = new TextureCreateInfo();
|
||||||
textureCreateInfo.Width = (uint) width;
|
textureCreateInfo.Width = (uint) width;
|
||||||
textureCreateInfo.Height = (uint) height;
|
textureCreateInfo.Height = (uint) height;
|
||||||
textureCreateInfo.Depth = 1;
|
textureCreateInfo.Depth = 1;
|
||||||
textureCreateInfo.Format = TextureFormat.R8G8B8A8;
|
textureCreateInfo.Format = TextureFormat.R8G8B8A8;
|
||||||
textureCreateInfo.IsCube = false;
|
textureCreateInfo.IsCube = false;
|
||||||
textureCreateInfo.LevelCount = 1;
|
textureCreateInfo.LevelCount = 1;
|
||||||
|
textureCreateInfo.SampleCount = SampleCount.One;
|
||||||
textureCreateInfo.UsageFlags = TextureUsageFlags.Sampler;
|
textureCreateInfo.UsageFlags = TextureUsageFlags.Sampler;
|
||||||
|
|
||||||
var texture = new Texture(device, textureCreateInfo);
|
var texture = new Texture(device, textureCreateInfo);
|
||||||
|
@ -130,9 +132,9 @@ namespace MoonWorks.Graphics
|
||||||
uint height,
|
uint height,
|
||||||
TextureFormat format,
|
TextureFormat format,
|
||||||
TextureUsageFlags usageFlags,
|
TextureUsageFlags usageFlags,
|
||||||
uint levelCount = 1
|
uint levelCount = 1,
|
||||||
)
|
SampleCount sampleCount = SampleCount.One
|
||||||
{
|
) {
|
||||||
var textureCreateInfo = new TextureCreateInfo
|
var textureCreateInfo = new TextureCreateInfo
|
||||||
{
|
{
|
||||||
Width = width,
|
Width = width,
|
||||||
|
@ -140,6 +142,7 @@ namespace MoonWorks.Graphics
|
||||||
Depth = 1,
|
Depth = 1,
|
||||||
IsCube = false,
|
IsCube = false,
|
||||||
LevelCount = levelCount,
|
LevelCount = levelCount,
|
||||||
|
SampleCount = sampleCount,
|
||||||
Format = format,
|
Format = format,
|
||||||
UsageFlags = usageFlags
|
UsageFlags = usageFlags
|
||||||
};
|
};
|
||||||
|
@ -165,8 +168,7 @@ namespace MoonWorks.Graphics
|
||||||
TextureFormat format,
|
TextureFormat format,
|
||||||
TextureUsageFlags usageFlags,
|
TextureUsageFlags usageFlags,
|
||||||
uint levelCount = 1
|
uint levelCount = 1
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
var textureCreateInfo = new TextureCreateInfo
|
var textureCreateInfo = new TextureCreateInfo
|
||||||
{
|
{
|
||||||
Width = width,
|
Width = width,
|
||||||
|
@ -195,8 +197,7 @@ namespace MoonWorks.Graphics
|
||||||
TextureFormat format,
|
TextureFormat format,
|
||||||
TextureUsageFlags usageFlags,
|
TextureUsageFlags usageFlags,
|
||||||
uint levelCount = 1
|
uint levelCount = 1
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
var textureCreateInfo = new TextureCreateInfo
|
var textureCreateInfo = new TextureCreateInfo
|
||||||
{
|
{
|
||||||
Width = size,
|
Width = size,
|
||||||
|
@ -232,6 +233,7 @@ namespace MoonWorks.Graphics
|
||||||
Depth = textureCreateInfo.Depth;
|
Depth = textureCreateInfo.Depth;
|
||||||
IsCube = textureCreateInfo.IsCube;
|
IsCube = textureCreateInfo.IsCube;
|
||||||
LevelCount = textureCreateInfo.LevelCount;
|
LevelCount = textureCreateInfo.LevelCount;
|
||||||
|
SampleCount = textureCreateInfo.SampleCount;
|
||||||
UsageFlags = textureCreateInfo.UsageFlags;
|
UsageFlags = textureCreateInfo.UsageFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,6 +257,7 @@ namespace MoonWorks.Graphics
|
||||||
Depth = 1;
|
Depth = 1;
|
||||||
IsCube = false;
|
IsCube = false;
|
||||||
LevelCount = 1;
|
LevelCount = 1;
|
||||||
|
SampleCount = SampleCount.One;
|
||||||
UsageFlags = TextureUsageFlags.ColorTarget;
|
UsageFlags = TextureUsageFlags.ColorTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,14 +275,12 @@ namespace MoonWorks.Graphics
|
||||||
const uint DDS_MAGIC = 0x20534444;
|
const uint DDS_MAGIC = 0x20534444;
|
||||||
const uint DDS_HEADERSIZE = 124;
|
const uint DDS_HEADERSIZE = 124;
|
||||||
const uint DDS_PIXFMTSIZE = 32;
|
const uint DDS_PIXFMTSIZE = 32;
|
||||||
const uint DDSD_CAPS = 0x1;
|
|
||||||
const uint DDSD_HEIGHT = 0x2;
|
const uint DDSD_HEIGHT = 0x2;
|
||||||
const uint DDSD_WIDTH = 0x4;
|
const uint DDSD_WIDTH = 0x4;
|
||||||
const uint DDSD_PITCH = 0x8;
|
const uint DDSD_PITCH = 0x8;
|
||||||
const uint DDSD_FMT = 0x1000;
|
|
||||||
const uint DDSD_LINEARSIZE = 0x80000;
|
const uint DDSD_LINEARSIZE = 0x80000;
|
||||||
const uint DDSD_REQ = (
|
const uint DDSD_REQ = (
|
||||||
DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_FMT
|
DDSD_HEIGHT | DDSD_WIDTH
|
||||||
);
|
);
|
||||||
const uint DDSCAPS_MIPMAP = 0x400000;
|
const uint DDSCAPS_MIPMAP = 0x400000;
|
||||||
const uint DDSCAPS_TEXTURE = 0x1000;
|
const uint DDSCAPS_TEXTURE = 0x1000;
|
||||||
|
|
|
@ -9,6 +9,7 @@ namespace MoonWorks.Graphics
|
||||||
public uint Depth;
|
public uint Depth;
|
||||||
public bool IsCube;
|
public bool IsCube;
|
||||||
public uint LevelCount;
|
public uint LevelCount;
|
||||||
|
public SampleCount SampleCount;
|
||||||
public TextureFormat Format;
|
public TextureFormat Format;
|
||||||
public TextureUsageFlags UsageFlags;
|
public TextureUsageFlags UsageFlags;
|
||||||
|
|
||||||
|
@ -21,6 +22,7 @@ namespace MoonWorks.Graphics
|
||||||
depth = Depth,
|
depth = Depth,
|
||||||
isCube = Conversions.BoolToByte(IsCube),
|
isCube = Conversions.BoolToByte(IsCube),
|
||||||
levelCount = LevelCount,
|
levelCount = LevelCount,
|
||||||
|
sampleCount = (Refresh.SampleCount) SampleCount,
|
||||||
format = (Refresh.TextureFormat) Format,
|
format = (Refresh.TextureFormat) Format,
|
||||||
usageFlags = (Refresh.TextureUsageFlags) UsageFlags
|
usageFlags = (Refresh.TextureUsageFlags) UsageFlags
|
||||||
};
|
};
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -50,6 +50,11 @@ namespace MoonWorks.Video
|
||||||
public VideoPlayer(GraphicsDevice graphicsDevice, AudioDevice audioDevice)
|
public VideoPlayer(GraphicsDevice graphicsDevice, AudioDevice audioDevice)
|
||||||
{
|
{
|
||||||
GraphicsDevice = graphicsDevice;
|
GraphicsDevice = graphicsDevice;
|
||||||
|
if (GraphicsDevice.VideoPipeline == null)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Missing video shaders!");
|
||||||
|
}
|
||||||
|
|
||||||
AudioDevice = audioDevice;
|
AudioDevice = audioDevice;
|
||||||
LinearSampler = new Sampler(graphicsDevice, SamplerCreateInfo.LinearClamp);
|
LinearSampler = new Sampler(graphicsDevice, SamplerCreateInfo.LinearClamp);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue