コード例 #1
0
ファイル: Query.cs プロジェクト: abasilak/phd
 public Query(QueryTarget t)
 {
     GL.GenQueries(1, out _index);
     _target           = t;
     _use              = true;
     _totalTimeElapsed = 0;
 }
コード例 #2
0
ファイル: QueryIndexer.cs プロジェクト: johnboggess/ObjectTK
        /// <summary>
        /// Acquires an unused index for the given <see cref="QueryTarget"/>.
        /// </summary>
        /// <param name="target">The QueryTarget to acquire an index for.</param>
        /// <returns>Unused index.</returns>
        protected static int AcquireIndex(QueryTarget target)
        {
            if (!TargetIndices.ContainsKey(target))
            {
                TargetIndices.Add(target, new SortedSet <int>());
            }
            // find first free index
            var i = 0;

            foreach (var index in TargetIndices[target])
            {
                if (index > i)
                {
                    break;
                }
                i++;
            }
            if (!IndexableTargets.Contains(target) && i > 0)
            {
                throw new QueryException(
                          string.Format("Query target not indexable and the single target it already in use: {0}", target));
            }
            // remember index is in use
            TargetIndices[target].Add(i);
            return(i);
        }
コード例 #3
0
 public static void BeginQueryEXT(QueryTarget target, UInt32 id)
 {
     Debug.Assert(Delegates.pglBeginQueryEXT != null, "pglBeginQueryEXT not implemented");
     Delegates.pglBeginQueryEXT((Int32)target, id);
     LogCommand("glBeginQueryEXT", null, target, id);
     DebugCheckErrors(null);
 }
コード例 #4
0
        /// <summary>
        /// glGetQueryiv returns in params a selected parameter of the query object target specified by target.
        /// Calling glGetQueryiv is equivalent to calling glGetQueryIndexediv with index set to zero.
        /// </summary>
        /// <param name="target">Specifies a query object target. Must be GL_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED_CONSERVATIVE GL_PRIMITIVES_GENERATED, GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, GL_TIME_ELAPSED, or GL_TIMESTAMP.</param>
        /// <param name="pname">Specifies the symbolic name of a query object target parameter. Accepted values are GL_CURRENT_QUERY or GL_QUERY_COUNTER_BITS.</param>
        /// <returns></returns>
        public static int GetQueryiv(QueryTarget target, GetQueryParameters pname)
        {
            int tmp = 0;

            Delegates.glGetQueryiv(target, pname, ref tmp);
            return(tmp);
        }
コード例 #5
0
 public static void QueryObjectParameterAMD(QueryTarget target, UInt32 id, Int32 pname, OcclusionQueryEventMaskAMD param)
 {
     Debug.Assert(Delegates.pglQueryObjectParameteruiAMD != null, "pglQueryObjectParameteruiAMD not implemented");
     Delegates.pglQueryObjectParameteruiAMD((Int32)target, id, pname, (UInt32)param);
     LogCommand("glQueryObjectParameteruiAMD", null, target, id, pname, param);
     DebugCheckErrors(null);
 }
コード例 #6
0
 public static void EndQueryEXT(QueryTarget target)
 {
     Debug.Assert(Delegates.pglEndQueryEXT != null, "pglEndQueryEXT not implemented");
     Delegates.pglEndQueryEXT((int)target);
     LogCommand("glEndQueryEXT", null, target);
     DebugCheckErrors(null);
 }
コード例 #7
0
        /// <summary>
        /// Gets the support queue of the thread with the threadID specified.
        /// </summary>
        /// <param name="threadID">The thread ID.</param>
        /// <param name="trans">The transaction currently in progress. Can be null if no transaction is in progress.</param>
        /// <returns>
        /// The requested supportqueue entity, or null if the thread isn't in a support queue.
        /// </returns>
        public static SupportQueueEntity GetQueueOfThread(int threadID, Transaction trans)
        {
            // the relation supportqueue - thread is stored in a SupportQueueThread entity. Use that entity as a filter for the support queue. If
            // that entity doesn't exist, the thread isn't in a supportqueue.
            var qf = new QueryFactory();
            var q  = qf.SupportQueueThread
                     .From(QueryTarget.InnerJoin(qf.SupportQueue).On(SupportQueueThreadFields.QueueID == SupportQueueFields.QueueID))
                     .Where(SupportQueueThreadFields.ThreadID == threadID);

            // use a supportqueue collection to fetch the support queue, which will contain 0 or 1 entities after the fetch
            SupportQueueCollection supportQueues = new SupportQueueCollection();

            // if a transaction has been specified, we've to add the collection to the transaction so the fetch takes place inside the same transaction so no
            // deadlocks occur on sqlserver
            if (trans != null)
            {
                trans.Add(supportQueues);
            }
            supportQueues.GetMulti(q);
            if (supportQueues.Count > 0)
            {
                // in a queue, return the instance
                return(supportQueues[0]);
            }
            else
            {
                // not in a queue, return null
                return(null);
            }
        }
コード例 #8
0
        public void CanTranslateEqualsToQueries()
        {
            var queryTarget = new QueryTarget
            {
                IntProp            = 1,
                LongProp           = 2,
                DecimalProp        = 1.1m,
                BoolProp           = true,
                Id                 = Guid.NewGuid(),
                DateTimeProp       = DateTime.UtcNow,
                DateTimeOffsetProp = DateTimeOffset.UtcNow
            };

            theSession.Store(queryTarget);

            theSession.SaveChanges();

            var itemFromDb = theSession.Query <QueryTarget>()
                             .Where(x => x.IntProp.Equals(queryTarget.IntProp))
                             .Where(x => x.LongProp.Equals(queryTarget.LongProp))
                             .Where(x => x.DecimalProp.Equals(queryTarget.DecimalProp))
                             .Where(x => x.BoolProp.Equals(queryTarget.BoolProp))
                             .Where(x => x.Id.Equals(queryTarget.Id))
                             .Where(x => x.DateTimeProp.Equals(queryTarget.DateTimeProp))
                             .Where(x => x.DateTimeOffsetProp.Equals(queryTarget.DateTimeOffsetProp))
                             .FirstOrDefault();

            Assert.NotNull(itemFromDb);
        }
コード例 #9
0
        /// <summary>
        /// Begin query.
        /// <para>delimit the boundaries of a query object.</para>
        /// </summary>
        /// <param name="target">Specifies the target type of query object established between glBeginQuery and the subsequent glEndQuery.</param>
        public void BeginQuery(QueryTarget target)
        {
            if (!this.initialized)
            {
                this.Initialize();
            }

            glBeginQuery((uint)target, this.Id);
        }
コード例 #10
0
ファイル: CounterQueueEvent.cs プロジェクト: ski982/Ryujinx-1
        public CounterQueueEvent(CounterQueue queue, QueryTarget type)
        {
            _queue = queue;

            _counter = queue.GetQueryObject();
            Type     = type;

            _counter.Begin();
        }
コード例 #11
0
        /// <summary>
        /// Gets an <see cref="IList{T}"/> of <see cref="TeamInRoundEntity"/>s matching the filter criteria.
        /// </summary>
        /// <param name="filter">The filter <see cref="IPredicateExpression"/> may contain <see cref="TeamInRoundFields"/> and <see cref="RoundFields"/>.</param>
        /// <param name="cancellationToken"></param>
        /// <returns>Returns an <see cref="IList{T}"/> of <see cref="TeamInRoundEntity"/>s matching the filter criteria.</returns>
        public virtual async Task <IList <TeamInRoundEntity> > GetTeamInRoundAsync(IPredicateExpression filter, CancellationToken cancellationToken)
        {
            using var da = _dbContext.GetNewAdapter();
            var qf = new QueryFactory();
            var q  = qf.TeamInRound.From(QueryTarget.InnerJoin(qf.Round)
                                         .On(TeamInRoundFields.RoundId == RoundFields.Id)).Where(filter);

            return((IList <TeamInRoundEntity>) await da.FetchQueryAsync <TeamInRoundEntity>(
                       q, cancellationToken));
        }
コード例 #12
0
 /// <summary>
 /// Get the filtered employees using generated relations.
 /// </summary>
 /// <param name="qf">Query Factory object</param>
 /// <returns></returns>
 private static EntityQuery <EmployeeEntity> GetFilteredEmployeesUsingRelations(QueryFactory qf)
 {
     return(qf.Employee.
            From(QueryTarget.
                 InnerJoin(EmployeeEntity.Relations.PersonEntityUsingBusinessEntityId)).
            Where(PersonFields.FirstName.StartsWith("A")).
            AndWhere(EmployeeFields.Gender == "M").
            OrderBy(EmployeeFields.BusinessEntityId.Ascending()).
            Limit(5));
 }
コード例 #13
0
ファイル: CounterQueueEvent.cs プロジェクト: neozumm/Ryujinx
        public CounterQueueEvent(CounterQueue queue, QueryTarget type, ulong drawIndex)
        {
            _queue = queue;

            _counter = queue.GetQueryObject();
            Type     = type;

            DrawIndex = drawIndex;

            _counter.Begin();
        }
コード例 #14
0
ファイル: Compat.cs プロジェクト: CasperTech/radegast
 public static void BeginQuery(QueryTarget target, int id)
 {
     if (RenderSettings.CoreQuerySupported)
     {
         GL.BeginQuery(target, id);
     }
     else
     {
         GL.Arb.BeginQuery((ArbOcclusionQuery)(int)target, id);
     }
 }
コード例 #15
0
ファイル: Compat.cs プロジェクト: CasperTech/radegast
 public static void EndQuery(QueryTarget target)
 {
     if (RenderSettings.CoreQuerySupported)
     {
         GL.EndQuery(target);
     }
     else
     {
         GL.Arb.EndQuery((ArbOcclusionQuery)(int)target);
     }
 }
コード例 #16
0
 /// <summary>
 /// Get the filtered employees with prefetched Person entities
 /// </summary>
 /// <param name="qf">Query Factory object</param>
 /// <returns></returns>
 private static EntityQuery <EmployeeEntity> GetFilteredEmployeesWithPerson(QueryFactory qf)
 {
     return(qf.Employee.
            From(QueryTarget.
                 InnerJoin(qf.Person).On(PersonFields.BusinessEntityId == EmployeeFields.BusinessEntityId)).
            Where(PersonFields.FirstName.StartsWith("A")).
            AndWhere(EmployeeFields.Gender == "M").
            OrderBy(EmployeeFields.BusinessEntityId.Ascending()).
            Limit(5).
            WithPath(EmployeeEntity.PrefetchPathPerson));
 }
コード例 #17
0
 public static void GetQueryEXT(QueryTarget target, QueryParameterName pname, out int @params)
 {
     unsafe
     {
         fixed(int *p_params = & @params)
         {
             Debug.Assert(Delegates.pglGetQueryivEXT != null, "pglGetQueryivEXT not implemented");
             Delegates.pglGetQueryivEXT((int)target, (int)pname, p_params);
             LogCommand("glGetQueryivEXT", null, target, pname, @params);
         }
     }
     DebugCheckErrors(null);
 }
コード例 #18
0
ファイル: QueryMapping.cs プロジェクト: lfricken/ObjectTK
        /// <summary>
        /// Begins the given query name.
        /// </summary>
        /// <param name="mapping">The query name to begin.</param>
        /// <param name="target">The query target to capture.</param>
        public void Begin(T mapping, QueryTarget target)
        {
            var map = _queries[mapping];

            if (map.Active)
            {
                throw new QueryException(string.Format("Query already active: {0} {1}", target, mapping));
            }
            map.Active = true;
            map.Target = target;
            map.Index  = AcquireIndex(target);
            GL.BeginQueryIndexed(target, map.Index, map.Handle);
        }
コード例 #19
0
ファイル: MessageGuiHelper.cs プロジェクト: alanschrank/HnD
        /// <summary>
        /// Gets the message of the attachment with the attachmentid passed in.
        /// </summary>
        /// <param name="attachmentId">The attachment ID.</param>
        /// <returns>MessageEntity if found, otherwise null. MessageEntity has its Thread entity prefetched</returns>
        public static async Task <MessageEntity> GetMessageWithAttachmentLogicAsync(int attachmentId)
        {
            var qf = new QueryFactory();
            var q  = qf.Message
                     .From(QueryTarget.InnerJoin(qf.Attachment).On(MessageFields.MessageID.Equal(AttachmentFields.MessageID)))
                     .Where(AttachmentFields.AttachmentID.Equal(attachmentId))
                     .Limit(1)
                     .WithPath(MessageEntity.PrefetchPathThread);

            using (var adapter = new DataAccessAdapter())
            {
                return(await adapter.FetchFirstAsync(q).ConfigureAwait(false));
            }
        }
コード例 #20
0
        /// <summary>
        /// Gets the message of the attachment with the attachmentid passed in.
        /// </summary>
        /// <param name="attachmentID">The attachment ID.</param>
        /// <returns>MessageEntity if found, otherwise null. MessageEntity has its Thread entity prefetched</returns>
        public static MessageEntity GetMessageWithAttachmentLogic(int attachmentID)
        {
            var qf = new QueryFactory();
            var q  = qf.Message
                     .From(QueryTarget.InnerJoin(qf.Attachment).On(MessageFields.MessageID == AttachmentFields.MessageID))
                     .Where(AttachmentFields.AttachmentID == attachmentID)
                     .Limit(1)
                     .WithPath(MessageEntity.PrefetchPathThread);
            var messages = new MessageCollection();

            messages.GetMulti(q);

            return((messages.Count > 0) ? messages[0] : null);
        }
コード例 #21
0
ファイル: Counters.cs プロジェクト: gamedropswithpops/Ryujinx
        private void UpdateAccumulatedCounter(CounterType type)
        {
            int handle = _queryObjects[(int)type];

            QueryTarget target = GetTarget(type);

            GL.EndQuery(target);

            GL.GetQueryObject(handle, GetQueryObjectParam.QueryResult, out long result);

            _accumulatedCounters[(int)type] += (ulong)result;

            GL.BeginQuery(target, handle);
        }
コード例 #22
0
        public async Task <EntityCollection <LogEntity> > GetAllLogsWithUserAndProjectInfo()
        {
            var logs = new EntityCollection <LogEntity>();

            using var adapter = new DataAccessAdapter();
            var qf = new QueryFactory();
            var q  = qf.Log.
                     From(QueryTarget.
                          InnerJoin(LogEntity.Relations.ProjectEntityUsingProjectId)
                          .InnerJoin(LogEntity.Relations.UserEntityUsingCreatedByUserId))
                     .OrderBy(LogFields.Id.Descending()).WithPath(LogEntity.PrefetchPathProject, LogEntity.PrefetchPathUser);

            return(await adapter.FetchQueryAsync(q, logs));
        }
コード例 #23
0
ファイル: BufferedQuery.cs プロジェクト: lalalaring/Ryujinx
        public BufferedQuery(QueryTarget type)
        {
            _buffer = GL.GenBuffer();
            Query   = GL.GenQuery();
            _type   = type;

            GL.BindBuffer(BufferTarget.QueryBuffer, _buffer);

            unsafe
            {
                long defaultValue = DefaultValue;
                GL.BufferStorage(BufferTarget.QueryBuffer, sizeof(long), (IntPtr)(&defaultValue), BufferStorageFlags.MapReadBit | BufferStorageFlags.MapWriteBit | BufferStorageFlags.MapPersistentBit);
            }
            _bufferMap = GL.MapBufferRange(BufferTarget.QueryBuffer, IntPtr.Zero, sizeof(long), BufferAccessMask.MapReadBit | BufferAccessMask.MapWriteBit | BufferAccessMask.MapPersistentBit);
        }
コード例 #24
0
        public async Task <EntityCollection <LogEntity> > GetCurrentUserLogs(int userId, int currentPage, int pageSize = 3)
        {
            var logs = new EntityCollection <LogEntity>();

            using var adapter = new DataAccessAdapter();
            var qf = new QueryFactory();

            return(await adapter.FetchQueryAsync(
                       qf.Log.Where(LogFields.CreatedByUserId == userId)
                       .From(QueryTarget.InnerJoin(LogEntity.Relations.UserEntityUsingCreatedByUserId))
                       .WithPath(LogEntity.PrefetchPathUser)
                       .OrderBy(LogFields.Id.Descending())
                       .Offset((currentPage - 1) * pageSize)
                       .Limit(pageSize), logs));
        }
コード例 #25
0
ファイル: QueryIndexer.cs プロジェクト: olegbom/ObjectTK
 /// <summary>
 /// Acquires an unused index for the given <see cref="QueryTarget"/>.
 /// </summary>
 /// <param name="target">The QueryTarget to acquire an index for.</param>
 /// <returns>Unused index.</returns>
 protected static int AcquireIndex(QueryTarget target)
 {
     if (!TargetIndices.ContainsKey(target)) TargetIndices.Add(target, new SortedSet<int>());
     // find first free index
     var i = 0;
     foreach (var index in TargetIndices[target])
     {
         if (index > i) break;
         i++;
     }
     if (!IndexableTargets.Contains(target) && i > 0) throw new QueryException(
         string.Format("Query target not indexable and the single target it already in use: {0}", target));
     // remember index is in use
     TargetIndices[target].Add(i);
     return i;
 }
コード例 #26
0
ファイル: CounterQueue.cs プロジェクト: piyachetk/Ryujinx
        internal CounterQueue(CounterType type)
        {
            Type = type;

            QueryTarget glType = GetTarget(Type);

            _queryPool = new Queue <BufferedQuery>(QueryPoolInitialSize);
            for (int i = 0; i < QueryPoolInitialSize; i++)
            {
                _queryPool.Enqueue(new BufferedQuery(glType));
            }

            _current = new CounterQueueEvent(this, glType, 0);

            _consumerThread = new Thread(EventConsumer);
            _consumerThread.Start();
        }
コード例 #27
0
        /// <summary>
        /// Gets all customers who have bought the product with the product id specified.
        /// </summary>
        /// <param name="productId">The product id.</param>
        /// <returns>an entity collection with 0 or more customers who have purchased the product with the id specified</returns>
        public IEntityCollection2 GetAllCustomersFilteredOnProduct(int productId)
        {
            var qf = new QueryFactory();
            var q  = qf.Customer
                     .From(QueryTarget
                           .InnerJoin(qf.Order).On(CustomerFields.CustomerId == OrderFields.CustomerId)
                           .InnerJoin(qf.OrderDetails).On(OrderFields.OrderId == OrderDetailsFields.OrderId))
                     .Where(OrderDetailsFields.ProductId == productId);

            var customers = new EntityCollection(new CustomerEntityFactory());

            using (DataAccessAdapter adapter = new DataAccessAdapter())
            {
                adapter.FetchQuery(q, customers);
            }
            return(customers);
        }
コード例 #28
0
        public async Task <IList <string> > GetRolesAsync(ApplicationUser user, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            using (var adapter = new DataAccessAdapter())
            {
                var qf = new QueryFactory();

                var q = qf.AspNetRole.From(QueryTarget
                                           .InnerJoin(AspNetUserRoleEntity.Relations.AspNetRoleEntityUsingRoleId))
                        .Where(AspNetUserRoleFields.UserId.Equal(user.Id));

                var userRoles = await adapter.FetchQueryAsync(q, cancellationToken);

                return(userRoles.Cast <AspNetRoleEntity>().Select(ur => ur.NormalizedName).ToList());
            }
        }
コード例 #29
0
        public async Task <IList <ApplicationUser> > GetUsersForClaimAsync(Claim claim, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            using (var adapter = new DataAccessAdapter())
            {
                var qf = new QueryFactory();
                var q  = qf.AspNetUser.From(QueryTarget
                                            .InnerJoin(AspNetUserClaimEntity.Relations.AspNetUserEntityUsingUserId))
                         .Where(AspNetUserClaimFields.ClaimType.Equal(claim.Type)
                                .And(AspNetUserClaimFields.ClaimValue.Equal(claim.Value)))
                         .Select(ProjectionLambdaCreator.Create <ApplicationUser, AspNetUserFields>());

                var users = await adapter.FetchQueryAsync(q, cancellationToken);

                return(users);
            }
        }
コード例 #30
0
        //
        // ListenToQuery(StructuredQuery query)
        //
        // Start listening to a query. I've not tried listening to multiple quries, your mileage may vary with that.
        public void ListenToQuery(StructuredQuery query)
        {
            var qt = new QueryTarget {
            };

            qt.StructuredQuery = query;
            qt.Parent          = string.Format("projects/{0}/databases/{1}/documents", ProjectId, DatabaseId);

            ListenRequest request = new ListenRequest
            {
                Database  = new DatabaseRootName(ProjectId, DatabaseId).ToString(),
                AddTarget = new Target
                {
                    Query = qt,
                }
            };

            PendingRequests.Add(request);
        }
コード例 #31
0
        public async Task <IList <ApplicationUser> > GetUsersInRoleAsync(string roleName, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();

            using (var adapter = new DataAccessAdapter())
            {
                var qf = new QueryFactory();
                var q  = qf.AspNetUser.From(QueryTarget
                                            .InnerJoin(AspNetRoleEntity.Relations.AspNetUserRoleEntityUsingRoleId)
                                            .InnerJoin(AspNetUserRoleEntity.Relations.AspNetUserEntityUsingUserId))
                         .Where(AspNetRoleFields.Name.Equal(roleName))
                         .AndWhere(AspNetUserRoleFields.RoleId.Equal(AspNetRoleFields.Id))
                         .Select(ProjectionLambdaCreator.Create <ApplicationUser, AspNetUserFields>());

                var users = await adapter.FetchQueryAsync(q, cancellationToken);

                return(users);
            }
        }
コード例 #32
0
ファイル: GLCore.cs プロジェクト: whztt07/DeltaEngine
		public static void BeginQuery(QueryTarget target, uint id)
		{
			glBeginQuery deleg = BaseGraphicsContext.Current.Loader.Get<glBeginQuery>();
			if (deleg != null)
				deleg(target, id);
		}
コード例 #33
0
ファイル: GLCore.cs プロジェクト: whztt07/DeltaEngine
		public static void GetQueryiv(QueryTarget target, GetQueryParam pname, int[] parameters)
		{
			glGetQueryiv deleg = BaseGraphicsContext.Current.Loader.Get<glGetQueryiv>();
			if (deleg != null)
				deleg(target, pname, parameters);
		}
コード例 #34
0
 public void Begin(QueryTarget target)
 {
     Target = target;
     GL.BeginQuery(target, id);
 }
コード例 #35
0
ファイル: GLCore.cs プロジェクト: whztt07/DeltaEngine
		public static void EndQuery(QueryTarget target)
		{
			glEndQuery deleg = BaseGraphicsContext.Current.Loader.Get<glEndQuery>();
			if (deleg != null)
				deleg(target);
		}
コード例 #36
0
 /// <summary>
 /// glBeginQueryIndexed and glEndQueryIndexed delimit the boundaries of a query object. query must be a name previously returned from a call to glGenQueries. If a query object with name id does not yet exist it is created with the type determined by target. target must be one of GL_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED, GL_PRIMITIVES_GENERATED, GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, or GL_TIME_ELAPSED. The behavior of the query object depends on its type and is explained in QueryTarget enum.
 /// Querying the GL_QUERY_RESULT implicitly flushes the GL pipeline until the rendering delimited by the query object has completed and the result is available. GL_QUERY_RESULT_AVAILABLE can be queried to determine if the result is immediately available or if the rendering is not yet complete.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="Index">index specifies the index of the query target and must be between a target-specific maximum.</param>
 /// <remarks>
 /// If the query target's count exceeds the maximum value representable in the number of available bits, as reported by glGetQueryiv with target set to the appropriate query target and pname GL_QUERY_COUNTER_BITS, the count becomes undefined.
 /// An implementation may support 0 bits in its counter, in which case query results are always undefined and essentially useless.
 /// When GL_SAMPLE_BUFFERS is 0, the samples-passed counter of an occlusion query will increment once for each fragment that passes the depth test. When GL_SAMPLE_BUFFERS is 1, an implementation may either increment the samples-passed counter individually for each sample of a fragment that passes the depth test, or it may choose to increment the counter for all samples of a fragment if any one of them passes the depth test.
 /// Calling glBeginQuery or glEndQuery is equivalent to calling glBeginQueryIndexed or glEndQueryIndexed with index set to zero, respectively.
 /// </remarks>
 public static void EndQueryIndexed(QueryTarget target, uint Index)
 {
     Delegates.glEndQueryIndexed(target, Index);
 }
コード例 #37
0
 //GL_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED, GL_PRIMITIVES_GENERATED, GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, or GL_TIME_ELAPSED.
 //GL_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED, GL_PRIMITIVES_GENERATED, GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, or GL_TIME_ELAPSED. GL_ANY_SAMPLES_PASSED_CONSERVATIVE, 
 /// <summary>
 /// glBeginQueryIndexed and glEndQueryIndexed delimit the boundaries of a query object. query must be a name previously returned from a call to glGenQueries. If a query object with name id does not yet exist it is created with the type determined by target. target must be one of GL_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED, GL_PRIMITIVES_GENERATED, GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, or GL_TIME_ELAPSED. The behavior of the query object depends on its type and is explained in QueryTarget enum.
 /// Querying the GL_QUERY_RESULT implicitly flushes the GL pipeline until the rendering delimited by the query object has completed and the result is available. GL_QUERY_RESULT_AVAILABLE can be queried to determine if the result is immediately available or if the rendering is not yet complete.
 /// </summary>
 /// <param name="target"></param>
 /// <param name="Index">index specifies the index of the query target and must be between a target-specific maximum.</param>
 /// <param name="QueryID"></param>
 /// <remarks>
 /// If the query target's count exceeds the maximum value representable in the number of available bits, as reported by glGetQueryiv with target set to the appropriate query target and pname GL_QUERY_COUNTER_BITS, the count becomes undefined.
 /// An implementation may support 0 bits in its counter, in which case query results are always undefined and essentially useless.
 /// When GL_SAMPLE_BUFFERS is 0, the samples-passed counter of an occlusion query will increment once for each fragment that passes the depth test. When GL_SAMPLE_BUFFERS is 1, an implementation may either increment the samples-passed counter individually for each sample of a fragment that passes the depth test, or it may choose to increment the counter for all samples of a fragment if any one of them passes the depth test.
 /// Calling glBeginQuery or glEndQuery is equivalent to calling glBeginQueryIndexed or glEndQueryIndexed with index set to zero, respectively.
 /// </remarks>
 public static void BeginQueryIndexed(QueryTarget target, uint Index, uint QueryID)
 {
     Delegates.glBeginQueryIndexed(target, Index, QueryID);
 }
コード例 #38
0
 /// <summary>
 /// glGetQueryIndexediv returns in params a selected parameter of the indexed query object target specified by target and index.
 /// </summary>
 /// <param name="target">Specifies a query object target. Must be GL_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED_CONSERVATIVE GL_PRIMITIVES_GENERATED, GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, GL_TIME_ELAPSED, or GL_TIMESTAMP.</param>
 /// <param name="Index">index specifies the index of the query object target and must be between zero and a target-specific maxiumum.</param>
 /// <param name="pname">Specifies the symbolic name of a query object target parameter. Accepted values are GL_CURRENT_QUERY or GL_QUERY_COUNTER_BITS.</param>
 /// <returns>Returns the requested data.</returns>
 /// <remarks>
 /// glGetQueryIndexediv returns in params a selected parameter of the indexed query object target specified by target and index. index specifies the index of the query object target and must be between zero and a target-specific maxiumum.
 /// pname names a specific query object target parameter. When pname is GL_CURRENT_QUERY, the name of the currently active query for the specified index of target, or zero if no query is active, will be placed in params. If pname is GL_QUERY_COUNTER_BITS, the implementation-dependent number of bits used to hold the result of queries for target is returned in params.
 /// The target GL_ANY_SAMPLES_PASSED_CONSERVATIVE is available only if the GL version is 4.3 or greater.
 /// If an error is generated, no change is made to the contents of params.
 /// Calling glGetQueryiv is equivalent to calling glGetQueryIndexediv with index set to zero.
 /// </remarks>
 public static int GetQueryIndexediv(QueryTarget target, uint Index, GetQueryIndexedParameters pname)
 {
     int tmp = 0;
     Delegates.glGetQueryIndexediv(target, Index, pname, ref tmp);
     return tmp;
 }        
コード例 #39
0
 /// <summary>
 /// glGetQueryIndexediv returns in params a selected parameter of the indexed query object target specified by target and index.
 /// </summary>
 /// <param name="target">Specifies a query object target. Must be GL_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED_CONSERVATIVE GL_PRIMITIVES_GENERATED, GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, GL_TIME_ELAPSED, or GL_TIMESTAMP.</param>
 /// <param name="Index">index specifies the index of the query object target and must be between zero and a target-specific maxiumum.</param>
 /// <param name="pname">Specifies the symbolic name of a query object target parameter. Accepted values are GL_CURRENT_QUERY or GL_QUERY_COUNTER_BITS.</param>
 /// <param name="params">Returns the requested data.</param>
 /// <remarks>
 /// glGetQueryIndexediv returns in params a selected parameter of the indexed query object target specified by target and index. index specifies the index of the query object target and must be between zero and a target-specific maxiumum.
 /// pname names a specific query object target parameter. When pname is GL_CURRENT_QUERY, the name of the currently active query for the specified index of target, or zero if no query is active, will be placed in params. If pname is GL_QUERY_COUNTER_BITS, the implementation-dependent number of bits used to hold the result of queries for target is returned in params.
 /// The target GL_ANY_SAMPLES_PASSED_CONSERVATIVE is available only if the GL version is 4.3 or greater.
 /// If an error is generated, no change is made to the contents of params.
 /// Calling glGetQueryiv is equivalent to calling glGetQueryIndexediv with index set to zero.
 /// </remarks>
 public static void GetQueryIndexediv(QueryTarget target, uint Index, GetQueryIndexedParameters pname, int[] @params)
 {
     Delegates.glGetQueryIndexediv(target, Index, pname, ref @params[0]);
 }
コード例 #40
0
 /// <summary>
 /// glGetQueryiv returns in params a selected parameter of the query object target specified by target.
 /// Calling glGetQueryiv is equivalent to calling glGetQueryIndexediv with index set to zero.
 /// </summary>
 /// <param name="target">Specifies a query object target. Must be GL_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED_CONSERVATIVE GL_PRIMITIVES_GENERATED, GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, GL_TIME_ELAPSED, or GL_TIMESTAMP.</param>
 /// <param name="pname">Specifies the symbolic name of a query object target parameter. Accepted values are GL_CURRENT_QUERY or GL_QUERY_COUNTER_BITS.</param>
 /// <returns></returns>
 public static int GetQueryiv(QueryTarget target, GetQueryParameters pname)
 {
     int tmp = 0;
     Delegates.glGetQueryiv(target, pname, ref tmp);
     return tmp;
 }
コード例 #41
0
ファイル: Query.cs プロジェクト: bitzhuwei/CSharpGL
 /// <summary>
 /// Een query.
 /// </summary>
 /// <param name="target">Specifies the target type of query object to be concluded.s</param>
 public void EndQuery(QueryTarget target)
 {
     glEndQuery((uint)target);
 }
コード例 #42
0
ファイル: QueryIndexer.cs プロジェクト: olegbom/ObjectTK
 /// <summary>
 /// Releases a previously acquired index for the given <see cref="QueryTarget"/>.
 /// </summary>
 /// <param name="target">The QueryTarget to release the index from.</param>
 /// <param name="index">The index to release.</param>
 protected static void ReleaseIndex(QueryTarget target, int index)
 {
     TargetIndices[target].Remove(index);
 }
コード例 #43
0
 /// <summary>
 /// glBeginQuery and glEndQuery delimit the boundaries of a query object. query must be a name previously returned from a call to glGenQueries. If a query object with name id does not yet exist it is created with the type determined by target. target must be one of GL_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED, GL_PRIMITIVES_GENERATED, GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, or GL_TIME_ELAPSED.
 /// Calling glBeginQuery or glEndQuery is equivalent to calling glBeginQueryIndexed or glEndQueryIndexed with index set to zero, respectively.
 /// </summary>
 /// <param name="target">Specifies the target type of query object to be concluded. The symbolic constant must be one of GL_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED, GL_PRIMITIVES_GENERATED, GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, or GL_TIME_ELAPSED.</param>
 public static void EndQuery(QueryTarget target)
 {
     Delegates.glEndQuery(target);
 }
コード例 #44
0
 /// <summary>
 /// glGetQueryiv returns in params a selected parameter of the query object target specified by target.
 /// Calling glGetQueryiv is equivalent to calling glGetQueryIndexediv with index set to zero.
 /// </summary>
 /// <param name="target">Specifies a query object target. Must be GL_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED_CONSERVATIVE GL_PRIMITIVES_GENERATED, GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, GL_TIME_ELAPSED, or GL_TIMESTAMP.</param>
 /// <param name="pname">Specifies the symbolic name of a query object target parameter. Accepted values are GL_CURRENT_QUERY or GL_QUERY_COUNTER_BITS.</param>
 /// <param name="params"></param>
 public static void GetQueryiv(QueryTarget target, GetQueryParameters pname, int[] @params)
 {
     Delegates.glGetQueryiv(target, pname, ref @params[0]);
 }
コード例 #45
0
ファイル: Query.cs プロジェクト: bitzhuwei/CSharpGL
        /// <summary>
        /// Begin query.
        /// <para>delimit the boundaries of a query object.</para>
        /// </summary>
        /// <param name="target">Specifies the target type of query object established between glBeginQuery and the subsequent glEndQuery.</param>
        public void BeginQuery(QueryTarget target)
        {
            if (!this.initialized) { this.Initialize(); }

            glBeginQuery((uint)target, this.Id);
        }
コード例 #46
0
 /// <summary>
 /// glBeginQuery and glEndQuery delimit the boundaries of a query object. query must be a name previously returned from a call to glGenQueries. If a query object with name id does not yet exist it is created with the type determined by target. target must be one of GL_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED, GL_PRIMITIVES_GENERATED, GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, or GL_TIME_ELAPSED.
 /// Calling glBeginQuery or glEndQuery is equivalent to calling glBeginQueryIndexed or glEndQueryIndexed with index set to zero, respectively.
 /// </summary>
 /// <param name="target">Specifies the target type of query object established between glBeginQuery and the subsequent glEndQuery. The symbolic constant must be one of GL_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED, GL_PRIMITIVES_GENERATED, GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, or GL_TIME_ELAPSED.</param>
 /// <param name="QueryID">Specifies the name of a query object.</param>
 public static void BeginQuery(QueryTarget target, uint QueryID)
 {
     Delegates.glBeginQuery(target, QueryID);
 }