public void CmdBindPipeline(MgPipelineBindPoint pipelineBindPoint, IMgPipeline pipeline) { var bPipeline = (VkPipeline)pipeline; Debug.Assert(bPipeline != null); Interops.vkCmdBindPipeline(this.Handle, (VkPipelineBindPoint)pipelineBindPoint, bPipeline.Handle); }
public void CmdBindPipeline(MgPipelineBindPoint pipelineBindPoint, IMgPipeline pipeline) { if (pipeline == null) { throw new ArgumentNullException(nameof(pipeline)); } if (pipelineBindPoint == MgPipelineBindPoint.COMPUTE) { mCommandEncoder.Compute.BindPipeline(pipeline); } else { mCommandEncoder.Graphics.BindPipeline(pipeline); } }
public void SetProgramID(MgPipelineBindPoint bindpoint, int programId, GLInternalCache layoutCache, IGLPipelineLayout pipelineLayout) { if (mProgramID != programId) { mProgramID = programId; mEntrypoint.BindProgram(mProgramID); BoundInternalCache = layoutCache; BoundPipelineLayout = pipelineLayout; SetupPipelineUniformBlocks(); SetupUniformBufferSlots(); var index = GetDescriptorSetIndex(bindpoint); BindDescriptorSets(mBoundDescriptorSets[index]); } }
public void CmdBindDescriptorSets( MgPipelineBindPoint pipelineBindPoint, IMgPipelineLayout layout, uint firstSet, uint descriptorSetCount, IMgDescriptorSet[] pDescriptorSets, uint[] pDynamicOffsets) { if (pipelineBindPoint == MgPipelineBindPoint.GRAPHICS) { mCommandEncoder.Graphics.BindDescriptorSets(layout, firstSet, descriptorSetCount, pDescriptorSets, pDynamicOffsets); } }
public void CmdBindDescriptorSets(MgPipelineBindPoint pipelineBindPoint, IMgPipelineLayout layout, UInt32 firstSet, UInt32 descriptorSetCount, IMgDescriptorSet[] pDescriptorSets, UInt32[] pDynamicOffsets) { var bLayout = (VkPipelineLayout)layout; Debug.Assert(bLayout != null); var stride = Marshal.SizeOf(typeof(IntPtr)); IntPtr sets = Marshal.AllocHGlobal((int)(stride * descriptorSetCount)); var src = new ulong[descriptorSetCount]; for (uint i = 0; i < descriptorSetCount; ++i) { var bDescSet = (VkDescriptorSet)pDescriptorSets[i]; Debug.Assert(bDescSet != null); src[i] = bDescSet.Handle; } Interops.vkCmdBindDescriptorSets(this.Handle, (VkPipelineBindPoint)pipelineBindPoint, bLayout.Handle, firstSet, descriptorSetCount, src, (uint)pDynamicOffsets.Length, pDynamicOffsets); }
public void Bind(MgPipelineBindPoint pipelineBindPoint, IMgPipelineLayout layout, uint firstSet, uint descriptorSetCount, IMgDescriptorSet[] pDescriptorSets, uint[] pDynamicOffsets) { if (layout == null) { throw new ArgumentNullException(nameof(layout)); } if (pDescriptorSets == null) { throw new ArgumentNullException(nameof(pDescriptorSets)); } if (firstSet != 0) { throw new ArgumentException("Mg.GL : only descriptor set 0 can be bound."); } var bLayout = (IGLPipelineLayout)layout; IsInvalid = false; if (!bLayout.Equals(BoundPipelineLayout)) { BoundPipelineLayout = bLayout; IsInvalid = true; } var isArrayDifferent = CopyDynamicOffsetsIfDifferent(pDynamicOffsets); IsInvalid = IsInvalid && isArrayDifferent; var bDescSet = (IGLDescriptorSet)pDescriptorSets[0]; // EXACT DSET ONLY if (!bDescSet.Equals(BoundDescriptorSet)) { BoundDescriptorSet = bDescSet; IsInvalid = true; } }
public void CmdBindDescriptorSets( MgPipelineBindPoint pipelineBindPoint, IMgPipelineLayout layout, uint firstSet, uint descriptorSetCount, IMgDescriptorSet[] pDescriptorSets, uint[] pDynamicOffsets) { //var parameter = new AmtDescriptorSetRecordingState(); //parameter.Bindpoint = pipelineBindPoint; //parameter.Layout = layout; //parameter.FirstSet = firstSet; //parameter.DynamicOffsets = pDynamicOffsets; //parameter.DescriptorSets = pDescriptorSets; //mRepository.DescriptorSets.Add(parameter); if (pipelineBindPoint == MgPipelineBindPoint.GRAPHICS) { mCommandEncoder.Graphics.BindDescriptorSets(layout, firstSet, descriptorSetCount, pDescriptorSets, pDynamicOffsets); } }
public void CmdBindPipeline(MgPipelineBindPoint pipelineBindPoint, IMgPipeline pipeline) { throw new NotImplementedException(); }
public void CmdBindDescriptorSets(MgPipelineBindPoint pipelineBindPoint, IMgPipelineLayout layout, uint firstSet, uint descriptorSetCount, IMgDescriptorSet[] pDescriptorSets, uint[] pDynamicOffsets) { mBinder.Bind(pipelineBindPoint, layout, firstSet, descriptorSetCount, pDescriptorSets, pDynamicOffsets); }
private static int GetDescriptorSetIndex(MgPipelineBindPoint bindpoint) { return((bindpoint == MgPipelineBindPoint.GRAPHICS) ? 0 : 1); }