st/nine: Refactor how user constbufs sizes are calculated
[mesa.git] / src / gallium / state_trackers / hgl / hgl_context.h
1 /*
2 * Copyright 2009-2014, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 * Alexander von Gluck IV, kallisti5@unixzen.com
7 */
8 #ifndef HGL_CONTEXT_H
9 #define HGL_CONTEXT_H
10
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 #include "state_tracker/st_api.h"
16 #include "state_tracker/st_manager.h"
17 #include "pipe/p_compiler.h"
18 #include "pipe/p_screen.h"
19 #include "postprocess/filters.h"
20 #include "os/os_thread.h"
21
22 #include "bitmap_wrapper.h"
23 #ifdef __cplusplus
24 }
25 #endif
26
27
28 #define CONTEXT_MAX 32
29
30 typedef int64 context_id;
31
32
33 struct hgl_buffer
34 {
35 struct st_framebuffer_iface *stfbi;
36 struct st_visual* visual;
37
38 unsigned width;
39 unsigned height;
40 unsigned mask;
41
42 struct pipe_screen* screen;
43 enum pipe_texture_target target;
44 struct pipe_resource* textures[ST_ATTACHMENT_COUNT];
45
46 void *map;
47
48 //struct hgl_buffer *next; /**< next in linked list */
49 };
50
51
52 struct hgl_context
53 {
54 struct st_api* api;
55 // State Tracker API
56 struct st_manager* manager;
57 // State Tracker Manager
58 struct st_context_iface* st;
59 // State Tracker Interface Object
60 struct st_visual* stVisual;
61 // State Tracker Visual
62
63 struct pipe_screen* screen;
64
65 //struct pipe_resource* textures[ST_ATTACHMENT_COUNT];
66
67 // Post processing
68 struct pp_queue_t* postProcess;
69 unsigned int postProcessEnable[PP_FILTERS];
70
71 // Desired viewport size
72 unsigned width;
73 unsigned height;
74
75 Bitmap* bitmap;
76 color_space colorSpace;
77
78 pipe_mutex fbMutex;
79
80 struct hgl_buffer* draw;
81 struct hgl_buffer* read;
82 };
83
84
85 // hgl state_tracker framebuffer
86 struct hgl_buffer* hgl_create_st_framebuffer(struct hgl_context* context);
87
88 // hgl state_tracker manager
89 struct st_manager* hgl_create_st_manager(struct hgl_context* screen);
90 void hgl_destroy_st_manager(struct st_manager *manager);
91
92 // hgl state_tracker visual
93 struct st_visual* hgl_create_st_visual(ulong options);
94 void hgl_destroy_st_visual(struct st_visual* visual);
95
96
97 #endif /* HGL_CONTEXT_H */