Remove alpha func

This commit is contained in:
Vincent Lejeune 2015-10-10 18:58:35 +02:00
parent 60bccf0f10
commit dd1afe85ae
6 changed files with 18 additions and 43 deletions

View File

@ -268,9 +268,10 @@ void D3D12GSRender::setScaleOffset()
void *scaleOffsetMap;
ThrowIfFailed(m_constantsData.m_heap->Map(0, &CD3DX12_RANGE(heapOffset, heapOffset + 256), &scaleOffsetMap));
streamToBuffer((char*)scaleOffsetMap + heapOffset, scaleOffsetMat, 16 * sizeof(float));
int isAlphaTested = m_set_alpha_test;
int isAlphaTested = !!(rsx::method_registers[NV4097_SET_ALPHA_TEST_ENABLE]);
float alpha_ref = (float&)rsx::method_registers[NV4097_SET_ALPHA_REF];
memcpy((char*)scaleOffsetMap + heapOffset + 16 * sizeof(float), &isAlphaTested, sizeof(int));
memcpy((char*)scaleOffsetMap + heapOffset + 17 * sizeof(float), &m_alpha_ref, sizeof(float));
memcpy((char*)scaleOffsetMap + heapOffset + 17 * sizeof(float), &alpha_ref, sizeof(float));
m_constantsData.m_heap->Unmap(0, &CD3DX12_RANGE(heapOffset, heapOffset + 256));
D3D12_CONSTANT_BUFFER_VIEW_DESC constantBufferViewDesc = {};

View File

@ -1663,7 +1663,7 @@ void GLGSRender::end()
}
// Enable(m_set_depth_test, GL_DEPTH_TEST);
Enable(m_set_alpha_test, GL_ALPHA_TEST);
// Enable(m_set_alpha_test, GL_ALPHA_TEST);
// Enable(m_set_blend || m_set_blend_mrt1 || m_set_blend_mrt2 || m_set_blend_mrt3, GL_BLEND);
Enable(m_set_scissor_horizontal && m_set_scissor_vertical, GL_SCISSOR_TEST);
// Enable(m_set_logic_op, GL_LOGIC_OP);
@ -1877,9 +1877,9 @@ void GLGSRender::end()
checkForGlError("glFrontFace");
}
if (m_set_alpha_func && m_set_alpha_ref)
// if (m_set_alpha_func && m_set_alpha_ref)
{
glAlphaFunc(m_alpha_func, m_alpha_ref);
// glAlphaFunc(m_alpha_func, m_alpha_ref);
checkForGlError("glAlphaFunc");
}

View File

@ -564,32 +564,13 @@ void RSXThread::DoCmd(const u32 fcmd, const u32 cmd, const u32 args_addr, const
// Alpha testing
case NV4097_SET_ALPHA_TEST_ENABLE:
{
m_set_alpha_test = ARGS(0) ? true : false;
break;
}
case NV4097_SET_ALPHA_FUNC:
{
m_set_alpha_func = true;
m_alpha_func = ARGS(0);
if (count == 2)
{
m_set_alpha_ref = true;
const u32 a1 = ARGS(1);
m_alpha_ref = (float&)a1;
}
break;
}
case NV4097_SET_ALPHA_REF:
{
m_set_alpha_ref = true;
const u32 a0 = ARGS(0);
m_alpha_ref = (float&)a0;
break;
}
// Cull face
case NV4097_SET_CULL_FACE_ENABLE:

View File

@ -352,13 +352,6 @@ public:
bool m_set_cull_face;
u32 m_cull_face;
// Alpha test
bool m_set_alpha_test;
bool m_set_alpha_func;
u32 m_alpha_func;
bool m_set_alpha_ref;
float m_alpha_ref;
// Shader
u16 m_shader_window_height;
u8 m_shader_window_origin;
@ -400,7 +393,7 @@ protected:
flip_handler.set(0);
vblank_handler.set(0);
user_handler.set(0);
m_set_alpha_test = false;
rsx::method_registers[NV4097_SET_ALPHA_TEST_ENABLE] = false;
m_set_depth_bounds_test = false;
rsx::method_registers[NV4097_SET_BLEND_ENABLE_MRT] = 0;
rsx::method_registers[NV4097_SET_BLEND_ENABLE] = false;
@ -433,8 +426,8 @@ protected:
m_back_polygon_mode = 0x1b02; // GL_FILL
m_front_face = 0x0901; // GL_CCW
m_cull_face = 0x0405; // GL_BACK
m_alpha_func = 0x0207; // GL_ALWAYS
m_alpha_ref = 0.0f;
rsx::method_registers[NV4097_SET_ALPHA_FUNC] = 0x0207; // GL_ALWAYS
rsx::method_registers[NV4097_SET_ALPHA_REF] = 0.0f;
m_shade_mode = 0x1D01; // GL_SMOOTH
m_depth_bounds_min = 0.0;
@ -505,9 +498,9 @@ protected:
m_set_context_dma_z = false;
m_set_cull_face = false;
m_set_front_face = false;
m_set_alpha_test = false;
m_set_alpha_func = false;
m_set_alpha_ref = false;
rsx::method_registers[NV4097_SET_ALPHA_TEST_ENABLE] = false;
rsx::method_registers[NV4097_SET_ALPHA_FUNC] = false;
rsx::method_registers[NV4097_SET_ALPHA_REF] = false;
m_set_poly_smooth = false;
m_set_poly_offset_fill = false;
m_set_poly_offset_line = false;

View File

@ -470,7 +470,7 @@ void SetupRsxRenderingStates(vm::ptr<CellGcmContextData>& cntxt)
GSRender& r = Emu.GetGSManager().GetRender();
rsx::method_registers[NV4097_SET_COLOR_MASK] = -1;
rsx::method_registers[NV4097_SET_DEPTH_MASK] = 0;
r.m_set_alpha_test = false;
rsx::method_registers[NV4097_SET_ALPHA_TEST_ENABLE] = false;
rsx::method_registers[NV4097_SET_BLEND_ENABLE] = false;
rsx::method_registers[NV4097_SET_BLEND_ENABLE_MRT] = false;
// r.m_set_logic_op = false;

View File

@ -493,7 +493,7 @@ void RSXDebugger::GetFlags()
#define LIST_FLAGS_ADD(name, value) \
m_list_flags->InsertItem(i, name); m_list_flags->SetItem(i, 1, value ? "Enabled" : "Disabled"); i++;
LIST_FLAGS_ADD("Alpha test", render.m_set_alpha_test);
LIST_FLAGS_ADD("Alpha test", rsx::method_registers[NV4097_SET_ALPHA_TEST_ENABLE]);
LIST_FLAGS_ADD("Blend", rsx::method_registers[NV4097_SET_BLEND_ENABLE]);
LIST_FLAGS_ADD("Scissor", render.m_set_scissor_horizontal && render.m_set_scissor_vertical);
LIST_FLAGS_ADD("Cull face", render.m_set_cull_face);
@ -592,9 +592,9 @@ void RSXDebugger::GetSettings()
#define LIST_SETTINGS_ADD(name, value) \
m_list_settings->InsertItem(i, name); m_list_settings->SetItem(i, 1, value); i++;
LIST_SETTINGS_ADD("Alpha func", !(render.m_set_alpha_func) ? "(none)" : wxString::Format("0x%x (%s)",
render.m_alpha_func,
ParseGCMEnum(render.m_alpha_func, CELL_GCM_ENUM)));
LIST_SETTINGS_ADD("Alpha func", !(rsx::method_registers[NV4097_SET_ALPHA_FUNC]) ? "(none)" : wxString::Format("0x%x (%s)",
rsx::method_registers[NV4097_SET_ALPHA_FUNC],
ParseGCMEnum(rsx::method_registers[NV4097_SET_ALPHA_FUNC], CELL_GCM_ENUM)));
LIST_SETTINGS_ADD("Blend color", !(rsx::method_registers[NV4097_SET_BLEND_COLOR]) ? "(none)" : wxString::Format("R:%d, G:%d, B:%d, A:%d",
rsx::method_registers[NV4097_SET_BLEND_COLOR] & 0xFF,
(rsx::method_registers[NV4097_SET_BLEND_COLOR] >> 8) & 0xFF,
@ -651,7 +651,7 @@ void RSXDebugger::SetFlags(wxListEvent& event)
GSRender& render = Emu.GetGSManager().GetRender();
switch(event.m_itemIndex)
{
case 0: render.m_set_alpha_test ^= true; break;
case 0: rsx::method_registers[NV4097_SET_ALPHA_TEST_ENABLE] ^= true; break;
case 1: rsx::method_registers[NV4097_SET_BLEND_ENABLE] ^= true; break;
case 2: render.m_set_cull_face ^= true; break;
case 3: render.m_set_depth_bounds_test ^= true; break;