Fixed issue #1281.
This commit is contained in:
parent
dd8d1de6b4
commit
b3fcc8350b
@ -440,7 +440,7 @@ public:
|
||||
float proj[16];
|
||||
bx::mtxOrtho(proj, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 100.0f, 0.0f, caps->homogeneousDepth);
|
||||
|
||||
uint8_t order[] =
|
||||
bgfx::ViewId order[] =
|
||||
{
|
||||
hdrSkybox,
|
||||
hdrMesh,
|
||||
|
@ -774,6 +774,9 @@ namespace bgfx
|
||||
uint8_t flags; //!< Status flags.
|
||||
};
|
||||
|
||||
///
|
||||
typedef uint16_t ViewId;
|
||||
|
||||
/// View stats.
|
||||
///
|
||||
/// @attention C99 equivalent is `bgfx_view_stats_t`.
|
||||
@ -781,7 +784,7 @@ namespace bgfx
|
||||
struct ViewStats
|
||||
{
|
||||
char name[256]; //!< View name.
|
||||
uint8_t view; //!< View id.
|
||||
ViewId view; //!< View id.
|
||||
int64_t cpuTimeElapsed; //!< CPU (submit) time elapsed.
|
||||
int64_t gpuTimeElapsed; //!< GPU time elapsed.
|
||||
};
|
||||
@ -834,9 +837,6 @@ namespace bgfx
|
||||
EncoderStats* encoderStats; //!< Encoder stats.
|
||||
};
|
||||
|
||||
///
|
||||
typedef uint16_t ViewId;
|
||||
|
||||
/// Encoder for submitting draw calls from multiple threads. Use `bgfx::begin()`
|
||||
/// to obtain encoder for thread.
|
||||
///
|
||||
@ -3155,8 +3155,8 @@ namespace bgfx
|
||||
///
|
||||
void setViewOrder(
|
||||
ViewId _id = 0
|
||||
, uint8_t _num = UINT8_MAX
|
||||
, const uint8_t* _remap = NULL
|
||||
, uint16_t _num = UINT16_MAX
|
||||
, const ViewId* _remap = NULL
|
||||
);
|
||||
|
||||
/// Reset all view settings to default.
|
||||
|
@ -335,13 +335,16 @@ typedef struct bgfx_hmd
|
||||
|
||||
} bgfx_hmd_t;
|
||||
|
||||
/**/
|
||||
typedef uint16_t bgfx_view_id_t;
|
||||
|
||||
/**/
|
||||
typedef struct bgfx_view_stats
|
||||
{
|
||||
char name[256];
|
||||
uint8_t view;
|
||||
int64_t cpuTimeElapsed;
|
||||
int64_t gpuTimeElapsed;
|
||||
char name[256];
|
||||
bgfx_view_id_t view;
|
||||
int64_t cpuTimeElapsed;
|
||||
int64_t gpuTimeElapsed;
|
||||
|
||||
} bgfx_view_stats_t;
|
||||
|
||||
@ -387,9 +390,6 @@ typedef struct bgfx_stats
|
||||
|
||||
} bgfx_stats_t;
|
||||
|
||||
/**/
|
||||
typedef uint16_t bgfx_view_id_t;
|
||||
|
||||
/**/
|
||||
struct bgfx_encoder;
|
||||
|
||||
@ -863,7 +863,7 @@ BGFX_C_API void bgfx_set_view_transform(bgfx_view_id_t _id, const void* _view, c
|
||||
BGFX_C_API void bgfx_set_view_transform_stereo(bgfx_view_id_t _id, const void* _view, const void* _projL, uint8_t _flags, const void* _projR);
|
||||
|
||||
/**/
|
||||
BGFX_C_API void bgfx_set_view_order(bgfx_view_id_t _id, uint8_t _num, const uint8_t* _order);
|
||||
BGFX_C_API void bgfx_set_view_order(bgfx_view_id_t _id, uint16_t _num, const bgfx_view_id_t* _order);
|
||||
|
||||
/**/
|
||||
BGFX_C_API void bgfx_reset_view(bgfx_view_id_t _id);
|
||||
|
@ -47,7 +47,7 @@ typedef struct bgfx_platform_data
|
||||
/**/
|
||||
BGFX_C_API void bgfx_set_platform_data(const bgfx_platform_data_t* _data);
|
||||
|
||||
typedef struct bgfx_internal_data
|
||||
typedef struct bgfx_internal_datauint8_t
|
||||
{
|
||||
const struct bgfx_caps* caps;
|
||||
void* context;
|
||||
@ -163,7 +163,7 @@ typedef struct bgfx_interface_vtbl
|
||||
void (*set_view_frame_buffer)(bgfx_view_id_t _id, bgfx_frame_buffer_handle_t _handle);
|
||||
void (*set_view_transform)(bgfx_view_id_t _id, const void* _view, const void* _proj);
|
||||
void (*set_view_transform_stereo)(bgfx_view_id_t _id, const void* _view, const void* _projL, uint8_t _flags, const void* _projR);
|
||||
void (*set_view_order)(bgfx_view_id_t _id, uint8_t _num, const uint8_t* _order);
|
||||
void (*set_view_order)(bgfx_view_id_t _id, uint16_t _num, const bgfx_view_id_t* _order);
|
||||
void (*encoder_set_marker)(struct bgfx_encoder* _encoder, const char* _marker);
|
||||
void (*encoder_set_state)(struct bgfx_encoder* _encoder, uint64_t _state, uint32_t _rgba);
|
||||
void (*encoder_set_condition)(struct bgfx_encoder* _encoder, bgfx_occlusion_query_handle_t _handle, bool _visible);
|
||||
|
@ -6,7 +6,7 @@
|
||||
#ifndef BGFX_DEFINES_H_HEADER_GUARD
|
||||
#define BGFX_DEFINES_H_HEADER_GUARD
|
||||
|
||||
#define BGFX_API_VERSION UINT32_C(56)
|
||||
#define BGFX_API_VERSION UINT32_C(57)
|
||||
|
||||
/// Color RGB/alpha/depth write. When it's not specified write will be disabled.
|
||||
#define BGFX_STATE_RGB_WRITE UINT64_C(0x0000000000000001) //!< Enable RGB write.
|
||||
|
@ -4043,7 +4043,7 @@ error:
|
||||
s_ctx->setViewTransform(_id, _view, _projL, _flags, _projR);
|
||||
}
|
||||
|
||||
void setViewOrder(ViewId _id, uint8_t _num, const uint8_t* _order)
|
||||
void setViewOrder(ViewId _id, uint16_t _num, const ViewId* _order)
|
||||
{
|
||||
BX_CHECK(checkView(_id), "Invalid view id: %d", _id);
|
||||
s_ctx->setViewOrder(_id, _num, _order);
|
||||
@ -5132,7 +5132,7 @@ BGFX_C_API void bgfx_set_view_transform_stereo(bgfx_view_id_t _id, const void* _
|
||||
bgfx::setViewTransform(_id, _view, _projL, _flags, _projR);
|
||||
}
|
||||
|
||||
BGFX_C_API void bgfx_set_view_order(bgfx_view_id_t _id, uint8_t _num, const uint8_t* _order)
|
||||
BGFX_C_API void bgfx_set_view_order(bgfx_view_id_t _id, uint16_t _num, const bgfx_view_id_t* _order)
|
||||
{
|
||||
bgfx::setViewOrder(_id, _num, _order);
|
||||
}
|
||||
|
@ -4308,14 +4308,14 @@ namespace bgfx
|
||||
m_view[_id].reset();
|
||||
}
|
||||
|
||||
BGFX_API_FUNC(void setViewOrder(ViewId _id, uint8_t _num, const uint8_t* _order) )
|
||||
BGFX_API_FUNC(void setViewOrder(ViewId _id, uint16_t _num, const ViewId* _order) )
|
||||
{
|
||||
const uint32_t num = bx::uint32_min(_id + _num, BGFX_CONFIG_MAX_VIEWS) - _id;
|
||||
if (NULL == _order)
|
||||
{
|
||||
for (uint32_t ii = 0; ii < num; ++ii)
|
||||
{
|
||||
uint8_t id = uint8_t(ii+_id);
|
||||
ViewId id = ViewId(ii+_id);
|
||||
m_viewRemap[id] = id;
|
||||
}
|
||||
}
|
||||
|
@ -531,7 +531,7 @@ namespace bgfx
|
||||
|
||||
m_queryIdx = m_gpuTimer.begin(_view);
|
||||
|
||||
viewStats.view = uint8_t(_view);
|
||||
viewStats.view = ViewId(_view);
|
||||
bx::strCopy(viewStats.name
|
||||
, BGFX_CONFIG_MAX_VIEW_NAME
|
||||
, &m_viewName[_view][BGFX_CONFIG_MAX_VIEW_NAME_RESERVED]
|
||||
|
Loading…
Reference in New Issue
Block a user