Initial Changes
This commit is contained in:
parent
8d8983049e
commit
72616a3ea9
1 changed files with 21 additions and 3 deletions
|
@ -181,13 +181,31 @@ namespace Ryujinx.Graphics.Shader.Translation
|
||||||
|
|
||||||
private static void EmitOutputsInitialization(EmitterContext context, AttributeUsage attributeUsage, IGpuAccessor gpuAccessor, ShaderStage stage)
|
private static void EmitOutputsInitialization(EmitterContext context, AttributeUsage attributeUsage, IGpuAccessor gpuAccessor, ShaderStage stage)
|
||||||
{
|
{
|
||||||
// Compute has no output attributes, and fragment is the last stage, so we
|
// Compute has no output attributes, so we
|
||||||
// don't need to initialize outputs on those stages.
|
// don't need to initialize outputs on that stage.
|
||||||
if (stage == ShaderStage.Compute || stage == ShaderStage.Fragment)
|
if (stage == ShaderStage.Compute)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stage == ShaderStage.Fragment)
|
||||||
|
{
|
||||||
|
// Fragment is the last stage, so we don't need to
|
||||||
|
// initialize outputs unless we're using DSB, in which
|
||||||
|
// we need to make sure the ouput has a valid value.
|
||||||
|
if (gpuAccessor.QueryGraphicsState().DualSourceBlendEnable)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
context.Store(StorageKind.Output, IoVariable.FragmentOutputColor, null, Const(1), Const(i), ConstF(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (stage == ShaderStage.Vertex)
|
if (stage == ShaderStage.Vertex)
|
||||||
{
|
{
|
||||||
InitializePositionOutput(context);
|
InitializePositionOutput(context);
|
||||||
|
|
Loading…
Reference in a new issue