Typo fix: comparaison->comparison

This commit is contained in:
Nekotekina 2016-07-19 14:06:01 +03:00
parent fc9fdca3f6
commit ceb4cb59ac
16 changed files with 114 additions and 114 deletions

View File

@ -88,7 +88,7 @@ protected:
/** returns string calling saturate function. /** returns string calling saturate function.
*/ */
virtual std::string saturate(const std::string &code) = 0; virtual std::string saturate(const std::string &code) = 0;
/** returns string calling comparaison function on 2 args passed as strings. /** returns string calling comparison function on 2 args passed as strings.
*/ */
virtual std::string compareFunction(COMPARE, const std::string &, const std::string &) = 0; virtual std::string compareFunction(COMPARE, const std::string &, const std::string &) = 0;

View File

@ -97,7 +97,7 @@ protected:
*/ */
virtual std::string getFunction(FUNCTION) = 0; virtual std::string getFunction(FUNCTION) = 0;
/** returns string calling comparaison function on 2 args passed as strings. /** returns string calling comparison function on 2 args passed as strings.
*/ */
virtual std::string compareFunction(COMPARE, const std::string &, const std::string &) = 0; virtual std::string compareFunction(COMPARE, const std::string &, const std::string &) = 0;

View File

@ -130,18 +130,18 @@ D3D12_STENCIL_OP get_stencil_op(rsx::stencil_op op)
throw EXCEPTION("Invalid stencil op (0x%x)", op); throw EXCEPTION("Invalid stencil op (0x%x)", op);
} }
D3D12_COMPARISON_FUNC get_compare_func(rsx::comparaison_function op) D3D12_COMPARISON_FUNC get_compare_func(rsx::comparison_function op)
{ {
switch (op) switch (op)
{ {
case rsx::comparaison_function::never: return D3D12_COMPARISON_FUNC_NEVER; case rsx::comparison_function::never: return D3D12_COMPARISON_FUNC_NEVER;
case rsx::comparaison_function::less: return D3D12_COMPARISON_FUNC_LESS; case rsx::comparison_function::less: return D3D12_COMPARISON_FUNC_LESS;
case rsx::comparaison_function::equal: return D3D12_COMPARISON_FUNC_EQUAL; case rsx::comparison_function::equal: return D3D12_COMPARISON_FUNC_EQUAL;
case rsx::comparaison_function::less_or_equal: return D3D12_COMPARISON_FUNC_LESS_EQUAL; case rsx::comparison_function::less_or_equal: return D3D12_COMPARISON_FUNC_LESS_EQUAL;
case rsx::comparaison_function::greater: return D3D12_COMPARISON_FUNC_GREATER; case rsx::comparison_function::greater: return D3D12_COMPARISON_FUNC_GREATER;
case rsx::comparaison_function::not_equal: return D3D12_COMPARISON_FUNC_NOT_EQUAL; case rsx::comparison_function::not_equal: return D3D12_COMPARISON_FUNC_NOT_EQUAL;
case rsx::comparaison_function::greater_or_equal: return D3D12_COMPARISON_FUNC_GREATER_EQUAL; case rsx::comparison_function::greater_or_equal: return D3D12_COMPARISON_FUNC_GREATER_EQUAL;
case rsx::comparaison_function::always: return D3D12_COMPARISON_FUNC_ALWAYS; case rsx::comparison_function::always: return D3D12_COMPARISON_FUNC_ALWAYS;
} }
throw EXCEPTION("Invalid or unsupported compare func (0x%x)", op); throw EXCEPTION("Invalid or unsupported compare func (0x%x)", op);
} }

View File

@ -30,7 +30,7 @@ D3D12_STENCIL_OP get_stencil_op(rsx::stencil_op op);
/** /**
* Convert GCM comparison function code to D3D12 one. * Convert GCM comparison function code to D3D12 one.
*/ */
D3D12_COMPARISON_FUNC get_compare_func(rsx::comparaison_function op); D3D12_COMPARISON_FUNC get_compare_func(rsx::comparison_function op);
/** /**
* Convert GCM texture format to an equivalent one supported by D3D12. * Convert GCM texture format to an equivalent one supported by D3D12.

View File

@ -298,22 +298,22 @@ void D3D12FragmentDecompiler::insertMainEnd(std::stringstream & OS)
{ {
switch (m_prog.alpha_func) switch (m_prog.alpha_func)
{ {
case rsx::comparaison_function::equal: case rsx::comparison_function::equal:
OS << " if (isAlphaTested && Out." << first_output_name << ".a != alphaRef) discard;\n"; OS << " if (isAlphaTested && Out." << first_output_name << ".a != alphaRef) discard;\n";
break; break;
case rsx::comparaison_function::not_equal: case rsx::comparison_function::not_equal:
OS << " if (isAlphaTested && Out." << first_output_name << ".a == alphaRef) discard;\n"; OS << " if (isAlphaTested && Out." << first_output_name << ".a == alphaRef) discard;\n";
break; break;
case rsx::comparaison_function::less_or_equal: case rsx::comparison_function::less_or_equal:
OS << " if (isAlphaTested && Out." << first_output_name << ".a > alphaRef) discard;\n"; OS << " if (isAlphaTested && Out." << first_output_name << ".a > alphaRef) discard;\n";
break; break;
case rsx::comparaison_function::less: case rsx::comparison_function::less:
OS << " if (isAlphaTested && Out." << first_output_name << ".a >= alphaRef) discard;\n"; OS << " if (isAlphaTested && Out." << first_output_name << ".a >= alphaRef) discard;\n";
break; break;
case rsx::comparaison_function::greater: case rsx::comparison_function::greater:
OS << " if (isAlphaTested && Out." << first_output_name << ".a <= alphaRef) discard;\n"; OS << " if (isAlphaTested && Out." << first_output_name << ".a <= alphaRef) discard;\n";
break; break;
case rsx::comparaison_function::greater_or_equal: case rsx::comparison_function::greater_or_equal:
OS << " if (isAlphaTested && Out." << first_output_name << ".a < alphaRef) discard;\n"; OS << " if (isAlphaTested && Out." << first_output_name << ".a < alphaRef) discard;\n";
break; break;
} }

View File

@ -792,20 +792,20 @@ rsx::window_pixel_center rsx::to_window_pixel_center(u8 in)
throw EXCEPTION("Unknow window pixel center %x", in); throw EXCEPTION("Unknow window pixel center %x", in);
} }
rsx::comparaison_function rsx::to_comparaison_function(u16 in) rsx::comparison_function rsx::to_comparison_function(u16 in)
{ {
switch (in) switch (in)
{ {
case CELL_GCM_NEVER: return rsx::comparaison_function::never; case CELL_GCM_NEVER: return rsx::comparison_function::never;
case CELL_GCM_LESS: return rsx::comparaison_function::less; case CELL_GCM_LESS: return rsx::comparison_function::less;
case CELL_GCM_EQUAL: return rsx::comparaison_function::equal; case CELL_GCM_EQUAL: return rsx::comparison_function::equal;
case CELL_GCM_LEQUAL: return rsx::comparaison_function::less_or_equal; case CELL_GCM_LEQUAL: return rsx::comparison_function::less_or_equal;
case CELL_GCM_GREATER: return rsx::comparaison_function::greater; case CELL_GCM_GREATER: return rsx::comparison_function::greater;
case CELL_GCM_NOTEQUAL: return rsx::comparaison_function::not_equal; case CELL_GCM_NOTEQUAL: return rsx::comparison_function::not_equal;
case CELL_GCM_GEQUAL: return rsx::comparaison_function::greater_or_equal; case CELL_GCM_GEQUAL: return rsx::comparison_function::greater_or_equal;
case CELL_GCM_ALWAYS: return rsx::comparaison_function::always; case CELL_GCM_ALWAYS: return rsx::comparison_function::always;
} }
throw EXCEPTION("Wrong comparaison function %x", in); throw EXCEPTION("Wrong comparison function %x", in);
} }
enum enum
@ -854,18 +854,18 @@ std::string print_boolean(bool b)
} }
} }
std::string print_comparaison_function(comparaison_function f) std::string print_comparison_function(comparison_function f)
{ {
switch (f) switch (f)
{ {
case comparaison_function::never: return "Never"; case comparison_function::never: return "Never";
case comparaison_function::less: return "Less"; case comparison_function::less: return "Less";
case comparaison_function::equal: return "Equal"; case comparison_function::equal: return "Equal";
case comparaison_function::less_or_equal: return "Less_equal"; case comparison_function::less_or_equal: return "Less_equal";
case comparaison_function::greater: return "Greater"; case comparison_function::greater: return "Greater";
case comparaison_function::not_equal: return "Not_equal"; case comparison_function::not_equal: return "Not_equal";
case comparaison_function::greater_or_equal: return "Greater_equal"; case comparison_function::greater_or_equal: return "Greater_equal";
case comparaison_function::always: return "Always"; case comparison_function::always: return "Always";
} }
throw; throw;
} }

View File

@ -129,7 +129,7 @@ namespace rsx
window_pixel_center to_window_pixel_center(u8 in); window_pixel_center to_window_pixel_center(u8 in);
enum class comparaison_function : u8 enum class comparison_function : u8
{ {
never, never,
less, less,
@ -141,7 +141,7 @@ namespace rsx
always always
}; };
comparaison_function to_comparaison_function(u16 in); comparison_function to_comparison_function(u16 in);
enum class fog_mode : u8 enum class fog_mode : u8
{ {

View File

@ -233,22 +233,22 @@ void GLFragmentDecompilerThread::insertMainEnd(std::stringstream & OS)
{ {
switch (m_prog.alpha_func) switch (m_prog.alpha_func)
{ {
case rsx::comparaison_function::equal: case rsx::comparison_function::equal:
OS << " if (bool(alpha_test) && " << first_output_name << ".a != alpha_ref) discard;\n"; OS << " if (bool(alpha_test) && " << first_output_name << ".a != alpha_ref) discard;\n";
break; break;
case rsx::comparaison_function::not_equal: case rsx::comparison_function::not_equal:
OS << " if (bool(alpha_test) && " << first_output_name << ".a == alpha_ref) discard;\n"; OS << " if (bool(alpha_test) && " << first_output_name << ".a == alpha_ref) discard;\n";
break; break;
case rsx::comparaison_function::less_or_equal: case rsx::comparison_function::less_or_equal:
OS << " if (bool(alpha_test) && " << first_output_name << ".a > alpha_ref) discard;\n"; OS << " if (bool(alpha_test) && " << first_output_name << ".a > alpha_ref) discard;\n";
break; break;
case rsx::comparaison_function::less: case rsx::comparison_function::less:
OS << " if (bool(alpha_test) && " << first_output_name << ".a >= alpha_ref) discard;\n"; OS << " if (bool(alpha_test) && " << first_output_name << ".a >= alpha_ref) discard;\n";
break; break;
case rsx::comparaison_function::greater: case rsx::comparison_function::greater:
OS << " if (bool(alpha_test) && " << first_output_name << ".a <= alpha_ref) discard;\n"; OS << " if (bool(alpha_test) && " << first_output_name << ".a <= alpha_ref) discard;\n";
break; break;
case rsx::comparaison_function::greater_or_equal: case rsx::comparison_function::greater_or_equal:
OS << " if (bool(alpha_test) && " << first_output_name << ".a < alpha_ref) discard;\n"; OS << " if (bool(alpha_test) && " << first_output_name << ".a < alpha_ref) discard;\n";
break; break;
} }

View File

@ -62,18 +62,18 @@ extern CellGcmContextData current_context;
namespace namespace
{ {
GLenum comparaison_op(rsx::comparaison_function op) GLenum comparison_op(rsx::comparison_function op)
{ {
switch (op) switch (op)
{ {
case rsx::comparaison_function::never: return GL_NEVER; case rsx::comparison_function::never: return GL_NEVER;
case rsx::comparaison_function::less: return GL_LESS; case rsx::comparison_function::less: return GL_LESS;
case rsx::comparaison_function::equal: return GL_EQUAL; case rsx::comparison_function::equal: return GL_EQUAL;
case rsx::comparaison_function::less_or_equal: return GL_LEQUAL; case rsx::comparison_function::less_or_equal: return GL_LEQUAL;
case rsx::comparaison_function::greater: return GL_GREATER; case rsx::comparison_function::greater: return GL_GREATER;
case rsx::comparaison_function::not_equal: return GL_NOTEQUAL; case rsx::comparison_function::not_equal: return GL_NOTEQUAL;
case rsx::comparaison_function::greater_or_equal: return GL_GEQUAL; case rsx::comparison_function::greater_or_equal: return GL_GEQUAL;
case rsx::comparaison_function::always: return GL_ALWAYS; case rsx::comparison_function::always: return GL_ALWAYS;
} }
throw; throw;
} }
@ -202,7 +202,7 @@ void GLGSRender::begin()
if (__glcheck enable(rsx::method_registers.depth_test_enabled(), GL_DEPTH_TEST)) if (__glcheck enable(rsx::method_registers.depth_test_enabled(), GL_DEPTH_TEST))
{ {
__glcheck glDepthFunc(comparaison_op(rsx::method_registers.depth_func())); __glcheck glDepthFunc(comparison_op(rsx::method_registers.depth_func()));
__glcheck glDepthMask(rsx::method_registers.depth_write_enabled()); __glcheck glDepthMask(rsx::method_registers.depth_write_enabled());
} }
@ -246,14 +246,14 @@ void GLGSRender::begin()
if (__glcheck enable(rsx::method_registers.stencil_test_enabled(), GL_STENCIL_TEST)) if (__glcheck enable(rsx::method_registers.stencil_test_enabled(), GL_STENCIL_TEST))
{ {
__glcheck glStencilFunc(comparaison_op(rsx::method_registers.stencil_func()), rsx::method_registers.stencil_func_ref(), __glcheck glStencilFunc(comparison_op(rsx::method_registers.stencil_func()), rsx::method_registers.stencil_func_ref(),
rsx::method_registers.stencil_func_mask()); rsx::method_registers.stencil_func_mask());
__glcheck glStencilOp(stencil_op(rsx::method_registers.stencil_op_fail()), stencil_op(rsx::method_registers.stencil_op_zfail()), __glcheck glStencilOp(stencil_op(rsx::method_registers.stencil_op_fail()), stencil_op(rsx::method_registers.stencil_op_zfail()),
stencil_op(rsx::method_registers.stencil_op_zpass())); stencil_op(rsx::method_registers.stencil_op_zpass()));
if (rsx::method_registers.two_sided_stencil_test_enabled()) { if (rsx::method_registers.two_sided_stencil_test_enabled()) {
__glcheck glStencilMaskSeparate(GL_BACK, rsx::method_registers.back_stencil_mask()); __glcheck glStencilMaskSeparate(GL_BACK, rsx::method_registers.back_stencil_mask());
__glcheck glStencilFuncSeparate(GL_BACK, comparaison_op(rsx::method_registers.back_stencil_func()), __glcheck glStencilFuncSeparate(GL_BACK, comparison_op(rsx::method_registers.back_stencil_func()),
rsx::method_registers.back_stencil_func_ref(), rsx::method_registers.back_stencil_func_mask()); rsx::method_registers.back_stencil_func_ref(), rsx::method_registers.back_stencil_func_mask());
__glcheck glStencilOpSeparate(GL_BACK, stencil_op(rsx::method_registers.back_stencil_op_fail()), __glcheck glStencilOpSeparate(GL_BACK, stencil_op(rsx::method_registers.back_stencil_op_fail()),
stencil_op(rsx::method_registers.back_stencil_op_zfail()), stencil_op(rsx::method_registers.back_stencil_op_zpass())); stencil_op(rsx::method_registers.back_stencil_op_zfail()), stencil_op(rsx::method_registers.back_stencil_op_zpass()));

View File

@ -458,14 +458,14 @@ rsx::complete_shader glsl_complete_shader(const rsx::decompiled_shader &shader,
} }
{ {
auto make_comparsion_test = [](rsx::comparaison_function compare_func, const std::string &test, const std::string &a, const std::string &b) -> std::string auto make_comparsion_test = [](rsx::comparison_function compare_func, const std::string &test, const std::string &a, const std::string &b) -> std::string
{ {
if (compare_func == rsx::comparaison_function::always) if (compare_func == rsx::comparison_function::always)
{ {
return{}; return{};
} }
if (compare_func == rsx::comparaison_function::never) if (compare_func == rsx::comparison_function::never)
{ {
return "\tdiscard;\n"; return "\tdiscard;\n";
} }
@ -474,27 +474,27 @@ rsx::complete_shader glsl_complete_shader(const rsx::decompiled_shader &shader,
switch (compare_func) switch (compare_func)
{ {
case rsx::comparaison_function::equal: case rsx::comparison_function::equal:
compare = "=="; compare = "==";
break; break;
case rsx::comparaison_function::not_equal: case rsx::comparison_function::not_equal:
compare = "!="; compare = "!=";
break; break;
case rsx::comparaison_function::less_or_equal: case rsx::comparison_function::less_or_equal:
compare = "<="; compare = "<=";
break; break;
case rsx::comparaison_function::less: case rsx::comparison_function::less:
compare = "<"; compare = "<";
break; break;
case rsx::comparaison_function::greater: case rsx::comparison_function::greater:
compare = ">"; compare = ">";
break; break;
case rsx::comparaison_function::greater_or_equal: case rsx::comparison_function::greater_or_equal:
compare = ">="; compare = ">=";
break; break;
} }
@ -508,11 +508,11 @@ rsx::complete_shader glsl_complete_shader(const rsx::decompiled_shader &shader,
{ {
std::string index_string = std::to_string(index); std::string index_string = std::to_string(index);
std::string fetch_texture = "texture_fetch(" + index_string + ", tex" + index_string + " * ftexture" + index_string + "_cm).a"; std::string fetch_texture = "texture_fetch(" + index_string + ", tex" + index_string + " * ftexture" + index_string + "_cm).a";
finalize += make_comparsion_test((rsx::comparaison_function)state.textures_zfunc[index], "", "0", fetch_texture); finalize += make_comparsion_test((rsx::comparison_function)state.textures_zfunc[index], "", "0", fetch_texture);
} }
} }
finalize += make_comparsion_test((rsx::comparaison_function)state.alpha_func, "alpha_test != 0 && ", "ocol.a", "alpha_ref"); finalize += make_comparsion_test((rsx::comparison_function)state.alpha_func, "alpha_test != 0 && ", "ocol.a", "alpha_ref");
} }
break; break;

View File

@ -221,7 +221,7 @@ struct RSXFragmentProgram
u32 offset; u32 offset;
u32 ctrl; u32 ctrl;
u16 unnormalized_coords; u16 unnormalized_coords;
rsx::comparaison_function alpha_func; rsx::comparison_function alpha_func;
bool front_back_color_enabled : 1; bool front_back_color_enabled : 1;
bool back_color_diffuse_output : 1; bool back_color_diffuse_output : 1;
bool back_color_specular_output : 1; bool back_color_specular_output : 1;

View File

@ -312,22 +312,22 @@ void VKFragmentDecompilerThread::insertMainEnd(std::stringstream & OS)
{ {
switch (m_prog.alpha_func) switch (m_prog.alpha_func)
{ {
case rsx::comparaison_function::equal: case rsx::comparison_function::equal:
OS << " if (bool(alpha_test) && " << first_output_name << ".a != alpha_ref) discard;\n"; OS << " if (bool(alpha_test) && " << first_output_name << ".a != alpha_ref) discard;\n";
break; break;
case rsx::comparaison_function::not_equal: case rsx::comparison_function::not_equal:
OS << " if (bool(alpha_test) && " << first_output_name << ".a == alpha_ref) discard;\n"; OS << " if (bool(alpha_test) && " << first_output_name << ".a == alpha_ref) discard;\n";
break; break;
case rsx::comparaison_function::less_or_equal: case rsx::comparison_function::less_or_equal:
OS << " if (bool(alpha_test) && " << first_output_name << ".a > alpha_ref) discard;\n"; OS << " if (bool(alpha_test) && " << first_output_name << ".a > alpha_ref) discard;\n";
break; break;
case rsx::comparaison_function::less: case rsx::comparison_function::less:
OS << " if (bool(alpha_test) && " << first_output_name << ".a >= alpha_ref) discard;\n"; OS << " if (bool(alpha_test) && " << first_output_name << ".a >= alpha_ref) discard;\n";
break; break;
case rsx::comparaison_function::greater: case rsx::comparison_function::greater:
OS << " if (bool(alpha_test) && " << first_output_name << ".a <= alpha_ref) discard;\n"; OS << " if (bool(alpha_test) && " << first_output_name << ".a <= alpha_ref) discard;\n";
break; break;
case rsx::comparaison_function::greater_or_equal: case rsx::comparison_function::greater_or_equal:
OS << " if (bool(alpha_test) && " << first_output_name << ".a < alpha_ref) discard;\n"; OS << " if (bool(alpha_test) && " << first_output_name << ".a < alpha_ref) discard;\n";
break; break;
} }

View File

@ -31,25 +31,25 @@ namespace
namespace vk namespace vk
{ {
VkCompareOp compare_op(rsx::comparaison_function op) VkCompareOp compare_op(rsx::comparison_function op)
{ {
switch (op) switch (op)
{ {
case rsx::comparaison_function::never: case rsx::comparison_function::never:
return VK_COMPARE_OP_NEVER; return VK_COMPARE_OP_NEVER;
case rsx::comparaison_function::greater: case rsx::comparison_function::greater:
return VK_COMPARE_OP_GREATER; return VK_COMPARE_OP_GREATER;
case rsx::comparaison_function::less: case rsx::comparison_function::less:
return VK_COMPARE_OP_LESS; return VK_COMPARE_OP_LESS;
case rsx::comparaison_function::less_or_equal: case rsx::comparison_function::less_or_equal:
return VK_COMPARE_OP_LESS_OR_EQUAL; return VK_COMPARE_OP_LESS_OR_EQUAL;
case rsx::comparaison_function::greater_or_equal: case rsx::comparison_function::greater_or_equal:
return VK_COMPARE_OP_GREATER_OR_EQUAL; return VK_COMPARE_OP_GREATER_OR_EQUAL;
case rsx::comparaison_function::equal: case rsx::comparison_function::equal:
return VK_COMPARE_OP_EQUAL; return VK_COMPARE_OP_EQUAL;
case rsx::comparaison_function::not_equal: case rsx::comparison_function::not_equal:
return VK_COMPARE_OP_NOT_EQUAL; return VK_COMPARE_OP_NOT_EQUAL;
case rsx::comparaison_function::always: case rsx::comparison_function::always:
return VK_COMPARE_OP_ALWAYS; return VK_COMPARE_OP_ALWAYS;
default: default:
throw EXCEPTION("Unsupported compare op: 0x%X", op); throw EXCEPTION("Unsupported compare op: 0x%X", op);

View File

@ -90,7 +90,7 @@ namespace
namespace rsx namespace rsx
{ {
std::string print_boolean(bool b); std::string print_boolean(bool b);
std::string print_comparaison_function(comparaison_function f); std::string print_comparison_function(comparison_function f);
std::string print_stencil_op(stencil_op op); std::string print_stencil_op(stencil_op op);
std::string print_fog_mode(fog_mode op); std::string print_fog_mode(fog_mode op);
std::string print_logic_op(logic_op op); std::string print_logic_op(logic_op op);
@ -1083,64 +1083,64 @@ struct registers_decoder<NV0039_OFFSET_IN>
template<> template<>
struct registers_decoder<NV4097_SET_DEPTH_FUNC> struct registers_decoder<NV4097_SET_DEPTH_FUNC>
{ {
static auto decode(u32 value) { return to_comparaison_function(value); } static auto decode(u32 value) { return to_comparison_function(value); }
static void commit_rsx_state(rsx_state &state, comparaison_function &&decoded_values) static void commit_rsx_state(rsx_state &state, comparison_function &&decoded_values)
{ {
state.m_depth_func = decoded_values; state.m_depth_func = decoded_values;
} }
static std::string dump(comparaison_function &&decoded_values) static std::string dump(comparison_function &&decoded_values)
{ {
return "Depth: compare_function = " + print_comparaison_function(decoded_values); return "Depth: compare_function = " + print_comparison_function(decoded_values);
} }
}; };
template<> template<>
struct registers_decoder<NV4097_SET_STENCIL_FUNC> struct registers_decoder<NV4097_SET_STENCIL_FUNC>
{ {
static auto decode(u32 value) { return to_comparaison_function(value); } static auto decode(u32 value) { return to_comparison_function(value); }
static void commit_rsx_state(rsx_state &state, comparaison_function &&decoded_values) static void commit_rsx_state(rsx_state &state, comparison_function &&decoded_values)
{ {
state.m_stencil_func = decoded_values; state.m_stencil_func = decoded_values;
} }
static std::string dump(comparaison_function &&decoded_values) static std::string dump(comparison_function &&decoded_values)
{ {
return "Stencil: (front) compare_function = " + print_comparaison_function(decoded_values); return "Stencil: (front) compare_function = " + print_comparison_function(decoded_values);
} }
}; };
template<> template<>
struct registers_decoder<NV4097_SET_BACK_STENCIL_FUNC> struct registers_decoder<NV4097_SET_BACK_STENCIL_FUNC>
{ {
static auto decode(u32 value) { return to_comparaison_function(value); } static auto decode(u32 value) { return to_comparison_function(value); }
static void commit_rsx_state(rsx_state &state, comparaison_function &&decoded_values) static void commit_rsx_state(rsx_state &state, comparison_function &&decoded_values)
{ {
state.m_back_stencil_func = decoded_values; state.m_back_stencil_func = decoded_values;
} }
static std::string dump(comparaison_function &&decoded_values) static std::string dump(comparison_function &&decoded_values)
{ {
return "Stencil: back compare_function = " + print_comparaison_function(decoded_values); return "Stencil: back compare_function = " + print_comparison_function(decoded_values);
} }
}; };
template<> template<>
struct registers_decoder<NV4097_SET_ALPHA_FUNC> struct registers_decoder<NV4097_SET_ALPHA_FUNC>
{ {
static auto decode(u32 value) { return to_comparaison_function(value); } static auto decode(u32 value) { return to_comparison_function(value); }
static void commit_rsx_state(rsx_state &state, comparaison_function &&decoded_values) static void commit_rsx_state(rsx_state &state, comparison_function &&decoded_values)
{ {
state.m_alpha_func = decoded_values; state.m_alpha_func = decoded_values;
} }
static std::string dump(comparaison_function &&decoded_values) static std::string dump(comparison_function &&decoded_values)
{ {
return "Alpha: compare_function = " + print_comparaison_function(decoded_values); return "Alpha: compare_function = " + print_comparison_function(decoded_values);
} }
}; };

View File

@ -794,7 +794,7 @@ namespace rsx
m_scissor_origin_y = 0; m_scissor_origin_y = 0;
m_alpha_test_enabled = false; m_alpha_test_enabled = false;
m_alpha_func = rsx::comparaison_function::always; m_alpha_func = rsx::comparison_function::always;
m_alpha_ref = 0; m_alpha_ref = 0;
m_blend_enabled = false; m_blend_enabled = false;
@ -816,7 +816,7 @@ namespace rsx
m_stencil_test_enabled = false; m_stencil_test_enabled = false;
m_two_sided_stencil_test_enabled = false; m_two_sided_stencil_test_enabled = false;
m_stencil_mask = 0xff; m_stencil_mask = 0xff;
m_stencil_func = rsx::comparaison_function::always; m_stencil_func = rsx::comparison_function::always;
m_stencil_func_ref = 0; m_stencil_func_ref = 0;
m_stencil_func_mask = 0xff; m_stencil_func_mask = 0xff;
m_stencil_op_fail = rsx::stencil_op::keep; m_stencil_op_fail = rsx::stencil_op::keep;
@ -824,7 +824,7 @@ namespace rsx
m_stencil_op_zpass = rsx::stencil_op::keep; m_stencil_op_zpass = rsx::stencil_op::keep;
m_back_stencil_mask = 0xff; m_back_stencil_mask = 0xff;
m_back_stencil_func = rsx::comparaison_function::always; m_back_stencil_func = rsx::comparison_function::always;
m_back_stencil_func_ref = 0; m_back_stencil_func_ref = 0;
m_back_stencil_func_mask = 0xff; m_back_stencil_func_mask = 0xff;
m_back_stencil_op_fail = rsx::stencil_op::keep; m_back_stencil_op_fail = rsx::stencil_op::keep;
@ -851,7 +851,7 @@ namespace rsx
m_fog_params_1 = 1.f; m_fog_params_1 = 1.f;
m_depth_test_enabled = false; m_depth_test_enabled = false;
m_depth_func = rsx::comparaison_function::less; m_depth_func = rsx::comparison_function::less;
m_depth_write_enabled = true; m_depth_write_enabled = true;
m_poly_offset_scale = 0.f; m_poly_offset_scale = 0.f;
@ -876,7 +876,7 @@ namespace rsx
m_context_dma_report = rsx::blit_engine::context_dma::to_memory_get_report; m_context_dma_report = rsx::blit_engine::context_dma::to_memory_get_report;
m_two_side_light_enabled = true; m_two_side_light_enabled = true;
m_alpha_func = rsx::comparaison_function::always; m_alpha_func = rsx::comparison_function::always;
// Reset vertex attrib array // Reset vertex attrib array
for (int i = 0; i < 16; i++) for (int i = 0; i < 16; i++)

View File

@ -166,7 +166,7 @@ namespace rsx
bool m_alpha_test_enabled : 1; bool m_alpha_test_enabled : 1;
u8 m_alpha_ref; u8 m_alpha_ref;
comparaison_function m_alpha_func : 3; comparison_function m_alpha_func : 3;
bool m_restart_index_enabled : 1; bool m_restart_index_enabled : 1;
u32 m_restart_index; u32 m_restart_index;
@ -193,7 +193,7 @@ namespace rsx
bool m_depth_bounds_test_enabled : 1; bool m_depth_bounds_test_enabled : 1;
bool m_depth_test_enabled : 1; bool m_depth_test_enabled : 1;
bool m_depth_write_enabled : 1; bool m_depth_write_enabled : 1;
comparaison_function m_depth_func : 3; comparison_function m_depth_func : 3;
f32 m_depth_bounds_min; f32 m_depth_bounds_min;
f32 m_depth_bounds_max; f32 m_depth_bounds_max;
f32 m_clip_min; f32 m_clip_min;
@ -206,8 +206,8 @@ namespace rsx
u8 m_back_stencil_func_ref; u8 m_back_stencil_func_ref;
u8 m_stencil_func_mask; u8 m_stencil_func_mask;
u8 m_back_stencil_func_mask; u8 m_back_stencil_func_mask;
comparaison_function m_stencil_func : 3; comparison_function m_stencil_func : 3;
comparaison_function m_back_stencil_func : 3; comparison_function m_back_stencil_func : 3;
stencil_op m_stencil_op_fail : 3; stencil_op m_stencil_op_fail : 3;
stencil_op m_stencil_op_zfail : 3; stencil_op m_stencil_op_zfail : 3;
stencil_op m_stencil_op_zpass : 3; stencil_op m_stencil_op_zpass : 3;
@ -631,17 +631,17 @@ namespace rsx
return m_two_sided_stencil_test_enabled; return m_two_sided_stencil_test_enabled;
} }
comparaison_function depth_func() const comparison_function depth_func() const
{ {
return m_depth_func; return m_depth_func;
} }
comparaison_function stencil_func() const comparison_function stencil_func() const
{ {
return m_stencil_func; return m_stencil_func;
} }
comparaison_function back_stencil_func() const comparison_function back_stencil_func() const
{ {
return m_back_stencil_func; return m_back_stencil_func;
} }
@ -971,7 +971,7 @@ namespace rsx
return m_fog_equation; return m_fog_equation;
} }
comparaison_function alpha_func() const comparison_function alpha_func() const
{ {
return m_alpha_func; return m_alpha_func;
} }