Beispiel #1
0
        public static IrOperand Parse(Operand operand)
        {
            IrOperand result;

            switch (operand.OperandType)
            {
            case Chunks.Shex.OperandType.ConstantBuffer:
                result = new IrConstantBufferOperand(0, 0, 0);
                break;

            case Chunks.Shex.OperandType.Sampler:
                result = new IrResourceOperand(IR.IrResourceType.Sampler, 0);
                break;

            case Chunks.Shex.OperandType.Resource:
                result = new IrResourceOperand(IR.IrResourceType.Texture, 0);
                break;

            case Chunks.Shex.OperandType.UnorderedAccessView:
                result = new IrResourceOperand(IR.IrResourceType.UnorderedAccessView, 0);
                break;

            default:
                result = new IrDebugOperand(operand.ToString());
                break;
            }
            result.DebugText = operand.ToString();
            return(result);
        }
 public void WriteOperand(IrConstantBufferOperand operand)
 {
     if (operand.BufferId != null)
     {
         Write($"CB{operand.BufferId}[{operand.BuffereBindPoint}][{operand.BufferOffset}]");
     }
     else
     {
         Write($"CB{operand.BuffereBindPoint}[{operand.BufferOffset}]");
     }
 }