Пример #1
0
		public void GetRegister(OperandType operandType, RegisterIndex registerIndex, out Number4[] register, out int index)
		{
			switch (operandType)
			{
				case OperandType.ConstantBuffer:
					register = _virtualMachine.ConstantBuffers[registerIndex.Index2D_0];
					index = registerIndex.Index2D_1;
					return;
				case OperandType.Input:
					// Only GS requires 2-dimensional inputs, but for simplicity we always use a 2-dimensional input array.
					register = Inputs[registerIndex.Index2D_0];
					index = registerIndex.Index2D_1;
					return;
				case OperandType.Output:
					register = Outputs;
					index = registerIndex.Index1D;
					return;
				case OperandType.Temp:
					register = Temps;
					index = registerIndex.Index1D;
					return;
				case OperandType.IndexableTemp:
					register = IndexableTemps[registerIndex.Index2D_0];
					index = registerIndex.Index2D_1;
					return;
				default:
					throw new ArgumentException("Unsupported operand type: " + operandType);
			}
		}
Пример #2
0
		public RegisterKey(OperandType registerType, RegisterIndex index)
		{
			RegisterType = registerType;
			Index = index;
		}
Пример #3
0
 public RegisterKey(OperandType registerType, RegisterIndex index)
 {
     RegisterType = registerType;
     Index        = index;
 }
Пример #4
0
		private static RegisterIndex GetRegisterIndex(ExecutionContext context, Operand operand)
		{
			var result = new RegisterIndex();
			switch (operand.IndexDimension)
			{
				case OperandIndexDimension._1D:
					result.Index1D = EvaluateOperandIndex(context, operand.Indices[0]);
					break;
				case OperandIndexDimension._2D:
					result.Index2D_0 = EvaluateOperandIndex(context, operand.Indices[0]);
					result.Index2D_1 = EvaluateOperandIndex(context, operand.Indices[1]);
					break;
			}
			return result;
		}
Пример #5
0
		public Number4 GetRegister(int contextIndex, OperandType registerType, RegisterIndex registerIndex)
		{
			Number4[] register;
			int index;
			_executionContexts[contextIndex].GetRegister(registerType, registerIndex, out register, out index);
			return register[index];
		}
Пример #6
0
		public void SetSampler(RegisterIndex registerIndex, SamplerState sampler)
		{
			Samplers[registerIndex.Index1D] = sampler;
		}
Пример #7
0
		public void SetTexture(RegisterIndex registerIndex, ITexture texture)
		{
			Textures[registerIndex.Index1D] = texture;
		}
Пример #8
0
 public void SetRegister(int contextIndex, OperandType registerType, RegisterIndex registerIndex, Number4 value)
 {
     SetRegister(contextIndex, registerType, registerIndex, ref value);
 }
Пример #9
0
		public void SetRegister(int contextIndex, OperandType registerType, RegisterIndex registerIndex, ref Number4 value)
		{
			Number4[] register;
			int index;
			_executionContexts[contextIndex].GetRegister(registerType, registerIndex, out register, out index);
			if (index < register.Length)
				register[index] = value;
		}