From aa3e718fcdc3a3965ce3eb2ea991232c4fc7ee5c Mon Sep 17 00:00:00 2001
From: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Date: Fri, 22 Jun 2018 00:29:44 +0200
Subject: [PATCH] [dxvk] Add DxvkOptions struct for quick lookup of
 features/limits

---
 src/dxvk/dxvk_device.cpp |  8 ++++++++
 src/dxvk/dxvk_device.h   | 16 +++++++++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/src/dxvk/dxvk_device.cpp b/src/dxvk/dxvk_device.cpp
index bbee9403..7d6b395b 100644
--- a/src/dxvk/dxvk_device.cpp
+++ b/src/dxvk/dxvk_device.cpp
@@ -38,6 +38,14 @@ namespace dxvk {
     // executed before we destroy any resources.
     m_vkd->vkDeviceWaitIdle(m_vkd->device());
   }
+
+
+  DxvkDeviceOptions DxvkDevice::options() const {
+    DxvkDeviceOptions options;
+    options.maxNumDynamicUniformBuffers = m_properties.limits.maxDescriptorSetUniformBuffersDynamic;
+    options.maxNumDynamicStorageBuffers = m_properties.limits.maxDescriptorSetStorageBuffersDynamic;
+    return options;
+  }
   
   
   Rc<DxvkPhysicalBuffer> DxvkDevice::allocPhysicalBuffer(
diff --git a/src/dxvk/dxvk_device.h b/src/dxvk/dxvk_device.h
index 290b59d5..7da64143 100644
--- a/src/dxvk/dxvk_device.h
+++ b/src/dxvk/dxvk_device.h
@@ -26,6 +26,14 @@
 namespace dxvk {
   
   class DxvkInstance;
+
+  /**
+   * \brief Device options
+   */
+  struct DxvkDeviceOptions {
+    uint32_t maxNumDynamicUniformBuffers = 0;
+    uint32_t maxNumDynamicStorageBuffers = 0;
+  };
   
   /**
    * \brief Device queue
@@ -98,7 +106,7 @@ namespace dxvk {
     Rc<DxvkAdapter> adapter() const {
       return m_adapter;
     }
-    
+
     /**
      * \brief Enabled device extensions
      * \returns Enabled device extensions
@@ -115,6 +123,12 @@ namespace dxvk {
       return m_features;
     }
     
+    /**
+     * \brief Retrieves device options
+     * \returns Device options
+     */
+    DxvkDeviceOptions options() const;
+    
     /**
      * \brief Allocates a physical buffer
      *