VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/cr_bits.h@ 60744

最後變更 在這個檔案從60744是 41071,由 vboxsync 提交於 13 年 前

crOpenGL: switch to using ASMBit* for gl resource tracking

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 1.4 KB
 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved.
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7/* Bit vector functions */
8
9#ifndef CR_BITS_H
10#define CR_BITS_H
11
12
13#include "cr_compiler.h"
14
15
16#define CR_MAX_CONTEXTS 512
17#define CR_MAX_BITARRAY (CR_MAX_CONTEXTS / 32) /* 32 contexts per uint */
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23static INLINE void RESET( unsigned int *b, const unsigned int *d )
24{
25 int j;
26 for (j=0;j<CR_MAX_BITARRAY;j++)
27 b[j] |= d[j];
28}
29static INLINE void DIRTY( unsigned int *b, const unsigned int *d )
30{
31 int j;
32 for (j=0;j<CR_MAX_BITARRAY;j++)
33 b[j] = d[j];
34}
35static INLINE void FILLDIRTY( unsigned int *b )
36{
37 int j;
38 for (j=0;j<CR_MAX_BITARRAY;j++)
39 b[j] = 0xffffffff;
40}
41static INLINE void CLEARDIRTY( unsigned int *b, const unsigned int *d )
42{
43 int j;
44 for (j=0;j<CR_MAX_BITARRAY;j++)
45 b[j] &= d[j];
46}
47
48/* As above, but complement the bits here instead of in the calling code */
49static INLINE void CLEARDIRTY2( unsigned int *b, const unsigned int *d )
50{
51 int j;
52 for (j=0;j<CR_MAX_BITARRAY;j++)
53 b[j] &= ~d[j];
54}
55
56static INLINE int CHECKDIRTY( const unsigned int *b, const unsigned int *d )
57{
58 int j;
59
60 for (j=0;j<CR_MAX_BITARRAY;j++)
61 if (b[j] & d[j])
62 return 1;
63
64 return 0;
65}
66
67#ifdef __cplusplus
68}
69#endif
70
71
72#endif /* CR_BITS_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette