u_upload_mgr: pass alignment to u_upload_data manually
[mesa.git] / src / gallium / state_trackers / nine / device9.h
index 9dc248e64fbd5c9964148b02f513989ad0d4674c..cbc1e61f5db662197b118ee1659fb7f67df7890c 100644 (file)
@@ -42,13 +42,12 @@ struct u_upload_mgr;
 struct NineSwapChain9;
 struct NineStateBlock9;
 
-#include "util/u_double_list.h"
+#include "util/list.h"
 
 struct NineDevice9
 {
     struct NineUnknown base;
     boolean ex;
-    D3DDISPLAYMODEEX *pFullscreenDisplayMode;
 
     /* G3D context */
     struct pipe_screen *screen;
@@ -70,6 +69,7 @@ struct NineDevice9
     struct nine_state state;   /* device state */
 
     struct list_head update_textures;
+    struct list_head managed_textures;
 
     boolean is_recording;
     boolean in_scene;
@@ -78,10 +78,14 @@ struct NineDevice9
 
     struct pipe_resource *constbuf_vs;
     struct pipe_resource *constbuf_ps;
+    uint16_t vs_const_size;
+    uint16_t ps_const_size;
     uint16_t max_vs_const_f;
     uint16_t max_ps_const_f;
-    uint32_t vs_bool_true;
-    uint32_t ps_bool_true;
+
+    struct pipe_resource *dummy_texture;
+    struct pipe_sampler_view *dummy_sampler_view;
+    struct pipe_sampler_state dummy_sampler_state;
 
     struct gen_mipmap_state *gen_mipmap;
 
@@ -111,16 +115,30 @@ struct NineDevice9
     struct {
         boolean user_vbufs;
         boolean user_ibufs;
+        boolean user_cbufs;
         boolean window_space_position_support;
+        boolean vs_integer;
+        boolean ps_integer;
     } driver_caps;
 
-    struct u_upload_mgr *upload;
+    struct {
+        boolean buggy_barycentrics;
+    } driver_bugs;
+
+    struct u_upload_mgr *vertex_uploader;
+    struct u_upload_mgr *index_uploader;
+    struct u_upload_mgr *constbuf_uploader;
+    unsigned constbuf_alignment;
 
     struct nine_range_pool range_pool;
 
     struct hud_context *hud; /* NULL if hud is disabled */
+
+    /* dummy vbo (containing 0 0 0 0) to bind if vertex shader input
+     * is not bound to anything by the vertex declaration */
+    struct pipe_resource *dummy_vbo;
 };
-static INLINE struct NineDevice9 *
+static inline struct NineDevice9 *
 NineDevice9( void *data )
 {
     return (struct NineDevice9 *)data;
@@ -134,6 +152,8 @@ NineDevice9_new( struct pipe_screen *pScreen,
                  IDirect3D9 *pD3D9,
                  ID3DPresentGroup *pPresentationGroup,
                  struct d3dadapter9_context *pCTX,
+                 boolean ex,
+                 D3DDISPLAYMODEEX *pFullscreenDisplayMode,
                  struct NineDevice9 **ppOut );
 
 HRESULT
@@ -145,7 +165,9 @@ NineDevice9_ctor( struct NineDevice9 *This,
                   D3DPRESENT_PARAMETERS *pPresentationParameters,
                   IDirect3D9 *pD3D9,
                   ID3DPresentGroup *pPresentationGroup,
-                  struct d3dadapter9_context *pCTX );
+                  struct d3dadapter9_context *pCTX,
+                  boolean ex,
+                  D3DDISPLAYMODEEX *pFullscreenDisplayMode );
 
 void
 NineDevice9_dtor( struct NineDevice9 *This );
@@ -164,10 +186,6 @@ NineDevice9_GetCSO( struct NineDevice9 *This );
 const D3DCAPS9 *
 NineDevice9_GetCaps( struct NineDevice9 *This );
 
-/* Mask: 0x1 = constant buffers, 0x2 = stipple */
-void
-NineDevice9_RestoreNonCSOState( struct NineDevice9 *This, unsigned mask );
-
 /*** Direct3D public ***/
 
 HRESULT WINAPI