Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: src/gpu/vk/GrVkTexture.cpp

Issue 1782583002: Add support for vertex and geometry shader textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: better rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/vk/GrVkProgramBuilder.cpp ('k') | tests/EGLImageTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "GrVkTexture.h" 8 #include "GrVkTexture.h"
9 #include "GrVkGpu.h" 9 #include "GrVkGpu.h"
10 #include "GrVkImageView.h" 10 #include "GrVkImageView.h"
11 #include "GrVkUtil.h" 11 #include "GrVkUtil.h"
12 12
13 #define VK_CALL(GPU, X) GR_VK_CALL(GPU->vkInterface(), X) 13 #define VK_CALL(GPU, X) GR_VK_CALL(GPU->vkInterface(), X)
14 14
15 // Because this class is virtually derived from GrSurface we must explicitly cal l its constructor. 15 // Because this class is virtually derived from GrSurface we must explicitly cal l its constructor.
16 GrVkTexture::GrVkTexture(GrVkGpu* gpu, 16 GrVkTexture::GrVkTexture(GrVkGpu* gpu,
17 const GrSurfaceDesc& desc, 17 const GrSurfaceDesc& desc,
18 GrGpuResource::LifeCycle lifeCycle, 18 GrGpuResource::LifeCycle lifeCycle,
19 const GrVkImage::Resource* imageResource, 19 const GrVkImage::Resource* imageResource,
20 const GrVkImageView* view) 20 const GrVkImageView* view)
21 : GrSurface(gpu, lifeCycle, desc) 21 : GrSurface(gpu, lifeCycle, desc)
22 , GrVkImage(imageResource) 22 , GrVkImage(imageResource)
23 , INHERITED(gpu, lifeCycle, desc, false) // false because we don't upload MI P data in Vk yet 23 , INHERITED(gpu, lifeCycle, desc, kSampler2D_GrSLType,
24 false) // false because we don't upload MIP data in Vk yet
24 , fTextureView(view) { 25 , fTextureView(view) {
25 this->registerWithCache(); 26 this->registerWithCache();
26 } 27 }
27 28
28 // Because this class is virtually derived from GrSurface we must explicitly cal l its constructor. 29 // Because this class is virtually derived from GrSurface we must explicitly cal l its constructor.
29 GrVkTexture::GrVkTexture(GrVkGpu* gpu, 30 GrVkTexture::GrVkTexture(GrVkGpu* gpu,
30 const GrSurfaceDesc& desc, 31 const GrSurfaceDesc& desc,
31 GrGpuResource::LifeCycle lifeCycle, 32 GrGpuResource::LifeCycle lifeCycle,
32 const GrVkImage::Resource* imageResource, 33 const GrVkImage::Resource* imageResource,
33 const GrVkImageView* view, 34 const GrVkImageView* view,
34 Derived) 35 Derived)
35 : GrSurface(gpu, lifeCycle, desc) 36 : GrSurface(gpu, lifeCycle, desc)
36 , GrVkImage(imageResource) 37 , GrVkImage(imageResource)
37 , INHERITED(gpu, lifeCycle, desc, false) // false because we don't upload MI P data in Vk yet 38 , INHERITED(gpu, lifeCycle, desc, kSampler2D_GrSLType,
39 false) // false because we don't upload MIP data in Vk yet
38 , fTextureView(view) {} 40 , fTextureView(view) {}
39 41
40 42
41 GrVkTexture* GrVkTexture::Create(GrVkGpu* gpu, 43 GrVkTexture* GrVkTexture::Create(GrVkGpu* gpu,
42 const GrSurfaceDesc& desc, 44 const GrSurfaceDesc& desc,
43 GrGpuResource::LifeCycle lifeCycle, 45 GrGpuResource::LifeCycle lifeCycle,
44 VkFormat format, 46 VkFormat format,
45 const GrVkImage::Resource* imageResource) { 47 const GrVkImage::Resource* imageResource) {
46 VkImage image = imageResource->fImage; 48 VkImage image = imageResource->fImage;
47 const GrVkImageView* imageView = GrVkImageView::Create(gpu, image, format, 49 const GrVkImageView* imageView = GrVkImageView::Create(gpu, image, format,
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 GrBackendObject GrVkTexture::getTextureHandle() const { 117 GrBackendObject GrVkTexture::getTextureHandle() const {
116 // Currently just passing back the pointer to the Resource as the handle 118 // Currently just passing back the pointer to the Resource as the handle
117 return (GrBackendObject)&fResource; 119 return (GrBackendObject)&fResource;
118 } 120 }
119 121
120 GrVkGpu* GrVkTexture::getVkGpu() const { 122 GrVkGpu* GrVkTexture::getVkGpu() const {
121 SkASSERT(!this->wasDestroyed()); 123 SkASSERT(!this->wasDestroyed());
122 return static_cast<GrVkGpu*>(this->getGpu()); 124 return static_cast<GrVkGpu*>(this->getGpu());
123 } 125 }
124 126
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkProgramBuilder.cpp ('k') | tests/EGLImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698