mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 17:47:12 -04:00
PS3: More manual GPU commands
This commit is contained in:
parent
cefb338e02
commit
f7dbe57966
@ -454,11 +454,7 @@ void Gfx_BeginFrame(void) {
|
||||
}
|
||||
|
||||
void Gfx_ClearBuffers(GfxBuffers buffers) {
|
||||
int targets = 0;
|
||||
if (buffers & GFX_BUFFER_COLOR) targets |= (GCM_CLEAR_R | GCM_CLEAR_G | GCM_CLEAR_B | GCM_CLEAR_A);
|
||||
if (buffers & GFX_BUFFER_DEPTH) targets |= (GCM_CLEAR_S | GCM_CLEAR_Z);
|
||||
|
||||
rsxClearSurface(context, targets);
|
||||
RSX_clear_buffers(context, buffers & GFX_BUFFER_COLOR, buffers & GFX_BUFFER_DEPTH);
|
||||
}
|
||||
|
||||
void Gfx_EndFrame(void) {
|
||||
|
@ -41,6 +41,7 @@ static CC_INLINE uint32_t* RSX_reserve_command(gcmContextData* context, uint32_t
|
||||
uint32_t* p = RSX_reserve_command(ctx, cmd, 1); \
|
||||
*p++ = value;
|
||||
|
||||
|
||||
/*########################################################################################################################*
|
||||
*-----------------------------------------------------Raster control------------------------------------------------------*
|
||||
*#########################################################################################################################*/
|
||||
@ -99,3 +100,33 @@ static CC_INLINE void RSX_set_alpha_blend(gcmContextData* ctx, int enabled) {
|
||||
static CC_INLINE void RSX_set_cull_face(gcmContextData* ctx, int enabled) {
|
||||
RSX_append_single_command(ctx, NV40TCL_CULL_FACE_ENABLE, enabled);
|
||||
}
|
||||
|
||||
|
||||
/*########################################################################################################################*
|
||||
*-----------------------------------------------------Vertex attributes---------------------------------------------------*
|
||||
*#########################################################################################################################*/
|
||||
/*static CC_INLINE void RSX_set_vertex_attrib_format(gcmContextData* ctx, int attrib, int format, int size, int stride) {
|
||||
uint32_t mask =
|
||||
RSX_MASK(NV40TCL_VTXFMT_TYPE_MASK, format) |
|
||||
RSX_MASK(NV40TCL_VTXFMT_SIZE_MASK, size) |
|
||||
RSX_MASK(NV40TCL_VTXFMT_STRIDE_MASK, stride);
|
||||
|
||||
RSX_append_single_command(ctx, NV40TCL_VTXFMT(attrib), mask);
|
||||
}
|
||||
|
||||
// NOTE: GCM_LOCATION_RSX implicitly assumed for location
|
||||
static CC_INLINE void RSX_set_vertex_attrib_pointer(gcmContextData* ctx, int attrib, uint32_t addr) {
|
||||
RSX_append_single_command(ctx, NV40TCL_VTXBUF_ADDRESS(attrib), addr);
|
||||
}*/
|
||||
|
||||
|
||||
/*########################################################################################################################*
|
||||
*------------------------------------------------------Buffer clearing----------------------------------------------------*
|
||||
*#########################################################################################################################*/
|
||||
static CC_INLINE void RSX_clear_buffers(gcmContextData* ctx, int color, int depth) {
|
||||
uint32_t targets = 0;
|
||||
if (color) targets |= (GCM_CLEAR_R | GCM_CLEAR_G | GCM_CLEAR_B | GCM_CLEAR_A);
|
||||
if (depth) targets |= (GCM_CLEAR_S | GCM_CLEAR_Z);
|
||||
|
||||
RSX_append_single_command(ctx, NV40TCL_CLEAR_BUFFERS, targets);
|
||||
}
|
||||
|
@ -342,7 +342,7 @@ void Gfx_BeginFrame(void) {
|
||||
|
||||
void Gfx_ClearBuffers(GfxBuffers buffers) {
|
||||
uint32_t* p = pb_begin();
|
||||
p = NV2A_start_clear(p, buffers & GFX_BUFFER_COLOR, buffers & GFX_BUFFER_DEPTH);
|
||||
p = NV2A_clear_buffers(p, buffers & GFX_BUFFER_COLOR, buffers & GFX_BUFFER_DEPTH);
|
||||
pb_end(p);
|
||||
|
||||
//pb_erase_text_screen();
|
||||
|
@ -221,18 +221,18 @@ static uint32_t* NV2A_reset_all_vertex_attribs(uint32_t* p) {
|
||||
return p;
|
||||
}
|
||||
|
||||
static uint32_t* NV2A_set_vertex_attrib_format(uint32_t* p, int index, int format, int size, int stride) {
|
||||
static uint32_t* NV2A_set_vertex_attrib_format(uint32_t* p, int attrib, int format, int size, int stride) {
|
||||
uint32_t mask =
|
||||
NV2A_MASK(NV097_SET_VERTEX_DATA_ARRAY_FORMAT_TYPE, format) |
|
||||
NV2A_MASK(NV097_SET_VERTEX_DATA_ARRAY_FORMAT_SIZE, size) |
|
||||
NV2A_MASK(NV097_SET_VERTEX_DATA_ARRAY_FORMAT_STRIDE, stride);
|
||||
|
||||
return NV2A_push1(p, NV097_SET_VERTEX_DATA_ARRAY_FORMAT + index * 4, mask);
|
||||
return NV2A_push1(p, NV097_SET_VERTEX_DATA_ARRAY_FORMAT + attrib * 4, mask);
|
||||
}
|
||||
|
||||
static uint32_t* NV2A_set_vertex_attrib_pointer(uint32_t* p, int index, cc_uint8* data) {
|
||||
static uint32_t* NV2A_set_vertex_attrib_pointer(uint32_t* p, int attrib, cc_uint8* data) {
|
||||
uint32_t offset = (uint32_t)data & 0x03ffffff;
|
||||
return NV2A_push1(p, NV097_SET_VERTEX_DATA_ARRAY_OFFSET + index * 4, offset);
|
||||
return NV2A_push1(p, NV097_SET_VERTEX_DATA_ARRAY_OFFSET + attrib * 4, offset);
|
||||
}
|
||||
|
||||
|
||||
@ -253,7 +253,7 @@ static CC_INLINE uint32_t* NV2A_set_clear_colour(uint32_t* p, uint32_t colour) {
|
||||
colour);
|
||||
}
|
||||
|
||||
static CC_INLINE uint32_t* NV2A_start_clear(uint32_t* p, int color, int depth) {
|
||||
static CC_INLINE uint32_t* NV2A_clear_buffers(uint32_t* p, int color, int depth) {
|
||||
uint32_t mask = 0;
|
||||
if (color) mask |= NV097_CLEAR_SURFACE_COLOR;
|
||||
if (depth) mask |= NV097_CLEAR_SURFACE_Z;
|
||||
|
2
third_party/bearssl/inner.h
vendored
2
third_party/bearssl/inner.h
vendored
@ -2410,7 +2410,7 @@ br_cpuid(uint32_t mask_eax, uint32_t mask_ebx,
|
||||
#else
|
||||
#define BR_SSE_FUNCTION
|
||||
#endif
|
||||
/* END classicube specific
|
||||
/* END classicube specific */
|
||||
|
||||
/* ==================================================================== */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user