(b0f5305f2) Unstable v0.9.10.0

This commit is contained in:
Juan Pablo Arce
2020-05-22 08:21:34 -03:00
parent 3d2b7bcf63
commit 4f8bd39789
75 changed files with 1023 additions and 407 deletions
@@ -160,21 +160,34 @@ namespace Steamworks
/// </summary>
public static int FileCount => Internal.GetFileCount();
/// <summary>
/// Get a list of filenames synchronized by Steam Cloud
/// </summary>
public static IEnumerable<string> Files
public struct RemoteFile
{
get
public string Filename;
public int Size;
public bool Delete()
{
int _ = 0;
for( int i=0; i<FileCount; i++ )
{
var filename = Internal.GetFileNameAndSize( i, ref _ );
yield return filename;
}
return Internal.FileDelete(Filename);
}
}
/// <summary>
/// Get a list of filenames synchronized by Steam Cloud
/// </summary>
public static List<RemoteFile> Files
{
get
{
var ret = new List<RemoteFile>();
int count = FileCount;
for( int i=0; i<count; i++ )
{
int size = -1;
var filename = Internal.GetFileNameAndSize( i, ref size );
ret.Add(new RemoteFile { Filename = filename, Size = size });
}
return ret;
}
}
}
}
@@ -98,6 +98,13 @@ namespace Steamworks.Ugc
return this;
}
public bool HasTag( string tag )
{
if (Tags != null && Tags.Contains(tag)) { return true; }
return false;
}
public async Task<PublishResult> SubmitAsync( IProgress<float> progress = null )
{
var result = default( PublishResult );
@@ -8,8 +8,18 @@ namespace Microsoft.Xna.Framework.Graphics
{
public sealed partial class SamplerStateCollection
{
private int _d3dMaxDirty;
private int _d3dDirty;
partial void CalculateMaxDirty()
{
_d3dMaxDirty = 0;
for (var i = 0; i < _actualSamplers.Length; i++)
{
_d3dMaxDirty |= 1 << i;
}
}
private void PlatformSetSamplerState(int index)
{
_d3dDirty |= 1 << index;
@@ -17,12 +27,12 @@ namespace Microsoft.Xna.Framework.Graphics
private void PlatformClear()
{
_d3dDirty = int.MaxValue;
_d3dDirty = _d3dMaxDirty;
}
private void PlatformDirty()
{
_d3dDirty = int.MaxValue;
_d3dDirty = _d3dMaxDirty;
}
internal void PlatformSetSamplers(GraphicsDevice device)
@@ -60,7 +70,8 @@ namespace Microsoft.Xna.Framework.Graphics
break;
}
_d3dDirty = 0;
if (_d3dDirty != 0) { throw new System.Exception($"SamplerStateCollection still dirty ({_d3dDirty})"); }
//_d3dDirty = 0;
}
}
}
@@ -23,6 +23,8 @@ namespace Microsoft.Xna.Framework.Graphics
private readonly SamplerState[] _actualSamplers;
private readonly bool _applyToVertexStage;
partial void CalculateMaxDirty();
internal SamplerStateCollection(GraphicsDevice device, int maxSamplers, bool applyToVertexStage)
{
_graphicsDevice = device;
@@ -38,7 +40,8 @@ namespace Microsoft.Xna.Framework.Graphics
_actualSamplers = new SamplerState[maxSamplers];
_applyToVertexStage = applyToVertexStage;
Clear();
CalculateMaxDirty();
Clear();
}
public SamplerState this [int index]
@@ -16,13 +16,15 @@ namespace Microsoft.Xna.Framework.Graphics
return;
if (_applyToVertexStage)
ClearTargets(targets, device._d3dContext.VertexShader);
ClearTargets(targets, device, device._d3dContext.VertexShader);
else
ClearTargets(targets, device._d3dContext.PixelShader);
ClearTargets(targets, device, device._d3dContext.PixelShader);
}
private void ClearTargets(RenderTargetBinding[] targets, SharpDX.Direct3D11.CommonShaderStage shaderStage)
private void ClearTargets(RenderTargetBinding[] targets, GraphicsDevice device, SharpDX.Direct3D11.CommonShaderStage shaderStage)
{
PlatformSetTextures(device);
// NOTE: We make the assumption here that the caller has
// locked the d3dContext for us to use.
@@ -92,7 +94,8 @@ namespace Microsoft.Xna.Framework.Graphics
break;
}
_dirty = 0;
if (_dirty != 0) { throw new System.Exception($"TextureCollection still dirty ({_dirty})"); }
//_dirty = 0;
}
}
}
@@ -12,13 +12,18 @@ namespace Microsoft.Xna.Framework.Graphics
private readonly Texture[] _textures;
private readonly bool _applyToVertexStage;
private int _dirty;
private int _dirtyMax;
internal TextureCollection(GraphicsDevice graphicsDevice, int maxTextures, bool applyToVertexStage)
{
_graphicsDevice = graphicsDevice;
_textures = new Texture[maxTextures];
_applyToVertexStage = applyToVertexStage;
_dirty = int.MaxValue;
for (int i=0;i<maxTextures;i++)
{
_dirtyMax |= 1 << i;
}
_dirty = _dirtyMax;
PlatformInit();
}
@@ -47,7 +52,7 @@ namespace Microsoft.Xna.Framework.Graphics
_textures[i] = null;
PlatformClear();
_dirty = int.MaxValue;
_dirty = _dirtyMax;
}
/// <summary>
@@ -55,7 +60,7 @@ namespace Microsoft.Xna.Framework.Graphics
/// </summary>
internal void Dirty()
{
_dirty = int.MaxValue;
_dirty = _dirtyMax;
}
internal void SetTextures(GraphicsDevice device)