zzogl: use the EXT version of fbo (fix the build on windows)

gsdx:
* add some parenthesis to shup up very verbose gcc warning
* adapt ogl to latest sudonim change


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5290 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut 2012-06-13 10:43:04 +00:00
parent 3b22f0fb0c
commit b8b451340c
6 changed files with 25 additions and 34 deletions

View File

@ -1520,7 +1520,7 @@ EXPORT_C GSReplay(char* lpszCmdLine, int renderer)
} }
} }
unsigned long end = timeGetTime(); unsigned long end = timeGetTime();
fprintf(stderr, "The %d frames of the scene was render on %dms\n", frame_number, end - start); fprintf(stderr, "The %ld frames of the scene was render on %ldms\n", frame_number, end - start);
fprintf(stderr, "A means of %fms by frame\n", (float)(end - start)/(float)frame_number); fprintf(stderr, "A means of %fms by frame\n", (float)(end - start)/(float)frame_number);
sleep(1); sleep(1);

View File

@ -521,8 +521,8 @@ REG64_(GIFReg, ALPHA)
uint8 _PAD2[3]; uint8 _PAD2[3];
REG_END2 REG_END2
// opaque => output will be Cs/As // opaque => output will be Cs/As
__forceinline bool IsOpaque() const {return (A == B || C == 2 && FIX == 0) && D == 0 || (A == 0 && B == D && C == 2 && FIX == 0x80);} __forceinline bool IsOpaque() const {return ((A == B || (C == 2 && FIX == 0)) && D == 0) || (A == 0 && B == D && C == 2 && FIX == 0x80);}
__forceinline bool IsOpaque(int amin, int amax) const {return (A == B || amax == 0) && D == 0 || A == 0 && B == D && amin == 0x80 && amax == 0x80;} __forceinline bool IsOpaque(int amin, int amax) const {return ((A == B || amax == 0) && D == 0) || (A == 0 && B == D && amin == 0x80 && amax == 0x80);}
REG_END2 REG_END2
REG64_(GIFReg, BITBLTBUF) REG64_(GIFReg, BITBLTBUF)

View File

@ -341,14 +341,20 @@ void GSRendererOGL::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
if(tex) if(tex)
{ {
const GSLocalMemory::psm_t &psm = GSLocalMemory::m_psm[context->TEX0.PSM];
ps_sel.wms = context->CLAMP.WMS; ps_sel.wms = context->CLAMP.WMS;
ps_sel.wmt = context->CLAMP.WMT; ps_sel.wmt = context->CLAMP.WMT;
ps_sel.fmt = tex->m_fmt;
ps_sel.aem = env.TEXA.AEM; ps_sel.aem = env.TEXA.AEM;
ps_sel.tfx = context->TEX0.TFX; ps_sel.tfx = context->TEX0.TFX;
ps_sel.tcc = context->TEX0.TCC; ps_sel.tcc = context->TEX0.TCC;
ps_sel.ltf = m_filter == 2 ? m_vt.IsLinear() : m_filter; ps_sel.ltf = m_filter == 2 ? m_vt.IsLinear() : m_filter;
ps_sel.rt = tex->m_target; ps_sel.rt = tex->m_target;
if (tex->m_palette) {
const GSLocalMemory::psm_t &cpsm = GSLocalMemory::m_psm[context->TEX0.CPSM];
ps_sel.fmt = cpsm.fmt | 4;
} else
ps_sel.fmt = psm.fmt;
int w = tex->m_texture->GetWidth(); int w = tex->m_texture->GetWidth();
int h = tex->m_texture->GetHeight(); int h = tex->m_texture->GetHeight();

View File

@ -226,7 +226,7 @@ public:
} }
void Set() {pthread_cond_signal(&m_cv);} void Set() {pthread_cond_signal(&m_cv);}
bool Wait(IGSLock* l) {pthread_cond_wait(&m_cv, *(GSCondVarLock*)l) == 0;} bool Wait(IGSLock* l) {pthread_cond_wait(&m_cv, *(GSCondVarLock*)l) == 0; return true;}
operator pthread_cond_t* () {return &m_cv;} operator pthread_cond_t* () {return &m_cv;}
}; };

View File

@ -5,10 +5,7 @@
#define FMT_32 0 #define FMT_32 0
#define FMT_24 1 #define FMT_24 1
#define FMT_16 2 #define FMT_16 2
#define FMT_8H 3 #define FMT_PAL 4 /* flag bit */
#define FMT_4HL 4
#define FMT_4HH 5
#define FMT_8 6
#ifndef VS_BPPZ #ifndef VS_BPPZ
#define VS_BPPZ 0 #define VS_BPPZ 0
@ -25,7 +22,7 @@
#define PS_FST 0 #define PS_FST 0
#define PS_WMS 0 #define PS_WMS 0
#define PS_WMT 0 #define PS_WMT 0
#define PS_FMT FMT_8 #define PS_FMT FMT_32
#define PS_AEM 0 #define PS_AEM 0
#define PS_TFX 0 #define PS_TFX 0
#define PS_TCC 1 #define PS_TCC 1
@ -431,27 +428,19 @@ vec4 sample_color(vec2 st, float q)
mat4 c; mat4 c;
if(PS_FMT == FMT_8H) if(PS_FMT & FMT_PAL)
{
c = sample_4p(sample_4a(uv)); c = sample_4p(sample_4a(uv));
}
else if(PS_FMT == FMT_4HL)
{
// FIXME mod and fmod are different when value are negative
c = sample_4p(mod(sample_4a(uv), 1.0f / 16));
}
else if(PS_FMT == FMT_4HH)
{
// FIXME mod and fmod are different when value are negative
c = sample_4p(mod(sample_4a(uv) * 16, 1.0f / 16));
}
else if(PS_FMT == FMT_8)
{
c = sample_4p(sample_4a(uv));
}
else else
{
c = sample_4c(uv); c = sample_4c(uv);
// PERF: see the impact of the exansion before/after the interpolation
for (uint i = 0; i < 4; i++) {
if((PS_FMT & ~FMT_PAL) == FMT_16)
{
// FIXME GLSL any only support bvec so try to mix it with notEqual
bvec3 rgb_check = notEqual( t.rgb, vec3(0.0f, 0.0f, 0.0f) );
t.a = t.a >= 0.5 ? TA.y : ( (PS_AEM == 0) || any(rgb_check) ) ? TA.x : 0.0f;
}
} }
if(PS_LTF != 0) if(PS_LTF != 0)
@ -464,11 +453,7 @@ vec4 sample_color(vec2 st, float q)
} }
} }
if(PS_FMT == FMT_32) if(PS_FMT == FMT_24)
{
;
}
else if(PS_FMT == FMT_24)
{ {
// FIXME GLSL any only support bvec so try to mix it with notEqual // FIXME GLSL any only support bvec so try to mix it with notEqual
bvec3 rgb_check = notEqual( t.rgb, vec3(0.0f, 0.0f, 0.0f) ); bvec3 rgb_check = notEqual( t.rgb, vec3(0.0f, 0.0f, 0.0f) );

View File

@ -194,7 +194,7 @@ namespace FB
static __forceinline void Delete() static __forceinline void Delete()
{ {
if (buf != 0) { if (buf != 0) {
glDeleteFramebuffers(1, &buf); glDeleteFramebuffersEXT(1, &buf);
buf = 0; buf = 0;
} }
} }