1 | /* $Id: shaderlib.h 85121 2020-07-08 19:33:26Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * shaderlib -- interface to WINE's Direct3D shader functions
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2014-2020 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | #ifndef VBOX_INCLUDED_SRC_Graphics_shaderlib_shaderlib_h
|
---|
19 | #define VBOX_INCLUDED_SRC_Graphics_shaderlib_shaderlib_h
|
---|
20 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
21 | # pragma once
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | #include <VBox/cdefs.h>
|
---|
25 |
|
---|
26 | RT_C_DECLS_BEGIN
|
---|
27 |
|
---|
28 | #ifdef IN_SHADERLIB_STATIC
|
---|
29 | # define SHADERDECL(type) DECLHIDDEN(type) RTCALL
|
---|
30 | #else
|
---|
31 | # define SHADERDECL(type) DECLEXPORT(type) RTCALL
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | /** Pointer to shaderlib callback interface. */
|
---|
35 | typedef struct VBOXVMSVGASHADERIF *PVBOXVMSVGASHADERIF;
|
---|
36 | /**
|
---|
37 | * Interface the shader lib can use to talk back to the VBox VMSVGA OGL 3D code.
|
---|
38 | */
|
---|
39 | typedef struct VBOXVMSVGASHADERIF
|
---|
40 | {
|
---|
41 | /**
|
---|
42 | * Switches the initialization profile in builds where we have to juggle two
|
---|
43 | * OpenGL profiles to gather all the data (i.e. mac os x).
|
---|
44 | *
|
---|
45 | * @param pThis Pointer to this structure.
|
---|
46 | * @param fOtherProfile If set, switch to the non-default profile. If
|
---|
47 | * clear, switch back to the default profile.
|
---|
48 | */
|
---|
49 | DECLCALLBACKMEMBER(void, pfnSwitchInitProfile,(PVBOXVMSVGASHADERIF pThis, bool fOtherProfile));
|
---|
50 |
|
---|
51 | /**
|
---|
52 | * Extension enumeration function.
|
---|
53 | *
|
---|
54 | * @param pThis Pointer to this structure.
|
---|
55 | * @param ppvEnumCtx Pointer to a void point that's initialized to NULL
|
---|
56 | * before the first call.
|
---|
57 | * @param pszBuf Where to store the extension name. Garbled on
|
---|
58 | * overflow (we assume no overflow).
|
---|
59 | * @param cbBuf The size of the buffer @a pszBuf points to.
|
---|
60 | * @param fOtherProfile Indicates which profile to get extensions from,
|
---|
61 | * we'll use the default profile if CLEAR and the
|
---|
62 | * non-default if SET.
|
---|
63 | */
|
---|
64 | DECLCALLBACKMEMBER(bool, pfnGetNextExtension,(PVBOXVMSVGASHADERIF pThis, void **ppvEnumCtx, char *pszBuf, size_t cbBuf,
|
---|
65 | bool fOtherProfile));
|
---|
66 | } VBOXVMSVGASHADERIF;
|
---|
67 |
|
---|
68 | SHADERDECL(int) ShaderInitLib(PVBOXVMSVGASHADERIF pVBoxShaderIf);
|
---|
69 | SHADERDECL(int) ShaderDestroyLib(void);
|
---|
70 |
|
---|
71 | SHADERDECL(int) ShaderContextCreate(void **ppShaderContext);
|
---|
72 | SHADERDECL(int) ShaderContextDestroy(void *pShaderContext);
|
---|
73 |
|
---|
74 | SHADERDECL(int) ShaderCreateVertexShader(void *pShaderContext, const uint32_t *pShaderData, uint32_t cbShaderData, void **pShaderObj);
|
---|
75 | SHADERDECL(int) ShaderCreatePixelShader(void *pShaderContext, const uint32_t *pShaderData, uint32_t cbShaderData, void **pShaderObj);
|
---|
76 |
|
---|
77 | SHADERDECL(int) ShaderDestroyVertexShader(void *pShaderContext, void *pShaderObj);
|
---|
78 | SHADERDECL(int) ShaderDestroyPixelShader(void *pShaderContext, void *pShaderObj);
|
---|
79 |
|
---|
80 | SHADERDECL(int) ShaderSetVertexShader(void *pShaderContext, void *pShaderObj);
|
---|
81 | SHADERDECL(int) ShaderSetPixelShader(void *pShaderContext, void *pShaderObj);
|
---|
82 |
|
---|
83 | SHADERDECL(int) ShaderSetVertexShaderConstantB(void *pShaderContext, uint32_t reg, const uint8_t *pValues, uint32_t cRegisters);
|
---|
84 | SHADERDECL(int) ShaderSetVertexShaderConstantI(void *pShaderContext, uint32_t reg, const int32_t *pValues, uint32_t cRegisters);
|
---|
85 | SHADERDECL(int) ShaderSetVertexShaderConstantF(void *pShaderContext, uint32_t reg, const float *pValues, uint32_t cRegisters);
|
---|
86 |
|
---|
87 | SHADERDECL(int) ShaderSetPixelShaderConstantB(void *pShaderContext, uint32_t reg, const uint8_t *pValues, uint32_t cRegisters);
|
---|
88 | SHADERDECL(int) ShaderSetPixelShaderConstantI(void *pShaderContext, uint32_t reg, const int32_t *pValues, uint32_t cRegisters);
|
---|
89 | SHADERDECL(int) ShaderSetPixelShaderConstantF(void *pShaderContext, uint32_t reg, const float *pValues, uint32_t cRegisters);
|
---|
90 |
|
---|
91 | SHADERDECL(int) ShaderSetPositionTransformed(void *pShaderContext, unsigned cxViewPort, unsigned cyViewPort, bool fPreTransformed);
|
---|
92 |
|
---|
93 | SHADERDECL(int) ShaderUpdateState(void *pShaderContext, uint32_t rtHeight);
|
---|
94 |
|
---|
95 | SHADERDECL(int) ShaderTransformProjection(unsigned cxViewPort, unsigned cyViewPort, float matrix[16], bool fPretransformed);
|
---|
96 |
|
---|
97 | RT_C_DECLS_END
|
---|
98 |
|
---|
99 | #endif /* !VBOX_INCLUDED_SRC_Graphics_shaderlib_shaderlib_h */
|
---|
100 |
|
---|