Path: blob/21.2-virgl/src/gallium/frontends/hgl/hgl_context.h
4561 views
/*1* Copyright 2009-2014, Haiku, Inc. All Rights Reserved.2* Distributed under the terms of the MIT License.3*4* Authors:5* Alexander von Gluck IV, [email protected]6*/7#ifndef HGL_CONTEXT_H8#define HGL_CONTEXT_H910#include "os/os_thread.h"11#include "pipe/p_format.h"12#include "pipe/p_compiler.h"13#include "pipe/p_screen.h"14#include "postprocess/filters.h"1516#include "frontend/api.h"1718#include "bitmap_wrapper.h"192021#ifdef __cplusplus22extern "C" {23#endif242526#define CONTEXT_MAX 322728typedef int64 context_id;293031struct hgl_buffer32{33struct st_framebuffer_iface *stfbi;34struct st_visual* visual;3536unsigned width;37unsigned height;38unsigned mask;3940struct pipe_screen* screen;41void* winsysContext;4243enum pipe_texture_target target;44struct pipe_resource* textures[ST_ATTACHMENT_COUNT];4546void *map;47};484950struct hgl_display51{52mtx_t mutex;5354struct st_api* api;55struct st_manager* manager;56};575859struct hgl_context60{61struct hgl_display* display;62struct st_context_iface* st;63struct st_visual* stVisual;6465// Post processing66struct pp_queue_t* postProcess;67unsigned int postProcessEnable[PP_FILTERS];6869// Desired viewport size70unsigned width;71unsigned height;7273mtx_t fbMutex;7475struct hgl_buffer* buffer;76};7778// hgl_buffer from statetracker interface79struct hgl_buffer* hgl_st_framebuffer(struct st_framebuffer_iface *stfbi);8081// hgl frontend82struct st_api* hgl_create_st_api(void);8384// hgl framebuffer85struct hgl_buffer* hgl_create_st_framebuffer(struct hgl_context* context, void *winsysContext);86void hgl_destroy_st_framebuffer(struct hgl_buffer *buffer);8788// hgl manager89struct st_manager* hgl_create_st_manager(struct hgl_context* screen);90void hgl_destroy_st_manager(struct st_manager *manager);9192// hgl visual93struct st_visual* hgl_create_st_visual(ulong options);94void hgl_destroy_st_visual(struct st_visual* visual);9596// hgl display97struct hgl_display* hgl_create_display(struct pipe_screen* screen);98void hgl_destroy_display(struct hgl_display *display);99100101#ifdef __cplusplus102}103#endif104105#endif /* HGL_CONTEXT_H */106107108