Skip to content

Commit e82c4b0

Browse files
committed
Blender_Recorder_GL: Consistently use DX identifiers.
1 parent 11d9066 commit e82c4b0

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

src/Layers/xrRender/xrD3DDefs.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ typedef enum D3D_CLEAR_FLAG {
1515
D3D_CLEAR_STENCIL = 0x2L
1616
} D3D_CLEAR_FLAG;
1717

18-
#define D3D_COMPARISON_NEVER GL_NEVER
19-
#define D3D_COMPARISON_LESS GL_LESS
20-
#define D3D_COMPARISON_EQUAL GL_EQUAL
21-
#define D3D_COMPARISON_LESS_EQUAL GL_LEQUAL
22-
#define D3D_COMPARISON_GREATER GL_GREATER
23-
#define D3D_COMPARISON_NOT_EQUAL GL_NEQUAL
24-
#define D3D_COMPARISON_GREATER_EQUAL GL_GEQUAL
25-
#define D3D_COMPARISON_ALWAYS GL_ALWAYS
18+
typedef enum D3D_COMPARISON_FUNC {
19+
D3D_COMPARISON_NEVER = GL_NEVER,
20+
D3D_COMPARISON_LESS = GL_LESS,
21+
D3D_COMPARISON_EQUAL = GL_EQUAL,
22+
D3D_COMPARISON_LESS_EQUAL = GL_LEQUAL,
23+
D3D_COMPARISON_GREATER = GL_GREATER,
24+
D3D_COMPARISON_NOT_EQUAL = GL_NOTEQUAL,
25+
D3D_COMPARISON_GREATER_EQUAL = GL_GEQUAL,
26+
D3D_COMPARISON_ALWAYS = GL_ALWAYS
27+
} D3D_COMPARISON_FUNC;
2628

2729
#define DX10_ONLY(expr) do {} while (0)
2830

src/Layers/xrRenderGL/Blender_Recorder_GL.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ void CBlender_Compile::r_CullMode(D3DCULL Mode)
3232

3333
void CBlender_Compile::i_Comparison(u32 s, u32 func)
3434
{
35-
RS.SetSAMP(s, (u32)GL_TEXTURE_COMPARE_MODE, (u32)GL_COMPARE_REF_TO_TEXTURE);
36-
RS.SetSAMP(s, (u32)GL_TEXTURE_COMPARE_FUNC, func);
35+
RS.SetSAMP(s, XRDX10SAMP_COMPARISONFILTER, TRUE);
36+
RS.SetSAMP(s, XRDX10SAMP_COMPARISONFUNC, func);
3737
}
3838

3939
void CBlender_Compile::r_Sampler_cmp(LPCSTR name, LPCSTR texture, bool b_ps1x_ProjectiveDivide)

src/Layers/xrRenderGL/glState.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,7 @@ void glState::UpdateSamplerState(u32 stage, u32 name, u32 value)
254254
CHK_GL(glSamplerParameteri(m_samplerArray[stage], GL_TEXTURE_COMPARE_FUNC, value));
255255
break;
256256
default:
257-
// Assume this is an OpenGL sampler parameter
258-
CHK_GL(glSamplerParameteri(m_samplerArray[stage], (GLenum)name, value));
257+
VERIFY(!"Sampler state not implemented");
259258
break;
260259
}
261260
}

src/Layers/xrRenderPC_GL/glResourceManager_Scripting.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class adopt_sampler
5454
adopt_sampler& _fmag_none () { if (C) C->i_Filter_Mag(stage,D3DTEXF_NONE); return *this; }
5555
adopt_sampler& _fmag_point () { if (C) C->i_Filter_Mag(stage,D3DTEXF_POINT); return *this; }
5656
adopt_sampler& _fmag_linear () { if (C) C->i_Filter_Mag(stage,D3DTEXF_LINEAR); return *this; }
57-
adopt_sampler& _comp_less () { if (C) C->i_Comparison(stage,D3DCMP_LESS); return *this; }
57+
adopt_sampler& _comp_less () { if (C) C->i_Comparison(stage,D3D_COMPARISON_LESS_EQUAL); return *this; }
5858
};
5959

6060
#pragma warning( push )

0 commit comments

Comments
 (0)