mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-02 22:30:39 +00:00
rsx: Properly flag the program control if needed
This commit is contained in:
parent
e3b23822fd
commit
1fd265d316
3 changed files with 31 additions and 5 deletions
|
@ -609,9 +609,14 @@ namespace rsx
|
||||||
|
|
||||||
if (!backend_config.supports_normalized_barycentrics)
|
if (!backend_config.supports_normalized_barycentrics)
|
||||||
{
|
{
|
||||||
// TODO
|
// Check for mode change between rasterized polys vs lines and points
|
||||||
// Store a global flag to track raster mode between polygon and non-polygon
|
// Luckily this almost never happens in real games
|
||||||
// Check if flag changed. If state is the same, ignore.
|
const auto current_mode = rsx::method_registers.current_draw_clause.classify_mode();
|
||||||
|
if (current_mode != m_current_draw_mode)
|
||||||
|
{
|
||||||
|
m_graphics_state |= (rsx::vertex_program_state_dirty | rsx::fragment_program_state_dirty);
|
||||||
|
m_current_draw_mode = current_mode;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
in_begin_end = true;
|
in_begin_end = true;
|
||||||
|
@ -1942,6 +1947,7 @@ namespace rsx
|
||||||
|
|
||||||
ensure(!(m_graphics_state & rsx::pipeline_state::vertex_program_ucode_dirty));
|
ensure(!(m_graphics_state & rsx::pipeline_state::vertex_program_ucode_dirty));
|
||||||
current_vertex_program.output_mask = rsx::method_registers.vertex_attrib_output_mask();
|
current_vertex_program.output_mask = rsx::method_registers.vertex_attrib_output_mask();
|
||||||
|
current_vertex_program.ctrl = rsx::method_registers.current_draw_clause.classify_mode() == primitive_class::polygon ? RSX_SHADER_CONTROL_POLYGON_RASTER : 0;
|
||||||
|
|
||||||
for (u32 textures_ref = current_vp_metadata.referenced_textures_mask, i = 0; textures_ref; textures_ref >>= 1, ++i)
|
for (u32 textures_ref = current_vp_metadata.referenced_textures_mask, i = 0; textures_ref; textures_ref >>= 1, ++i)
|
||||||
{
|
{
|
||||||
|
@ -2149,8 +2155,12 @@ namespace rsx
|
||||||
current_fragment_program.texcoord_control_mask = rsx::method_registers.texcoord_control_mask();
|
current_fragment_program.texcoord_control_mask = rsx::method_registers.texcoord_control_mask();
|
||||||
current_fragment_program.two_sided_lighting = rsx::method_registers.two_side_light_en();
|
current_fragment_program.two_sided_lighting = rsx::method_registers.two_side_light_en();
|
||||||
|
|
||||||
if (method_registers.current_draw_clause.primitive == primitive_type::points &&
|
if (method_registers.current_draw_clause.classify_mode() == primitive_class::polygon)
|
||||||
method_registers.point_sprite_enabled())
|
{
|
||||||
|
current_fragment_program.ctrl |= RSX_SHADER_CONTROL_POLYGON_RASTER;
|
||||||
|
}
|
||||||
|
else if (method_registers.point_sprite_enabled() &&
|
||||||
|
method_registers.current_draw_clause.primitive == primitive_type::points)
|
||||||
{
|
{
|
||||||
// Set high word of the control mask to store point sprite control
|
// Set high word of the control mask to store point sprite control
|
||||||
current_fragment_program.texcoord_control_mask |= u32(method_registers.point_sprite_control_mask()) << 16;
|
current_fragment_program.texcoord_control_mask |= u32(method_registers.point_sprite_control_mask()) << 16;
|
||||||
|
|
|
@ -497,6 +497,8 @@ namespace rsx
|
||||||
s32 m_skip_frame_ctr = 0;
|
s32 m_skip_frame_ctr = 0;
|
||||||
bool skip_current_frame = false;
|
bool skip_current_frame = false;
|
||||||
|
|
||||||
|
primitive_class m_current_draw_mode = primitive_class::polygon;
|
||||||
|
|
||||||
backend_configuration backend_config{};
|
backend_configuration backend_config{};
|
||||||
|
|
||||||
// FIFO
|
// FIFO
|
||||||
|
|
|
@ -35,6 +35,12 @@ namespace rsx
|
||||||
vertex_arrays_changed = (1 << 2),
|
vertex_arrays_changed = (1 << 2),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class primitive_class
|
||||||
|
{
|
||||||
|
polygon,
|
||||||
|
non_polygon
|
||||||
|
};
|
||||||
|
|
||||||
struct barrier_t
|
struct barrier_t
|
||||||
{
|
{
|
||||||
u32 draw_id;
|
u32 draw_id;
|
||||||
|
@ -260,6 +266,14 @@ namespace rsx
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
primitive_class classify_mode() const
|
||||||
|
{
|
||||||
|
return primitive >= rsx::primitive_type::triangles
|
||||||
|
? primitive_class::polygon
|
||||||
|
: primitive_class::non_polygon;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void reset(rsx::primitive_type type);
|
void reset(rsx::primitive_type type);
|
||||||
|
|
||||||
void begin()
|
void begin()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue