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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/vulkan/vulkan_sampler.h
diff --git a/gpu/vulkan/vulkan_sampler.h b/gpu/vulkan/vulkan_sampler.h
new file mode 100644
index 0000000000000000000000000000000000000000..87889fe6c03a28b7a1e035cc1a344d4c93dc451b
--- /dev/null
+++ b/gpu/vulkan/vulkan_sampler.h
@@ -0,0 +1,58 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_VULKAN_VULKAN_SAMPLER_H_
+#define GPU_VULKAN_VULKAN_SAMPLER_H_
+
+#include <float.h>
+#include <vulkan/vulkan.h>
+
+#include "base/macros.h"
+#include "gpu/vulkan/vulkan_export.h"
+
+namespace gpu {
+
+class VulkanDeviceQueue;
+
+class VULKAN_EXPORT VulkanSampler {
+ public:
+ struct SamplerOptions {
+ SamplerOptions();
+ ~SamplerOptions();
+
+ VkFilter mag_filter = VK_FILTER_NEAREST;
+ VkFilter min_filter = VK_FILTER_NEAREST;
+ VkSamplerMipmapMode mipmap_mode = VK_SAMPLER_MIPMAP_MODE_NEAREST;
+ VkSamplerAddressMode address_mode_u = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
+ VkSamplerAddressMode address_mode_v = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
+ VkSamplerAddressMode address_mode_w = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
+ float mip_lod_bias = 0.0f;
+ bool anisotropy_enable = false;
+ float max_anisotropy = 1.0f;
+ bool compare_enable = false;
+ VkCompareOp compare_op = VK_COMPARE_OP_NEVER;
+ float min_lod = 0.0f;
+ float max_lod = FLT_MAX;
+ VkBorderColor border_color = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
+ bool unnormalized_coordinates = false;
+ };
+
+ explicit VulkanSampler(VulkanDeviceQueue* device_queue);
+ ~VulkanSampler();
+
+ bool Initialize(const SamplerOptions& options);
+ void Destroy();
+
+ VkSampler handle() const { return handle_; }
+
+ private:
+ VulkanDeviceQueue* device_queue_ = nullptr;
+ VkSampler handle_ = VK_NULL_HANDLE;
+
+ DISALLOW_COPY_AND_ASSIGN(VulkanSampler);
+};
+
+} // namespace gpu
+
+#endif // GPU_VULKAN_VULKAN_SAMPLER_H_
« 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