diff options
author | Robert Phillips <robertphillips@google.com> | 2018-03-01 16:51:25 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-02 12:11:05 +0000 |
commit | f2ec024c445ed17e80a5d351c797841f93ce8a7e (patch) | |
tree | ea340ae2a12cb983cd2b93998a084ee463b0d806 /include | |
parent | f184bdf507a171cf31e85751edf778af1ae3531d (diff) |
Make use of the buffer data null hint a GrContextOption
TBR=bsalomon@google.com
Change-Id: I5a3fd18479ca8c95e1bc8c087c28346264049eb0
Reviewed-on: https://skia-review.googlesource.com/111604
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrContextOptions.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/gpu/GrContextOptions.h b/include/gpu/GrContextOptions.h index 74ec7feb1f..69ea181bbb 100644 --- a/include/gpu/GrContextOptions.h +++ b/include/gpu/GrContextOptions.h @@ -132,6 +132,19 @@ struct GrContextOptions { bool fAvoidStencilBuffers = false; /** + * When specifing new data for a vertex/index buffer that replaces old data Ganesh can give + * a hint to the driver that the previous data will not be used in future draws like this: + * glBufferData(GL_..._BUFFER, size, NULL, usage); //<--hint, NULL means + * glBufferSubData(GL_..._BUFFER, 0, lessThanSize, data) // old data can't be + * // used again. + * However, this can be an unoptimization on some platforms, esp. Chrome. + * Chrome's cmd buffer will create a new allocation and memset the whole thing + * to zero (for security reasons). + * Defaults to the value of GR_GL_USE_BUFFER_DATA_NULL_HINT #define (which is, by default, 1). + */ + Enable fUseGLBufferDataNullHint = Enable::kDefault; + + /** * If true, texture fetches from mip-mapped textures will be biased to read larger MIP levels. * This has the effect of sharpening those textures, at the cost of some aliasing, and possible * performance impact. |