1 | /* $Id: shaderlib.h 59741 2016-02-19 15:11:35Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * shaderlib -- interface to WINE's Direct3D shader functions
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2014-2015 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 |
|
---|
19 | #ifndef ___shaderlib_h___
|
---|
20 | #define ___shaderlib_h___
|
---|
21 |
|
---|
22 | #include <VBox/cdefs.h>
|
---|
23 |
|
---|
24 | RT_C_DECLS_BEGIN
|
---|
25 |
|
---|
26 | #ifdef IN_SHADERLIB_STATIC
|
---|
27 | # define SHADERDECL(type) DECLHIDDEN(type) RTCALL
|
---|
28 | #else
|
---|
29 | # define SHADERDECL(type) DECLEXPORT(type) RTCALL
|
---|
30 | #endif
|
---|
31 |
|
---|
32 | /** Pointer to shaderlib callback interface. */
|
---|
33 | typedef struct VBOXVMSVGASHADERIF *PVBOXVMSVGASHADERIF;
|
---|
34 | /**
|
---|
35 | * Interface the shader lib can use to talk back to the VBox VMSVGA OGL 3D code.
|
---|
36 | */
|
---|
37 | typedef struct VBOXVMSVGASHADERIF
|
---|
38 | {
|
---|
39 | /**
|
---|
40 | * Switches the initialization profile in builds where we have to juggle two
|
---|
41 | * OpenGL profiles to gather all the data (i.e. mac os x).
|
---|
42 | *
|
---|
43 | * @param pThis Pointer to this structure.
|
---|
44 | * @param fOtherProfile If set, switch to the non-default profile. If
|
---|
45 | * clear, switch back to the default profile.
|
---|
46 | */
|
---|
47 | DECLCALLBACKMEMBER(void, pfnSwitchInitProfile)(PVBOXVMSVGASHADERIF pThis, bool fOtherProfile);
|
---|
48 |
|
---|
49 | /**
|
---|
50 | * Extension enumeration function.
|
---|
51 | *
|
---|
52 | * @param pThis Pointer to this structure.
|
---|
53 | * @param ppvEnumCtx Pointer to a void point that's initialized to NULL
|
---|
54 | * before the first call.
|
---|
55 | * @param pszBuf Where to store the extension name. Garbled on
|
---|
56 | * overflow (we assume no overflow).
|
---|
57 | * @param cbBuf The size of the buffer @a pszBuf points to.
|
---|
58 | * @param fOtherProfile Indicates which profile to get extensions from,
|
---|
59 | * we'll use the default profile if CLEAR and the
|
---|
60 | * non-default if SET.
|
---|
61 | */
|
---|
62 | DECLCALLBACKMEMBER(bool, pfnGetNextExtension)(PVBOXVMSVGASHADERIF pThis, void **ppvEnumCtx, char *pszBuf, size_t cbBuf,
|
---|
63 | bool fOtherProfile);
|
---|
64 | } VBOXVMSVGASHADERIF;
|
---|
65 |
|
---|
66 | SHADERDECL(int) ShaderInitLib(PVBOXVMSVGASHADERIF pVBoxShaderIf);
|
---|
67 | SHADERDECL(int) ShaderDestroyLib(void);
|
---|
68 |
|
---|
69 | SHADERDECL(int) ShaderContextCreate(void **ppShaderContext);
|
---|
70 | SHADERDECL(int) ShaderContextDestroy(void *pShaderContext);
|
---|
71 |
|
---|
72 | SHADERDECL(int) ShaderCreateVertexShader(void *pShaderContext, const uint32_t *pShaderData, void **pShaderObj);
|
---|
73 | SHADERDECL(int) ShaderCreatePixelShader(void *pShaderContext, const uint32_t *pShaderData, void **pShaderObj);
|
---|
74 |
|
---|
75 | SHADERDECL(int) ShaderDestroyVertexShader(void *pShaderContext, void *pShaderObj);
|
---|
76 | SHADERDECL(int) ShaderDestroyPixelShader(void *pShaderContext, void *pShaderObj);
|
---|
77 |
|
---|
78 | SHADERDECL(int) ShaderSetVertexShader(void *pShaderContext, void *pShaderObj);
|
---|
79 | SHADERDECL(int) ShaderSetPixelShader(void *pShaderContext, void *pShaderObj);
|
---|
80 |
|
---|
81 | SHADERDECL(int) ShaderSetVertexShaderConstantB(void *pShaderContext, uint32_t reg, const uint8_t *pValues, uint32_t cRegisters);
|
---|
82 | SHADERDECL(int) ShaderSetVertexShaderConstantI(void *pShaderContext, uint32_t reg, const int32_t *pValues, uint32_t cRegisters);
|
---|
83 | SHADERDECL(int) ShaderSetVertexShaderConstantF(void *pShaderContext, uint32_t reg, const float *pValues, uint32_t cRegisters);
|
---|
84 |
|
---|
85 | SHADERDECL(int) ShaderSetPixelShaderConstantB(void *pShaderContext, uint32_t reg, const uint8_t *pValues, uint32_t cRegisters);
|
---|
86 | SHADERDECL(int) ShaderSetPixelShaderConstantI(void *pShaderContext, uint32_t reg, const int32_t *pValues, uint32_t cRegisters);
|
---|
87 | SHADERDECL(int) ShaderSetPixelShaderConstantF(void *pShaderContext, uint32_t reg, const float *pValues, uint32_t cRegisters);
|
---|
88 |
|
---|
89 | SHADERDECL(int) ShaderSetPositionTransformed(void *pShaderContext, unsigned cxViewPort, unsigned cyViewPort, bool fPreTransformed);
|
---|
90 |
|
---|
91 | SHADERDECL(int) ShaderUpdateState(void *pShaderContext, uint32_t rtHeight);
|
---|
92 |
|
---|
93 | SHADERDECL(int) ShaderTransformProjection(unsigned cxViewPort, unsigned cyViewPort, float matrix[16], bool fPretransformed);
|
---|
94 |
|
---|
95 | RT_C_DECLS_END
|
---|
96 |
|
---|
97 | #endif /* !___shaderlib_h___ */
|
---|
98 |
|
---|