|
@@ -316,7 +316,7 @@ namespace bgfx { namespace d3d12
|
|
|
{
|
|
{
|
|
|
if (UINT16_MAX != _decl.m_attributes[attr])
|
|
if (UINT16_MAX != _decl.m_attributes[attr])
|
|
|
{
|
|
{
|
|
|
- memcpy(elem, &s_attrib[attr], sizeof(D3D12_INPUT_ELEMENT_DESC) );
|
|
|
|
|
|
|
+ bx::memCopy(elem, &s_attrib[attr], sizeof(D3D12_INPUT_ELEMENT_DESC) );
|
|
|
|
|
|
|
|
if (0 == _decl.m_attributes[attr])
|
|
if (0 == _decl.m_attributes[attr])
|
|
|
{
|
|
{
|
|
@@ -501,8 +501,8 @@ namespace bgfx { namespace d3d12
|
|
|
// m_renderdocdll = loadRenderDoc();
|
|
// m_renderdocdll = loadRenderDoc();
|
|
|
|
|
|
|
|
m_fbh.idx = invalidHandle;
|
|
m_fbh.idx = invalidHandle;
|
|
|
- memset(m_uniforms, 0, sizeof(m_uniforms) );
|
|
|
|
|
- memset(&m_resolution, 0, sizeof(m_resolution) );
|
|
|
|
|
|
|
+ bx::memSet(m_uniforms, 0, sizeof(m_uniforms) );
|
|
|
|
|
+ bx::memSet(&m_resolution, 0, sizeof(m_resolution) );
|
|
|
|
|
|
|
|
#if USE_D3D12_DYNAMIC_LIB
|
|
#if USE_D3D12_DYNAMIC_LIB
|
|
|
m_kernel32dll = bx::dlopen("kernel32.dll");
|
|
m_kernel32dll = bx::dlopen("kernel32.dll");
|
|
@@ -684,7 +684,7 @@ namespace bgfx { namespace d3d12
|
|
|
|
|
|
|
|
if (NULL != m_factory)
|
|
if (NULL != m_factory)
|
|
|
{
|
|
{
|
|
|
- memset(&m_adapterDesc, 0, sizeof(m_adapterDesc) );
|
|
|
|
|
|
|
+ bx::memSet(&m_adapterDesc, 0, sizeof(m_adapterDesc) );
|
|
|
luid = m_device->GetAdapterLuid();
|
|
luid = m_device->GetAdapterLuid();
|
|
|
#if BX_PLATFORM_WINDOWS
|
|
#if BX_PLATFORM_WINDOWS
|
|
|
IDXGIAdapter3* adapter;
|
|
IDXGIAdapter3* adapter;
|
|
@@ -730,7 +730,7 @@ namespace bgfx { namespace d3d12
|
|
|
);
|
|
);
|
|
|
if (0 == ii)
|
|
if (0 == ii)
|
|
|
{
|
|
{
|
|
|
- memcpy(&m_architecture, &architecture, sizeof(architecture) );
|
|
|
|
|
|
|
+ bx::memCopy(&m_architecture, &architecture, sizeof(architecture) );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -895,7 +895,7 @@ namespace bgfx { namespace d3d12
|
|
|
m_infoQueue->SetBreakOnSeverity(D3D12_MESSAGE_SEVERITY_WARNING, false);
|
|
m_infoQueue->SetBreakOnSeverity(D3D12_MESSAGE_SEVERITY_WARNING, false);
|
|
|
|
|
|
|
|
D3D12_INFO_QUEUE_FILTER filter;
|
|
D3D12_INFO_QUEUE_FILTER filter;
|
|
|
- memset(&filter, 0, sizeof(filter) );
|
|
|
|
|
|
|
+ bx::memSet(&filter, 0, sizeof(filter) );
|
|
|
|
|
|
|
|
D3D12_MESSAGE_CATEGORY catlist[] =
|
|
D3D12_MESSAGE_CATEGORY catlist[] =
|
|
|
{
|
|
{
|
|
@@ -1319,7 +1319,7 @@ namespace bgfx { namespace d3d12
|
|
|
void createVertexDecl(VertexDeclHandle _handle, const VertexDecl& _decl) BX_OVERRIDE
|
|
void createVertexDecl(VertexDeclHandle _handle, const VertexDecl& _decl) BX_OVERRIDE
|
|
|
{
|
|
{
|
|
|
VertexDecl& decl = m_vertexDecls[_handle.idx];
|
|
VertexDecl& decl = m_vertexDecls[_handle.idx];
|
|
|
- memcpy(&decl, &_decl, sizeof(VertexDecl) );
|
|
|
|
|
|
|
+ bx::memCopy(&decl, &_decl, sizeof(VertexDecl) );
|
|
|
dump(decl);
|
|
dump(decl);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1456,7 +1456,7 @@ namespace bgfx { namespace d3d12
|
|
|
|
|
|
|
|
for (uint32_t yy = 0, height = srcHeight; yy < height; ++yy)
|
|
for (uint32_t yy = 0, height = srcHeight; yy < height; ++yy)
|
|
|
{
|
|
{
|
|
|
- memcpy(dst, src, pitch);
|
|
|
|
|
|
|
+ bx::memCopy(dst, src, pitch);
|
|
|
|
|
|
|
|
src += srcPitch;
|
|
src += srcPitch;
|
|
|
dst += dstPitch;
|
|
dst += dstPitch;
|
|
@@ -1547,7 +1547,7 @@ namespace bgfx { namespace d3d12
|
|
|
|
|
|
|
|
uint32_t size = BX_ALIGN_16(g_uniformTypeSize[_type] * _num);
|
|
uint32_t size = BX_ALIGN_16(g_uniformTypeSize[_type] * _num);
|
|
|
void* data = BX_ALLOC(g_allocator, size);
|
|
void* data = BX_ALLOC(g_allocator, size);
|
|
|
- memset(data, 0, size);
|
|
|
|
|
|
|
+ bx::memSet(data, 0, size);
|
|
|
m_uniforms[_handle.idx] = data;
|
|
m_uniforms[_handle.idx] = data;
|
|
|
m_uniformReg.add(_handle, _name, data);
|
|
m_uniformReg.add(_handle, _name, data);
|
|
|
}
|
|
}
|
|
@@ -1630,7 +1630,7 @@ namespace bgfx { namespace d3d12
|
|
|
|
|
|
|
|
void updateUniform(uint16_t _loc, const void* _data, uint32_t _size) BX_OVERRIDE
|
|
void updateUniform(uint16_t _loc, const void* _data, uint32_t _size) BX_OVERRIDE
|
|
|
{
|
|
{
|
|
|
- memcpy(m_uniforms[_loc], _data, _size);
|
|
|
|
|
|
|
+ bx::memCopy(m_uniforms[_loc], _data, _size);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void setMarker(const char* /*_marker*/, uint32_t /*_size*/) BX_OVERRIDE
|
|
void setMarker(const char* /*_marker*/, uint32_t /*_size*/) BX_OVERRIDE
|
|
@@ -1762,7 +1762,7 @@ namespace bgfx { namespace d3d12
|
|
|
|
|
|
|
|
void postReset()
|
|
void postReset()
|
|
|
{
|
|
{
|
|
|
- memset(m_backBufferColorFence, 0, sizeof(m_backBufferColorFence) );
|
|
|
|
|
|
|
+ bx::memSet(m_backBufferColorFence, 0, sizeof(m_backBufferColorFence) );
|
|
|
|
|
|
|
|
uint32_t rtvDescriptorSize = m_device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV);
|
|
uint32_t rtvDescriptorSize = m_device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV);
|
|
|
|
|
|
|
@@ -1835,7 +1835,7 @@ namespace bgfx { namespace d3d12
|
|
|
uint32_t msaa = s_checkMsaa[ii];
|
|
uint32_t msaa = s_checkMsaa[ii];
|
|
|
|
|
|
|
|
D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS data;
|
|
D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS data;
|
|
|
- memset(&data, 0, sizeof(msaa) );
|
|
|
|
|
|
|
+ bx::memSet(&data, 0, sizeof(msaa) );
|
|
|
data.Format = getBufferFormat();
|
|
data.Format = getBufferFormat();
|
|
|
data.SampleCount = msaa;
|
|
data.SampleCount = msaa;
|
|
|
data.Flags = D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_NONE;
|
|
data.Flags = D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_NONE;
|
|
@@ -1945,12 +1945,12 @@ data.NumQualityLevels = 0;
|
|
|
{
|
|
{
|
|
|
if (_flags&BGFX_UNIFORM_FRAGMENTBIT)
|
|
if (_flags&BGFX_UNIFORM_FRAGMENTBIT)
|
|
|
{
|
|
{
|
|
|
- memcpy(&m_fsScratch[_regIndex], _val, _numRegs*16);
|
|
|
|
|
|
|
+ bx::memCopy(&m_fsScratch[_regIndex], _val, _numRegs*16);
|
|
|
m_fsChanges += _numRegs;
|
|
m_fsChanges += _numRegs;
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- memcpy(&m_vsScratch[_regIndex], _val, _numRegs*16);
|
|
|
|
|
|
|
+ bx::memCopy(&m_vsScratch[_regIndex], _val, _numRegs*16);
|
|
|
m_vsChanges += _numRegs;
|
|
m_vsChanges += _numRegs;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -1977,7 +1977,7 @@ data.NumQualityLevels = 0;
|
|
|
|
|
|
|
|
{
|
|
{
|
|
|
uint32_t size = program.m_vsh->m_size;
|
|
uint32_t size = program.m_vsh->m_size;
|
|
|
- memcpy(data, m_vsScratch, size);
|
|
|
|
|
|
|
+ bx::memCopy(data, m_vsScratch, size);
|
|
|
data += size;
|
|
data += size;
|
|
|
|
|
|
|
|
m_vsChanges = 0;
|
|
m_vsChanges = 0;
|
|
@@ -1985,7 +1985,7 @@ data.NumQualityLevels = 0;
|
|
|
|
|
|
|
|
if (NULL != program.m_fsh)
|
|
if (NULL != program.m_fsh)
|
|
|
{
|
|
{
|
|
|
- memcpy(data, m_fsScratch, program.m_fsh->m_size);
|
|
|
|
|
|
|
+ bx::memCopy(data, m_fsScratch, program.m_fsh->m_size);
|
|
|
|
|
|
|
|
m_fsChanges = 0;
|
|
m_fsChanges = 0;
|
|
|
}
|
|
}
|
|
@@ -2149,7 +2149,7 @@ data.NumQualityLevels = 0;
|
|
|
{
|
|
{
|
|
|
for (uint32_t ii = 1; ii < BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS; ++ii)
|
|
for (uint32_t ii = 1; ii < BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS; ++ii)
|
|
|
{
|
|
{
|
|
|
- memcpy(&_desc.RenderTarget[ii], drt, sizeof(D3D12_RENDER_TARGET_BLEND_DESC) );
|
|
|
|
|
|
|
+ bx::memCopy(&_desc.RenderTarget[ii], drt, sizeof(D3D12_RENDER_TARGET_BLEND_DESC) );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2181,7 +2181,7 @@ data.NumQualityLevels = 0;
|
|
|
{
|
|
{
|
|
|
const uint32_t fstencil = unpackStencil(0, _stencil);
|
|
const uint32_t fstencil = unpackStencil(0, _stencil);
|
|
|
|
|
|
|
|
- memset(&_desc, 0, sizeof(_desc) );
|
|
|
|
|
|
|
+ bx::memSet(&_desc, 0, sizeof(_desc) );
|
|
|
uint32_t func = (_state&BGFX_STATE_DEPTH_TEST_MASK)>>BGFX_STATE_DEPTH_TEST_SHIFT;
|
|
uint32_t func = (_state&BGFX_STATE_DEPTH_TEST_MASK)>>BGFX_STATE_DEPTH_TEST_SHIFT;
|
|
|
_desc.DepthEnable = 0 != func;
|
|
_desc.DepthEnable = 0 != func;
|
|
|
_desc.DepthWriteMask = !!(BGFX_STATE_DEPTH_WRITE & _state)
|
|
_desc.DepthWriteMask = !!(BGFX_STATE_DEPTH_WRITE & _state)
|
|
@@ -2212,7 +2212,7 @@ data.NumQualityLevels = 0;
|
|
|
uint32_t setInputLayout(D3D12_INPUT_ELEMENT_DESC* _vertexElements, const VertexDecl& _vertexDecl, const ProgramD3D12& _program, uint8_t _numInstanceData)
|
|
uint32_t setInputLayout(D3D12_INPUT_ELEMENT_DESC* _vertexElements, const VertexDecl& _vertexDecl, const ProgramD3D12& _program, uint8_t _numInstanceData)
|
|
|
{
|
|
{
|
|
|
VertexDecl decl;
|
|
VertexDecl decl;
|
|
|
- memcpy(&decl, &_vertexDecl, sizeof(VertexDecl) );
|
|
|
|
|
|
|
+ bx::memCopy(&decl, &_vertexDecl, sizeof(VertexDecl) );
|
|
|
const uint16_t* attrMask = _program.m_vsh->m_attrMask;
|
|
const uint16_t* attrMask = _program.m_vsh->m_attrMask;
|
|
|
|
|
|
|
|
for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
|
|
for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
|
|
@@ -2249,7 +2249,7 @@ data.NumQualityLevels = 0;
|
|
|
++elem;
|
|
++elem;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- memcpy(curr, &inst, sizeof(D3D12_INPUT_ELEMENT_DESC) );
|
|
|
|
|
|
|
+ bx::memCopy(curr, &inst, sizeof(D3D12_INPUT_ELEMENT_DESC) );
|
|
|
curr->InputSlot = 1;
|
|
curr->InputSlot = 1;
|
|
|
curr->SemanticIndex = index;
|
|
curr->SemanticIndex = index;
|
|
|
curr->AlignedByteOffset = ii*16;
|
|
curr->AlignedByteOffset = ii*16;
|
|
@@ -2291,7 +2291,7 @@ data.NumQualityLevels = 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
D3D12_COMPUTE_PIPELINE_STATE_DESC desc;
|
|
D3D12_COMPUTE_PIPELINE_STATE_DESC desc;
|
|
|
- memset(&desc, 0, sizeof(desc) );
|
|
|
|
|
|
|
+ bx::memSet(&desc, 0, sizeof(desc) );
|
|
|
|
|
|
|
|
desc.pRootSignature = m_rootSignature;
|
|
desc.pRootSignature = m_rootSignature;
|
|
|
|
|
|
|
@@ -2330,7 +2330,7 @@ data.NumQualityLevels = 0;
|
|
|
_stencil &= packStencil(~BGFX_STENCIL_FUNC_REF_MASK, BGFX_STENCIL_MASK);
|
|
_stencil &= packStencil(~BGFX_STENCIL_FUNC_REF_MASK, BGFX_STENCIL_MASK);
|
|
|
|
|
|
|
|
VertexDecl decl;
|
|
VertexDecl decl;
|
|
|
- memcpy(&decl, &m_vertexDecls[_declIdx], sizeof(VertexDecl) );
|
|
|
|
|
|
|
+ bx::memCopy(&decl, &m_vertexDecls[_declIdx], sizeof(VertexDecl) );
|
|
|
const uint16_t* attrMask = program.m_vsh->m_attrMask;
|
|
const uint16_t* attrMask = program.m_vsh->m_attrMask;
|
|
|
|
|
|
|
|
for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
|
|
for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
|
|
@@ -2361,7 +2361,7 @@ data.NumQualityLevels = 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
D3D12_GRAPHICS_PIPELINE_STATE_DESC desc;
|
|
D3D12_GRAPHICS_PIPELINE_STATE_DESC desc;
|
|
|
- memset(&desc, 0, sizeof(desc) );
|
|
|
|
|
|
|
+ bx::memSet(&desc, 0, sizeof(desc) );
|
|
|
|
|
|
|
|
desc.pRootSignature = m_rootSignature;
|
|
desc.pRootSignature = m_rootSignature;
|
|
|
|
|
|
|
@@ -2369,7 +2369,7 @@ data.NumQualityLevels = 0;
|
|
|
desc.VS.BytecodeLength = program.m_vsh->m_code->size;
|
|
desc.VS.BytecodeLength = program.m_vsh->m_code->size;
|
|
|
|
|
|
|
|
const Memory* temp = alloc(program.m_fsh->m_code->size);
|
|
const Memory* temp = alloc(program.m_fsh->m_code->size);
|
|
|
- memset(temp->data, 0, temp->size);
|
|
|
|
|
|
|
+ bx::memSet(temp->data, 0, temp->size);
|
|
|
bx::MemoryReader rd(program.m_fsh->m_code->data, program.m_fsh->m_code->size);
|
|
bx::MemoryReader rd(program.m_fsh->m_code->data, program.m_fsh->m_code->size);
|
|
|
bx::StaticMemoryBlockWriter wr(temp->data, temp->size);
|
|
bx::StaticMemoryBlockWriter wr(temp->data, temp->size);
|
|
|
|
|
|
|
@@ -2410,7 +2410,7 @@ data.NumQualityLevels = 0;
|
|
|
|
|
|
|
|
if (patchShader)
|
|
if (patchShader)
|
|
|
{
|
|
{
|
|
|
- memcpy(temp->data, program.m_fsh->m_code->data, program.m_fsh->m_code->size);
|
|
|
|
|
|
|
+ bx::memCopy(temp->data, program.m_fsh->m_code->data, program.m_fsh->m_code->size);
|
|
|
|
|
|
|
|
bx::seek(&wr, 0, bx::Whence::Begin);
|
|
bx::seek(&wr, 0, bx::Whence::Begin);
|
|
|
union { uint32_t offset; void* ptr; } cast =
|
|
union { uint32_t offset; void* ptr; } cast =
|
|
@@ -2509,7 +2509,7 @@ data.NumQualityLevels = 0;
|
|
|
if (FAILED(hr) )
|
|
if (FAILED(hr) )
|
|
|
{
|
|
{
|
|
|
BX_TRACE("Failed to load cached PSO (HRESULT 0x%08x).", hr);
|
|
BX_TRACE("Failed to load cached PSO (HRESULT 0x%08x).", hr);
|
|
|
- memset(&desc.CachedPSO, 0, sizeof(desc.CachedPSO) );
|
|
|
|
|
|
|
+ bx::memSet(&desc.CachedPSO, 0, sizeof(desc.CachedPSO) );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2632,7 +2632,7 @@ data.NumQualityLevels = 0;
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
UniformHandle handle;
|
|
UniformHandle handle;
|
|
|
- memcpy(&handle, _uniformBuffer.read(sizeof(UniformHandle) ), sizeof(UniformHandle) );
|
|
|
|
|
|
|
+ bx::memCopy(&handle, _uniformBuffer.read(sizeof(UniformHandle) ), sizeof(UniformHandle) );
|
|
|
data = (const char*)m_uniforms[handle.idx];
|
|
data = (const char*)m_uniforms[handle.idx];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -2977,7 +2977,7 @@ data.NumQualityLevels = 0;
|
|
|
D3D12_SHADER_RESOURCE_VIEW_DESC* srvd = &_texture.m_srvd;
|
|
D3D12_SHADER_RESOURCE_VIEW_DESC* srvd = &_texture.m_srvd;
|
|
|
if (0 != _mip)
|
|
if (0 != _mip)
|
|
|
{
|
|
{
|
|
|
- memcpy(&tmpSrvd, srvd, sizeof(tmpSrvd) );
|
|
|
|
|
|
|
+ bx::memCopy(&tmpSrvd, srvd, sizeof(tmpSrvd) );
|
|
|
srvd = &tmpSrvd;
|
|
srvd = &tmpSrvd;
|
|
|
|
|
|
|
|
switch (_texture.m_srvd.ViewDimension)
|
|
switch (_texture.m_srvd.ViewDimension)
|
|
@@ -3023,7 +3023,7 @@ data.NumQualityLevels = 0;
|
|
|
|
|
|
|
|
if (0 != _mip)
|
|
if (0 != _mip)
|
|
|
{
|
|
{
|
|
|
- memcpy(&tmpUavd, uavd, sizeof(tmpUavd) );
|
|
|
|
|
|
|
+ bx::memCopy(&tmpUavd, uavd, sizeof(tmpUavd) );
|
|
|
uavd = &tmpUavd;
|
|
uavd = &tmpUavd;
|
|
|
|
|
|
|
|
switch (_texture.m_uavd.ViewDimension)
|
|
switch (_texture.m_uavd.ViewDimension)
|
|
@@ -3473,7 +3473,7 @@ data.NumQualityLevels = 0;
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- memset(&cmd.vbv[1], 0, sizeof(cmd.vbv[1]) );
|
|
|
|
|
|
|
+ bx::memSet(&cmd.vbv[1], 0, sizeof(cmd.vbv[1]) );
|
|
|
}
|
|
}
|
|
|
cmd.draw.InstanceCount = _draw.m_numInstances;
|
|
cmd.draw.InstanceCount = _draw.m_numInstances;
|
|
|
cmd.draw.VertexCountPerInstance = numVertices;
|
|
cmd.draw.VertexCountPerInstance = numVertices;
|
|
@@ -3514,7 +3514,7 @@ data.NumQualityLevels = 0;
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- memset(&cmd.vbv[1], 0, sizeof(cmd.vbv[1]) );
|
|
|
|
|
|
|
+ bx::memSet(&cmd.vbv[1], 0, sizeof(cmd.vbv[1]) );
|
|
|
}
|
|
}
|
|
|
cmd.drawIndexed.IndexCountPerInstance = numIndices;
|
|
cmd.drawIndexed.IndexCountPerInstance = numIndices;
|
|
|
cmd.drawIndexed.InstanceCount = _draw.m_numInstances;
|
|
cmd.drawIndexed.InstanceCount = _draw.m_numInstances;
|
|
@@ -3581,7 +3581,7 @@ data.NumQualityLevels = 0;
|
|
|
|
|
|
|
|
if (0 != memcmp(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) ) )
|
|
if (0 != memcmp(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) ) )
|
|
|
{
|
|
{
|
|
|
- memcpy(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) );
|
|
|
|
|
|
|
+ bx::memCopy(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) );
|
|
|
_commandList->IASetVertexBuffers(0
|
|
_commandList->IASetVertexBuffers(0
|
|
|
, 0 == cmd.vbv[1].BufferLocation ? 1 : 2
|
|
, 0 == cmd.vbv[1].BufferLocation ? 1 : 2
|
|
|
, cmd.vbv
|
|
, cmd.vbv
|
|
@@ -3611,7 +3611,7 @@ data.NumQualityLevels = 0;
|
|
|
|
|
|
|
|
if (0 != memcmp(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) ) )
|
|
if (0 != memcmp(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) ) )
|
|
|
{
|
|
{
|
|
|
- memcpy(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) );
|
|
|
|
|
|
|
+ bx::memCopy(m_current.vbv, cmd.vbv, sizeof(cmd.vbv) );
|
|
|
_commandList->IASetVertexBuffers(0
|
|
_commandList->IASetVertexBuffers(0
|
|
|
, 0 == cmd.vbv[1].BufferLocation ? 1 : 2
|
|
, 0 == cmd.vbv[1].BufferLocation ? 1 : 2
|
|
|
, cmd.vbv
|
|
, cmd.vbv
|
|
@@ -3620,7 +3620,7 @@ data.NumQualityLevels = 0;
|
|
|
|
|
|
|
|
if (0 != memcmp(&m_current.ibv, &cmd.ibv, sizeof(cmd.ibv) ) )
|
|
if (0 != memcmp(&m_current.ibv, &cmd.ibv, sizeof(cmd.ibv) ) )
|
|
|
{
|
|
{
|
|
|
- memcpy(&m_current.ibv, &cmd.ibv, sizeof(cmd.ibv) );
|
|
|
|
|
|
|
+ bx::memCopy(&m_current.ibv, &cmd.ibv, sizeof(cmd.ibv) );
|
|
|
_commandList->IASetIndexBuffer(&cmd.ibv);
|
|
_commandList->IASetIndexBuffer(&cmd.ibv);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -3644,14 +3644,14 @@ data.NumQualityLevels = 0;
|
|
|
|
|
|
|
|
if (_clean)
|
|
if (_clean)
|
|
|
{
|
|
{
|
|
|
- memset(&m_current, 0, sizeof(m_current) );
|
|
|
|
|
|
|
+ bx::memSet(&m_current, 0, sizeof(m_current) );
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void BatchD3D12::begin()
|
|
void BatchD3D12::begin()
|
|
|
{
|
|
{
|
|
|
- memset(&m_stats, 0, sizeof(m_stats) );
|
|
|
|
|
- memset(&m_current, 0, sizeof(m_current) );
|
|
|
|
|
|
|
+ bx::memSet(&m_stats, 0, sizeof(m_stats) );
|
|
|
|
|
+ bx::memSet(&m_current, 0, sizeof(m_current) );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void BatchD3D12::end(ID3D12GraphicsCommandList* _commandList)
|
|
void BatchD3D12::end(ID3D12GraphicsCommandList* _commandList)
|
|
@@ -3772,7 +3772,7 @@ data.NumQualityLevels = 0;
|
|
|
ID3D12Resource* staging = createCommittedResource(s_renderD3D12->m_device, HeapProperty::Upload, _size);
|
|
ID3D12Resource* staging = createCommittedResource(s_renderD3D12->m_device, HeapProperty::Upload, _size);
|
|
|
uint8_t* data;
|
|
uint8_t* data;
|
|
|
DX_CHECK(staging->Map(0, NULL, (void**)&data) );
|
|
DX_CHECK(staging->Map(0, NULL, (void**)&data) );
|
|
|
- memcpy(data, _data, _size);
|
|
|
|
|
|
|
+ bx::memCopy(data, _data, _size);
|
|
|
staging->Unmap(0, NULL);
|
|
staging->Unmap(0, NULL);
|
|
|
|
|
|
|
|
D3D12_RESOURCE_STATES state = setState(_commandList, D3D12_RESOURCE_STATE_COPY_DEST);
|
|
D3D12_RESOURCE_STATES state = setState(_commandList, D3D12_RESOURCE_STATE_COPY_DEST);
|
|
@@ -3933,7 +3933,7 @@ data.NumQualityLevels = 0;
|
|
|
uint8_t numAttrs = 0;
|
|
uint8_t numAttrs = 0;
|
|
|
bx::read(&reader, numAttrs);
|
|
bx::read(&reader, numAttrs);
|
|
|
|
|
|
|
|
- memset(m_attrMask, 0, sizeof(m_attrMask) );
|
|
|
|
|
|
|
+ bx::memSet(m_attrMask, 0, sizeof(m_attrMask) );
|
|
|
|
|
|
|
|
for (uint32_t ii = 0; ii < numAttrs; ++ii)
|
|
for (uint32_t ii = 0; ii < numAttrs; ++ii)
|
|
|
{
|
|
{
|
|
@@ -4128,7 +4128,7 @@ data.NumQualityLevels = 0;
|
|
|
const uint32_t msaaQuality = bx::uint32_satsub( (m_flags&BGFX_TEXTURE_RT_MSAA_MASK)>>BGFX_TEXTURE_RT_MSAA_SHIFT, 1);
|
|
const uint32_t msaaQuality = bx::uint32_satsub( (m_flags&BGFX_TEXTURE_RT_MSAA_MASK)>>BGFX_TEXTURE_RT_MSAA_SHIFT, 1);
|
|
|
const DXGI_SAMPLE_DESC& msaa = s_msaa[msaaQuality];
|
|
const DXGI_SAMPLE_DESC& msaa = s_msaa[msaaQuality];
|
|
|
|
|
|
|
|
- memset(&m_srvd, 0, sizeof(m_srvd) );
|
|
|
|
|
|
|
+ bx::memSet(&m_srvd, 0, sizeof(m_srvd) );
|
|
|
m_srvd.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
|
|
m_srvd.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
|
|
|
m_srvd.Format = s_textureFormat[m_textureFormat].m_fmtSrv;
|
|
m_srvd.Format = s_textureFormat[m_textureFormat].m_fmtSrv;
|
|
|
DXGI_FORMAT format = s_textureFormat[m_textureFormat].m_fmt;
|
|
DXGI_FORMAT format = s_textureFormat[m_textureFormat].m_fmt;
|
|
@@ -4385,7 +4385,7 @@ data.NumQualityLevels = 0;
|
|
|
DX_CHECK(staging->Map(0, NULL, (void**)&data) );
|
|
DX_CHECK(staging->Map(0, NULL, (void**)&data) );
|
|
|
for (uint32_t ii = 0, height = _rect.m_height; ii < height; ++ii)
|
|
for (uint32_t ii = 0, height = _rect.m_height; ii < height; ++ii)
|
|
|
{
|
|
{
|
|
|
- memcpy(&data[ii*rowPitch], &_mem->data[ii*srcpitch], srcpitch);
|
|
|
|
|
|
|
+ bx::memCopy(&data[ii*rowPitch], &_mem->data[ii*srcpitch], srcpitch);
|
|
|
}
|
|
}
|
|
|
staging->Unmap(0, NULL);
|
|
staging->Unmap(0, NULL);
|
|
|
|
|
|
|
@@ -4431,7 +4431,7 @@ data.NumQualityLevels = 0;
|
|
|
{
|
|
{
|
|
|
m_denseIdx = UINT16_MAX;
|
|
m_denseIdx = UINT16_MAX;
|
|
|
m_numTh = _num;
|
|
m_numTh = _num;
|
|
|
- memcpy(m_attachment, _attachment, _num*sizeof(Attachment) );
|
|
|
|
|
|
|
+ bx::memCopy(m_attachment, _attachment, _num*sizeof(Attachment) );
|
|
|
|
|
|
|
|
postReset();
|
|
postReset();
|
|
|
}
|
|
}
|
|
@@ -5286,7 +5286,7 @@ data.NumQualityLevels = 0;
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- memcpy(&srvHandle[stage], &srvHandle[0], sizeof(D3D12_GPU_DESCRIPTOR_HANDLE) );
|
|
|
|
|
|
|
+ bx::memCopy(&srvHandle[stage], &srvHandle[0], sizeof(D3D12_GPU_DESCRIPTOR_HANDLE) );
|
|
|
samplerFlags[stage] = 0;
|
|
samplerFlags[stage] = 0;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|