Fixed draw indirect.

This commit is contained in:
Branimir Karadžić 2024-02-09 20:55:44 -08:00
parent a9f61040c7
commit 98d88d9fc6
17 changed files with 54 additions and 54 deletions

View File

@ -4000,7 +4000,7 @@ public static class bgfx
/// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
///
[LinkName("bgfx_encoder_submit_indirect_count")]
public static extern void encoder_submit_indirect_count(Encoder* _this, ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32 _start, IndexBufferHandle _numHandle, uint32 _numIndex, uint16 _numMax, uint32 _depth, uint8 _flags);
public static extern void encoder_submit_indirect_count(Encoder* _this, ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32 _start, IndexBufferHandle _numHandle, uint32 _numIndex, uint32 _numMax, uint32 _depth, uint8 _flags);
/// <summary>
/// Set compute index buffer.
@ -4576,7 +4576,7 @@ public static class bgfx
/// <param name="_flags">Which states to discard for next draw. See `BGFX_DISCARD_*`.</param>
///
[LinkName("bgfx_submit_indirect_count")]
public static extern void submit_indirect_count(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32 _start, IndexBufferHandle _numHandle, uint32 _numIndex, uint16 _numMax, uint32 _depth, uint8 _flags);
public static extern void submit_indirect_count(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32 _start, IndexBufferHandle _numHandle, uint32 _numIndex, uint32 _numMax, uint32 _depth, uint8 _flags);
/// <summary>
/// Set compute index buffer.

View File

@ -3956,7 +3956,7 @@ public static partial class bgfx
/// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
///
[DllImport(DllName, EntryPoint="bgfx_encoder_submit_indirect_count", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_submit_indirect_count(Encoder* _this, ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint _start, IndexBufferHandle _numHandle, uint _numIndex, ushort _numMax, uint _depth, byte _flags);
public static extern unsafe void encoder_submit_indirect_count(Encoder* _this, ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint _start, IndexBufferHandle _numHandle, uint _numIndex, uint _numMax, uint _depth, byte _flags);
/// <summary>
/// Set compute index buffer.
@ -4532,7 +4532,7 @@ public static partial class bgfx
/// <param name="_flags">Which states to discard for next draw. See `BGFX_DISCARD_*`.</param>
///
[DllImport(DllName, EntryPoint="bgfx_submit_indirect_count", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void submit_indirect_count(ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint _start, IndexBufferHandle _numHandle, uint _numIndex, ushort _numMax, uint _depth, byte _flags);
public static extern unsafe void submit_indirect_count(ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint _start, IndexBufferHandle _numHandle, uint _numIndex, uint _numMax, uint _depth, byte _flags);
/// <summary>
/// Set compute index buffer.

View File

@ -10,7 +10,7 @@ import bindbc.bgfx.config;
import bindbc.common.types: c_int64, c_uint64, va_list;
static import bgfx.fakeenum;
enum uint apiVersion = 125;
enum uint apiVersion = 126;
alias ViewID = ushort;
@ -1719,7 +1719,7 @@ extern(C++, "bgfx") struct Encoder{
depth = Depth for sorting.
flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
{q{void}, q{submit}, q{ViewID id, ProgramHandle program, IndirectBufferHandle indirectHandle, uint start, IndexBufferHandle numHandle, uint numIndex=0, ushort numMax=ushort.max, uint depth=0, ubyte flags=Discard.all}, ext: `C++`},
{q{void}, q{submit}, q{ViewID id, ProgramHandle program, IndirectBufferHandle indirectHandle, uint start, IndexBufferHandle numHandle, uint numIndex=0, uint numMax=uint.max, uint depth=0, ubyte flags=Discard.all}, ext: `C++`},
/**
Set compute index buffer.
@ -3427,7 +3427,7 @@ mixin(joinFnBinds((){
depth = Depth for sorting.
flags = Which states to discard for next draw. See `BGFX_DISCARD_*`.
*/
{q{void}, q{submit}, q{ViewID id, ProgramHandle program, IndirectBufferHandle indirectHandle, uint start, IndexBufferHandle numHandle, uint numIndex=0, ushort numMax=ushort.max, uint depth=0, ubyte flags=Discard.all}, ext: `C++, "bgfx"`},
{q{void}, q{submit}, q{ViewID id, ProgramHandle program, IndirectBufferHandle indirectHandle, uint start, IndexBufferHandle numHandle, uint numIndex=0, uint numMax=uint.max, uint depth=0, ubyte flags=Discard.all}, ext: `C++, "bgfx"`},
/**
* Set compute index buffer.

View File

@ -1785,7 +1785,7 @@ pub const Init = extern struct {
/// <param name="_numMax">Max number of draws.</param>
/// <param name="_depth">Depth for sorting.</param>
/// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
pub inline fn submitIndirectCount(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u16, _depth: u32, _flags: u8) void {
pub inline fn submitIndirectCount(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u32, _depth: u32, _flags: u8) void {
return bgfx_encoder_submit_indirect_count(self, _id, _program, _indirectHandle, _start, _numHandle, _numIndex, _numMax, _depth, _flags);
}
/// Set compute index buffer.
@ -3148,7 +3148,7 @@ extern fn bgfx_encoder_submit_indirect(self: ?*Encoder, _id: ViewId, _program: P
/// <param name="_numMax">Max number of draws.</param>
/// <param name="_depth">Depth for sorting.</param>
/// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
extern fn bgfx_encoder_submit_indirect_count(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u16, _depth: u32, _flags: u8) void;
extern fn bgfx_encoder_submit_indirect_count(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u32, _depth: u32, _flags: u8) void;
/// Set compute index buffer.
/// <param name="_stage">Compute stage.</param>
@ -3601,10 +3601,10 @@ extern fn bgfx_submit_indirect(_id: ViewId, _program: ProgramHandle, _indirectHa
/// <param name="_numMax">Max number of draws.</param>
/// <param name="_depth">Depth for sorting.</param>
/// <param name="_flags">Which states to discard for next draw. See `BGFX_DISCARD_*`.</param>
pub inline fn submitIndirectCount(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u16, _depth: u32, _flags: u8) void {
pub inline fn submitIndirectCount(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u32, _depth: u32, _flags: u8) void {
return bgfx_submit_indirect_count(_id, _program, _indirectHandle, _start, _numHandle, _numIndex, _numMax, _depth, _flags);
}
extern fn bgfx_submit_indirect_count(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u16, _depth: u32, _flags: u8) void;
extern fn bgfx_submit_indirect_count(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u32, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u32, _depth: u32, _flags: u8) void;
/// Set compute index buffer.
/// <param name="_stage">Compute stage.</param>

View File

@ -415,7 +415,7 @@ public:
}
else
{
bgfx::submit(0, m_program, m_indirect_buffer_handle, 0, uint16_t(numToDraw));
bgfx::submit(0, m_program, m_indirect_buffer_handle, 0, numToDraw);
}
}
else

View File

@ -1547,7 +1547,7 @@ namespace bgfx
, uint32_t _start
, IndexBufferHandle _numHandle
, uint32_t _numIndex = 0
, uint16_t _numMax = UINT16_MAX
, uint32_t _numMax = UINT32_MAX
, uint32_t _depth = 0
, uint8_t _flags = BGFX_DISCARD_ALL
);
@ -4024,7 +4024,7 @@ namespace bgfx
, uint32_t _start
, IndexBufferHandle _numHandle
, uint32_t _numIndex = 0
, uint16_t _numMax = UINT16_MAX
, uint32_t _numMax = UINT32_MAX
, uint32_t _depth = 0
, uint8_t _flags = BGFX_DISCARD_ALL
);

View File

@ -2726,7 +2726,7 @@ BGFX_C_API void bgfx_encoder_submit_indirect(bgfx_encoder_t* _this, bgfx_view_id
* @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.
*
*/
BGFX_C_API void bgfx_encoder_submit_indirect_count(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags);
BGFX_C_API void bgfx_encoder_submit_indirect_count(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint32_t _numMax, uint32_t _depth, uint8_t _flags);
/**
* Set compute index buffer.
@ -3307,7 +3307,7 @@ BGFX_C_API void bgfx_submit_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _
* @param[in] _flags Which states to discard for next draw. See `BGFX_DISCARD_*`.
*
*/
BGFX_C_API void bgfx_submit_indirect_count(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags);
BGFX_C_API void bgfx_submit_indirect_count(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint32_t _numMax, uint32_t _depth, uint8_t _flags);
/**
* Set compute index buffer.
@ -3775,7 +3775,7 @@ struct bgfx_interface_vtbl
void (*encoder_submit)(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint32_t _depth, uint8_t _flags);
void (*encoder_submit_occlusion_query)(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint32_t _depth, uint8_t _flags);
void (*encoder_submit_indirect)(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, uint32_t _num, uint32_t _depth, uint8_t _flags);
void (*encoder_submit_indirect_count)(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags);
void (*encoder_submit_indirect_count)(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint32_t _numMax, uint32_t _depth, uint8_t _flags);
void (*encoder_set_compute_index_buffer)(bgfx_encoder_t* _this, uint8_t _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
void (*encoder_set_compute_vertex_buffer)(bgfx_encoder_t* _this, uint8_t _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
void (*encoder_set_compute_dynamic_index_buffer)(bgfx_encoder_t* _this, uint8_t _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
@ -3821,7 +3821,7 @@ struct bgfx_interface_vtbl
void (*submit)(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint32_t _depth, uint8_t _flags);
void (*submit_occlusion_query)(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint32_t _depth, uint8_t _flags);
void (*submit_indirect)(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, uint32_t _num, uint32_t _depth, uint8_t _flags);
void (*submit_indirect_count)(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags);
void (*submit_indirect_count)(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint32_t _numMax, uint32_t _depth, uint8_t _flags);
void (*set_compute_index_buffer)(uint8_t _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
void (*set_compute_vertex_buffer)(uint8_t _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
void (*set_compute_dynamic_index_buffer)(uint8_t _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);

View File

@ -15,7 +15,7 @@
#ifndef BGFX_DEFINES_H_HEADER_GUARD
#define BGFX_DEFINES_H_HEADER_GUARD
#define BGFX_API_VERSION UINT32_C(125)
#define BGFX_API_VERSION UINT32_C(126)
/**
* Color RGB/alpha/depth write. When it's not specified write will be disabled.

View File

@ -1,7 +1,7 @@
-- vim: syntax=lua
-- bgfx interface
version(125)
version(126)
typedef "bool"
typedef "char"
@ -2491,8 +2491,8 @@ func.Encoder.submit { cname = "submit_indirect_count" }
--- created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.
.numIndex "uint32_t" --- Element in number buffer.
{ default = 0 }
.numMax "uint16_t" --- Max number of draws.
{ default = UINT16_MAX }
.numMax "uint32_t" --- Max number of draws.
{ default = UINT32_MAX }
.depth "uint32_t" --- Depth for sorting.
{ default = 0 }
.flags "uint8_t" --- Discard or preserve states. See `BGFX_DISCARD_*`.
@ -3061,8 +3061,8 @@ func.submit { cname = "submit_indirect_count" }
--- created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.
.numIndex "uint32_t" --- Element in number buffer.
{ default = 0 }
.numMax "uint16_t" --- Max number of draws.
{ default = UINT16_MAX }
.numMax "uint32_t" --- Max number of draws.
{ default = UINT32_MAX }
.depth "uint32_t" --- Depth for sorting.
{ default = 0 }
.flags "uint8_t" --- Which states to discard for next draw. See `BGFX_DISCARD_*`.

View File

@ -3900,7 +3900,7 @@ namespace bgfx
BGFX_ENCODER(submit(_id, _program, _indirectHandle, _start, _num, _depth, _flags) );
}
void Encoder::submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags)
void Encoder::submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex, uint32_t _numMax, uint32_t _depth, uint8_t _flags)
{
BGFX_CHECK_HANDLE_INVALID_OK("submit", s_ctx->m_programHandle, _program);
BGFX_CHECK_HANDLE("submit", s_ctx->m_vertexBufferHandle, _indirectHandle);
@ -5506,7 +5506,7 @@ namespace bgfx
s_ctx->m_encoder0->submit(_id, _program, _indirectHandle, _start, _num, _depth, _flags);
}
void submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags)
void submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex, uint32_t _numMax, uint32_t _depth, uint8_t _flags)
{
BGFX_CHECK_ENCODER0();
s_ctx->m_encoder0->submit(_id, _program, _indirectHandle, _start, _numHandle, _numIndex, _numMax, _depth, _flags);

View File

@ -885,7 +885,7 @@ BGFX_C_API void bgfx_encoder_submit_indirect(bgfx_encoder_t* _this, bgfx_view_id
This->submit((bgfx::ViewId)_id, program.cpp, indirectHandle.cpp, _start, _num, _depth, _flags);
}
BGFX_C_API void bgfx_encoder_submit_indirect_count(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags)
BGFX_C_API void bgfx_encoder_submit_indirect_count(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint32_t _numMax, uint32_t _depth, uint8_t _flags)
{
bgfx::Encoder* This = (bgfx::Encoder*)_this;
union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } program = { _program };
@ -1164,7 +1164,7 @@ BGFX_C_API void bgfx_submit_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _
bgfx::submit((bgfx::ViewId)_id, program.cpp, indirectHandle.cpp, _start, _num, _depth, _flags);
}
BGFX_C_API void bgfx_submit_indirect_count(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags)
BGFX_C_API void bgfx_submit_indirect_count(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint32_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint32_t _numMax, uint32_t _depth, uint8_t _flags)
{
union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } program = { _program };
union { bgfx_indirect_buffer_handle_t c; bgfx::IndirectBufferHandle cpp; } indirectHandle = { _indirectHandle };

View File

@ -1755,12 +1755,12 @@ namespace bgfx
m_submitFlags = isIndex16() ? 0 : BGFX_SUBMIT_INTERNAL_INDEX32;
}
m_startIndirect = 0;
m_numIndirect = UINT16_MAX;
m_startIndirect = 0;
m_numIndirect = UINT32_MAX;
m_numIndirectIndex = 0;
m_indirectBuffer.idx = kInvalidHandle;
m_indirectBuffer.idx = kInvalidHandle;
m_numIndirectBuffer.idx = kInvalidHandle;
m_occlusionQuery.idx = kInvalidHandle;
m_occlusionQuery.idx = kInvalidHandle;
}
bool setStreamBit(uint8_t _stream, VertexBufferHandle _handle)
@ -1789,10 +1789,10 @@ namespace bgfx
uint32_t m_numVertices;
uint32_t m_instanceDataOffset;
uint32_t m_numInstances;
uint16_t m_instanceDataStride;
uint16_t m_startIndirect;
uint16_t m_numIndirect;
uint32_t m_startIndirect;
uint32_t m_numIndirect;
uint32_t m_numIndirectIndex;
uint16_t m_instanceDataStride;
uint16_t m_numMatrices;
uint16_t m_scissor;
uint8_t m_submitFlags;
@ -1829,7 +1829,7 @@ namespace bgfx
m_submitFlags = 0;
m_indirectBuffer.idx = kInvalidHandle;
m_startIndirect = 0;
m_numIndirect = UINT16_MAX;
m_numIndirect = UINT32_MAX;
}
uint32_t m_uniformBegin;
@ -2786,9 +2786,9 @@ namespace bgfx
submit(_id, _program, handle, _depth, _flags);
}
void submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags)
void submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint32_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex, uint32_t _numMax, uint32_t _depth, uint8_t _flags)
{
m_draw.m_numIndirectIndex = _numIndex;
m_draw.m_numIndirectIndex = _numIndex;
m_draw.m_numIndirectBuffer = _numHandle;
submit(_id, _program, _indirectHandle, _start, _numMax, _depth, _flags);
}

View File

@ -5877,7 +5877,7 @@ namespace bgfx { namespace d3d11
const VertexBufferD3D11& vb = m_vertexBuffers[compute.m_indirectBuffer.idx];
ID3D11Buffer* ptr = vb.m_ptr;
uint32_t numDrawIndirect = UINT16_MAX == compute.m_numIndirect
uint32_t numDrawIndirect = UINT32_MAX == compute.m_numIndirect
? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE
: compute.m_numIndirect
;
@ -6332,7 +6332,7 @@ namespace bgfx { namespace d3d11
if (isValid(draw.m_indexBuffer) )
{
numDrawIndirect = UINT16_MAX == draw.m_numIndirect
numDrawIndirect = UINT32_MAX == draw.m_numIndirect
? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE
: draw.m_numIndirect
;
@ -6346,7 +6346,7 @@ namespace bgfx { namespace d3d11
}
else
{
numDrawIndirect = UINT16_MAX == draw.m_numIndirect
numDrawIndirect = UINT32_MAX == draw.m_numIndirect
? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE
: draw.m_numIndirect
;

View File

@ -4300,7 +4300,7 @@ namespace bgfx { namespace d3d12
);
const VertexBufferD3D12& indirect = s_renderD3D12->m_vertexBuffers[_draw.m_indirectBuffer.idx];
const uint32_t numDrawIndirect = UINT16_MAX == _draw.m_numIndirect
const uint32_t numDrawIndirect = UINT32_MAX == _draw.m_numIndirect
? indirect.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE
: _draw.m_numIndirect
;
@ -6749,7 +6749,7 @@ namespace bgfx { namespace d3d12
{
const VertexBufferD3D12& indirect = m_vertexBuffers[compute.m_indirectBuffer.idx];
uint32_t numDrawIndirect = UINT16_MAX == compute.m_numIndirect
uint32_t numDrawIndirect = UINT32_MAX == compute.m_numIndirect
? indirect.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE
: compute.m_numIndirect
;

View File

@ -1324,7 +1324,7 @@ namespace bgfx { namespace gl
{
while (s_vertexAttribArraysPendingDisable)
{
uint32_t index = bx::uint32_cnttz(s_vertexAttribArraysPendingDisable);
uint32_t index = bx::countTrailingZeros(s_vertexAttribArraysPendingDisable);
uint64_t mask = ~(UINT64_C(1) << index);
s_vertexAttribArraysPendingDisable &= mask;
s_currentlyEnabledVertexAttribArrays &= mask;
@ -1333,7 +1333,7 @@ namespace bgfx { namespace gl
while (s_vertexAttribArraysPendingEnable)
{
uint32_t index = bx::uint32_cnttz(s_vertexAttribArraysPendingEnable);
uint32_t index = bx::countTrailingZeros(s_vertexAttribArraysPendingEnable);
uint64_t mask = UINT64_C(1) << index;
s_vertexAttribArraysPendingEnable &= ~mask;
s_currentlyEnabledVertexAttribArrays |= mask;
@ -1851,7 +1851,7 @@ namespace bgfx { namespace gl
if (_array)
{
glTexStorage3D(target
, 1 + GLsizei(bx::log2( (int32_t)_dim) )
, 1 + GLsizei(bx::ceilLog2( (int32_t)_dim) )
, internalFmt
, _dim
, _dim
@ -7727,7 +7727,7 @@ namespace bgfx { namespace gl
GL_CHECK(glBindBuffer(GL_DISPATCH_INDIRECT_BUFFER, vb.m_id) );
}
uint32_t numDrawIndirect = UINT16_MAX == compute.m_numIndirect
uint32_t numDrawIndirect = UINT32_MAX == compute.m_numIndirect
? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE
: compute.m_numIndirect
;
@ -8399,7 +8399,7 @@ namespace bgfx { namespace gl
: GL_UNSIGNED_INT
;
numDrawIndirect = UINT16_MAX == draw.m_numIndirect
numDrawIndirect = UINT32_MAX == draw.m_numIndirect
? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE
: draw.m_numIndirect
;
@ -8426,7 +8426,7 @@ namespace bgfx { namespace gl
}
else
{
numDrawIndirect = UINT16_MAX == draw.m_numIndirect
numDrawIndirect = UINT32_MAX == draw.m_numIndirect
? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE
: draw.m_numIndirect
;

View File

@ -4411,7 +4411,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa
{
const VertexBufferMtl& vb = m_vertexBuffers[compute.m_indirectBuffer.idx];
uint32_t numDrawIndirect = UINT16_MAX == compute.m_numIndirect
uint32_t numDrawIndirect = UINT32_MAX == compute.m_numIndirect
? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE
: compute.m_numIndirect
;
@ -4866,7 +4866,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa
const MTLIndexType indexFormat = isIndex16 ? MTLIndexTypeUInt16 : MTLIndexTypeUInt32;
const IndexBufferMtl& ib = m_indexBuffers[draw.m_indexBuffer.idx];
numDrawIndirect = UINT16_MAX == draw.m_numIndirect
numDrawIndirect = UINT32_MAX == draw.m_numIndirect
? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE
: draw.m_numIndirect
;
@ -4878,7 +4878,7 @@ BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNa
}
else
{
numDrawIndirect = UINT16_MAX == draw.m_numIndirect
numDrawIndirect = UINT32_MAX == draw.m_numIndirect
? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE
: draw.m_numIndirect
;

View File

@ -8449,7 +8449,7 @@ VK_DESTROY
{
const VertexBufferVK& vb = m_vertexBuffers[compute.m_indirectBuffer.idx];
uint32_t numDrawIndirect = UINT16_MAX == compute.m_numIndirect
uint32_t numDrawIndirect = UINT32_MAX == compute.m_numIndirect
? vb.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE
: compute.m_numIndirect
;
@ -8765,7 +8765,7 @@ VK_DESTROY
{
const VertexBufferVK& vb = m_vertexBuffers[draw.m_indirectBuffer.idx];
bufferIndirect = vb.m_buffer;
numDrawIndirect = UINT16_MAX == draw.m_numIndirect
numDrawIndirect = UINT32_MAX == draw.m_numIndirect
? vb.m_size / BGFX_CONFIG_DRAW_INDIRECT_STRIDE
: draw.m_numIndirect
;