From: Lawrence S. <ljs...@us...> - 2014-03-26 05:00:37
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 6447a9fc5ae74429c94eb30a7b2c8ee867989ec1 (commit) from 5087f089c81068fdeface03e33344c115d60a38c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6447a9fc5ae74429c94eb30a7b2c8ee867989ec1 Author: Lawrence Sebald <ljs...@us...> Date: Wed Mar 26 01:00:16 2014 -0400 No need to wait for a vblank when doing render-to-texture. ----------------------------------------------------------------------- Summary of changes: doc/CHANGELOG | 13 ++++++++ examples/dreamcast/pvr/texture_render/ta.c | 40 ++++++++++++++----------- kernel/arch/dreamcast/hardware/pvr/pvr_irq.c | 16 ++++++++-- 3 files changed, 48 insertions(+), 21 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 64901a7..0259ccf 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -16,7 +16,20 @@ KallistiOS version 2.0.1 ----------------------------------------------- - *** Cleaned up warnings with -std=c99 for C code [LS] - DC Changed the PVR render-to-texture support to allow for two render-to- texture passes without an intervening render-to-screen pass [LS] +- *** Fixed an issue in fs_ext2 that would allow you to rename a directory to be + a child of itself, thus chopping it off from the rest of the directory + tree [LS] +- *** Added a fs_readlink() function to resolve symlinks [LS] +- *** Fixed the vqenc and kmgenc utilities for compilation on a 64-bit OS [LS] +- DC Corrected an issue with video cable detection with GCC 4.8.x [LS] - DC Added support for ATA devices on the G1 bus [LS] +- DC Fixed an infinite loop in ATA initialization if nothing except the GD-ROM + drive is connected [LS] +- *** Added documentation for the addons tree [LS] +- DC Made the hardware auto-initialization/shutdown functions weakly linked so + that they can be overridden without modifying KOS [LS] +- DC Corrected render-to-texture mode so that you don't have to wait for a + vblank to actually render to the texture [LS] KallistiOS version 2.0.0 ----------------------------------------------- - DC Broadband Adapter driver fixes [Dan Potter == DP] diff --git a/examples/dreamcast/pvr/texture_render/ta.c b/examples/dreamcast/pvr/texture_render/ta.c index 3842eb6..492de15 100644 --- a/examples/dreamcast/pvr/texture_render/ta.c +++ b/examples/dreamcast/pvr/texture_render/ta.c @@ -1,14 +1,11 @@ /* This program is a slight modification of the libdream/ta example program. The big difference in this program is that we add in a small bit of user - input code, and support render-to-texture mode. */ - -/* This is a port of my original 3dtest example to KOS. The big difference - here is that the background plane is no longer used. */ + input code, and that we support render-to-texture mode. */ #include <kos.h> -/* A little test program -- creates twelve rainbow polygons and - moves them around over a color-shifting background. */ +/* A little test program -- creates six rainbow polygons and + moves them around over a white background. */ typedef struct { float x, y, z; float dx, dy; @@ -124,7 +121,7 @@ void draw_frame() { if(!to_texture) pvr_scene_begin(); - else { + else { pvr_scene_begin_txr(d_texture, &tx_x, &tx_y); to_texture = 2; } @@ -151,7 +148,6 @@ void draw_frame() { void draw_textured() { pvr_poly_cxt_t cxt; pvr_poly_hdr_t hdr; - pvr_ptr_t tmp; int i; pvr_poly_cxt_txr(&cxt, PVR_LIST_OP_POLY, PVR_TXRFMT_RGB565 | PVR_TXRFMT_NONTWIDDLED, 1024, 512, d_texture, PVR_FILTER_NONE); @@ -196,7 +192,8 @@ int main(int argc, char **argv) { maple_device_t *cont; cont_state_t *state; int finished = 0; - uint64 timer = timer_ms_gettime64(); + uint64 timer = timer_ms_gettime64(), start, end; + uint32 counter = 0; pvr_init(&pvr_params); @@ -205,34 +202,41 @@ int main(int argc, char **argv) { pvr_set_bg_color(1.0f, 1.0f, 1.0f); - while(!finished) { + start = timer_ms_gettime64(); + + while(!finished) { cont = maple_enum_type(0, MAPLE_FUNC_CONTROLLER); - if(cont != NULL) { + if(cont != NULL) { state = (cont_state_t *) maple_dev_status(cont); - if(state != NULL && timer < timer_ms_gettime64()) { + if(state != NULL && timer < timer_ms_gettime64()) { if(state->buttons & CONT_START) finished = 1; - else if(state->buttons & CONT_A && (to_texture % 2) != 1) { + else if(state->buttons & CONT_A && (to_texture % 2) != 1) { ++to_texture; timer = timer_ms_gettime64() + 200; } - else if(state->buttons & CONT_B && to_texture) { + else if(state->buttons & CONT_B && to_texture) { to_texture = 0; timer = timer_ms_gettime64() + 200; } } } - if(to_texture < 2) { + if(to_texture < 2) draw_frame(); - } - else { + else draw_textured(); - } + + ++counter; } + end = timer_ms_gettime64(); + + printf("%lu frames in %llu ms = %f FPS\n", counter, end - start, + counter / ((float)end - start) * 1000.0f); + pvr_mem_free(d_texture); /* Shutdown isn't technically neccessary, but is possible */ diff --git a/kernel/arch/dreamcast/hardware/pvr/pvr_irq.c b/kernel/arch/dreamcast/hardware/pvr/pvr_irq.c index a8c0abf..de1732d 100644 --- a/kernel/arch/dreamcast/hardware/pvr/pvr_irq.c +++ b/kernel/arch/dreamcast/hardware/pvr/pvr_irq.c @@ -122,9 +122,19 @@ void pvr_int_handler(uint32 code) { return; } - // If it's not a vblank, ignore for now for the rest of this. - if(code != ASIC_EVT_PVR_VBLINT) - return; + if(!pvr_state.to_texture[bufn]) { + // If it's not a vblank, ignore the rest of this for now. + if(code != ASIC_EVT_PVR_VBLINT) + return; + } + else { + // We don't need to wait for a vblank for rendering to a texture, but + // we really don't care about anything else unless we've actually gotten + // all the data submitted to the TA. + if(pvr_state.lists_transferred != pvr_state.lists_enabled && + !pvr_state.render_completed) + return; + } // If the render-done interrupt has fired then we are ready to flip to the // new frame buffer. hooks/post-receive -- A pseudo Operating System for the Dreamcast. |