Improve source generator support for dynamic shaders

このコミットが含まれているのは:
Sergio Pedri committed 2021-12-19 16:45:12 +01:00
1 親 80044d69fd
コミット 23b500fe81
5ファイル変更
+27 -32

検索条件に一致するファイルはありません

+8 -3
ファイルの表示
@@ -29,7 +29,7 @@ internal struct ShaderBytecodeLoader : IBytecodeLoader
{
if (this.cachedShader is not ICachedShader cachedShader)
{
return ThrowHelper.ThrowInvalidOperationException<ICachedShader>("The shader has not been initialized");
return ThrowHelper.ThrowInvalidOperationException<ICachedShader>("The shader has not been initialized.");
}
return cachedShader;
@@ -40,7 +40,12 @@ internal struct ShaderBytecodeLoader : IBytecodeLoader
{
if (this.cachedShader is not null)
{
ThrowHelper.ThrowInvalidOperationException("The shader has already been initialized");
ThrowHelper.ThrowInvalidOperationException("The shader has already been initialized.");
}
if (handle == IntPtr.Zero)
{
ThrowHelper.ThrowNotSupportedException("Runtime shader compilation is not supported by the current configuration.");
}
this.cachedShader = new ICachedShader.Dynamic((IDxcBlob*)handle);
@@ -52,7 +57,7 @@ internal struct ShaderBytecodeLoader : IBytecodeLoader
{
if (this.cachedShader is not null)
{
ThrowHelper.ThrowInvalidOperationException("The shader has already been initialized");
ThrowHelper.ThrowInvalidOperationException("The shader has already been initialized.");
}
this.cachedShader = new ICachedShader.Embedded(bytecode);