mirror of
https://github.com/libretro/RetroArch
synced 2025-02-17 06:40:57 +00:00
(RGL PS3) Cleanups
This commit is contained in:
parent
32604f0aa3
commit
d836be0273
ps3/rgl
@ -20,7 +20,7 @@ extern "C" {
|
||||
#define RGL_BOOLEAN_REGISTERS_COUNT 32
|
||||
|
||||
// parameter setter, prototype of functions called when a uniform is set.
|
||||
typedef void(*_cgSetFunction) (void *, const void* _RGL_RESTRICT);
|
||||
typedef void(*_cgSetFunction) (void *, const void*);
|
||||
typedef void(*_cgSetArrayIndexFunction) (void *, const void*, const int index);
|
||||
|
||||
typedef struct _CgUniform
|
||||
|
@ -6,7 +6,6 @@
|
||||
|
||||
namespace RGL
|
||||
{
|
||||
|
||||
template<class T> class Vector
|
||||
{
|
||||
public:
|
||||
|
@ -18,11 +18,7 @@
|
||||
|
||||
#define RGLGCM_BIG_ENDIAN
|
||||
|
||||
#if RGL_ENDIAN == RGL_BIG_ENDIAN
|
||||
#define ENDIAN_32(X, F) ((F) ? endianSwapWord(X) : (X))
|
||||
#else
|
||||
#define ENDIAN_32(X, F) (X)
|
||||
#endif
|
||||
|
||||
#define FRAGMENT_PROFILE_INDEX 1
|
||||
#define RGLP_MAX_TEXTURE_SIZE 4096
|
||||
@ -36,6 +32,9 @@
|
||||
#define RGLGCM_HOST_SIZE_DEFAULT (0)
|
||||
#define RGLGCM_TRANSIENT_ENTRIES_DEFAULT 64
|
||||
|
||||
// There are 6 clock domains, each with a maximum of 4 experiments, plus 4 elapsed exp.
|
||||
#define RGL_MAX_DPM_QUERIES (4 * 6 + 4)
|
||||
|
||||
// RSX semaphore allocation
|
||||
// 64-191 events
|
||||
// 192 fence implementation (independent of nv_glFence)
|
||||
@ -457,9 +456,6 @@ extern "C" {
|
||||
#define RGLBIT_FALSE(f,n) ((f) &= ~(1<<(n)))
|
||||
#define RGLBIT_ASSIGN(f,n,val) do { if(val) RGLBIT_TRUE(f,n); else RGLBIT_FALSE(f,n); } while(0)
|
||||
|
||||
#define ALIGN16 __attribute__((aligned (16)))
|
||||
#define _RGL_RESTRICT __restrict
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GLfloat R, G, B, A;
|
||||
@ -511,8 +507,7 @@ extern "C" {
|
||||
char *mallocData;
|
||||
GLsizei mallocStorageSize;
|
||||
GLenum dataState; // valid data location (see enum above)
|
||||
}
|
||||
rglImage;
|
||||
} rglImage;
|
||||
|
||||
// Raster data structure
|
||||
// This struct is used internally to define 3D raster data for writing
|
||||
@ -678,7 +673,7 @@ extern "C" {
|
||||
GLfloat value[4]; // constant attribute value
|
||||
GLuint frequency; // instancing divisor
|
||||
GLboolean normalized;
|
||||
} ALIGN16 rglAttribute;
|
||||
} __attribute__((aligned (16))) rglAttribute;
|
||||
|
||||
// state for the entire set of vertex attributes, plus
|
||||
// other AttribSet-encapsulated state.
|
||||
@ -694,7 +689,7 @@ extern "C" {
|
||||
unsigned int DirtyMask; // 1 == attribute has changed & needs updating
|
||||
unsigned int EnabledMask; // 1 == attribute is enabled for drawing
|
||||
unsigned int HasVBOMask; // 1 == attribute is in a VBO (ie server-side)
|
||||
} ALIGN16 rglAttributeState;
|
||||
} __attribute__((aligned (16))) rglAttributeState;
|
||||
|
||||
struct rglBufferObject
|
||||
{
|
||||
@ -716,7 +711,6 @@ extern "C" {
|
||||
#define RGL_CONTEXT_DEPTH_MASK 0x10
|
||||
#define RGL_CONTEXT_COLOR_MASK 0x0F
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
RGL_CONTEXT_ACTIVE_SURFACE_COLOR0,
|
||||
@ -728,8 +722,6 @@ extern "C" {
|
||||
RGL_CONTEXT_ACTIVE_SURFACES
|
||||
};
|
||||
|
||||
#define rglELEMENTS_IN_MATRIX 16 // 4x4
|
||||
|
||||
typedef struct rglNameSpace
|
||||
{
|
||||
void** data;
|
||||
@ -748,9 +740,6 @@ extern "C" {
|
||||
rglTexNameSpaceDestroyFunction destroy;
|
||||
} rglTexNameSpace;
|
||||
|
||||
// There are 6 clock domains, each with a maximum of 4 experiments, plus 4 elapsed exp.
|
||||
#define RGL_MAX_DPM_QUERIES (4 * 6 + 4)
|
||||
|
||||
struct RGLcontext
|
||||
{
|
||||
GLenum error;
|
||||
@ -821,7 +810,6 @@ extern "C" {
|
||||
rglNameSpace cgParameterNameSpace;
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#include "Types.h"
|
||||
#include "../export/RGL/export.h"
|
||||
#include "platform.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -53,7 +52,6 @@ GLboolean rglTexNameSpaceIsName(void *data, GLuint name );
|
||||
void rglTexNameSpaceDeleteNames(void *data, GLsizei n, const GLuint *names );
|
||||
void rglTexNameSpaceReinit(void *saved, void *active);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -1,12 +0,0 @@
|
||||
#ifndef _PLATFORM_H
|
||||
#define _PLATFORM_H
|
||||
|
||||
#include "../export/RGL/rgl.h"
|
||||
|
||||
#define RGL_LITTLE_ENDIAN 0x1234
|
||||
#define RGL_BIG_ENDIAN 0x4321
|
||||
|
||||
#define RGL_ENDIAN RGL_BIG_ENDIAN
|
||||
#define RGL_ALIGN_FAST_TRANSFER 128
|
||||
|
||||
#endif
|
@ -2,6 +2,17 @@
|
||||
#define gcm_emit_method_at(buffer, location, method, n) gcm_emit_at((buffer),(location), (method) |((n) << 18))
|
||||
#define gcm_finish_n_commands(buffer, n) (buffer) += n
|
||||
|
||||
#define SUBPIXEL_BITS 12
|
||||
#define SUBPIXEL_ADJUST (0.5/(1<<SUBPIXEL_BITS))
|
||||
#define BLOCKSIZE_MAX_DIMENSIONS 1024
|
||||
|
||||
#define CL0039_MIN_PITCH -32768
|
||||
#define CL0039_MAX_PITCH 32767
|
||||
#define CL0039_MAX_LINES 0x3fffff
|
||||
#define CL0039_MAX_ROWS 0x7ff
|
||||
|
||||
#define RGLGCM_UTIL_LABEL_INDEX 253
|
||||
|
||||
static inline GLuint rglPlatformGetBitsPerPixel (GLenum internalFormat)
|
||||
{
|
||||
switch (internalFormat)
|
||||
@ -27,7 +38,8 @@ static inline GLuint rglPlatformGetBitsPerPixel (GLenum internalFormat)
|
||||
}
|
||||
}
|
||||
|
||||
static inline void rglGcmSetVertexProgramParameterBlock(struct CellGcmContextData *thisContext, uint32_t baseConst, uint32_t constCount, const float * __restrict value)
|
||||
static inline void rglGcmSetVertexProgramParameterBlock(struct CellGcmContextData *thisContext,
|
||||
uint32_t baseConst, uint32_t constCount, const float * __restrict value)
|
||||
{
|
||||
uint32_t blockCount, blockRemain, i;
|
||||
|
||||
@ -107,9 +119,6 @@ static inline void rglGcmSetInlineTransfer(struct CellGcmContextData *thisContex
|
||||
}
|
||||
}
|
||||
|
||||
#define SUBPIXEL_BITS 12
|
||||
#define SUBPIXEL_ADJUST (0.5/(1<<SUBPIXEL_BITS))
|
||||
|
||||
#define rglGcmSwap16Float32(fp, f) \
|
||||
{ \
|
||||
union SwapF32_16 \
|
||||
@ -728,7 +737,6 @@ static inline void rglGcmFifoGlViewport(void *data, GLclampf zNear, GLclampf zFa
|
||||
clipY1 - clipY0, zNear, zFar, scale, offset );
|
||||
}
|
||||
|
||||
#define BLOCKSIZE_MAX_DIMENSIONS 1024
|
||||
|
||||
static inline void rglGcmSetTransferImage(struct CellGcmContextData *thisContext, uint8_t mode, uint32_t dstOffset, uint32_t dstPitch, uint32_t dstX, uint32_t dstY, uint32_t srcOffset, uint32_t srcPitch, uint32_t srcX, uint32_t srcY, uint32_t width, uint32_t height, uint32_t bytesPerPixel)
|
||||
{
|
||||
@ -902,7 +910,6 @@ static inline void RGLGCM_CALC_COLOR_LE_ARGB8( GLuint *color0, const GLfloat r,
|
||||
*color0 = ( a2 << 24 ) | ( r2 << 16 ) | ( g2 << 8 ) | ( b2 << 0 );
|
||||
}
|
||||
|
||||
#define RGLGCM_UTIL_LABEL_INDEX 253
|
||||
|
||||
// Utility to let RSX wait for complete RSX pipeline idle
|
||||
static inline void rglGcmUtilWaitForIdle (void)
|
||||
@ -956,11 +963,6 @@ static inline void rglPrintFifoFromGet( unsigned int numWords )
|
||||
rglPrintIt((( uint32_t* )rglGcmState_i.fifo.lastGetRead )[i] );
|
||||
}
|
||||
|
||||
#define CL0039_MIN_PITCH -32768
|
||||
#define CL0039_MAX_PITCH 32767
|
||||
#define CL0039_MAX_LINES 0x3fffff
|
||||
#define CL0039_MAX_ROWS 0x7ff
|
||||
|
||||
static inline void rglGcmTransferData
|
||||
(
|
||||
GLuint dstId,
|
||||
|
@ -30,13 +30,7 @@
|
||||
#include <Cg/CgCommon.h>
|
||||
|
||||
// endian swapping of the fragment uniforms, if necessary
|
||||
#if RGL_ENDIAN == RGL_BIG_ENDIAN
|
||||
#define SWAP_IF_BIG_ENDIAN(arg) endianSwapWordByHalf(arg)
|
||||
#elif RGL_ENDIAN == RGL_LITTLE_ENDIAN
|
||||
#define SWAP_IF_BIG_ENDIAN(arg) arg
|
||||
#else
|
||||
#error include missing for endianness
|
||||
#endif
|
||||
|
||||
void rglPsglPlatformInit (void *data);
|
||||
void rglPsglPlatformExit (void);
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
#include <ppu_intrinsics.h>
|
||||
|
||||
#include <RGL/platform.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
@ -25,11 +24,7 @@
|
||||
MEMORY MANAGER
|
||||
============================================================ */
|
||||
|
||||
#if RGL_ENDIAN == RGL_BIG_ENDIAN
|
||||
#define ENDIAN_32(X, F) ((F) ? endianSwapWord(X) : (X))
|
||||
#else
|
||||
#define ENDIAN_32(X, F) (X)
|
||||
#endif
|
||||
|
||||
int _parameterAlloc = 0;
|
||||
int _ucodeAlloc = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user