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

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: 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
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..f234b9374e9e3b74f5fc21a36cdc8e6a557de1d2
--- /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 = 0.0f;
piman 2016/05/18 19:02:18 nit: 1.0f (values < 1.0f don't really make sense)
David Yen 2016/05/18 21:08:35 Done.
+ 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_

Powered by Google App Engine
This is Rietveld 408576698