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

Side by Side Diff: gpu/vulkan/vulkan_sampler.h

Issue 1989013002: Added Vulkan Descriptor Sets and Samplers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Separated out descriptor layout Created 4 years, 7 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 | « gpu/vulkan/vulkan_descriptor_set.cc ('k') | gpu/vulkan/vulkan_sampler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef GPU_VULKAN_VULKAN_SAMPLER_H_
6 #define GPU_VULKAN_VULKAN_SAMPLER_H_
7
8 #include <float.h>
9 #include <vulkan/vulkan.h>
10
11 #include "base/macros.h"
12 #include "gpu/vulkan/vulkan_export.h"
13
14 namespace gpu {
15
16 class VulkanDeviceQueue;
17
18 class VULKAN_EXPORT VulkanSampler {
19 public:
20 struct SamplerOptions {
21 SamplerOptions();
22 ~SamplerOptions();
23
24 VkFilter mag_filter = VK_FILTER_NEAREST;
25 VkFilter min_filter = VK_FILTER_NEAREST;
26 VkSamplerMipmapMode mipmap_mode = VK_SAMPLER_MIPMAP_MODE_NEAREST;
27 VkSamplerAddressMode address_mode_u = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
28 VkSamplerAddressMode address_mode_v = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
29 VkSamplerAddressMode address_mode_w = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
30 float mip_lod_bias = 0.0f;
31 bool anisotropy_enable = false;
32 float max_anisotropy = 1.0f;
33 bool compare_enable = false;
34 VkCompareOp compare_op = VK_COMPARE_OP_NEVER;
35 float min_lod = 0.0f;
36 float max_lod = FLT_MAX;
37 VkBorderColor border_color = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
38 bool unnormalized_coordinates = false;
39 };
40
41 explicit VulkanSampler(VulkanDeviceQueue* device_queue);
42 ~VulkanSampler();
43
44 bool Initialize(const SamplerOptions& options);
45 void Destroy();
46
47 VkSampler handle() const { return handle_; }
48
49 private:
50 VulkanDeviceQueue* device_queue_ = nullptr;
51 VkSampler handle_ = VK_NULL_HANDLE;
52
53 DISALLOW_COPY_AND_ASSIGN(VulkanSampler);
54 };
55
56 } // namespace gpu
57
58 #endif // GPU_VULKAN_VULKAN_SAMPLER_H_
OLDNEW
« no previous file with comments | « gpu/vulkan/vulkan_descriptor_set.cc ('k') | gpu/vulkan/vulkan_sampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698