mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-29 02:55:36 -05:00
Merge pull request #349 from MikePopoloski/master
Fixing crash on WP8 ARM
This commit is contained in:
commit
2b5c9c1ee2
2 changed files with 14 additions and 5 deletions
|
@ -12,12 +12,19 @@ namespace bgfx
|
|||
{
|
||||
struct ViewState
|
||||
{
|
||||
ViewState() { }
|
||||
ViewState(Frame* _render, bool _hmdEnabled)
|
||||
: m_alphaRef(0.0f)
|
||||
, m_invViewCached(UINT16_MAX)
|
||||
, m_invProjCached(UINT16_MAX)
|
||||
, m_invViewProjCached(UINT16_MAX)
|
||||
{
|
||||
reset(_render, _hmdEnabled);
|
||||
}
|
||||
|
||||
void reset(Frame* _render, bool _hmdEnabled)
|
||||
{
|
||||
m_alphaRef = 0.0f;
|
||||
m_invViewCached = UINT16_MAX;
|
||||
m_invProjCached = UINT16_MAX;
|
||||
m_invViewProjCached = UINT16_MAX;
|
||||
|
||||
m_view[0] = _render->m_view;
|
||||
m_view[1] = m_viewTmp[1];
|
||||
|
||||
|
|
|
@ -2459,6 +2459,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
|||
void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
|
||||
Matrix4 m_predefinedUniforms[PredefinedUniform::Count];
|
||||
UniformRegistry m_uniformReg;
|
||||
ViewState m_viewState;
|
||||
|
||||
StateCacheT<ID3D11BlendState> m_blendStateCache;
|
||||
StateCacheT<ID3D11DepthStencilState> m_depthStencilStateCache;
|
||||
|
@ -3305,7 +3306,8 @@ BX_PRAGMA_DIAGNOSTIC_POP();
|
|||
const bool hmdEnabled = m_ovr.isEnabled() || m_ovr.isDebug();
|
||||
_render->m_hmdEnabled = hmdEnabled;
|
||||
|
||||
ViewState viewState(_render, hmdEnabled);
|
||||
ViewState& viewState = m_viewState;
|
||||
viewState.reset(_render, hmdEnabled);
|
||||
|
||||
bool wireframe = !!(_render->m_debug&BGFX_DEBUG_WIREFRAME);
|
||||
bool scissorEnabled = false;
|
||||
|
|
Loading…
Reference in a new issue