File: spursConfiguration.h

package info (click to toggle)
openmohaa 0.82.1%2Bdfsg-1
  • links: PTS, VCS
  • area: contrib
  • in suites: forky, sid
  • size: 34,192 kB
  • sloc: cpp: 315,720; ansic: 275,789; sh: 312; xml: 246; asm: 141; makefile: 7
file content (96 lines) | stat: -rw-r--r-- 3,145 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/* [SCE CONFIDENTIAL DOCUMENT]
 * PLAYSTATION(R)3 SPU Optimized Bullet Physics Library (http://bulletphysics.com)
 *                Copyright (C) 2007 Sony Computer Entertainment Inc.
 *                                                All Rights Reserved.
 */

#ifndef __CELL_SPU_CONFIG
#define __CELL_SPU_CONFIG

#include <cell/spurs.h>

#ifdef __cplusplus
extern "C" { 
#endif

#define CELL_SPURS_DEFAULT_SPU_COUNT 1

// "-Wl,--whole-archive -lprof_stub -Wl,--no-whole-archive"

enum CellSpursReturn {
	CELL_SPURS_OK=0,
	CELL_SPURS_EBUSY,
	CELL_SPURS_EINVAL,
	CELL_SPURS_EMISC
};

/**
 * \brief This class controls the SPU usage of SPURS
 *
 * There are three ways to initialize SPU usage.  
 *
 * The first way is to initialize SPURS yourself, and to pass in a pointer to
 * SPURS as well as priorities for the use of the SPUs, using initWithSpurs.
 * This is good if you intend to use SPURS elsewhere in your code, the management
 * can be shared across all processes.
 *
 * The second way is to control the number of SPUs used by SPURS with
 * initWithSpuCount.  Software will create its own instance of SPURS when it needs
 * it using that maximum number of SPUs.
 *
 * If you do neither of the two, Software will create its own instance of SPURS when
 * it needs it using CELL_SPURS_DEFAULT_SPU_COUNT SPUs.
 *
 * terminate() can be used to either detatch from an existing SPURS or to
 * terminate the Software-created SPURS.  Note that this will only work if all collision
 * scenes have been destroyed, otherwise SPURS would still be needed.
 *
 * Creating a new scene will cause SPURS to re-initialize.
 *
 * isSpursInitialized can be used to query whether software is currently using SPURS.
 *
 **/

/**
 * \brief Initializes SPUs given a pre-configured SPURS.
 * \param[in] pSpurs            A pointer to SPURS
 * \param[in] iSPUCount         The number of SPUs
 * \param[in] auiPriorities     The priorities for the code to use
 * \return Return is:
 * CELL_SPURS_OK on success
 * CELL_SPURS_EBUSY if SPU usage has already been initialized
 * CELL_SPURS_EINVAL if the priorities or SPURS pointer is invalid.
 */
int spursConfiguration_initWithSpurs(CellSpurs *pSpurs, int iSPUCount, uint8_t auiPriorities[8]);

/**
 * \brief Sets the number of SPUs to be used by a software-initialized SPURS.
 * \param[in] iSPUCount         A valid value is in the range 1-6
 * \return Return is:
 * CELL_SPURS_OK on success
 * CELL_SPURS_EBUSY if SPU usage has already been initialized
 * CELL_SPURS_EINVAL if iSPUCount is out of range or if SPURS couldn't be
 *   initialized to that many SPUs.
 */
int spursConfiguration_initWithSpuCount(int iSPUCount);

/**
 * \brief Terminates (or disconnects from) SPURS.
 * \return Return is:
 * CELL_SPURS_OK if SPURS terminates ok, or if it was previously terminated/
 *   never initialized.
 * CELL_SPURS_EBUSY if there are existing Scenes which would need SPURS.
 */
int spursConfiguration_terminate();

/**
 * \brief Queries whether SPU usage has been initialized.
 * \return True if initialized.
 */
bool spursConfiguration_isSpursInitialized();

#ifdef __cplusplus
}
#endif

#endif //__CELL_SPU_CONFIG