Removed _BIT suffix from BGFX_CLEAR_* flags.

This commit is contained in:
Branimir Karadžić 2015-01-10 21:39:45 -08:00
parent a038b6d426
commit ff7f967c1b
31 changed files with 80 additions and 77 deletions

View file

@ -23,7 +23,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -70,7 +70,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -475,7 +475,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -118,7 +118,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -21,7 +21,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -70,7 +70,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -118,7 +118,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -385,7 +385,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -127,7 +127,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -161,7 +161,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -62,7 +62,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT | BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -79,7 +79,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT | BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -38,7 +38,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -16,14 +16,14 @@
#include "camera.h"
#include "imgui/imgui.h"
#define RENDER_VIEWID_RANGE1_PASS_0 1
#define RENDER_VIEWID_RANGE1_PASS_1 2
#define RENDER_VIEWID_RANGE1_PASS_2 3
#define RENDER_VIEWID_RANGE1_PASS_3 4
#define RENDER_VIEWID_RANGE1_PASS_4 5
#define RENDER_VIEWID_RANGE1_PASS_5 6
#define RENDER_VIEWID_RANGE1_PASS_0 1
#define RENDER_VIEWID_RANGE1_PASS_1 2
#define RENDER_VIEWID_RANGE1_PASS_2 3
#define RENDER_VIEWID_RANGE1_PASS_3 4
#define RENDER_VIEWID_RANGE1_PASS_4 5
#define RENDER_VIEWID_RANGE1_PASS_5 6
#define RENDER_VIEWID_RANGE5_PASS_6 7
#define RENDER_VIEWID_RANGE1_PASS_7 13
#define RENDER_VIEWID_RANGE1_PASS_7 13
#define MAX_NUM_LIGHTS 5
@ -1209,7 +1209,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
}
// Make sure at the beginning everything gets cleared.
clearView(0, BGFX_CLEAR_COLOR_BIT | BGFX_CLEAR_DEPTH_BIT | BGFX_CLEAR_STENCIL_BIT, clearValues);
clearView(0, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH | BGFX_CLEAR_STENCIL, clearValues);
bgfx::submit(0);
s_viewMask |= 1;
@ -1238,7 +1238,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Second pass - Draw reflected objects.
// Clear depth from previous pass.
clearView(RENDER_VIEWID_RANGE1_PASS_1, BGFX_CLEAR_DEPTH_BIT, clearValues);
clearView(RENDER_VIEWID_RANGE1_PASS_1, BGFX_CLEAR_DEPTH, clearValues);
// Compute reflected matrix.
float reflectMtx[16];
@ -1352,7 +1352,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
for (uint8_t ii = 0, viewId = RENDER_VIEWID_RANGE5_PASS_6; ii < numLights; ++ii, ++viewId)
{
// Clear stencil for this light source.
clearView(viewId, BGFX_CLEAR_STENCIL_BIT, clearValues);
clearView(viewId, BGFX_CLEAR_STENCIL, clearValues);
// Draw shadow projection of scene objects.

View file

@ -2616,9 +2616,9 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Make sure at the beginning everything gets cleared.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT
| BGFX_CLEAR_DEPTH_BIT
| BGFX_CLEAR_STENCIL_BIT
, BGFX_CLEAR_COLOR
| BGFX_CLEAR_DEPTH
| BGFX_CLEAR_STENCIL
, clearValues.m_clearRgba
, clearValues.m_clearDepth
, clearValues.m_clearStencil
@ -2653,7 +2653,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Using stencil texture requires rendering to separate render target. first pass is building depth buffer.
if (settings_useStencilTexture)
{
bgfx::setViewClear(VIEWID_RANGE1_RT_PASS1, BGFX_CLEAR_DEPTH_BIT, 0x00000000, 1.0f, 0);
bgfx::setViewClear(VIEWID_RANGE1_RT_PASS1, BGFX_CLEAR_DEPTH, 0x00000000, 1.0f, 0);
bgfx::setViewFrameBuffer(VIEWID_RANGE1_RT_PASS1, s_stencilFb);
const RenderState& renderState = s_renderStates[RenderState::ShadowVolume_UsingStencilTexture_BuildDepth];
@ -2689,7 +2689,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::setViewFrameBuffer(viewId, s_stencilFb);
bgfx::setViewClear(viewId
, BGFX_CLEAR_COLOR_BIT
, BGFX_CLEAR_COLOR
, 0x00000000
, 1.0f
, 0
@ -2701,7 +2701,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::setViewFrameBuffer(viewId, invalid);
bgfx::setViewClear(viewId
, BGFX_CLEAR_STENCIL_BIT
, BGFX_CLEAR_STENCIL
, clearValues.m_clearRgba
, clearValues.m_clearDepth
, clearValues.m_clearStencil

View file

@ -282,12 +282,12 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Clear backbuffer and shadowmap framebuffer at beginning.
bgfx::setViewClear(RENDER_SHADOW_PASS_ID
, BGFX_CLEAR_COLOR_BIT | BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
, 0x303030ff, 1.0f, 0
);
bgfx::setViewClear(RENDER_SCENE_PASS_ID
, BGFX_CLEAR_COLOR_BIT | BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
, 0x303030ff, 1.0f, 0
);

View file

@ -2730,8 +2730,8 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Clear backbuffer at beginning.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT
| BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR
| BGFX_CLEAR_DEPTH
, clearValues.m_clearRgba
, clearValues.m_clearDepth
, clearValues.m_clearStencil
@ -2741,7 +2741,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Clear shadowmap rendertarget at beginning.
const uint8_t flags0 = (LightType::DirectionalLight == settings.m_lightType)
? 0
: BGFX_CLEAR_COLOR_BIT | BGFX_CLEAR_DEPTH_BIT | BGFX_CLEAR_STENCIL_BIT
: BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH | BGFX_CLEAR_STENCIL
;
bgfx::setViewClear(RENDERVIEW_SHADOWMAP_0_ID
@ -2753,7 +2753,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::submit(RENDERVIEW_SHADOWMAP_0_ID);
const uint8_t flags1 = (LightType::DirectionalLight == settings.m_lightType)
? BGFX_CLEAR_COLOR_BIT | BGFX_CLEAR_DEPTH_BIT
? BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
: 0
;

View file

@ -263,7 +263,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -233,7 +233,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set views clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -319,7 +319,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::setClearColor(1, 1.0f, 1.0f, 1.0f, 1.0f);
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 1.0f // Depth
, 0 // Stencil
, 0 // FB texture 0, color palette 0
@ -327,7 +327,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
);
bgfx::setViewClear(1
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 1.0f // Depth
, 0 // Stencil
, 0 // Color palette 0

View file

@ -1215,7 +1215,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -238,7 +238,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set geometry pass view clear state.
bgfx::setViewClear(RENDER_PASS_GEOMETRY_ID
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 1.0f
, 0
, 1
@ -246,7 +246,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set light pass view clear state.
bgfx::setViewClear(RENDER_PASS_LIGHT_ID
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 1.0f
, 0
, 0

View file

@ -85,7 +85,7 @@ void cmdDestroyWindow(const void* /*_userData*/)
}
}
static const InputBinding s_bindings[] =
static const InputBinding s_bindings[] =
{
{ entry::Key::KeyC, entry::Modifier::None, 1, cmdCreateWindow, NULL },
{ entry::Key::KeyD, entry::Modifier::None, 1, cmdDestroyWindow, NULL },
@ -115,7 +115,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0
@ -218,7 +218,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
{
bgfx::setViewRect(ii, 0, 0, windows[ii].m_width, windows[ii].m_height);
bgfx::setViewClear(ii
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0
@ -240,7 +240,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::dbgTextPrintf(0, 1, 0x4f, "bgfx/examples/22-windows");
bgfx::dbgTextPrintf(0, 2, 0x6f, "Description: Rendering into multiple windows.");
bgfx::dbgTextPrintf(0, 3, 0x0f, "Frame: % 7.3f[ms]", double(frameTime)*toMs);
if (swapChainSupported)
{
bgfx::dbgTextPrintf(0, 5, 0x2f, "Press 'c' to create or 'd' to destroy window.");
@ -283,7 +283,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
}
}
// Advance to next frame. Rendering thread will be kicked to
// Advance to next frame. Rendering thread will be kicked to
// process submitted rendering primitives.
bgfx::frame();
}

View file

@ -51,7 +51,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
bgfx::setDebug(debug);
// Set view 0 clear state.
bgfx::setViewClear(0, BGFX_CLEAR_COLOR_BIT | BGFX_CLEAR_DEPTH_BIT, 0x303030ff, 1.0f, 0);
bgfx::setViewClear(0, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x303030ff, 1.0f, 0);
// Create vertex stream declaration.
PosColorVertex::init();

View file

@ -106,7 +106,7 @@ void VectorDisplay::setup(uint16_t _width, uint16_t _height, int _view)
genLinetex();
bgfx::setViewClear(_view, BGFX_CLEAR_COLOR_BIT | BGFX_CLEAR_DEPTH_BIT, 0x000000ff, 1.0f, 0);
bgfx::setViewClear(_view, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x000000ff, 1.0f, 0);
setupResDependent();
}

View file

@ -111,7 +111,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
// Set view 0 clear state.
bgfx::setViewClear(0
, BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_DEPTH_BIT
, BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
, 0x303030ff
, 1.0f
, 0

View file

@ -183,9 +183,12 @@
///
#define BGFX_CLEAR_NONE UINT8_C(0x00)
#define BGFX_CLEAR_COLOR_BIT UINT8_C(0x01)
#define BGFX_CLEAR_DEPTH_BIT UINT8_C(0x02)
#define BGFX_CLEAR_STENCIL_BIT UINT8_C(0x04)
#define BGFX_CLEAR_COLOR UINT8_C(0x01)
#define BGFX_CLEAR_DEPTH UINT8_C(0x02)
#define BGFX_CLEAR_STENCIL UINT8_C(0x04)
#define BGFX_CLEAR_DISCARD_COLOR UINT8_C(0x08)
#define BGFX_CLEAR_DISCARD_DEPTH UINT8_C(0x10)
#define BGFX_CLEAR_DISCARD_STENCIL UINT8_C(0x20)
///
#define BGFX_DEBUG_NONE UINT32_C(0x00000000)

View file

@ -2867,8 +2867,8 @@ namespace bgfx
BGFX_API_FUNC(void setViewClear(uint8_t _id, uint8_t _flags, float _depth, uint8_t _stencil, uint8_t _0, uint8_t _1, uint8_t _2, uint8_t _3, uint8_t _4, uint8_t _5, uint8_t _6, uint8_t _7) )
{
Clear& clear = m_clear[_id];
clear.m_flags = (_flags & ~BGFX_CLEAR_COLOR_BIT)
| (0xff != (_0&_1&_2&_3&_4&_5&_6&_7) ? BGFX_CLEAR_COLOR_BIT|BGFX_CLEAR_COLOR_USE_PALETTE_BIT : 0)
clear.m_flags = (_flags & ~BGFX_CLEAR_COLOR)
| (0xff != (_0&_1&_2&_3&_4&_5&_6&_7) ? BGFX_CLEAR_COLOR|BGFX_CLEAR_COLOR_USE_PALETTE_BIT : 0)
;
clear.m_index[0] = _0;
clear.m_index[1] = _1;

View file

@ -1375,7 +1375,7 @@ namespace bgfx
else
{
if (NULL != m_currentColor
&& BGFX_CLEAR_COLOR_BIT & _clear.m_flags)
&& BGFX_CLEAR_COLOR & _clear.m_flags)
{
if (BGFX_CLEAR_COLOR_USE_PALETTE_BIT & _clear.m_flags)
{
@ -1399,11 +1399,11 @@ namespace bgfx
}
if (NULL != m_currentDepthStencil
&& (BGFX_CLEAR_DEPTH_BIT|BGFX_CLEAR_STENCIL_BIT) & _clear.m_flags)
&& (BGFX_CLEAR_DEPTH|BGFX_CLEAR_STENCIL) & _clear.m_flags)
{
DWORD flags = 0;
flags |= (_clear.m_flags & BGFX_CLEAR_DEPTH_BIT) ? D3D11_CLEAR_DEPTH : 0;
flags |= (_clear.m_flags & BGFX_CLEAR_STENCIL_BIT) ? D3D11_CLEAR_STENCIL : 0;
flags |= (_clear.m_flags & BGFX_CLEAR_DEPTH) ? D3D11_CLEAR_DEPTH : 0;
flags |= (_clear.m_flags & BGFX_CLEAR_STENCIL) ? D3D11_CLEAR_STENCIL : 0;
m_deviceCtx->ClearDepthStencilView(m_currentDepthStencil, flags, _clear.m_depth, _clear.m_stencil);
}
}
@ -2030,11 +2030,11 @@ namespace bgfx
ID3D11DeviceContext* deviceCtx = m_deviceCtx;
uint64_t state = 0;
state |= _clear.m_flags & BGFX_CLEAR_COLOR_BIT ? BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE : 0;
state |= _clear.m_flags & BGFX_CLEAR_DEPTH_BIT ? BGFX_STATE_DEPTH_TEST_ALWAYS|BGFX_STATE_DEPTH_WRITE : 0;
state |= _clear.m_flags & BGFX_CLEAR_COLOR ? BGFX_STATE_RGB_WRITE|BGFX_STATE_ALPHA_WRITE : 0;
state |= _clear.m_flags & BGFX_CLEAR_DEPTH ? BGFX_STATE_DEPTH_TEST_ALWAYS|BGFX_STATE_DEPTH_WRITE : 0;
uint64_t stencil = 0;
stencil |= _clear.m_flags & BGFX_CLEAR_STENCIL_BIT ? 0
stencil |= _clear.m_flags & BGFX_CLEAR_STENCIL ? 0
| BGFX_STENCIL_TEST_ALWAYS
| BGFX_STENCIL_FUNC_REF(_clear.m_stencil)
| BGFX_STENCIL_FUNC_RMASK(0xff)
@ -2899,7 +2899,7 @@ namespace bgfx
{
ID3D11DeviceContext* deviceCtx = s_renderD3D11->m_deviceCtx;
if (BGFX_CLEAR_COLOR_BIT & _clear.m_flags)
if (BGFX_CLEAR_COLOR & _clear.m_flags)
{
if (BGFX_CLEAR_COLOR_USE_PALETTE_BIT & _clear.m_flags)
{
@ -2933,11 +2933,11 @@ namespace bgfx
}
if (NULL != m_dsv
&& (BGFX_CLEAR_DEPTH_BIT|BGFX_CLEAR_STENCIL_BIT) & _clear.m_flags)
&& (BGFX_CLEAR_DEPTH|BGFX_CLEAR_STENCIL) & _clear.m_flags)
{
DWORD flags = 0;
flags |= (_clear.m_flags & BGFX_CLEAR_DEPTH_BIT) ? D3D11_CLEAR_DEPTH : 0;
flags |= (_clear.m_flags & BGFX_CLEAR_STENCIL_BIT) ? D3D11_CLEAR_STENCIL : 0;
flags |= (_clear.m_flags & BGFX_CLEAR_DEPTH) ? D3D11_CLEAR_DEPTH : 0;
flags |= (_clear.m_flags & BGFX_CLEAR_STENCIL) ? D3D11_CLEAR_STENCIL : 0;
deviceCtx->ClearDepthStencilView(m_dsv, flags, _clear.m_depth, _clear.m_stencil);
}
}

View file

@ -1467,7 +1467,7 @@ namespace bgfx
D3DCOLOR color = 0;
DWORD flags = 0;
if (BGFX_CLEAR_COLOR_BIT & _clear.m_flags)
if (BGFX_CLEAR_COLOR & _clear.m_flags)
{
if (BGFX_CLEAR_COLOR_USE_PALETTE_BIT & _clear.m_flags)
{
@ -1493,13 +1493,13 @@ namespace bgfx
) );
}
if (BGFX_CLEAR_DEPTH_BIT & _clear.m_flags)
if (BGFX_CLEAR_DEPTH & _clear.m_flags)
{
flags |= D3DCLEAR_ZBUFFER;
DX_CHECK(device->SetRenderState(D3DRS_ZWRITEENABLE, TRUE) );
}
if (BGFX_CLEAR_STENCIL_BIT & _clear.m_flags)
if (BGFX_CLEAR_STENCIL & _clear.m_flags)
{
flags |= D3DCLEAR_STENCIL;
}
@ -1523,7 +1523,7 @@ namespace bgfx
DX_CHECK(device->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE) );
DX_CHECK(device->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE) );
if (BGFX_CLEAR_DEPTH_BIT & _clear.m_flags)
if (BGFX_CLEAR_DEPTH & _clear.m_flags)
{
DX_CHECK(device->SetRenderState(D3DRS_ZWRITEENABLE, TRUE) );
DX_CHECK(device->SetRenderState(D3DRS_COLORWRITEENABLE
@ -1542,7 +1542,7 @@ namespace bgfx
DX_CHECK(device->SetRenderState(D3DRS_ZENABLE, FALSE) );
}
if (BGFX_CLEAR_STENCIL_BIT & _clear.m_flags)
if (BGFX_CLEAR_STENCIL & _clear.m_flags)
{
DX_CHECK(device->SetRenderState(D3DRS_STENCILENABLE, TRUE) );
DX_CHECK(device->SetRenderState(D3DRS_TWOSIDEDSTENCILMODE, TRUE) );

View file

@ -2256,7 +2256,7 @@ namespace bgfx
if (1 == numMrt)
{
GLuint flags = 0;
if (BGFX_CLEAR_COLOR_BIT & _clear.m_flags)
if (BGFX_CLEAR_COLOR & _clear.m_flags)
{
if (BGFX_CLEAR_COLOR_USE_PALETTE_BIT & _clear.m_flags)
{
@ -2281,14 +2281,14 @@ namespace bgfx
GL_CHECK(glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE) );
}
if (BGFX_CLEAR_DEPTH_BIT & _clear.m_flags)
if (BGFX_CLEAR_DEPTH & _clear.m_flags)
{
flags |= GL_DEPTH_BUFFER_BIT;
GL_CHECK(glClearDepth(_clear.m_depth) );
GL_CHECK(glDepthMask(GL_TRUE) );
}
if (BGFX_CLEAR_STENCIL_BIT & _clear.m_flags)
if (BGFX_CLEAR_STENCIL & _clear.m_flags)
{
flags |= GL_STENCIL_BUFFER_BIT;
GL_CHECK(glClearStencil(_clear.m_stencil) );
@ -2314,10 +2314,10 @@ namespace bgfx
GL_CHECK(glDisable(GL_CULL_FACE) );
GL_CHECK(glDisable(GL_BLEND) );
GLboolean colorMask = !!(BGFX_CLEAR_COLOR_BIT & _clear.m_flags);
GLboolean colorMask = !!(BGFX_CLEAR_COLOR & _clear.m_flags);
GL_CHECK(glColorMask(colorMask, colorMask, colorMask, colorMask) );
if (BGFX_CLEAR_DEPTH_BIT & _clear.m_flags)
if (BGFX_CLEAR_DEPTH & _clear.m_flags)
{
GL_CHECK(glEnable(GL_DEPTH_TEST) );
GL_CHECK(glDepthFunc(GL_ALWAYS) );
@ -2328,7 +2328,7 @@ namespace bgfx
GL_CHECK(glDisable(GL_DEPTH_TEST) );
}
if (BGFX_CLEAR_STENCIL_BIT & _clear.m_flags)
if (BGFX_CLEAR_STENCIL & _clear.m_flags)
{
GL_CHECK(glEnable(GL_STENCIL_TEST) );
GL_CHECK(glStencilFuncSeparate(GL_FRONT_AND_BACK, GL_ALWAYS, _clear.m_stencil, 0xff) );