mirror of
https://github.com/PCSX2/pcsx2.git
synced 2026-01-31 01:15:24 +01:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9dd6277e3 | ||
|
|
e5f49d0ae7 | ||
|
|
73371c3098 | ||
|
|
11da1c053d | ||
|
|
3bc5779f68 | ||
|
|
644f0e61ba | ||
|
|
5a8f01edf4 | ||
|
|
02afca3bb6 | ||
|
|
1fb3d7dd17 |
@@ -1,4 +1,4 @@
|
||||
Source: pcsx2.snapshot
|
||||
Source: pcsx2
|
||||
Section: contrib/games
|
||||
Priority: optional
|
||||
Maintainer: Gregory Hainaut <gregory.hainaut@gmail.com>
|
||||
@@ -28,7 +28,7 @@ Build-Depends: cmake (>= 2.8.5),
|
||||
Standards-Version: 3.9.3
|
||||
Homepage: http://pcsx2.net/
|
||||
|
||||
Package: pcsx2-unstable
|
||||
Package: pcsx2
|
||||
Architecture: i386
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
# libasound => alsa plugin for pulseaudio
|
||||
@@ -36,12 +36,12 @@ Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Recommends: libasound2-plugins,
|
||||
libusb-0.1-4
|
||||
Conflicts: pcsx2,
|
||||
pcsx2-data-unstable,
|
||||
pcsx2-l10n-unstable,
|
||||
pcsx2-plugins-unstable
|
||||
Replaces: pcsx2-data-unstable,
|
||||
pcsx2-l10n-unstable,
|
||||
pcsx2-plugins-unstable
|
||||
pcsx2-data,
|
||||
pcsx2-l10n,
|
||||
pcsx2-plugins
|
||||
Replaces: pcsx2-data,
|
||||
pcsx2-l10n,
|
||||
pcsx2-plugins
|
||||
Description: Playstation 2 emulator
|
||||
PCSX2 is a PlayStation 2 emulator for Windows and Linux.
|
||||
.
|
||||
@@ -49,14 +49,14 @@ Description: Playstation 2 emulator
|
||||
this instruction set, it does not have enough horse power to run this emulator
|
||||
anyway.
|
||||
|
||||
Package: pcsx2-unstable-dbg
|
||||
Package: pcsx2-dbg
|
||||
Section: contrib/debug
|
||||
Priority: extra
|
||||
Architecture: i386
|
||||
Depends: ${misc:Depends}, pcsx2-unstable (= ${binary:Version})
|
||||
Depends: ${misc:Depends}, pcsx2 (= ${binary:Version})
|
||||
Conflicts: pcsx2-dbg,
|
||||
pcsx2-plugins-unstable-dbg
|
||||
Replaces: pcsx2-plugins-unstable-dbg
|
||||
pcsx2-plugins-dbg
|
||||
Replaces: pcsx2-plugins-dbg
|
||||
Description: Debug symbols for pcsx2
|
||||
PCSX2 is a PlayStation 2 emulator for Windows and Linux.
|
||||
.
|
||||
@@ -32,7 +32,7 @@ EOF
|
||||
|
||||
# Default value
|
||||
SVN_CO_VERSION=0;
|
||||
BRANCH="trunk"
|
||||
BRANCH="1.2.x"
|
||||
LOCAL=0
|
||||
while [ -n "$1" ]; do
|
||||
case $1 in
|
||||
@@ -57,8 +57,8 @@ else
|
||||
fi
|
||||
|
||||
# Debian name of package and tarball
|
||||
PKG_NAME="pcsx2.snapshot-${SVN_CO_VERSION}"
|
||||
TAR_NAME="pcsx2.snapshot_${SVN_CO_VERSION}.orig.tar"
|
||||
PKG_NAME="pcsx2-1.2.2"
|
||||
TAR_NAME="pcsx2_1.2.2.orig.tar"
|
||||
|
||||
# Directory
|
||||
TMP_DIR=/tmp
|
||||
@@ -1,4 +1,4 @@
|
||||
?package(pcsx2-unstable): \
|
||||
?package(pcsx2): \
|
||||
needs="X11" \
|
||||
section="Applications/Emulators" \
|
||||
title="pcsx2" \
|
||||
@@ -17,7 +17,7 @@ override_dh_auto_configure:
|
||||
-DPACKAGE_MODE=TRUE
|
||||
|
||||
override_dh_strip:
|
||||
dh_strip --package=pcsx2-unstable --dbg-package=pcsx2-unstable-dbg
|
||||
dh_strip --package=pcsx2 --dbg-package=pcsx2-dbg
|
||||
|
||||
override_dh_makeshlibs:
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
#pragma once
|
||||
|
||||
static const int PCSX2_VersionHi = 1;
|
||||
static const int PCSX2_VersionMid = 2;
|
||||
static const int PCSX2_VersionMid = 3;
|
||||
static const int PCSX2_VersionLo = 0;
|
||||
static const bool PCSX2_isReleaseVersion = 1;
|
||||
static const bool PCSX2_isReleaseVersion = 0;
|
||||
|
||||
class SysCoreThread;
|
||||
class CpuInitializerSet;
|
||||
|
||||
@@ -316,6 +316,11 @@ void vifMFIFOInterrupt()
|
||||
if (vif1.irq && vif1.tag.size == 0) {
|
||||
SPR_LOG("VIF MFIFO Code Interrupt detected");
|
||||
vif1Regs.stat.INT = true;
|
||||
|
||||
if (((vif1Regs.code >> 24) & 0x7f) != 0x7) {
|
||||
vif1Regs.stat.VIS = true;
|
||||
}
|
||||
|
||||
hwIntcIrq(INTC_VIF1);
|
||||
--vif1.irq;
|
||||
|
||||
|
||||
@@ -31,8 +31,10 @@ GSDevice11::GSDevice11()
|
||||
memset(&m_vs_cb_cache, 0, sizeof(m_vs_cb_cache));
|
||||
memset(&m_ps_cb_cache, 0, sizeof(m_ps_cb_cache));
|
||||
|
||||
FXAA_Compiled = false;
|
||||
ExShader_Compiled = false;
|
||||
|
||||
UserHacks_NVIDIAHack = !!theApp.GetConfig("UserHacks_NVIDIAHack", 0) && !!theApp.GetConfig("UserHacks", 0);
|
||||
FFXA_Compiled = false;
|
||||
|
||||
m_state.topology = D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED;
|
||||
m_state.bf = -1;
|
||||
@@ -274,8 +276,6 @@ bool GSDevice11::Create(GSWnd* wnd)
|
||||
|
||||
hr = m_dev->CreateBuffer(&bd, NULL, &m_shaderfx.cb);
|
||||
|
||||
ExShader_Compiled = false;
|
||||
|
||||
// Fxaa
|
||||
|
||||
memset(&bd, 0, sizeof(bd));
|
||||
@@ -286,7 +286,7 @@ bool GSDevice11::Create(GSWnd* wnd)
|
||||
|
||||
hr = m_dev->CreateBuffer(&bd, NULL, &m_fxaa.cb);
|
||||
|
||||
FFXA_Compiled = false;
|
||||
//
|
||||
|
||||
memset(&rd, 0, sizeof(rd));
|
||||
|
||||
@@ -773,7 +773,7 @@ void GSDevice11::DoExternalFX(GSTexture* st, GSTexture* dt)
|
||||
// and for some reason isolating this code makes the plugin not crash
|
||||
void GSDevice11::InitFXAA()
|
||||
{
|
||||
if (!FFXA_Compiled)
|
||||
if (!FXAA_Compiled)
|
||||
{
|
||||
try {
|
||||
CompileShader(IDR_FXAA_FX, "ps_main", NULL, &m_fxaa.ps);
|
||||
@@ -781,7 +781,7 @@ void GSDevice11::InitFXAA()
|
||||
catch (GSDXRecoverableError) {
|
||||
CompileShader(IDR_FXAA_FX, "ps_recover", NULL, &m_fxaa.ps);
|
||||
}
|
||||
FFXA_Compiled = true;
|
||||
FXAA_Compiled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -85,9 +85,9 @@ class GSDevice11 : public GSDeviceDX
|
||||
public: // TODO
|
||||
CComPtr<ID3D11RasterizerState> m_rs;
|
||||
|
||||
bool UserHacks_NVIDIAHack;
|
||||
bool FFXA_Compiled;
|
||||
bool FXAA_Compiled;
|
||||
bool ExShader_Compiled;
|
||||
bool UserHacks_NVIDIAHack;
|
||||
|
||||
struct
|
||||
{
|
||||
|
||||
@@ -28,7 +28,9 @@ GSDevice9::GSDevice9()
|
||||
: m_lost(false)
|
||||
{
|
||||
m_rbswapped = true;
|
||||
FFXA_Compiled = false;
|
||||
FXAA_Compiled = false;
|
||||
ExShader_Compiled = false;
|
||||
|
||||
|
||||
memset(&m_pp, 0, sizeof(m_pp));
|
||||
memset(&m_d3dcaps, 0, sizeof(m_d3dcaps));
|
||||
@@ -357,25 +359,8 @@ bool GSDevice9::Create(GSWnd* wnd)
|
||||
{NULL, NULL},
|
||||
};
|
||||
|
||||
CompileShader(IDR_SHADEBOOST_FX, "ps_main", macro, &m_shadeboost.ps);
|
||||
CompileShader(IDR_SHADEBOOST_FX, "ps_main", macro, &m_shadeboost.ps);
|
||||
|
||||
ExShader_Compiled = false;
|
||||
FFXA_Compiled = false;
|
||||
/*
|
||||
// fxaa
|
||||
if (Use_FXAA_Shader)
|
||||
{
|
||||
#if EXTERNAL_SHADER_LOADING
|
||||
try {
|
||||
CompileShader("shader.fx", "ps_main", NULL, &m_fxaa.ps);
|
||||
}
|
||||
catch (GSDXRecoverableError) {
|
||||
CompileShader(IDR_FXAA_FX, "ps_main", NULL, &m_fxaa.ps);
|
||||
}
|
||||
#else
|
||||
CompileShader(IDR_FXAA_FX, "ps_main", NULL, &m_fxaa.ps);
|
||||
#endif
|
||||
}*/
|
||||
// create shader layout
|
||||
|
||||
VSSelector sel;
|
||||
@@ -935,16 +920,8 @@ void GSDevice9::DoInterlace(GSTexture* st, GSTexture* dt, int shader, bool linea
|
||||
StretchRect(st, sr, dt, dr, m_interlace.ps[shader], (const float*)&cb, 1, linear);
|
||||
}
|
||||
|
||||
|
||||
void GSDevice9::DoExternalFX(GSTexture* st, GSTexture* dt)
|
||||
void GSDevice9::InitExternalFX()
|
||||
{
|
||||
GSVector2i s = dt->GetSize();
|
||||
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 dr(0, 0, s.x, s.y);
|
||||
|
||||
ExternalFXConstantBuffer cb;
|
||||
|
||||
if (!ExShader_Compiled)
|
||||
{
|
||||
try {
|
||||
@@ -955,6 +932,18 @@ void GSDevice9::DoExternalFX(GSTexture* st, GSTexture* dt)
|
||||
}
|
||||
ExShader_Compiled = true;
|
||||
}
|
||||
}
|
||||
|
||||
void GSDevice9::DoExternalFX(GSTexture* st, GSTexture* dt)
|
||||
{
|
||||
GSVector2i s = dt->GetSize();
|
||||
|
||||
GSVector4 sr(0, 0, 1, 1);
|
||||
GSVector4 dr(0, 0, s.x, s.y);
|
||||
|
||||
ExternalFXConstantBuffer cb;
|
||||
|
||||
InitExternalFX();
|
||||
|
||||
cb.rcpFrame = GSVector4(1.0f / s.x, 1.0f / s.y, 0.0f, 0.0f);
|
||||
cb.rcpFrameOpt = GSVector4::zero();
|
||||
@@ -962,6 +951,19 @@ void GSDevice9::DoExternalFX(GSTexture* st, GSTexture* dt)
|
||||
StretchRect(st, sr, dt, dr, m_shaderfx.ps, (const float*)&cb, 2, true);
|
||||
}
|
||||
|
||||
void GSDevice9::InitFXAA()
|
||||
{
|
||||
if (!FXAA_Compiled)
|
||||
{
|
||||
try {
|
||||
CompileShader(IDR_FXAA_FX, "ps_main", NULL, &m_fxaa.ps);
|
||||
}
|
||||
catch (GSDXRecoverableError) {
|
||||
CompileShader(IDR_FXAA_FX, "ps_recover", NULL, &m_fxaa.ps);
|
||||
}
|
||||
FXAA_Compiled = true;
|
||||
}
|
||||
}
|
||||
|
||||
void GSDevice9::DoFXAA(GSTexture* st, GSTexture* dt)
|
||||
{
|
||||
@@ -972,16 +974,7 @@ void GSDevice9::DoFXAA(GSTexture* st, GSTexture* dt)
|
||||
|
||||
FXAAConstantBuffer cb;
|
||||
|
||||
if (!FFXA_Compiled)
|
||||
{
|
||||
try {
|
||||
CompileShader(IDR_FXAA_FX, "ps_main", NULL, &m_fxaa.ps);
|
||||
}
|
||||
catch (GSDXRecoverableError) {
|
||||
CompileShader(IDR_FXAA_FX, "ps_recover", NULL, &m_fxaa.ps);
|
||||
}
|
||||
FFXA_Compiled = true;
|
||||
}
|
||||
InitFXAA();
|
||||
|
||||
cb.rcpFrame = GSVector4(1.0f / s.x, 1.0f / s.y, 0.0f, 0.0f);
|
||||
cb.rcpFrameOpt = GSVector4::zero();
|
||||
|
||||
@@ -75,6 +75,9 @@ class GSDevice9 : public GSDeviceDX
|
||||
void DoShadeBoost(GSTexture* st, GSTexture* dt);
|
||||
void DoExternalFX(GSTexture* st, GSTexture* dt);
|
||||
|
||||
void InitExternalFX();
|
||||
void InitFXAA();
|
||||
|
||||
//
|
||||
|
||||
D3DCAPS9 m_d3dcaps;
|
||||
@@ -114,7 +117,7 @@ class GSDevice9 : public GSDeviceDX
|
||||
|
||||
public: // TODO
|
||||
|
||||
bool FFXA_Compiled;
|
||||
bool FXAA_Compiled;
|
||||
bool ExShader_Compiled;
|
||||
|
||||
struct
|
||||
|
||||
@@ -1134,8 +1134,7 @@ void GSDeviceOGL::OMSetRenderTargets(GSTexture* rt, GSTexture* ds, const GSVecto
|
||||
OMSetWriteBuffer();
|
||||
OMAttachRt(static_cast<GSTextureOGL*>(rt)->GetID());
|
||||
} else {
|
||||
// Note: NULL rt is only used in DATE so far. Color writing is disabled
|
||||
// on the blend setup
|
||||
// Note: NULL rt is only used in DATE so far.
|
||||
OMSetFBO(m_fbo);
|
||||
OMSetWriteBuffer(GL_NONE);
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ bool RunLinuxDialog()
|
||||
GtkWidget *interlace_label, *threads_label, *native_label, *fsaa_label, *rexy_label, *render_label, *filter_label;
|
||||
|
||||
GtkWidget *hack_table, *hack_skipdraw_label, *hack_box, *hack_frame;
|
||||
GtkWidget *hack_alpha_check, *hack_offset_check, *hack_skipdraw_spin, *hack_msaa_check, *hack_sprite_check, * hack_wild_check, *hack_enble_check, *hack_logz_check;
|
||||
GtkWidget *hack_alpha_check, *hack_date_check, *hack_offset_check, *hack_skipdraw_spin, *hack_msaa_check, *hack_sprite_check, * hack_wild_check, *hack_enble_check, *hack_logz_check;
|
||||
GtkWidget *hack_tco_label, *hack_tco_entry;
|
||||
GtkWidget *gl_box, *gl_frame, *gl_table;
|
||||
|
||||
@@ -353,6 +353,7 @@ bool RunLinuxDialog()
|
||||
|
||||
// Create our hack settings.
|
||||
hack_alpha_check = gtk_check_button_new_with_label("Alpha Hack");
|
||||
hack_date_check = gtk_check_button_new_with_label("Date Hack");
|
||||
hack_offset_check = gtk_check_button_new_with_label("Offset Hack");
|
||||
hack_skipdraw_label = gtk_label_new("Skipdraw:");
|
||||
hack_skipdraw_spin = gtk_spin_button_new_with_range(0,1000,1);
|
||||
@@ -373,6 +374,7 @@ bool RunLinuxDialog()
|
||||
gtk_table_attach_defaults(GTK_TABLE(hack_table), hack_sprite_check, 0, 1, 1, 2);
|
||||
gtk_table_attach_defaults(GTK_TABLE(hack_table), hack_wild_check, 1, 2, 1, 2);
|
||||
gtk_table_attach_defaults(GTK_TABLE(hack_table), hack_logz_check, 0, 1, 2, 3);
|
||||
gtk_table_attach_defaults(GTK_TABLE(hack_table), hack_date_check, 1, 2, 2, 3);
|
||||
// Note: MSAA is not implemented yet. I disable it to make the table square
|
||||
//gtk_table_attach_defaults(GTK_TABLE(hack_table), hack_msaa_check, 2, 3, 1, 2);
|
||||
gtk_table_attach_defaults(GTK_TABLE(hack_table), hack_skipdraw_label, 0, 1, 3, 4);
|
||||
@@ -397,6 +399,7 @@ bool RunLinuxDialog()
|
||||
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(hack_alpha_check), theApp.GetConfig("UserHacks_AlphaHack", 0));
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(hack_offset_check), theApp.GetConfig("UserHacks_HalfPixelOffset", 0));
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(hack_date_check), theApp.GetConfig("UserHacks_DateGL4", 0));
|
||||
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(hack_enble_check), theApp.GetConfig("UserHacks", 0));
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(hack_msaa_check), theApp.GetConfig("UserHacks_MSAA", 0));
|
||||
@@ -512,11 +515,7 @@ override_GL_ARB_shading_language_420pack = -1
|
||||
gtk_container_add(GTK_CONTAINER(central_box), hw_frame);
|
||||
gtk_container_add(GTK_CONTAINER(central_box), sw_frame);
|
||||
|
||||
if (!!theApp.GetConfig("UserHacks", 0))
|
||||
{
|
||||
gtk_container_add(GTK_CONTAINER(advance_box), hack_frame);
|
||||
}
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(advance_box), hack_frame);
|
||||
gtk_container_add(GTK_CONTAINER(advance_box), gl_frame);
|
||||
|
||||
g_signal_connect(render_combo_box, "changed", G_CALLBACK(toggle_widget_states), NULL);
|
||||
@@ -577,6 +576,7 @@ override_GL_ARB_shading_language_420pack = -1
|
||||
theApp.SetConfig("UserHacks_HalfPixelOffset", (int)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hack_offset_check)));
|
||||
theApp.SetConfig("UserHacks_AlphaHack", (int)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hack_alpha_check)));
|
||||
theApp.SetConfig("logz", (int)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hack_logz_check)));
|
||||
theApp.SetConfig("UserHacks_DateGL4", (int)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hack_date_check)));
|
||||
|
||||
theApp.SetConfig("UserHacks_MSAA", (int)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hack_msaa_check)));
|
||||
theApp.SetConfig("UserHacks_WildHack", (int)gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(hack_wild_check)));
|
||||
|
||||
@@ -36,6 +36,7 @@ GSRenderer::GSRenderer()
|
||||
|
||||
m_interlace = theApp.GetConfig("interlace", 7);
|
||||
m_aspectratio = theApp.GetConfig("aspectratio", 1);
|
||||
m_shader = theApp.GetConfig("TVShader", 0);
|
||||
m_filter = theApp.GetConfig("filter", 1);
|
||||
m_vsync = !!theApp.GetConfig("vsync", 0);
|
||||
m_aa1 = !!theApp.GetConfig("aa1", 0);
|
||||
@@ -560,7 +561,8 @@ void GSRenderer::KeyEvent(GSKeyEventData* e)
|
||||
return;
|
||||
case VK_F7:
|
||||
m_shader = (m_shader + post_shader_nb + step) % post_shader_nb;
|
||||
printf("GSdx: Set shader %d.\n", (int)m_shader);
|
||||
printf("GSdx: Set shader to: %d.\n", (int)m_shader);
|
||||
theApp.SetConfig("TVShader", (int)m_shader);
|
||||
return;
|
||||
case VK_DELETE:
|
||||
m_aa1 = !m_aa1;
|
||||
@@ -598,6 +600,7 @@ void GSRenderer::KeyEvent(GSKeyEventData* e)
|
||||
return;
|
||||
case XK_F7:
|
||||
m_shader = (m_shader + post_shader_nb + step) % post_shader_nb;
|
||||
theApp.SetConfig("TVShader", (int)m_shader);
|
||||
fprintf(stderr,"GSdx: Set shader %d.\n", (int)m_shader);
|
||||
return;
|
||||
case XK_Delete:
|
||||
|
||||
@@ -609,10 +609,10 @@ bool GSHacksDlg::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
|
||||
"Will disable partial transparency in some games or even prevent drawing some elements altogether.";
|
||||
break;
|
||||
case IDC_CHECK_NVIDIA_HACK:
|
||||
helpstr = "This is a hack to work around problems with recent NVIDIA drivers causing odd stretching problems in DirectX 11 only"
|
||||
helpstr = "This is a hack to work around problems with recent NVIDIA drivers causing odd stretching problems in DirectX 11 only "
|
||||
"when using Upscaling.\n\n"
|
||||
"Try not to use this unless your game Videos or 2D screens are stretching outside the frame.\n\n"
|
||||
"If you have an AMD/ATi graphics card you should not needs this.";
|
||||
"If you have an AMD/ATi graphics card you should not need this.";
|
||||
break;
|
||||
case IDC_CHECK_DISABLE_ALL_HACKS:
|
||||
helpstr = "FOR TESTING ONLY!!\n\n"
|
||||
|
||||
@@ -60,7 +60,12 @@ void GSDeviceOGL::CreateTextureFX()
|
||||
// Help to debug FS in apitrace
|
||||
m_apitrace = CompilePS(PSSelector());
|
||||
|
||||
if (!!theApp.GetConfig("GL_NV_Depth", 0)) {
|
||||
// VS gl_position.z => [-1,-1]
|
||||
// FS depth => [0, 1]
|
||||
// because of -1 we loose lot of precision for small GS value
|
||||
// This extension allow FS depth to range from -1 to 1. So
|
||||
// gl_position.z could range from [0, 1]
|
||||
if (GLLoader::found_GL_NV_depth_buffer_float) {
|
||||
gl_DepthRangedNV(-1.0f, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace PboPool {
|
||||
|
||||
void EndTransfer() {
|
||||
// Note: keep offset aligned for SSE/AVX
|
||||
m_offset[m_current_pbo] += (m_size + 64) & ~0x3F;
|
||||
m_offset[m_current_pbo] = (m_offset[m_current_pbo] + m_size + 31) & ~0x1F;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,8 +319,11 @@ bool GSTextureOGL::Update(const GSVector4i& r, const void* data, int pitch)
|
||||
char* map = PboPool::Map(r.height() * line_size);
|
||||
|
||||
for (uint32 h = r.height(); h > 0; h--) {
|
||||
GSVector4i::storent(map, src, line_size);
|
||||
//memcpy(map, src, line_size);
|
||||
// avoid a crash if map is not aligned
|
||||
if ((uint32)map & 0x1F)
|
||||
memcpy(map, src, line_size);
|
||||
else
|
||||
GSVector4i::storent(map, src, line_size);
|
||||
src += pitch;
|
||||
map += line_size;
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ void ps_main9()
|
||||
#ifdef ps_main2
|
||||
void ps_main2()
|
||||
{
|
||||
if(sample_c().a < 127.5f / 255.0f) // >= 0x80 pass
|
||||
if(sample_c().a < (127.5f / 255.0f)) // >= 0x80 pass
|
||||
discard;
|
||||
|
||||
#ifdef ENABLE_OGL_STENCIL_DEBUG
|
||||
@@ -237,7 +237,7 @@ void ps_main2()
|
||||
#ifdef ps_main3
|
||||
void ps_main3()
|
||||
{
|
||||
if(127.5f / 255.0f < sample_c().a) // < 0x80 pass (== 0x80 should not pass)
|
||||
if((127.5f / 255.0f) < sample_c().a) // < 0x80 pass (== 0x80 should not pass)
|
||||
discard;
|
||||
|
||||
#ifdef ENABLE_OGL_STENCIL_DEBUG
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*===============================================================================*\
|
||||
|######################### [GSdx FXAA 2.00 Revised] ######################|
|
||||
|########################### By Asmodean ########################|
|
||||
|####################### [GSdx FXAA 2.00] ########################|
|
||||
|######################## By Asmodean #########################|
|
||||
|| ||
|
||||
|| This program is free software; you can redistribute it and/or ||
|
||||
|| modify it under the terms of the GNU General Public License ||
|
||||
@@ -16,13 +16,9 @@
|
||||
\*===============================================================================*/
|
||||
#ifdef SHADER_MODEL
|
||||
|
||||
//-#[ANTIALIASING TECHNIQUES] [1=ON|0=OFF] #READ: For best results: Use post antialiasing OR FS filtering. Not both. Postfix [2D/3D] after descriptions indicates if it's typically better for 2D, or 3D.
|
||||
#define UHQ_FXAA 1 //#High Quality Fast Approximate Anti Aliasing. Adapted for GSdx from Timothy Lottes FXAA 3.11. [3D].
|
||||
|
||||
//-[FXAA OPTIONS]
|
||||
#define FxaaSubpixMax 0.00 //[0.00 to 1.00] Amount of subpixel aliasing removal. Higher values: more subpixel antialiasing(softer). Lower values: less subpixel antialiasing(sharper). 0.00: Edge only antialiasing (no blurring)
|
||||
#define FxaaQuality 4 //[1|2|3|4] Overall Fxaa quality preset (pixel coverage). 1: Low, 2: Medium, 3: High, 4: Ultra. I use these labels lightly, as even the 'low coverage' preset is in fact, still pretty high quality.
|
||||
#define FxaaEarlyExit 1 //[0 or 1] Use Fxaa early exit pathing. This basically tells the algorithm to offset only luma-edge detected pixels. When disabled, the entire scene is antialiased(FSAA). 0 is off, 1 is on.
|
||||
#define UHQ_FXAA 1 //High Quality Fast Approximate Anti Aliasing. Adapted for GSdx from Timothy Lottes FXAA 3.11.
|
||||
#define FxaaSubpixMax 0.0 //[0.00 to 1.00] Amount of subpixel aliasing removal. 0.00: Edge only antialiasing (no blurring)
|
||||
#define FxaaEarlyExit 1 //[0 or 1] Use Fxaa early exit pathing. When disabled, the entire scene is antialiased(FSAA). 0 is off, 1 is on.
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
[GLOBALS|FUNCTIONS]
|
||||
@@ -30,13 +26,7 @@
|
||||
|
||||
#if (SHADER_MODEL >= 0x400)
|
||||
Texture2D Texture : register(t0);
|
||||
SamplerState TextureSampler : register(s0)
|
||||
{
|
||||
Filter = Anisotropic;
|
||||
MaxAnisotropy = 16;
|
||||
AddressU = Clamp;
|
||||
AddressV = Clamp;
|
||||
};
|
||||
SamplerState TextureSampler : register(s0);
|
||||
#else
|
||||
texture2D Texture : register(t0);
|
||||
sampler2D TextureSampler : register(s0);
|
||||
@@ -83,6 +73,7 @@ float RGBLuminance(float3 color)
|
||||
float3 RGBGammaToLinear(float3 color, float gamma)
|
||||
{
|
||||
color = abs(color);
|
||||
|
||||
color.r = (color.r <= 0.0404482362771082) ? saturate(color.r / 12.92) :
|
||||
saturate(pow((color.r + 0.055) / 1.055, gamma));
|
||||
|
||||
@@ -98,6 +89,7 @@ float3 RGBGammaToLinear(float3 color, float gamma)
|
||||
float3 LinearToRGBGamma(float3 color, float gamma)
|
||||
{
|
||||
color = abs(color);
|
||||
|
||||
color.r = (color.r <= 0.00313066844250063) ? saturate(color.r * 12.92) : 1.055 *
|
||||
saturate(pow(color.r, 1.0 / gamma)) - 0.055;
|
||||
|
||||
@@ -114,21 +106,6 @@ float3 LinearToRGBGamma(float3 color, float gamma)
|
||||
#define GammaCorrection(color, gamma) pow(color, gamma)
|
||||
#define InverseGammaCorrection(color, gamma) pow(color, 1.0/gamma)
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
[VERTEX CODE SECTION]
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
//Not used - here for testing on custom builds.
|
||||
VS_OUTPUT vs_main(VS_INPUT input)
|
||||
{
|
||||
VS_OUTPUT output;
|
||||
|
||||
output.p = input.p;
|
||||
output.t = input.t;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
[GAMMA PREPASS CODE SECTION]
|
||||
------------------------------------------------------------------------------*/
|
||||
@@ -152,7 +129,6 @@ float4 PreGammaPass(float4 color, float2 uv0)
|
||||
[FXAA CODE SECTION]
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
#if (UHQ_FXAA == 1)
|
||||
#if (SHADER_MODEL >= 0x500)
|
||||
#define FXAA_HLSL_5 1
|
||||
#define FXAA_GATHER4_ALPHA 1
|
||||
@@ -164,70 +140,6 @@ float4 PreGammaPass(float4 color, float2 uv0)
|
||||
#define FXAA_GATHER4_ALPHA 0
|
||||
#endif
|
||||
|
||||
#if (FxaaQuality == 4)
|
||||
#define FxaaEdgeThreshold (0.033)
|
||||
#define FxaaEdgeThresholdMin (0.00)
|
||||
#define FXAA_QUALITY__PS 14
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 2.0
|
||||
#define FXAA_QUALITY__P4 2.0
|
||||
#define FXAA_QUALITY__P5 2.0
|
||||
#define FXAA_QUALITY__P6 2.0
|
||||
#define FXAA_QUALITY__P7 2.0
|
||||
#define FXAA_QUALITY__P8 2.0
|
||||
#define FXAA_QUALITY__P9 2.0
|
||||
#define FXAA_QUALITY__P10 4.0
|
||||
#define FXAA_QUALITY__P11 8.0
|
||||
#define FXAA_QUALITY__P12 8.0
|
||||
|
||||
#elif (FxaaQuality == 3)
|
||||
#define FxaaEdgeThreshold (0.125)
|
||||
#define FxaaEdgeThresholdMin (0.0312)
|
||||
#define FXAA_QUALITY__PS 12
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 2.0
|
||||
#define FXAA_QUALITY__P4 2.0
|
||||
#define FXAA_QUALITY__P5 2.0
|
||||
#define FXAA_QUALITY__P6 2.0
|
||||
#define FXAA_QUALITY__P7 2.0
|
||||
#define FXAA_QUALITY__P8 2.0
|
||||
#define FXAA_QUALITY__P9 2.0
|
||||
#define FXAA_QUALITY__P10 4.0
|
||||
#define FXAA_QUALITY__P11 8.0
|
||||
|
||||
#elif (FxaaQuality == 2)
|
||||
#define FxaaEdgeThreshold (0.166)
|
||||
#define FxaaEdgeThresholdMin (0.0625)
|
||||
#define FXAA_QUALITY__PS 10
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 2.0
|
||||
#define FXAA_QUALITY__P4 2.0
|
||||
#define FXAA_QUALITY__P5 2.0
|
||||
#define FXAA_QUALITY__P6 2.0
|
||||
#define FXAA_QUALITY__P7 2.0
|
||||
#define FXAA_QUALITY__P8 4.0
|
||||
#define FXAA_QUALITY__P9 8.0
|
||||
|
||||
#elif (FxaaQuality == 1)
|
||||
#define FxaaEdgeThreshold (0.250)
|
||||
#define FxaaEdgeThresholdMin (0.0833)
|
||||
#define FXAA_QUALITY__PS 8
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 2.0
|
||||
#define FXAA_QUALITY__P4 2.0
|
||||
#define FXAA_QUALITY__P5 2.0
|
||||
#define FXAA_QUALITY__P6 4.0
|
||||
#define FXAA_QUALITY__P7 12.0
|
||||
#endif
|
||||
|
||||
#if (FXAA_HLSL_5 == 1)
|
||||
struct FxaaTex { SamplerState smpl; Texture2D tex; };
|
||||
#define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)
|
||||
@@ -252,6 +164,22 @@ float4 PreGammaPass(float4 color, float2 uv0)
|
||||
#define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))
|
||||
#endif
|
||||
|
||||
#define FxaaEdgeThreshold 0.033
|
||||
#define FxaaEdgeThresholdMin 0.00
|
||||
#define FXAA_QUALITY__P0 1.0
|
||||
#define FXAA_QUALITY__P1 1.5
|
||||
#define FXAA_QUALITY__P2 2.0
|
||||
#define FXAA_QUALITY__P3 2.0
|
||||
#define FXAA_QUALITY__P4 2.0
|
||||
#define FXAA_QUALITY__P5 2.0
|
||||
#define FXAA_QUALITY__P6 2.0
|
||||
#define FXAA_QUALITY__P7 2.0
|
||||
#define FXAA_QUALITY__P8 2.0
|
||||
#define FXAA_QUALITY__P9 2.0
|
||||
#define FXAA_QUALITY__P10 4.0
|
||||
#define FXAA_QUALITY__P11 8.0
|
||||
#define FXAA_QUALITY__P12 8.0
|
||||
|
||||
float FxaaLuma(float4 rgba)
|
||||
{
|
||||
rgba.w = RGBLuminance(rgba.xyz);
|
||||
@@ -403,7 +331,6 @@ float4 FxaaPixelShader(float2 pos, FxaaTex tex, float2 fxaaRcpFrame, float fxaaS
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P2;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P2;
|
||||
|
||||
#if (FXAA_QUALITY__PS > 3)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -417,7 +344,6 @@ float4 FxaaPixelShader(float2 pos, FxaaTex tex, float2 fxaaRcpFrame, float fxaaS
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P3;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P3;
|
||||
|
||||
#if (FXAA_QUALITY__PS > 4)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -431,7 +357,6 @@ float4 FxaaPixelShader(float2 pos, FxaaTex tex, float2 fxaaRcpFrame, float fxaaS
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P4;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P4;
|
||||
|
||||
#if (FXAA_QUALITY__PS > 5)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -445,7 +370,6 @@ float4 FxaaPixelShader(float2 pos, FxaaTex tex, float2 fxaaRcpFrame, float fxaaS
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P5;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P5;
|
||||
|
||||
#if (FXAA_QUALITY__PS > 6)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -459,7 +383,6 @@ float4 FxaaPixelShader(float2 pos, FxaaTex tex, float2 fxaaRcpFrame, float fxaaS
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P6;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P6;
|
||||
|
||||
#if (FXAA_QUALITY__PS > 7)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -473,7 +396,6 @@ float4 FxaaPixelShader(float2 pos, FxaaTex tex, float2 fxaaRcpFrame, float fxaaS
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P7;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P7;
|
||||
|
||||
#if (FXAA_QUALITY__PS > 8)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -487,7 +409,6 @@ float4 FxaaPixelShader(float2 pos, FxaaTex tex, float2 fxaaRcpFrame, float fxaaS
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P8;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P8;
|
||||
|
||||
#if (FXAA_QUALITY__PS > 9)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -501,7 +422,6 @@ float4 FxaaPixelShader(float2 pos, FxaaTex tex, float2 fxaaRcpFrame, float fxaaS
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P9;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P9;
|
||||
|
||||
#if (FXAA_QUALITY__PS > 10)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -515,7 +435,6 @@ float4 FxaaPixelShader(float2 pos, FxaaTex tex, float2 fxaaRcpFrame, float fxaaS
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P10;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P10;
|
||||
|
||||
#if (FXAA_QUALITY__PS > 11)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -529,7 +448,6 @@ float4 FxaaPixelShader(float2 pos, FxaaTex tex, float2 fxaaRcpFrame, float fxaaS
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P11;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P11;
|
||||
|
||||
#if (FXAA_QUALITY__PS > 12)
|
||||
if(doneNP) {
|
||||
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
||||
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
||||
@@ -542,27 +460,8 @@ float4 FxaaPixelShader(float2 pos, FxaaTex tex, float2 fxaaRcpFrame, float fxaaS
|
||||
doneNP = (!doneN) || (!doneP);
|
||||
if(!doneP) posP.x += offNP.x * FXAA_QUALITY__P12;
|
||||
if(!doneP) posP.y += offNP.y * FXAA_QUALITY__P12;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}}}}}}}}}}}
|
||||
|
||||
float dstN = posM.x - posN.x;
|
||||
float dstP = posP.x - posM.x;
|
||||
if(!horzSpan) dstN = posM.y - posN.y;
|
||||
@@ -595,16 +494,17 @@ float4 FxaaPass(float4 FxaaColor : COLOR0, float2 uv0 : TEXCOORD0)
|
||||
#if (SHADER_MODEL >= 0x400)
|
||||
tex.tex = Texture;
|
||||
tex.smpl = TextureSampler;
|
||||
|
||||
Texture.GetDimensions(PixelSize.x, PixelSize.y);
|
||||
FxaaColor = FxaaPixelShader(uv0, tex, 1.0/PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);
|
||||
#else
|
||||
|
||||
tex = TextureSampler;
|
||||
FxaaColor = FxaaPixelShader(uv0, tex, PixelSize.xy, FxaaSubpixMax, FxaaEdgeThreshold, FxaaEdgeThresholdMin);
|
||||
#endif
|
||||
|
||||
return FxaaColor;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
[MAIN() & COMBINE PASS CODE SECTION]
|
||||
@@ -615,27 +515,26 @@ PS_OUTPUT ps_main(VS_OUTPUT input)
|
||||
PS_OUTPUT output;
|
||||
|
||||
#if (SHADER_MODEL >= 0x400)
|
||||
float4 color = Texture.Sample(TextureSampler, input.t);
|
||||
color = PreGammaPass(color, input.t);
|
||||
|
||||
#if (UHQ_FXAA == 1)
|
||||
float4 color = Texture.Sample(TextureSampler, input.t);
|
||||
|
||||
color = PreGammaPass(color, input.t);
|
||||
color = FxaaPass(color, input.t);
|
||||
#endif
|
||||
|
||||
#else
|
||||
float4 color = tex2D(TextureSampler, input.t);
|
||||
color = PreGammaPass(color, input.t);
|
||||
|
||||
#if (UHQ_FXAA == 1)
|
||||
float4 color = tex2D(TextureSampler, input.t);
|
||||
|
||||
color = PreGammaPass(color, input.t);
|
||||
color = FxaaPass(color, input.t);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
output.c = color;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
[RECOVERY PS CODE SECTION]
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
PS_OUTPUT ps_recover(VS_OUTPUT input)
|
||||
{
|
||||
PS_OUTPUT output;
|
||||
|
||||
@@ -248,7 +248,7 @@ static const char* convert_glsl =
|
||||
"#ifdef ps_main2\n"
|
||||
"void ps_main2()\n"
|
||||
"{\n"
|
||||
" if(sample_c().a < 127.5f / 255.0f) // >= 0x80 pass\n"
|
||||
" if(sample_c().a < (127.5f / 255.0f)) // >= 0x80 pass\n"
|
||||
" discard;\n"
|
||||
"\n"
|
||||
"#ifdef ENABLE_OGL_STENCIL_DEBUG\n"
|
||||
@@ -262,7 +262,7 @@ static const char* convert_glsl =
|
||||
"#ifdef ps_main3\n"
|
||||
"void ps_main3()\n"
|
||||
"{\n"
|
||||
" if(127.5f / 255.0f < sample_c().a) // < 0x80 pass (== 0x80 should not pass)\n"
|
||||
" if((127.5f / 255.0f) < sample_c().a) // < 0x80 pass (== 0x80 should not pass)\n"
|
||||
" discard;\n"
|
||||
"\n"
|
||||
"#ifdef ENABLE_OGL_STENCIL_DEBUG\n"
|
||||
|
||||
Reference in New Issue
Block a user