OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrVkGpu.h" | 8 #include "GrVkGpu.h" |
9 | 9 |
10 #include "GrContextOptions.h" | 10 #include "GrContextOptions.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 &fCmdPool)); | 128 &fCmdPool)); |
129 | 129 |
130 // must call this after creating the CommandPool | 130 // must call this after creating the CommandPool |
131 fResourceProvider.init(); | 131 fResourceProvider.init(); |
132 fCurrentCmdBuffer = fResourceProvider.createPrimaryCommandBuffer(); | 132 fCurrentCmdBuffer = fResourceProvider.createPrimaryCommandBuffer(); |
133 SkASSERT(fCurrentCmdBuffer); | 133 SkASSERT(fCurrentCmdBuffer); |
134 fCurrentCmdBuffer->begin(this); | 134 fCurrentCmdBuffer->begin(this); |
135 | 135 |
136 // set up our heaps | 136 // set up our heaps |
137 fHeaps[kLinearImage_Heap].reset(new GrVkHeap(this, GrVkHeap::kSubAlloc_Strat
egy, 16*1024*1024)); | 137 fHeaps[kLinearImage_Heap].reset(new GrVkHeap(this, GrVkHeap::kSubAlloc_Strat
egy, 16*1024*1024)); |
138 fHeaps[kOptimalImage_Heap].reset(new GrVkHeap(this, GrVkHeap::kSubAlloc_Stra
tegy, 64*1024*1024)); | 138 // We want the OptimalImage_Heap to use a SubAlloc_strategy but it occasiona
lly causes the |
| 139 // device to run out of memory. Most likely this is caused by fragmentation
in the device heap |
| 140 // and we can't allocate more. Until we get a fix moving this to SingleAlloc
. |
| 141 fHeaps[kOptimalImage_Heap].reset(new GrVkHeap(this, GrVkHeap::kSingleAlloc_S
trategy, 64*1024*1024)); |
139 fHeaps[kSmallOptimalImage_Heap].reset(new GrVkHeap(this, GrVkHeap::kSubAlloc
_Strategy, 2*1024*1024)); | 142 fHeaps[kSmallOptimalImage_Heap].reset(new GrVkHeap(this, GrVkHeap::kSubAlloc
_Strategy, 2*1024*1024)); |
140 fHeaps[kVertexBuffer_Heap].reset(new GrVkHeap(this, GrVkHeap::kSingleAlloc_S
trategy, 0)); | 143 fHeaps[kVertexBuffer_Heap].reset(new GrVkHeap(this, GrVkHeap::kSingleAlloc_S
trategy, 0)); |
141 fHeaps[kIndexBuffer_Heap].reset(new GrVkHeap(this, GrVkHeap::kSingleAlloc_St
rategy, 0)); | 144 fHeaps[kIndexBuffer_Heap].reset(new GrVkHeap(this, GrVkHeap::kSingleAlloc_St
rategy, 0)); |
142 fHeaps[kUniformBuffer_Heap].reset(new GrVkHeap(this, GrVkHeap::kSubAlloc_Str
ategy, 64*1024)); | 145 fHeaps[kUniformBuffer_Heap].reset(new GrVkHeap(this, GrVkHeap::kSubAlloc_Str
ategy, 64*1024)); |
143 fHeaps[kCopyReadBuffer_Heap].reset(new GrVkHeap(this, GrVkHeap::kSingleAlloc
_Strategy, 0)); | 146 fHeaps[kCopyReadBuffer_Heap].reset(new GrVkHeap(this, GrVkHeap::kSingleAlloc
_Strategy, 0)); |
144 fHeaps[kCopyWriteBuffer_Heap].reset(new GrVkHeap(this, GrVkHeap::kSubAlloc_S
trategy, 16*1024*1024)); | 147 fHeaps[kCopyWriteBuffer_Heap].reset(new GrVkHeap(this, GrVkHeap::kSubAlloc_S
trategy, 16*1024*1024)); |
145 } | 148 } |
146 | 149 |
147 GrVkGpu::~GrVkGpu() { | 150 GrVkGpu::~GrVkGpu() { |
148 fCurrentCmdBuffer->end(this); | 151 fCurrentCmdBuffer->end(this); |
(...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1706 aglSwapBuffers(aglGetCurrentContext()); | 1709 aglSwapBuffers(aglGetCurrentContext()); |
1707 int set_a_break_pt_here = 9; | 1710 int set_a_break_pt_here = 9; |
1708 aglSwapBuffers(aglGetCurrentContext()); | 1711 aglSwapBuffers(aglGetCurrentContext()); |
1709 #elif defined(SK_BUILD_FOR_WIN32) | 1712 #elif defined(SK_BUILD_FOR_WIN32) |
1710 SwapBuf(); | 1713 SwapBuf(); |
1711 int set_a_break_pt_here = 9; | 1714 int set_a_break_pt_here = 9; |
1712 SwapBuf(); | 1715 SwapBuf(); |
1713 #endif | 1716 #endif |
1714 #endif | 1717 #endif |
1715 } | 1718 } |
OLD | NEW |