mirror of
https://github.com/libretro/beetle-psx-libretro.git
synced 2024-11-23 08:49:47 +00:00
Clean up RSX interface style
Co-authored-by: rz5 <rz5@users.noreply.github.com> Co-authored-by: ggdrt <45282415+ggdrt@users.noreply.github.com>
This commit is contained in:
parent
592708520c
commit
67872c1529
398
rsx/rsx_intf.cpp
398
rsx/rsx_intf.cpp
@ -245,7 +245,7 @@ struct Framebuffer
|
||||
|
||||
struct PrimitiveBatch {
|
||||
SemiTransparencyMode transparency_mode;
|
||||
/* GL_TRIANGLES or GL_LINES */
|
||||
/* GL_TRIANGLES or GL_LINES */
|
||||
GLenum draw_mode;
|
||||
bool opaque;
|
||||
bool set_mask;
|
||||
@ -980,8 +980,8 @@ static void GlRenderer_draw(GlRenderer *renderer)
|
||||
Framebuffer_init(&_fb, &renderer->fb_out);
|
||||
|
||||
glFramebufferTexture( GL_DRAW_FRAMEBUFFER,
|
||||
GL_DEPTH_STENCIL_ATTACHMENT,
|
||||
renderer->fb_out_depth.id,
|
||||
GL_DEPTH_STENCIL_ATTACHMENT,
|
||||
renderer->fb_out_depth.id,
|
||||
0);
|
||||
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
@ -1000,80 +1000,80 @@ static void GlRenderer_draw(GlRenderer *renderer)
|
||||
renderer->command_buffer->map = NULL;
|
||||
|
||||
if (!renderer->batches.empty())
|
||||
renderer->batches.back().count = renderer->vertex_index_pos
|
||||
- renderer->batches.back().first;
|
||||
renderer->batches.back().count = renderer->vertex_index_pos
|
||||
- renderer->batches.back().first;
|
||||
|
||||
for (std::vector<PrimitiveBatch>::iterator it =
|
||||
renderer->batches.begin();
|
||||
it != renderer->batches.end();
|
||||
++it)
|
||||
renderer->batches.begin();
|
||||
it != renderer->batches.end();
|
||||
++it)
|
||||
{
|
||||
/* Mask bits */
|
||||
if (it->set_mask)
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||
else
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_ZERO);
|
||||
/* Mask bits */
|
||||
if (it->set_mask)
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
|
||||
else
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_ZERO);
|
||||
|
||||
if (it->mask_test)
|
||||
glStencilFunc(GL_NOTEQUAL, 1, 1);
|
||||
else
|
||||
glStencilFunc(GL_ALWAYS, 1, 1);
|
||||
if (it->mask_test)
|
||||
glStencilFunc(GL_NOTEQUAL, 1, 1);
|
||||
else
|
||||
glStencilFunc(GL_ALWAYS, 1, 1);
|
||||
|
||||
/* Blending */
|
||||
bool opaque = it->opaque;
|
||||
if (renderer->command_buffer->program)
|
||||
glUniform1ui(renderer->command_buffer->program->uniforms["draw_semi_transparent"], !opaque);
|
||||
if (opaque)
|
||||
glDisable(GL_BLEND);
|
||||
else
|
||||
{
|
||||
glEnable(GL_BLEND);
|
||||
/* Blending */
|
||||
bool opaque = it->opaque;
|
||||
if (renderer->command_buffer->program)
|
||||
glUniform1ui(renderer->command_buffer->program->uniforms["draw_semi_transparent"], !opaque);
|
||||
if (opaque)
|
||||
glDisable(GL_BLEND);
|
||||
else
|
||||
{
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
GLenum blend_func = GL_FUNC_ADD;
|
||||
GLenum blend_src = GL_CONSTANT_ALPHA;
|
||||
GLenum blend_dst = GL_CONSTANT_ALPHA;
|
||||
GLenum blend_func = GL_FUNC_ADD;
|
||||
GLenum blend_src = GL_CONSTANT_ALPHA;
|
||||
GLenum blend_dst = GL_CONSTANT_ALPHA;
|
||||
|
||||
switch (it->transparency_mode)
|
||||
{
|
||||
/* 0.5xB + 0.5 x F */
|
||||
case SemiTransparencyMode_Average:
|
||||
blend_func = GL_FUNC_ADD;
|
||||
/* Set to 0.5 with glBlendColor */
|
||||
blend_src = GL_CONSTANT_ALPHA;
|
||||
blend_dst = GL_CONSTANT_ALPHA;
|
||||
break;
|
||||
/* 1.0xB + 1.0 x F */
|
||||
case SemiTransparencyMode_Add:
|
||||
blend_func = GL_FUNC_ADD;
|
||||
blend_src = GL_ONE;
|
||||
blend_dst = GL_ONE;
|
||||
break;
|
||||
/* 1.0xB - 1.0 x F */
|
||||
case SemiTransparencyMode_SubtractSource:
|
||||
blend_func = GL_FUNC_REVERSE_SUBTRACT;
|
||||
blend_src = GL_ONE;
|
||||
blend_dst = GL_ONE;
|
||||
break;
|
||||
case SemiTransparencyMode_AddQuarterSource:
|
||||
blend_func = GL_FUNC_ADD;
|
||||
blend_src = GL_CONSTANT_COLOR;
|
||||
blend_dst = GL_ONE;
|
||||
break;
|
||||
}
|
||||
switch (it->transparency_mode)
|
||||
{
|
||||
/* 0.5xB + 0.5 x F */
|
||||
case SemiTransparencyMode_Average:
|
||||
blend_func = GL_FUNC_ADD;
|
||||
/* Set to 0.5 with glBlendColor */
|
||||
blend_src = GL_CONSTANT_ALPHA;
|
||||
blend_dst = GL_CONSTANT_ALPHA;
|
||||
break;
|
||||
/* 1.0xB + 1.0 x F */
|
||||
case SemiTransparencyMode_Add:
|
||||
blend_func = GL_FUNC_ADD;
|
||||
blend_src = GL_ONE;
|
||||
blend_dst = GL_ONE;
|
||||
break;
|
||||
/* 1.0xB - 1.0 x F */
|
||||
case SemiTransparencyMode_SubtractSource:
|
||||
blend_func = GL_FUNC_REVERSE_SUBTRACT;
|
||||
blend_src = GL_ONE;
|
||||
blend_dst = GL_ONE;
|
||||
break;
|
||||
case SemiTransparencyMode_AddQuarterSource:
|
||||
blend_func = GL_FUNC_ADD;
|
||||
blend_src = GL_CONSTANT_COLOR;
|
||||
blend_dst = GL_ONE;
|
||||
break;
|
||||
}
|
||||
|
||||
glBlendFuncSeparate(blend_src, blend_dst, GL_ONE, GL_ZERO);
|
||||
glBlendEquationSeparate(blend_func, GL_FUNC_ADD);
|
||||
}
|
||||
glBlendFuncSeparate(blend_src, blend_dst, GL_ONE, GL_ZERO);
|
||||
glBlendEquationSeparate(blend_func, GL_FUNC_ADD);
|
||||
}
|
||||
|
||||
/* Drawing */
|
||||
if (!DRAWBUFFER_IS_EMPTY(renderer->command_buffer))
|
||||
{
|
||||
/* This method doesn't call prepare_draw/finalize_draw itself, it
|
||||
* must be handled by the caller. This is because this command
|
||||
* can be called several times on the same buffer (i.e. multiple
|
||||
* draw calls between the prepare/finalize) */
|
||||
glDrawElements(it->draw_mode, it->count, GL_UNSIGNED_SHORT, &renderer->vertex_indices[it->first]);
|
||||
}
|
||||
/* Drawing */
|
||||
if (!DRAWBUFFER_IS_EMPTY(renderer->command_buffer))
|
||||
{
|
||||
/* This method doesn't call prepare_draw/finalize_draw itself, it
|
||||
* must be handled by the caller. This is because this command
|
||||
* can be called several times on the same buffer (i.e. multiple
|
||||
* draw calls between the prepare/finalize) */
|
||||
glDrawElements(it->draw_mode, it->count, GL_UNSIGNED_SHORT, &renderer->vertex_indices[it->first]);
|
||||
}
|
||||
}
|
||||
|
||||
glDisable(GL_STENCIL_TEST);
|
||||
@ -1373,10 +1373,11 @@ static bool GlRenderer_new(GlRenderer *renderer, DrawConfig config)
|
||||
{
|
||||
/* Dithering is superfluous when we increase the internal
|
||||
* color depth, but users asked for it */
|
||||
DrawBuffer_disable_attribute(command_buffer, "dither");
|
||||
} else
|
||||
DrawBuffer_disable_attribute(command_buffer, "dither");
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawBuffer_enable_attribute(command_buffer, "dither");
|
||||
DrawBuffer_enable_attribute(command_buffer, "dither");
|
||||
}
|
||||
|
||||
GLenum command_draw_mode = wireframe ? GL_LINE : GL_FILL;
|
||||
@ -1413,7 +1414,7 @@ static bool GlRenderer_new(GlRenderer *renderer, DrawConfig config)
|
||||
&renderer->fb_out_depth,
|
||||
renderer->fb_out.width,
|
||||
renderer->fb_out.height,
|
||||
GL_DEPTH24_STENCIL8);
|
||||
GL_DEPTH24_STENCIL8);
|
||||
|
||||
renderer->filter_type = filter;
|
||||
renderer->command_buffer = command_buffer;
|
||||
@ -1492,7 +1493,7 @@ static void GlRenderer_free(GlRenderer *renderer)
|
||||
|
||||
unsigned i;
|
||||
for (i = 0; i < INDEX_BUFFER_LEN; i++)
|
||||
renderer->vertex_indices[i] = 0;
|
||||
renderer->vertex_indices[i] = 0;
|
||||
}
|
||||
|
||||
static inline void apply_scissor(GlRenderer *renderer)
|
||||
@ -1663,7 +1664,6 @@ static bool retro_refresh_variables(GlRenderer *renderer)
|
||||
struct retro_variable var = {0};
|
||||
|
||||
var.key = BEETLE_OPT(renderer_software_fb);
|
||||
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
{
|
||||
if (!strcmp(var.value, "enabled"))
|
||||
@ -1717,7 +1717,6 @@ static bool retro_refresh_variables(GlRenderer *renderer)
|
||||
}
|
||||
|
||||
var.key = BEETLE_OPT(filter);
|
||||
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
{
|
||||
if (!strcmp(var.value, "nearest"))
|
||||
@ -1747,22 +1746,21 @@ static bool retro_refresh_variables(GlRenderer *renderer)
|
||||
dither_mode dither_mode = DITHER_NATIVE;
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
{
|
||||
if (!strcmp(var.value, "1x(native)"))
|
||||
{
|
||||
dither_mode = DITHER_NATIVE;
|
||||
DrawBuffer_enable_attribute(renderer->command_buffer, "dither");
|
||||
}
|
||||
|
||||
else if (!strcmp(var.value, "internal resolution"))
|
||||
{
|
||||
dither_mode = DITHER_UPSCALED;
|
||||
DrawBuffer_enable_attribute(renderer->command_buffer, "dither");
|
||||
}
|
||||
else if (!strcmp(var.value, "disabled"))
|
||||
{
|
||||
dither_mode = DITHER_OFF;
|
||||
DrawBuffer_disable_attribute(renderer->command_buffer, "dither");
|
||||
}
|
||||
if (!strcmp(var.value, "1x(native)"))
|
||||
{
|
||||
dither_mode = DITHER_NATIVE;
|
||||
DrawBuffer_enable_attribute(renderer->command_buffer, "dither");
|
||||
}
|
||||
else if (!strcmp(var.value, "internal resolution"))
|
||||
{
|
||||
dither_mode = DITHER_UPSCALED;
|
||||
DrawBuffer_enable_attribute(renderer->command_buffer, "dither");
|
||||
}
|
||||
else if (!strcmp(var.value, "disabled"))
|
||||
{
|
||||
dither_mode = DITHER_OFF;
|
||||
DrawBuffer_disable_attribute(renderer->command_buffer, "dither");
|
||||
}
|
||||
}
|
||||
|
||||
var.key = BEETLE_OPT(wireframe);
|
||||
@ -1779,7 +1777,7 @@ static bool retro_refresh_variables(GlRenderer *renderer)
|
||||
|
||||
if (rebuild_fb_out)
|
||||
{
|
||||
if (dither_mode == DITHER_OFF)
|
||||
if (dither_mode == DITHER_OFF)
|
||||
DrawBuffer_disable_attribute(renderer->command_buffer, "dither");
|
||||
else
|
||||
DrawBuffer_enable_attribute(renderer->command_buffer, "dither");
|
||||
@ -1866,8 +1864,8 @@ static void vertex_preprocessing(
|
||||
unsigned count,
|
||||
GLenum mode,
|
||||
SemiTransparencyMode stm,
|
||||
bool mask_test,
|
||||
bool set_mask)
|
||||
bool mask_test,
|
||||
bool set_mask)
|
||||
{
|
||||
if (!renderer)
|
||||
return;
|
||||
@ -1891,7 +1889,6 @@ static void vertex_preprocessing(
|
||||
|
||||
int16_t z = renderer->primitive_ordering;
|
||||
renderer->primitive_ordering += 1;
|
||||
|
||||
|
||||
for (unsigned i = 0; i < count; i++)
|
||||
{
|
||||
@ -1903,56 +1900,56 @@ static void vertex_preprocessing(
|
||||
}
|
||||
|
||||
if (renderer->batches.empty()
|
||||
|| mode != renderer->command_draw_mode
|
||||
|| is_opaque != renderer->opaque
|
||||
|| (is_semi_transparent &&
|
||||
stm != renderer->semi_transparency_mode)
|
||||
|| renderer->set_mask != set_mask
|
||||
|| renderer->mask_test != mask_test)
|
||||
|| mode != renderer->command_draw_mode
|
||||
|| is_opaque != renderer->opaque
|
||||
|| (is_semi_transparent &&
|
||||
stm != renderer->semi_transparency_mode)
|
||||
|| renderer->set_mask != set_mask
|
||||
|| renderer->mask_test != mask_test)
|
||||
{
|
||||
if (!renderer->batches.empty())
|
||||
{
|
||||
PrimitiveBatch& last_batch = renderer->batches.back();
|
||||
last_batch.count = renderer->vertex_index_pos - last_batch.first;
|
||||
}
|
||||
PrimitiveBatch batch;
|
||||
batch.opaque = is_opaque;
|
||||
batch.draw_mode = mode;
|
||||
batch.transparency_mode = stm;
|
||||
batch.set_mask = set_mask;
|
||||
batch.mask_test = mask_test;
|
||||
batch.first = renderer->vertex_index_pos;
|
||||
batch.count = 0;
|
||||
renderer->batches.push_back(batch);
|
||||
if (!renderer->batches.empty())
|
||||
{
|
||||
PrimitiveBatch& last_batch = renderer->batches.back();
|
||||
last_batch.count = renderer->vertex_index_pos - last_batch.first;
|
||||
}
|
||||
PrimitiveBatch batch;
|
||||
batch.opaque = is_opaque;
|
||||
batch.draw_mode = mode;
|
||||
batch.transparency_mode = stm;
|
||||
batch.set_mask = set_mask;
|
||||
batch.mask_test = mask_test;
|
||||
batch.first = renderer->vertex_index_pos;
|
||||
batch.count = 0;
|
||||
renderer->batches.push_back(batch);
|
||||
|
||||
renderer->semi_transparency_mode = stm;
|
||||
renderer->command_draw_mode = mode;
|
||||
renderer->opaque = is_opaque;
|
||||
renderer->set_mask = set_mask;
|
||||
renderer->mask_test = mask_test;
|
||||
renderer->semi_transparency_mode = stm;
|
||||
renderer->command_draw_mode = mode;
|
||||
renderer->opaque = is_opaque;
|
||||
renderer->set_mask = set_mask;
|
||||
renderer->mask_test = mask_test;
|
||||
}
|
||||
}
|
||||
|
||||
static void vertex_add_blended_pass(
|
||||
GlRenderer *renderer, int vertex_index)
|
||||
GlRenderer *renderer, int vertex_index)
|
||||
{
|
||||
if (!renderer->batches.empty())
|
||||
{
|
||||
PrimitiveBatch& last_batch = renderer->batches.back();
|
||||
last_batch.count = renderer->vertex_index_pos - last_batch.first;
|
||||
PrimitiveBatch& last_batch = renderer->batches.back();
|
||||
last_batch.count = renderer->vertex_index_pos - last_batch.first;
|
||||
|
||||
PrimitiveBatch batch;
|
||||
batch.opaque = false;
|
||||
batch.draw_mode = last_batch.draw_mode;
|
||||
batch.transparency_mode = last_batch.transparency_mode;
|
||||
batch.set_mask = true;
|
||||
batch.mask_test = last_batch.mask_test;
|
||||
batch.first = vertex_index;
|
||||
batch.count = 0;
|
||||
renderer->batches.push_back(batch);
|
||||
PrimitiveBatch batch;
|
||||
batch.opaque = false;
|
||||
batch.draw_mode = last_batch.draw_mode;
|
||||
batch.transparency_mode = last_batch.transparency_mode;
|
||||
batch.set_mask = true;
|
||||
batch.mask_test = last_batch.mask_test;
|
||||
batch.first = vertex_index;
|
||||
batch.count = 0;
|
||||
renderer->batches.push_back(batch);
|
||||
|
||||
renderer->opaque = false;
|
||||
renderer->set_mask = true;
|
||||
renderer->opaque = false;
|
||||
renderer->set_mask = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1962,8 +1959,8 @@ static void push_primitive(
|
||||
unsigned count,
|
||||
GLenum mode,
|
||||
SemiTransparencyMode stm,
|
||||
bool mask_test,
|
||||
bool set_mask)
|
||||
bool mask_test,
|
||||
bool set_mask)
|
||||
{
|
||||
if (!renderer)
|
||||
return;
|
||||
@ -2249,7 +2246,7 @@ static bool rsx_gl_open(bool is_pal)
|
||||
retro_pixel_format f = RETRO_PIXEL_FORMAT_XRGB8888;
|
||||
VideoClock clock = is_pal ? VideoClock_Pal : VideoClock_Ntsc;
|
||||
|
||||
if ( !environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &f) )
|
||||
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &f))
|
||||
return false;
|
||||
|
||||
/* glsm related setup */
|
||||
@ -2264,7 +2261,7 @@ static bool rsx_gl_open(bool is_pal)
|
||||
params.major = 3;
|
||||
params.minor = 3;
|
||||
|
||||
if ( !glsm_ctl(GLSM_CTL_STATE_CONTEXT_INIT, ¶ms) )
|
||||
if (!glsm_ctl(GLSM_CTL_STATE_CONTEXT_INIT, ¶ms))
|
||||
return false;
|
||||
|
||||
/* No context until 'context_reset' is called */
|
||||
@ -2301,8 +2298,7 @@ static void rsx_gl_refresh_variables(void)
|
||||
|
||||
/* This call can potentially (but not necessarily) call
|
||||
* 'context_destroy' and 'context_reset' to reinitialize */
|
||||
bool ok =
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO, &av_info);
|
||||
bool ok = environ_cb(RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO, &av_info);
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
@ -2544,7 +2540,7 @@ static void rsx_gl_push_quad(
|
||||
depth_shift,
|
||||
(uint8_t) dither,
|
||||
semi_transparent,
|
||||
{min_u, min_v, max_u, max_v},
|
||||
{min_u, min_v, max_u, max_v},
|
||||
},
|
||||
{
|
||||
{p1x, p1y, 0.95, p1w }, /* position */
|
||||
@ -2560,7 +2556,7 @@ static void rsx_gl_push_quad(
|
||||
depth_shift,
|
||||
(uint8_t) dither,
|
||||
semi_transparent,
|
||||
{min_u, min_v, max_u, max_v},
|
||||
{min_u, min_v, max_u, max_v},
|
||||
},
|
||||
{
|
||||
{p2x, p2y, 0.95, p2w }, /* position */
|
||||
@ -2576,7 +2572,7 @@ static void rsx_gl_push_quad(
|
||||
depth_shift,
|
||||
(uint8_t) dither,
|
||||
semi_transparent,
|
||||
{min_u, min_v, max_u, max_v},
|
||||
{min_u, min_v, max_u, max_v},
|
||||
},
|
||||
{
|
||||
{p3x, p3y, 0.95, p3w }, /* position */
|
||||
@ -2592,7 +2588,7 @@ static void rsx_gl_push_quad(
|
||||
depth_shift,
|
||||
(uint8_t) dither,
|
||||
semi_transparent,
|
||||
{ min_u, min_v, max_u, max_v },
|
||||
{ min_u, min_v, max_u, max_v },
|
||||
},
|
||||
};
|
||||
|
||||
@ -2606,11 +2602,11 @@ static void rsx_gl_push_quad(
|
||||
unsigned index_pos = renderer->vertex_index_pos;
|
||||
|
||||
for (unsigned i = 0; i < 6; i++)
|
||||
renderer->vertex_indices[renderer->vertex_index_pos++] = index + indices[i];
|
||||
renderer->vertex_indices[renderer->vertex_index_pos++] = index + indices[i];
|
||||
|
||||
/* Add transparent pass if needed */
|
||||
if (is_semi_transparent && is_textured)
|
||||
vertex_add_blended_pass(renderer, index_pos);
|
||||
vertex_add_blended_pass(renderer, index_pos);
|
||||
|
||||
DrawBuffer_push_slice(renderer->command_buffer, v, 4,
|
||||
sizeof(CommandVertex));
|
||||
@ -2680,7 +2676,7 @@ static void rsx_gl_push_triangle(
|
||||
depth_shift,
|
||||
(uint8_t) dither,
|
||||
semi_transparent,
|
||||
{min_u, min_v, max_u, max_v},
|
||||
{min_u, min_v, max_u, max_v},
|
||||
},
|
||||
{
|
||||
{p1x, p1y, 0.95, p1w }, /* position */
|
||||
@ -2696,7 +2692,7 @@ static void rsx_gl_push_triangle(
|
||||
depth_shift,
|
||||
(uint8_t) dither,
|
||||
semi_transparent,
|
||||
{min_u, min_v, max_u, max_v},
|
||||
{min_u, min_v, max_u, max_v},
|
||||
},
|
||||
{
|
||||
{p2x, p2y, 0.95, p2w }, /* position */
|
||||
@ -2712,7 +2708,7 @@ static void rsx_gl_push_triangle(
|
||||
depth_shift,
|
||||
(uint8_t) dither,
|
||||
semi_transparent,
|
||||
{min_u, min_v, max_u, max_v},
|
||||
{min_u, min_v, max_u, max_v},
|
||||
}
|
||||
};
|
||||
|
||||
@ -2793,7 +2789,7 @@ static void rsx_gl_copy_rect(
|
||||
GlRenderer *renderer = static_renderer.state_data;
|
||||
|
||||
if (src_x == dst_x && src_y == dst_y)
|
||||
return;
|
||||
return;
|
||||
|
||||
renderer->set_mask = mask_set_or != 0;
|
||||
renderer->mask_test = mask_eval_and != 0;
|
||||
@ -3232,7 +3228,7 @@ static void rsx_vulkan_refresh_variables(void)
|
||||
var.key = BEETLE_OPT(msaa);
|
||||
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
|
||||
{
|
||||
msaa = strtoul(var.value, nullptr, 0);
|
||||
msaa = strtoul(var.value, nullptr, 0);
|
||||
}
|
||||
|
||||
var.key = BEETLE_OPT(mdec_yuv);
|
||||
@ -3981,7 +3977,7 @@ void rsx_intf_set_draw_offset(int16_t x, int16_t y)
|
||||
}
|
||||
|
||||
void rsx_intf_set_draw_area(uint16_t x0, uint16_t y0,
|
||||
uint16_t x1, uint16_t y1)
|
||||
uint16_t x1, uint16_t y1)
|
||||
{
|
||||
#ifdef RSX_DUMP
|
||||
rsx_dump_set_draw_area(x0, y0, x1, y1);
|
||||
@ -4179,8 +4175,8 @@ void rsx_intf_push_triangle(
|
||||
uint16_t t0x, uint16_t t0y,
|
||||
uint16_t t1x, uint16_t t1y,
|
||||
uint16_t t2x, uint16_t t2y,
|
||||
uint16_t min_u, uint16_t min_v,
|
||||
uint16_t max_u, uint16_t max_v,
|
||||
uint16_t min_u, uint16_t min_v,
|
||||
uint16_t max_u, uint16_t max_v,
|
||||
uint16_t texpage_x, uint16_t texpage_y,
|
||||
uint16_t clut_x, uint16_t clut_y,
|
||||
uint8_t texture_blend_mode,
|
||||
@ -4238,23 +4234,23 @@ void rsx_intf_push_triangle(
|
||||
}
|
||||
|
||||
void rsx_intf_push_quad(
|
||||
float p0x, float p0y, float p0w,
|
||||
float p1x, float p1y, float p1w,
|
||||
float p2x, float p2y, float p2w,
|
||||
float p3x, float p3y, float p3w,
|
||||
uint32_t c0, uint32_t c1, uint32_t c2, uint32_t c3,
|
||||
uint16_t t0x, uint16_t t0y,
|
||||
uint16_t t1x, uint16_t t1y,
|
||||
uint16_t t2x, uint16_t t2y,
|
||||
uint16_t t3x, uint16_t t3y,
|
||||
uint16_t min_u, uint16_t min_v,
|
||||
uint16_t max_u, uint16_t max_v,
|
||||
uint16_t texpage_x, uint16_t texpage_y,
|
||||
uint16_t clut_x, uint16_t clut_y,
|
||||
uint8_t texture_blend_mode,
|
||||
uint8_t depth_shift,
|
||||
bool dither,
|
||||
int blend_mode,
|
||||
float p0x, float p0y, float p0w,
|
||||
float p1x, float p1y, float p1w,
|
||||
float p2x, float p2y, float p2w,
|
||||
float p3x, float p3y, float p3w,
|
||||
uint32_t c0, uint32_t c1, uint32_t c2, uint32_t c3,
|
||||
uint16_t t0x, uint16_t t0y,
|
||||
uint16_t t1x, uint16_t t1y,
|
||||
uint16_t t2x, uint16_t t2y,
|
||||
uint16_t t3x, uint16_t t3y,
|
||||
uint16_t min_u, uint16_t min_v,
|
||||
uint16_t max_u, uint16_t max_v,
|
||||
uint16_t texpage_x, uint16_t texpage_y,
|
||||
uint16_t clut_x, uint16_t clut_y,
|
||||
uint8_t texture_blend_mode,
|
||||
uint8_t depth_shift,
|
||||
bool dither,
|
||||
int blend_mode,
|
||||
uint32_t mask_test,
|
||||
uint32_t set_mask)
|
||||
{
|
||||
@ -4272,40 +4268,40 @@ void rsx_intf_push_quad(
|
||||
rsx_dump_quad(vertices, &state);
|
||||
#endif
|
||||
|
||||
switch (rsx_type)
|
||||
{
|
||||
case RSX_SOFTWARE:
|
||||
break;
|
||||
case RSX_OPENGL:
|
||||
switch (rsx_type)
|
||||
{
|
||||
case RSX_SOFTWARE:
|
||||
break;
|
||||
case RSX_OPENGL:
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
||||
if (static_renderer.state != GlState_Invalid
|
||||
&& static_renderer.state_data)
|
||||
rsx_gl_push_quad(p0x, p0y, p0w, p1x, p1y, p1w, p2x, p2y, p2w, p3x, p3y, p3w,
|
||||
c0, c1, c2, c3,
|
||||
t0x, t0y, t1x, t1y, t2x, t2y, t3x, t3y,
|
||||
min_u, min_v, max_u, max_v,
|
||||
texpage_x, texpage_y, clut_x, clut_y,
|
||||
texture_blend_mode,
|
||||
depth_shift,
|
||||
dither,
|
||||
blend_mode, mask_test != 0, set_mask != 0);
|
||||
if (static_renderer.state != GlState_Invalid
|
||||
&& static_renderer.state_data)
|
||||
rsx_gl_push_quad(p0x, p0y, p0w, p1x, p1y, p1w, p2x, p2y, p2w, p3x, p3y, p3w,
|
||||
c0, c1, c2, c3,
|
||||
t0x, t0y, t1x, t1y, t2x, t2y, t3x, t3y,
|
||||
min_u, min_v, max_u, max_v,
|
||||
texpage_x, texpage_y, clut_x, clut_y,
|
||||
texture_blend_mode,
|
||||
depth_shift,
|
||||
dither,
|
||||
blend_mode, mask_test != 0, set_mask != 0);
|
||||
#endif
|
||||
break;
|
||||
case RSX_VULKAN:
|
||||
break;
|
||||
case RSX_VULKAN:
|
||||
#if defined(HAVE_VULKAN)
|
||||
if (renderer)
|
||||
rsx_vulkan_push_quad(p0x, p0y, p0w, p1x, p1y, p1w, p2x, p2y, p2w, p3x, p3y, p3w,
|
||||
c0, c1, c2, c3,
|
||||
t0x, t0y, t1x, t1y, t2x, t2y, t3x, t3y,
|
||||
min_u, min_v, max_u, max_v,
|
||||
texpage_x, texpage_y, clut_x, clut_y,
|
||||
texture_blend_mode,
|
||||
depth_shift,
|
||||
dither,
|
||||
blend_mode, mask_test != 0, set_mask != 0);
|
||||
if (renderer)
|
||||
rsx_vulkan_push_quad(p0x, p0y, p0w, p1x, p1y, p1w, p2x, p2y, p2w, p3x, p3y, p3w,
|
||||
c0, c1, c2, c3,
|
||||
t0x, t0y, t1x, t1y, t2x, t2y, t3x, t3y,
|
||||
min_u, min_v, max_u, max_v,
|
||||
texpage_x, texpage_y, clut_x, clut_y,
|
||||
texture_blend_mode,
|
||||
depth_shift,
|
||||
dither,
|
||||
blend_mode, mask_test != 0, set_mask != 0);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void rsx_intf_push_line(int16_t p0x, int16_t p0y,
|
||||
|
@ -28,11 +28,11 @@ enum blending_modes
|
||||
|
||||
enum width_modes
|
||||
{
|
||||
WIDTH_MODE_256 = 0,
|
||||
WIDTH_MODE_320,
|
||||
WIDTH_MODE_512,
|
||||
WIDTH_MODE_640,
|
||||
WIDTH_MODE_368
|
||||
WIDTH_MODE_256 = 0,
|
||||
WIDTH_MODE_320,
|
||||
WIDTH_MODE_512,
|
||||
WIDTH_MODE_640,
|
||||
WIDTH_MODE_368
|
||||
};
|
||||
|
||||
void rsx_intf_set_environment(retro_environment_t cb);
|
||||
@ -69,17 +69,17 @@ void rsx_intf_push_triangle(float p0x, float p0y, float p0w,
|
||||
uint32_t c0, uint32_t c1, uint32_t c2,
|
||||
uint16_t t0x, uint16_t t0y,
|
||||
uint16_t t1x, uint16_t t1y,
|
||||
uint16_t min_u, uint16_t min_v,
|
||||
uint16_t max_u, uint16_t max_v,
|
||||
uint16_t min_u, uint16_t min_v,
|
||||
uint16_t max_u, uint16_t max_v,
|
||||
uint16_t t2x, uint16_t t2y,
|
||||
uint16_t texpage_x, uint16_t texpage_y,
|
||||
uint16_t clut_x, uint16_t clut_y,
|
||||
uint8_t texture_blend_mode,
|
||||
uint8_t depth_shift,
|
||||
bool dither,
|
||||
// This is really an `enum blending_modes`
|
||||
// but I don't want to deal with enums in the
|
||||
// FFI
|
||||
/* This is really an `enum blending_modes`
|
||||
* but I don't want to deal with enums in the
|
||||
* FFI */
|
||||
int blend_mode,
|
||||
uint32_t mask_test,
|
||||
uint32_t set_mask);
|
||||
@ -96,8 +96,8 @@ void rsx_intf_push_quad(float p0x, float p0y, float p0w,
|
||||
uint16_t t1x, uint16_t t1y,
|
||||
uint16_t t2x, uint16_t t2y,
|
||||
uint16_t t3x, uint16_t t3y,
|
||||
uint16_t min_u, uint16_t min_v,
|
||||
uint16_t max_u, uint16_t max_v,
|
||||
uint16_t min_u, uint16_t min_v,
|
||||
uint16_t max_u, uint16_t max_v,
|
||||
uint16_t texpage_x, uint16_t texpage_y,
|
||||
uint16_t clut_x, uint16_t clut_y,
|
||||
uint8_t texture_blend_mode,
|
||||
@ -118,11 +118,11 @@ void rsx_intf_push_line(int16_t p0x, int16_t p0y,
|
||||
uint32_t mask_test,
|
||||
uint32_t set_mask);
|
||||
|
||||
void rsx_intf_load_image( uint16_t x, uint16_t y,
|
||||
uint16_t w, uint16_t h,
|
||||
uint16_t *vram,
|
||||
uint32_t mask_test,
|
||||
uint32_t set_mask);
|
||||
void rsx_intf_load_image(uint16_t x, uint16_t y,
|
||||
uint16_t w, uint16_t h,
|
||||
uint16_t *vram,
|
||||
uint32_t mask_test,
|
||||
uint32_t set_mask);
|
||||
|
||||
bool rsx_intf_read_vram(uint16_t x, uint16_t y,
|
||||
uint16_t w, uint16_t h,
|
||||
|
Loading…
Reference in New Issue
Block a user