VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/shaderlib/shaderlib.h@ 98103

Last change on this file since 98103 was 98103, checked in by vboxsync, 23 months ago

Copyright year updates by scm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.8 KB
Line 
1/* $Id: shaderlib.h 98103 2023-01-17 14:15:46Z vboxsync $ */
2/** @file
3 * shaderlib -- interface to WINE's Direct3D shader functions
4 */
5
6/*
7 * Copyright (C) 2014-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef VBOX_INCLUDED_SRC_Graphics_shaderlib_shaderlib_h
29#define VBOX_INCLUDED_SRC_Graphics_shaderlib_shaderlib_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34#include <VBox/cdefs.h>
35
36RT_C_DECLS_BEGIN
37
38#ifdef IN_SHADERLIB_STATIC
39# define SHADERDECL(type) DECLHIDDEN(type) RTCALL
40#else
41# define SHADERDECL(type) DECLEXPORT(type) RTCALL
42#endif
43
44/** Pointer to shaderlib callback interface. */
45typedef struct VBOXVMSVGASHADERIF *PVBOXVMSVGASHADERIF;
46/**
47 * Interface the shader lib can use to talk back to the VBox VMSVGA OGL 3D code.
48 */
49typedef struct VBOXVMSVGASHADERIF
50{
51 /**
52 * Switches the initialization profile in builds where we have to juggle two
53 * OpenGL profiles to gather all the data (i.e. mac os x).
54 *
55 * @param pThis Pointer to this structure.
56 * @param fOtherProfile If set, switch to the non-default profile. If
57 * clear, switch back to the default profile.
58 */
59 DECLCALLBACKMEMBER(void, pfnSwitchInitProfile,(PVBOXVMSVGASHADERIF pThis, bool fOtherProfile));
60
61 /**
62 * Extension enumeration function.
63 *
64 * @param pThis Pointer to this structure.
65 * @param ppvEnumCtx Pointer to a void point that's initialized to NULL
66 * before the first call.
67 * @param pszBuf Where to store the extension name. Garbled on
68 * overflow (we assume no overflow).
69 * @param cbBuf The size of the buffer @a pszBuf points to.
70 * @param fOtherProfile Indicates which profile to get extensions from,
71 * we'll use the default profile if CLEAR and the
72 * non-default if SET.
73 */
74 DECLCALLBACKMEMBER(bool, pfnGetNextExtension,(PVBOXVMSVGASHADERIF pThis, void **ppvEnumCtx, char *pszBuf, size_t cbBuf,
75 bool fOtherProfile));
76} VBOXVMSVGASHADERIF;
77
78SHADERDECL(int) ShaderInitLib(PVBOXVMSVGASHADERIF pVBoxShaderIf);
79SHADERDECL(int) ShaderDestroyLib(void);
80
81SHADERDECL(int) ShaderContextCreate(void **ppShaderContext);
82SHADERDECL(int) ShaderContextDestroy(void *pShaderContext);
83
84SHADERDECL(int) ShaderCreateVertexShader(void *pShaderContext, const uint32_t *pShaderData, uint32_t cbShaderData, void **pShaderObj);
85SHADERDECL(int) ShaderCreatePixelShader(void *pShaderContext, const uint32_t *pShaderData, uint32_t cbShaderData, void **pShaderObj);
86
87SHADERDECL(int) ShaderDestroyVertexShader(void *pShaderContext, void *pShaderObj);
88SHADERDECL(int) ShaderDestroyPixelShader(void *pShaderContext, void *pShaderObj);
89
90SHADERDECL(int) ShaderSetVertexShader(void *pShaderContext, void *pShaderObj);
91SHADERDECL(int) ShaderSetPixelShader(void *pShaderContext, void *pShaderObj);
92
93SHADERDECL(int) ShaderSetVertexShaderConstantB(void *pShaderContext, uint32_t reg, const uint8_t *pValues, uint32_t cRegisters);
94SHADERDECL(int) ShaderSetVertexShaderConstantI(void *pShaderContext, uint32_t reg, const int32_t *pValues, uint32_t cRegisters);
95SHADERDECL(int) ShaderSetVertexShaderConstantF(void *pShaderContext, uint32_t reg, const float *pValues, uint32_t cRegisters);
96
97SHADERDECL(int) ShaderSetPixelShaderConstantB(void *pShaderContext, uint32_t reg, const uint8_t *pValues, uint32_t cRegisters);
98SHADERDECL(int) ShaderSetPixelShaderConstantI(void *pShaderContext, uint32_t reg, const int32_t *pValues, uint32_t cRegisters);
99SHADERDECL(int) ShaderSetPixelShaderConstantF(void *pShaderContext, uint32_t reg, const float *pValues, uint32_t cRegisters);
100
101SHADERDECL(int) ShaderSetPositionTransformed(void *pShaderContext, unsigned cxViewPort, unsigned cyViewPort, bool fPreTransformed);
102
103SHADERDECL(int) ShaderUpdateState(void *pShaderContext, uint32_t rtHeight);
104
105SHADERDECL(int) ShaderTransformProjection(unsigned cxViewPort, unsigned cyViewPort, float matrix[16], bool fPretransformed);
106
107RT_C_DECLS_END
108
109#endif /* !VBOX_INCLUDED_SRC_Graphics_shaderlib_shaderlib_h */
110
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette