mirror of
https://github.com/libretro/RetroArch
synced 2025-04-07 13:23:32 +00:00
(RSX) Style nits
This commit is contained in:
parent
35fa25bed6
commit
f8db0b86a9
@ -73,11 +73,169 @@
|
||||
if (rsx->shared_context_use) \
|
||||
rsx->ctx_driver->bind_hw_render(rsx->ctx_data, enable)
|
||||
|
||||
static void rsx_set_viewport(void *data, unsigned viewport_width,
|
||||
unsigned viewport_height, bool force_full, bool allow_rotate);
|
||||
static void rsx_load_texture_data(rsx_t* rsx, rsx_texture_t *texture,
|
||||
const void *frame, unsigned width, unsigned height, unsigned pitch,
|
||||
bool rgb32, bool menu, enum texture_filter_type filter_type);
|
||||
bool rgb32, bool menu, enum texture_filter_type filter_type)
|
||||
{
|
||||
u8 *texbuffer;
|
||||
u32 mag_filter, min_filter;
|
||||
const u8 *data = (u8*)frame;
|
||||
|
||||
if (!texture->data)
|
||||
{
|
||||
texture->data = (u32 *)rsxMemalign(128, texture->height * pitch);
|
||||
rsxAddressToOffset(texture->data, &texture->offset);
|
||||
}
|
||||
|
||||
texbuffer = (u8*)texture->data;
|
||||
memcpy(texbuffer, data, height * pitch);
|
||||
|
||||
texture->tex.format = (rgb32 ? GCM_TEXTURE_FORMAT_A8R8G8B8 :
|
||||
menu ? GCM_TEXTURE_FORMAT_A4R4G4B4 : GCM_TEXTURE_FORMAT_R5G6B5) | GCM_TEXTURE_FORMAT_LIN;
|
||||
texture->tex.mipmap = 1;
|
||||
texture->tex.dimension = GCM_TEXTURE_DIMS_2D;
|
||||
texture->tex.cubemap = GCM_FALSE;
|
||||
texture->tex.remap = ((GCM_TEXTURE_REMAP_TYPE_REMAP << GCM_TEXTURE_REMAP_TYPE_B_SHIFT)
|
||||
| (GCM_TEXTURE_REMAP_TYPE_REMAP << GCM_TEXTURE_REMAP_TYPE_G_SHIFT)
|
||||
| (GCM_TEXTURE_REMAP_TYPE_REMAP << GCM_TEXTURE_REMAP_TYPE_R_SHIFT)
|
||||
| (GCM_TEXTURE_REMAP_TYPE_REMAP << GCM_TEXTURE_REMAP_TYPE_A_SHIFT)
|
||||
| (GCM_TEXTURE_REMAP_COLOR_B << GCM_TEXTURE_REMAP_COLOR_B_SHIFT)
|
||||
| (GCM_TEXTURE_REMAP_COLOR_G << GCM_TEXTURE_REMAP_COLOR_G_SHIFT)
|
||||
| (GCM_TEXTURE_REMAP_COLOR_R << GCM_TEXTURE_REMAP_COLOR_R_SHIFT)
|
||||
| (GCM_TEXTURE_REMAP_COLOR_A << GCM_TEXTURE_REMAP_COLOR_A_SHIFT));
|
||||
texture->tex.width = width;
|
||||
texture->tex.height = height;
|
||||
texture->tex.depth = 1;
|
||||
texture->tex.location = GCM_LOCATION_RSX;
|
||||
texture->tex.pitch = pitch;
|
||||
texture->tex.offset = texture->offset;
|
||||
|
||||
switch (filter_type)
|
||||
{
|
||||
case TEXTURE_FILTER_MIPMAP_NEAREST:
|
||||
case TEXTURE_FILTER_NEAREST:
|
||||
min_filter = GCM_TEXTURE_NEAREST;
|
||||
mag_filter = GCM_TEXTURE_NEAREST;
|
||||
break;
|
||||
case TEXTURE_FILTER_MIPMAP_LINEAR:
|
||||
case TEXTURE_FILTER_LINEAR:
|
||||
default:
|
||||
min_filter = GCM_TEXTURE_LINEAR;
|
||||
mag_filter = GCM_TEXTURE_LINEAR;
|
||||
break;
|
||||
}
|
||||
texture->min_filter = min_filter;
|
||||
texture->mag_filter = mag_filter;
|
||||
texture->wrap_s = GCM_TEXTURE_CLAMP_TO_EDGE;
|
||||
texture->wrap_t = GCM_TEXTURE_CLAMP_TO_EDGE;
|
||||
}
|
||||
|
||||
static void rsx_set_viewport(void *data, unsigned viewport_width,
|
||||
unsigned viewport_height, bool force_full, bool allow_rotate)
|
||||
{
|
||||
int i;
|
||||
rsx_viewport_t vp;
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
float device_aspect = (float)viewport_width / viewport_height;
|
||||
struct video_ortho ortho = {0, 1, 0, 1, -1, 1};
|
||||
settings_t *settings = config_get_ptr();
|
||||
rsx_t *rsx = (rsx_t*)data;
|
||||
bool video_scale_integer = settings->bools.video_scale_integer;
|
||||
unsigned aspect_ratio_idx = settings->uints.video_aspect_ratio_idx;
|
||||
|
||||
if (video_scale_integer && !force_full)
|
||||
{
|
||||
video_viewport_get_scaled_integer(&rsx->vp,
|
||||
viewport_width, viewport_height,
|
||||
video_driver_get_aspect_ratio(), rsx->keep_aspect);
|
||||
viewport_width = rsx->vp.width;
|
||||
viewport_height = rsx->vp.height;
|
||||
}
|
||||
else if (rsx->keep_aspect && !force_full)
|
||||
{
|
||||
float desired_aspect = video_driver_get_aspect_ratio();
|
||||
|
||||
#if defined(HAVE_MENU)
|
||||
if (aspect_ratio_idx == ASPECT_RATIO_CUSTOM)
|
||||
{
|
||||
const struct video_viewport *custom = video_viewport_get_custom();
|
||||
|
||||
x = custom->x;
|
||||
y = custom->y;
|
||||
viewport_width = custom->width;
|
||||
viewport_height = custom->height;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
float delta;
|
||||
if (fabsf(device_aspect - desired_aspect) < 0.0001f)
|
||||
{
|
||||
/* If the aspect ratios of screen and desired aspect
|
||||
* ratio are sufficiently equal (floating point stuff),
|
||||
* assume they are actually equal.
|
||||
*/
|
||||
}
|
||||
else if (device_aspect > desired_aspect)
|
||||
{
|
||||
delta = (desired_aspect / device_aspect - 1.0f)
|
||||
/ 2.0f + 0.5f;
|
||||
x = (int)roundf(viewport_width * (0.5f - delta));
|
||||
viewport_width = (unsigned)roundf(2.0f * viewport_width * delta);
|
||||
}
|
||||
else
|
||||
{
|
||||
delta = (device_aspect / desired_aspect - 1.0f)
|
||||
/ 2.0f + 0.5f;
|
||||
y = (int)roundf(viewport_height * (0.5f - delta));
|
||||
viewport_height = (unsigned)roundf(2.0f * viewport_height * delta);
|
||||
}
|
||||
}
|
||||
|
||||
rsx->vp.x = x;
|
||||
rsx->vp.y = y;
|
||||
rsx->vp.width = viewport_width;
|
||||
rsx->vp.height = viewport_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
rsx->vp.x = 0;
|
||||
rsx->vp.y = 0;
|
||||
rsx->vp.width = viewport_width;
|
||||
rsx->vp.height = viewport_height;
|
||||
}
|
||||
|
||||
vp.min = 0.0f;
|
||||
vp.max = 1.0f;
|
||||
vp.x = rsx->vp.x;
|
||||
vp.y = rsx->height - rsx->vp.y - rsx->vp.height;
|
||||
vp.w = rsx->vp.width;
|
||||
vp.h = rsx->vp.height;
|
||||
vp.scale[0] = vp.w * 0.5f;
|
||||
vp.scale[1] = vp.h * -0.5f;
|
||||
vp.scale[2] = (vp.max - vp.min) * 0.5f;
|
||||
vp.scale[3] = 0.0f;
|
||||
vp.offset[0] = vp.x + vp.w * 0.5f;
|
||||
vp.offset[1] = vp.y + vp.h * 0.5f;
|
||||
vp.offset[2] = (vp.max + vp.min) * 0.5f;
|
||||
vp.offset[3] = 0.0f;
|
||||
|
||||
rsxSetViewport(rsx->context, vp.x, vp.y, vp.w, vp.h, vp.min, vp.max, vp.scale, vp.offset);
|
||||
for (i = 0; i < 8; i++)
|
||||
rsxSetViewportClip(rsx->context, i, rsx->width, rsx->height);
|
||||
rsxSetScissor(rsx->context, vp.x, vp.y, vp.w, vp.h);
|
||||
|
||||
rsx_set_projection(rsx, &ortho, allow_rotate);
|
||||
|
||||
/* Set last backbuffer viewport. */
|
||||
if (!force_full)
|
||||
{
|
||||
rsx->vp.width = viewport_width;
|
||||
rsx->vp.height = viewport_height;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static const gfx_ctx_driver_t* rsx_get_context(rsx_t* rsx)
|
||||
{
|
||||
@ -248,7 +406,7 @@ static gcmContextData *rsx_init_screen(rsx_t* gcm)
|
||||
gcmSetFlipMode(GCM_FLIP_VSYNC); /* Wait for VSYNC to flip */
|
||||
|
||||
gcm->depth_pitch = res.width * sizeof(u32);
|
||||
gcm->depth_buffer = (u32 *) rsxMemalign (64, (res.height * gcm->depth_pitch)); //Beware, if was (res.height * gcm->depth_pitch)*2
|
||||
gcm->depth_buffer = (u32 *)rsxMemalign(64, (res.height * gcm->depth_pitch)); /* Beware, if was (res.height * gcm->depth_pitch) * 2 */
|
||||
|
||||
rsxAddressToOffset(gcm->depth_buffer, &gcm->depth_offset);
|
||||
|
||||
@ -578,112 +736,6 @@ static void rsx_update_viewport(rsx_t* rsx)
|
||||
rsx->should_resize = false;
|
||||
}
|
||||
|
||||
static void rsx_set_viewport(void *data, unsigned viewport_width,
|
||||
unsigned viewport_height, bool force_full, bool allow_rotate)
|
||||
{
|
||||
int i;
|
||||
rsx_viewport_t vp;
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
float device_aspect = (float)viewport_width / viewport_height;
|
||||
struct video_ortho ortho = {0, 1, 0, 1, -1, 1};
|
||||
settings_t *settings = config_get_ptr();
|
||||
rsx_t *rsx = (rsx_t*)data;
|
||||
bool video_scale_integer = settings->bools.video_scale_integer;
|
||||
unsigned aspect_ratio_idx = settings->uints.video_aspect_ratio_idx;
|
||||
|
||||
if (video_scale_integer && !force_full)
|
||||
{
|
||||
video_viewport_get_scaled_integer(&rsx->vp,
|
||||
viewport_width, viewport_height,
|
||||
video_driver_get_aspect_ratio(), rsx->keep_aspect);
|
||||
viewport_width = rsx->vp.width;
|
||||
viewport_height = rsx->vp.height;
|
||||
}
|
||||
else if (rsx->keep_aspect && !force_full)
|
||||
{
|
||||
float desired_aspect = video_driver_get_aspect_ratio();
|
||||
|
||||
#if defined(HAVE_MENU)
|
||||
if (aspect_ratio_idx == ASPECT_RATIO_CUSTOM)
|
||||
{
|
||||
const struct video_viewport *custom = video_viewport_get_custom();
|
||||
|
||||
x = custom->x;
|
||||
y = custom->y;
|
||||
viewport_width = custom->width;
|
||||
viewport_height = custom->height;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
float delta;
|
||||
if (fabsf(device_aspect - desired_aspect) < 0.0001f)
|
||||
{
|
||||
/* If the aspect ratios of screen and desired aspect
|
||||
* ratio are sufficiently equal (floating point stuff),
|
||||
* assume they are actually equal.
|
||||
*/
|
||||
}
|
||||
else if (device_aspect > desired_aspect)
|
||||
{
|
||||
delta = (desired_aspect / device_aspect - 1.0f)
|
||||
/ 2.0f + 0.5f;
|
||||
x = (int)roundf(viewport_width * (0.5f - delta));
|
||||
viewport_width = (unsigned)roundf(2.0f * viewport_width * delta);
|
||||
}
|
||||
else
|
||||
{
|
||||
delta = (device_aspect / desired_aspect - 1.0f)
|
||||
/ 2.0f + 0.5f;
|
||||
y = (int)roundf(viewport_height * (0.5f - delta));
|
||||
viewport_height = (unsigned)roundf(2.0f * viewport_height * delta);
|
||||
}
|
||||
}
|
||||
|
||||
rsx->vp.x = x;
|
||||
rsx->vp.y = y;
|
||||
rsx->vp.width = viewport_width;
|
||||
rsx->vp.height = viewport_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
rsx->vp.x = 0;
|
||||
rsx->vp.y = 0;
|
||||
rsx->vp.width = viewport_width;
|
||||
rsx->vp.height = viewport_height;
|
||||
}
|
||||
|
||||
vp.min = 0.0f;
|
||||
vp.max = 1.0f;
|
||||
vp.x = rsx->vp.x;
|
||||
vp.y = rsx->height - rsx->vp.y - rsx->vp.height;
|
||||
vp.w = rsx->vp.width;
|
||||
vp.h = rsx->vp.height;
|
||||
vp.scale[0] = vp.w * 0.5f;
|
||||
vp.scale[1] = vp.h * -0.5f;
|
||||
vp.scale[2] = (vp.max - vp.min) * 0.5f;
|
||||
vp.scale[3] = 0.0f;
|
||||
vp.offset[0] = vp.x + vp.w * 0.5f;
|
||||
vp.offset[1] = vp.y + vp.h * 0.5f;
|
||||
vp.offset[2] = (vp.max + vp.min) * 0.5f;
|
||||
vp.offset[3] = 0.0f;
|
||||
|
||||
rsxSetViewport(rsx->context, vp.x, vp.y, vp.w, vp.h, vp.min, vp.max, vp.scale, vp.offset);
|
||||
for (i = 0; i < 8; i++)
|
||||
rsxSetViewportClip(rsx->context, i, rsx->width, rsx->height);
|
||||
rsxSetScissor(rsx->context, vp.x, vp.y, vp.w, vp.h);
|
||||
|
||||
rsx_set_projection(rsx, &ortho, allow_rotate);
|
||||
|
||||
/* Set last backbuffer viewport. */
|
||||
if (!force_full)
|
||||
{
|
||||
rsx->vp.width = viewport_width;
|
||||
rsx->vp.height = viewport_height;
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned rsx_wrap_type_to_enum(enum gfx_wrap_type type)
|
||||
{
|
||||
switch (type)
|
||||
@ -864,63 +916,6 @@ static void rsx_blit_buffer(
|
||||
}
|
||||
#endif
|
||||
|
||||
static void rsx_load_texture_data(rsx_t* rsx, rsx_texture_t *texture,
|
||||
const void *frame, unsigned width, unsigned height, unsigned pitch,
|
||||
bool rgb32, bool menu, enum texture_filter_type filter_type)
|
||||
{
|
||||
u8 *texbuffer;
|
||||
u32 mag_filter, min_filter;
|
||||
const u8 *data = (u8*)frame;
|
||||
|
||||
if (!texture->data)
|
||||
{
|
||||
texture->data = (u32 *)rsxMemalign(128, texture->height * pitch);
|
||||
rsxAddressToOffset(texture->data, &texture->offset);
|
||||
}
|
||||
|
||||
texbuffer = (u8*)texture->data;
|
||||
memcpy(texbuffer, data, height * pitch);
|
||||
|
||||
texture->tex.format = (rgb32 ? GCM_TEXTURE_FORMAT_A8R8G8B8 :
|
||||
menu ? GCM_TEXTURE_FORMAT_A4R4G4B4 : GCM_TEXTURE_FORMAT_R5G6B5) | GCM_TEXTURE_FORMAT_LIN;
|
||||
texture->tex.mipmap = 1;
|
||||
texture->tex.dimension = GCM_TEXTURE_DIMS_2D;
|
||||
texture->tex.cubemap = GCM_FALSE;
|
||||
texture->tex.remap = ((GCM_TEXTURE_REMAP_TYPE_REMAP << GCM_TEXTURE_REMAP_TYPE_B_SHIFT)
|
||||
| (GCM_TEXTURE_REMAP_TYPE_REMAP << GCM_TEXTURE_REMAP_TYPE_G_SHIFT)
|
||||
| (GCM_TEXTURE_REMAP_TYPE_REMAP << GCM_TEXTURE_REMAP_TYPE_R_SHIFT)
|
||||
| (GCM_TEXTURE_REMAP_TYPE_REMAP << GCM_TEXTURE_REMAP_TYPE_A_SHIFT)
|
||||
| (GCM_TEXTURE_REMAP_COLOR_B << GCM_TEXTURE_REMAP_COLOR_B_SHIFT)
|
||||
| (GCM_TEXTURE_REMAP_COLOR_G << GCM_TEXTURE_REMAP_COLOR_G_SHIFT)
|
||||
| (GCM_TEXTURE_REMAP_COLOR_R << GCM_TEXTURE_REMAP_COLOR_R_SHIFT)
|
||||
| (GCM_TEXTURE_REMAP_COLOR_A << GCM_TEXTURE_REMAP_COLOR_A_SHIFT));
|
||||
texture->tex.width = width;
|
||||
texture->tex.height = height;
|
||||
texture->tex.depth = 1;
|
||||
texture->tex.location = GCM_LOCATION_RSX;
|
||||
texture->tex.pitch = pitch;
|
||||
texture->tex.offset = texture->offset;
|
||||
|
||||
switch (filter_type)
|
||||
{
|
||||
case TEXTURE_FILTER_MIPMAP_NEAREST:
|
||||
case TEXTURE_FILTER_NEAREST:
|
||||
min_filter = GCM_TEXTURE_NEAREST;
|
||||
mag_filter = GCM_TEXTURE_NEAREST;
|
||||
break;
|
||||
case TEXTURE_FILTER_MIPMAP_LINEAR:
|
||||
case TEXTURE_FILTER_LINEAR:
|
||||
default:
|
||||
min_filter = GCM_TEXTURE_LINEAR;
|
||||
mag_filter = GCM_TEXTURE_LINEAR;
|
||||
break;
|
||||
}
|
||||
texture->min_filter = min_filter;
|
||||
texture->mag_filter = mag_filter;
|
||||
texture->wrap_s = GCM_TEXTURE_CLAMP_TO_EDGE;
|
||||
texture->wrap_t = GCM_TEXTURE_CLAMP_TO_EDGE;
|
||||
}
|
||||
|
||||
static void rsx_set_texture(rsx_t* rsx, rsx_texture_t *texture)
|
||||
{
|
||||
rsxInvalidateTextureCache(rsx->context, GCM_INVALIDATE_TEXTURE);
|
||||
|
@ -61,14 +61,14 @@ static void gfx_display_rsx_draw(gfx_display_ctx_draw_t *draw,
|
||||
void *data, unsigned video_width, unsigned video_height)
|
||||
{
|
||||
unsigned i;
|
||||
rsx_viewport_t vp;
|
||||
int end_vert_idx;
|
||||
rsx_vertex_t *vertices = NULL;
|
||||
rsx_texture_t *texture = NULL;
|
||||
const float *vertex = NULL;
|
||||
const float *tex_coord = NULL;
|
||||
const float *color = NULL;
|
||||
rsx_t *rsx = (rsx_t*)data;
|
||||
rsx_viewport_t vp;
|
||||
int end_vert_idx;
|
||||
rsx_vertex_t *vertices;
|
||||
|
||||
if (!rsx || !draw)
|
||||
return;
|
||||
@ -106,9 +106,12 @@ static void gfx_display_rsx_draw(gfx_display_ctx_draw_t *draw,
|
||||
|
||||
rsxInvalidateTextureCache(rsx->context, GCM_INVALIDATE_TEXTURE);
|
||||
rsxLoadTexture(rsx->context, rsx->tex_unit[VIDEO_SHADER_STOCK_BLEND]->index, &texture->tex);
|
||||
rsxTextureControl(rsx->context, rsx->tex_unit[VIDEO_SHADER_STOCK_BLEND]->index, GCM_TRUE, 0 << 8, 12 << 8, GCM_TEXTURE_MAX_ANISO_1);
|
||||
rsxTextureFilter(rsx->context, rsx->tex_unit[VIDEO_SHADER_STOCK_BLEND]->index, 0, texture->min_filter, texture->mag_filter, GCM_TEXTURE_CONVOLUTION_QUINCUNX);
|
||||
rsxTextureWrapMode(rsx->context, rsx->tex_unit[VIDEO_SHADER_STOCK_BLEND]->index, texture->wrap_s, texture->wrap_t, GCM_TEXTURE_CLAMP_TO_EDGE, 0, GCM_TEXTURE_ZFUNC_LESS, 0);
|
||||
rsxTextureControl(rsx->context, rsx->tex_unit[VIDEO_SHADER_STOCK_BLEND]->index,
|
||||
GCM_TRUE, 0 << 8, 12 << 8, GCM_TEXTURE_MAX_ANISO_1);
|
||||
rsxTextureFilter(rsx->context, rsx->tex_unit[VIDEO_SHADER_STOCK_BLEND]->index, 0,
|
||||
texture->min_filter, texture->mag_filter, GCM_TEXTURE_CONVOLUTION_QUINCUNX);
|
||||
rsxTextureWrapMode(rsx->context, rsx->tex_unit[VIDEO_SHADER_STOCK_BLEND]->index, texture->wrap_s,
|
||||
texture->wrap_t, GCM_TEXTURE_CLAMP_TO_EDGE, 0, GCM_TEXTURE_ZFUNC_LESS, 0);
|
||||
|
||||
#if RSX_MAX_TEXTURE_VERTICES > 0
|
||||
/* Using preallocated texture vertices uses better memory managment but may cause more flickering */
|
||||
@ -136,18 +139,32 @@ static void gfx_display_rsx_draw(gfx_display_ctx_draw_t *draw,
|
||||
vertices[i].b = *color++;
|
||||
vertices[i].a = *color++;
|
||||
}
|
||||
rsxAddressToOffset(&vertices[rsx->texture_vert_idx].x, &rsx->pos_offset[VIDEO_SHADER_STOCK_BLEND]);
|
||||
rsxAddressToOffset(&vertices[rsx->texture_vert_idx].u, &rsx->uv_offset[VIDEO_SHADER_STOCK_BLEND]);
|
||||
rsxAddressToOffset(&vertices[rsx->texture_vert_idx].r, &rsx->col_offset[VIDEO_SHADER_STOCK_BLEND]);
|
||||
rsxAddressToOffset(&vertices[rsx->texture_vert_idx].x,
|
||||
&rsx->pos_offset[VIDEO_SHADER_STOCK_BLEND]);
|
||||
rsxAddressToOffset(&vertices[rsx->texture_vert_idx].u,
|
||||
&rsx->uv_offset[VIDEO_SHADER_STOCK_BLEND]);
|
||||
rsxAddressToOffset(&vertices[rsx->texture_vert_idx].r,
|
||||
&rsx->col_offset[VIDEO_SHADER_STOCK_BLEND]);
|
||||
rsx->texture_vert_idx = end_vert_idx;
|
||||
|
||||
rsxBindVertexArrayAttrib(rsx->context, rsx->pos_index[VIDEO_SHADER_STOCK_BLEND]->index, 0, rsx->pos_offset[VIDEO_SHADER_STOCK_BLEND], sizeof(rsx_vertex_t), 2, GCM_VERTEX_DATA_TYPE_F32, GCM_LOCATION_RSX);
|
||||
rsxBindVertexArrayAttrib(rsx->context, rsx->uv_index[VIDEO_SHADER_STOCK_BLEND]->index, 0, rsx->uv_offset[VIDEO_SHADER_STOCK_BLEND], sizeof(rsx_vertex_t), 2, GCM_VERTEX_DATA_TYPE_F32, GCM_LOCATION_RSX);
|
||||
rsxBindVertexArrayAttrib(rsx->context, rsx->col_index[VIDEO_SHADER_STOCK_BLEND]->index, 0, rsx->col_offset[VIDEO_SHADER_STOCK_BLEND], sizeof(rsx_vertex_t), 4, GCM_VERTEX_DATA_TYPE_F32, GCM_LOCATION_RSX);
|
||||
rsxBindVertexArrayAttrib(rsx->context, rsx->pos_index[VIDEO_SHADER_STOCK_BLEND]->index, 0,
|
||||
rsx->pos_offset[VIDEO_SHADER_STOCK_BLEND], sizeof(rsx_vertex_t), 2,
|
||||
GCM_VERTEX_DATA_TYPE_F32, GCM_LOCATION_RSX);
|
||||
rsxBindVertexArrayAttrib(rsx->context, rsx->uv_index[VIDEO_SHADER_STOCK_BLEND]->index, 0,
|
||||
rsx->uv_offset[VIDEO_SHADER_STOCK_BLEND], sizeof(rsx_vertex_t), 2,
|
||||
GCM_VERTEX_DATA_TYPE_F32, GCM_LOCATION_RSX);
|
||||
rsxBindVertexArrayAttrib(rsx->context, rsx->col_index[VIDEO_SHADER_STOCK_BLEND]->index, 0,
|
||||
rsx->col_offset[VIDEO_SHADER_STOCK_BLEND], sizeof(rsx_vertex_t), 4,
|
||||
GCM_VERTEX_DATA_TYPE_F32, GCM_LOCATION_RSX);
|
||||
|
||||
rsxLoadVertexProgram(rsx->context, rsx->vpo[VIDEO_SHADER_STOCK_BLEND], rsx->vp_ucode[VIDEO_SHADER_STOCK_BLEND]);
|
||||
rsxSetVertexProgramParameter(rsx->context, rsx->vpo[VIDEO_SHADER_STOCK_BLEND], rsx->proj_matrix[VIDEO_SHADER_STOCK_BLEND], (float *)&rsx->mvp_no_rot);
|
||||
rsxLoadFragmentProgramLocation(rsx->context, rsx->fpo[VIDEO_SHADER_STOCK_BLEND], rsx->fp_offset[VIDEO_SHADER_STOCK_BLEND], GCM_LOCATION_RSX);
|
||||
rsxLoadVertexProgram(rsx->context, rsx->vpo[VIDEO_SHADER_STOCK_BLEND],
|
||||
rsx->vp_ucode[VIDEO_SHADER_STOCK_BLEND]);
|
||||
rsxSetVertexProgramParameter(rsx->context,
|
||||
rsx->vpo[VIDEO_SHADER_STOCK_BLEND], rsx->proj_matrix[VIDEO_SHADER_STOCK_BLEND],
|
||||
(float *)&rsx->mvp_no_rot);
|
||||
rsxLoadFragmentProgramLocation(rsx->context,
|
||||
rsx->fpo[VIDEO_SHADER_STOCK_BLEND], rsx->fp_offset[VIDEO_SHADER_STOCK_BLEND],
|
||||
GCM_LOCATION_RSX);
|
||||
|
||||
rsxClearSurface(rsx->context, GCM_CLEAR_Z);
|
||||
rsxDrawVertexArray(rsx->context, GCM_TYPE_TRIANGLE_STRIP, 0, draw->coords->vertices);
|
||||
|
Loading…
x
Reference in New Issue
Block a user