OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 * GR_GL_USE_BUFFER_DATA_NULL_HINT: When specifing new data for a vertex/index | 49 * GR_GL_USE_BUFFER_DATA_NULL_HINT: When specifing new data for a vertex/index |
50 * buffer that replaces old data Ganesh can give a hint to the driver that the | 50 * buffer that replaces old data Ganesh can give a hint to the driver that the |
51 * previous data will not be used in future draws like this: | 51 * previous data will not be used in future draws like this: |
52 * glBufferData(GL_..._BUFFER, size, NULL, usage); //<--hint, NULL means | 52 * glBufferData(GL_..._BUFFER, size, NULL, usage); //<--hint, NULL means |
53 * glBufferSubData(GL_..._BUFFER, 0, lessThanSize, data) // old data can't be | 53 * glBufferSubData(GL_..._BUFFER, 0, lessThanSize, data) // old data can't be |
54 * // used again. | 54 * // used again. |
55 * However, this can be an unoptimization on some platforms, esp. Chrome. | 55 * However, this can be an unoptimization on some platforms, esp. Chrome. |
56 * Chrome's cmd buffer will create a new allocation and memset the whole thing | 56 * Chrome's cmd buffer will create a new allocation and memset the whole thing |
57 * to zero (for security reasons). Defaults to 1 (enabled). | 57 * to zero (for security reasons). Defaults to 1 (enabled). |
58 * | 58 * |
59 * GR_GL_PER_GL_FUNC_CALLBACK: When set to 1 the GrGLInterface object provides | |
60 * a function pointer that is called just before every gl function. The ptr must | |
61 * be valid (i.e. there is no NULL check). However, by default the callback will | |
62 * be set to a function that does nothing. The signature of the function is: | |
63 * void function(const GrGLInterface*) | |
64 * It is not extern "C". | |
65 * The GrGLInterface field fCallback specifies the function ptr and there is an | |
66 * additional field fCallbackData of type intptr_t for client data. | |
67 * | |
68 * GR_GL_CHECK_ALLOC_WITH_GET_ERROR: If set to 1 this will then glTexImage, | 59 * GR_GL_CHECK_ALLOC_WITH_GET_ERROR: If set to 1 this will then glTexImage, |
69 * glBufferData, glRenderbufferStorage, etc will be checked for errors. This | 60 * glBufferData, glRenderbufferStorage, etc will be checked for errors. This |
70 * amounts to ensuring the error is GL_NO_ERROR, calling the allocating | 61 * amounts to ensuring the error is GL_NO_ERROR, calling the allocating |
71 * function, and then checking that the error is still GL_NO_ERROR. When the | 62 * function, and then checking that the error is still GL_NO_ERROR. When the |
72 * value is 0 we will assume no error was generated without checking. | 63 * value is 0 we will assume no error was generated without checking. |
73 * | 64 * |
74 * GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT: We will normally check the FBO status | 65 * GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT: We will normally check the FBO status |
75 * every time we bind a texture or renderbuffer to an FBO. However, in some | 66 * every time we bind a texture or renderbuffer to an FBO. However, in some |
76 * environments CheckFrameBufferStatus is very expensive. If this is set we will | 67 * environments CheckFrameBufferStatus is very expensive. If this is set we will |
77 * check the first time we use a color format or a combination of color / | 68 * check the first time we use a color format or a combination of color / |
(...skipping 30 matching lines...) Expand all Loading... |
108 #endif | 99 #endif |
109 | 100 |
110 #if !defined(GR_GL_CHECK_ERROR_START) | 101 #if !defined(GR_GL_CHECK_ERROR_START) |
111 #define GR_GL_CHECK_ERROR_START 1 | 102 #define GR_GL_CHECK_ERROR_START 1 |
112 #endif | 103 #endif |
113 | 104 |
114 #if !defined(GR_GL_USE_BUFFER_DATA_NULL_HINT) | 105 #if !defined(GR_GL_USE_BUFFER_DATA_NULL_HINT) |
115 #define GR_GL_USE_BUFFER_DATA_NULL_HINT 1 | 106 #define GR_GL_USE_BUFFER_DATA_NULL_HINT 1 |
116 #endif | 107 #endif |
117 | 108 |
118 #if !defined(GR_GL_PER_GL_FUNC_CALLBACK) | |
119 #define GR_GL_PER_GL_FUNC_CALLBACK 0 | |
120 #endif | |
121 | |
122 #if !defined(GR_GL_CHECK_ALLOC_WITH_GET_ERROR) | 109 #if !defined(GR_GL_CHECK_ALLOC_WITH_GET_ERROR) |
123 #define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 1 | 110 #define GR_GL_CHECK_ALLOC_WITH_GET_ERROR 1 |
124 #endif | 111 #endif |
125 | 112 |
126 #if !defined(GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT) | 113 #if !defined(GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT) |
127 #define GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT 0 | 114 #define GR_GL_CHECK_FBO_STATUS_ONCE_PER_FORMAT 0 |
128 #endif | 115 #endif |
129 | 116 |
130 #if !defined(GR_GL_MUST_USE_VBO) | 117 #if !defined(GR_GL_MUST_USE_VBO) |
131 #define GR_GL_MUST_USE_VBO 0 | 118 #define GR_GL_MUST_USE_VBO 0 |
132 #endif | 119 #endif |
133 | 120 |
134 #if !defined(GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE) | 121 #if !defined(GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE) |
135 #define GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE 0 | 122 #define GR_GL_USE_NEW_SHADER_SOURCE_SIGNATURE 0 |
136 #endif | 123 #endif |
137 | 124 |
138 #endif | 125 #endif |
OLD | NEW |