(RGL PS3) Cleanups...

This commit is contained in:
twinaphex 2014-02-19 01:27:19 +01:00
parent f8ce4734ee
commit 80c506cbeb
6 changed files with 25 additions and 20 deletions

View File

@ -3,7 +3,6 @@
#include "cgbdefs.hpp"
#include <iostream>
#include <string>
#include <vector>
#include <cstddef>

View File

@ -1,3 +1,6 @@
#ifndef _RGL_EXTERNS_H
#define _RGL_EXTERNS_H
GLboolean rglGcmFifoReferenceInUse (void *data, GLuint reference);
GLuint rglGcmFifoPutReference (void *data);
void rglGcmGetTileRegionInfo (void *data, GLuint *address, GLuint *size);
@ -7,3 +10,5 @@ int32_t rglOutOfSpaceCallback (void *data, uint32_t spaceInWords);
void rglGcmFifoGlSetRenderTarget (const void *args);
void rglCreatePushBuffer (void *data);
void rglGcmFreeTiledSurface (GLuint bufferId);
#endif

View File

@ -1,3 +1,6 @@
#ifndef _RGL_INLINE_H
#define _RGL_INLINE_H
#define gcm_emit_at(buffer, location, word) ((buffer)[(location)] = (word))
#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
@ -664,3 +667,5 @@ static inline void rglGcmTransferData
gcm_emit_at(thisContext->current, 1, 0);
gcm_finish_n_commands(thisContext->current, 2);
}
#endif

View File

@ -1,3 +1,6 @@
#ifndef _RGL_TYPEDEFS_H
#define _RGL_TYPEDEFS_H
#include "../include/export/RGL/rgl.h"
#include "../include/RGL/Types.h"
@ -349,28 +352,20 @@ struct rglGcmState
char *localAddress;
// host memory window the gpu can access
void *hostMemoryBase;
GLuint hostMemorySize;
void *hostMemoryBase;
GLuint hostMemorySize;
// semaphores
rglGcmSemaphoreMemory *semaphores;
rglGcmSemaphoreMemory *semaphores;
// -- context state --
// fifo
rglGcmFifo fifo;
// rendering target
rglGcmRenderTarget renderTarget;
// state
rglGcmCachedState state;
// Cell Gcm Config
CellGcmConfig config;
// to use as the back end label value when syncing before cellGcmSetTile, SetZCull, and SetInvalidateTile.
GLuint labelValue;
CellGcmConfig config;
GLuint labelValue;
};
extern rglGcmState rglGcmState_i;
#endif

View File

@ -32,6 +32,10 @@
// endian swapping of the fragment uniforms, if necessary
#define SWAP_IF_BIG_ENDIAN(arg) endianSwapWordByHalf(arg)
#ifdef __cplusplus
extern "C" {
#endif
void rglPsglPlatformInit (void *data);
void rglPsglPlatformExit (void);
@ -39,9 +43,6 @@ RGL_EXPORT RGLdevice* rglPlatformCreateDeviceAuto( GLenum colorFormat, GLenum de
RGL_EXPORT RGLdevice* rglPlatformCreateDeviceExtended (const void *data);
RGL_EXPORT GLfloat rglPlatformGetDeviceAspectRatio (const void *data);
#ifdef __cplusplus
extern "C" {
#endif
char *rglPlatformBufferObjectMapTextureReference(void *data, GLenum access);
GLboolean rglPlatformBufferObjectUnmapTextureReference (void *data);

View File

@ -1909,7 +1909,7 @@ static int rglGcmInitRM( rglGcmResource *gcmResource, int inSysMem, unsigned int
// cause a problem fetching invalid addresses at the end of the push buffer.
gcmResource->hostMemorySize = rglPad( RGLGCM_FIFO_SIZE + dmaPushBufferSize + RGLGCM_DMA_PUSH_BUFFER_PREFETCH_PADDING + (RGLGCM_LM_MAX_TOTAL_QUERIES * sizeof( GLuint )), 1 << 20 );
if ( gcmResource->hostMemorySize > 0 )
if (gcmResource->hostMemorySize)
gcmResource->hostMemoryBase = (char *)memalign( 1 << 20, gcmResource->hostMemorySize );
// Initialize RSXIF