mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 00:58:30 -05:00
Cleanup.
This commit is contained in:
parent
1183d9e337
commit
0ed78a0753
2 changed files with 70 additions and 82 deletions
|
@ -450,13 +450,7 @@ namespace bgfx
|
||||||
const uint32_t width = (bx::uint32_min(m_width, _width +_x)-_x)*2;
|
const uint32_t width = (bx::uint32_min(m_width, _width +_x)-_x)*2;
|
||||||
const uint32_t height = bx::uint32_min(m_height, _height+_y)-_y;
|
const uint32_t height = bx::uint32_min(m_height, _height+_y)-_y;
|
||||||
const uint32_t dstPitch = m_width*2;
|
const uint32_t dstPitch = m_width*2;
|
||||||
|
bx::memcpy(dst, src, width, height, _pitch, dstPitch);
|
||||||
for (uint32_t yy = 0; yy < height; ++yy)
|
|
||||||
{
|
|
||||||
memcpy(dst, src, width);
|
|
||||||
dst += dstPitch;
|
|
||||||
src += _pitch;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -603,85 +603,85 @@ namespace bgfx { namespace d3d9
|
||||||
s_textureFormat[TextureFormat::BC5].m_fmt = s_extendedFormats[ExtendedFormat::Ati2].m_supported ? D3DFMT_ATI2 : D3DFMT_UNKNOWN;
|
s_textureFormat[TextureFormat::BC5].m_fmt = s_extendedFormats[ExtendedFormat::Ati2].m_supported ? D3DFMT_ATI2 : D3DFMT_UNKNOWN;
|
||||||
|
|
||||||
g_caps.supported |= m_instancingSupport ? BGFX_CAPS_INSTANCING : 0;
|
g_caps.supported |= m_instancingSupport ? BGFX_CAPS_INSTANCING : 0;
|
||||||
|
}
|
||||||
|
|
||||||
for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
|
for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
|
||||||
{
|
{
|
||||||
uint8_t support = 0;
|
uint8_t support = 0;
|
||||||
|
|
||||||
support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
|
support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
|
||||||
, m_deviceType
|
, m_deviceType
|
||||||
, adapterFormat
|
, adapterFormat
|
||||||
, 0
|
, 0
|
||||||
, D3DRTYPE_TEXTURE
|
, D3DRTYPE_TEXTURE
|
||||||
, s_textureFormat[ii].m_fmt
|
, s_textureFormat[ii].m_fmt
|
||||||
) ) ? BGFX_CAPS_FORMAT_TEXTURE_2D : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
) ) ? BGFX_CAPS_FORMAT_TEXTURE_2D : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
||||||
|
|
||||||
support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
|
support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
|
||||||
, m_deviceType
|
, m_deviceType
|
||||||
, adapterFormat
|
, adapterFormat
|
||||||
, D3DUSAGE_QUERY_SRGBREAD
|
, D3DUSAGE_QUERY_SRGBREAD
|
||||||
, D3DRTYPE_TEXTURE
|
, D3DRTYPE_TEXTURE
|
||||||
, s_textureFormat[ii].m_fmt
|
, s_textureFormat[ii].m_fmt
|
||||||
) ) ? BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
) ) ? BGFX_CAPS_FORMAT_TEXTURE_2D_SRGB : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
||||||
|
|
||||||
support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
|
support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
|
||||||
, m_deviceType
|
, m_deviceType
|
||||||
, adapterFormat
|
, adapterFormat
|
||||||
, 0
|
, 0
|
||||||
, D3DRTYPE_VOLUMETEXTURE
|
, D3DRTYPE_VOLUMETEXTURE
|
||||||
, s_textureFormat[ii].m_fmt
|
, s_textureFormat[ii].m_fmt
|
||||||
) ) ? BGFX_CAPS_FORMAT_TEXTURE_3D : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
) ) ? BGFX_CAPS_FORMAT_TEXTURE_3D : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
||||||
|
|
||||||
support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
|
support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
|
||||||
, m_deviceType
|
, m_deviceType
|
||||||
, adapterFormat
|
, adapterFormat
|
||||||
, D3DUSAGE_QUERY_SRGBREAD
|
, D3DUSAGE_QUERY_SRGBREAD
|
||||||
, D3DRTYPE_VOLUMETEXTURE
|
, D3DRTYPE_VOLUMETEXTURE
|
||||||
, s_textureFormat[ii].m_fmt
|
, s_textureFormat[ii].m_fmt
|
||||||
) ) ? BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
) ) ? BGFX_CAPS_FORMAT_TEXTURE_3D_SRGB : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
||||||
|
|
||||||
support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
|
support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
|
||||||
, m_deviceType
|
, m_deviceType
|
||||||
, adapterFormat
|
, adapterFormat
|
||||||
, 0
|
, 0
|
||||||
, D3DRTYPE_CUBETEXTURE
|
, D3DRTYPE_CUBETEXTURE
|
||||||
, s_textureFormat[ii].m_fmt
|
, s_textureFormat[ii].m_fmt
|
||||||
) ) ? BGFX_CAPS_FORMAT_TEXTURE_CUBE : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
) ) ? BGFX_CAPS_FORMAT_TEXTURE_CUBE : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
||||||
|
|
||||||
support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
|
support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
|
||||||
, m_deviceType
|
, m_deviceType
|
||||||
, adapterFormat
|
, adapterFormat
|
||||||
, D3DUSAGE_QUERY_SRGBREAD
|
, D3DUSAGE_QUERY_SRGBREAD
|
||||||
, D3DRTYPE_CUBETEXTURE
|
, D3DRTYPE_CUBETEXTURE
|
||||||
, s_textureFormat[ii].m_fmt
|
, s_textureFormat[ii].m_fmt
|
||||||
) ) ? BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
) ) ? BGFX_CAPS_FORMAT_TEXTURE_CUBE_SRGB : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
||||||
|
|
||||||
support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
|
support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
|
||||||
, m_deviceType
|
, m_deviceType
|
||||||
, adapterFormat
|
, adapterFormat
|
||||||
, D3DUSAGE_QUERY_VERTEXTEXTURE
|
, D3DUSAGE_QUERY_VERTEXTEXTURE
|
||||||
, D3DRTYPE_TEXTURE
|
, D3DRTYPE_TEXTURE
|
||||||
, s_textureFormat[ii].m_fmt
|
, s_textureFormat[ii].m_fmt
|
||||||
) ) ? BGFX_CAPS_FORMAT_TEXTURE_VERTEX : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
) ) ? BGFX_CAPS_FORMAT_TEXTURE_VERTEX : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
||||||
|
|
||||||
support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
|
support |= SUCCEEDED(m_d3d9->CheckDeviceFormat(m_adapter
|
||||||
, m_deviceType
|
, m_deviceType
|
||||||
, adapterFormat
|
, adapterFormat
|
||||||
, isDepth(TextureFormat::Enum(ii) ) ? D3DUSAGE_DEPTHSTENCIL : D3DUSAGE_RENDERTARGET
|
, isDepth(TextureFormat::Enum(ii) ) ? D3DUSAGE_DEPTHSTENCIL : D3DUSAGE_RENDERTARGET
|
||||||
, D3DRTYPE_TEXTURE
|
, D3DRTYPE_TEXTURE
|
||||||
, s_textureFormat[ii].m_fmt
|
, s_textureFormat[ii].m_fmt
|
||||||
) ) ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
) ) ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
||||||
|
|
||||||
support |= SUCCEEDED(m_d3d9->CheckDeviceMultiSampleType(m_adapter
|
support |= SUCCEEDED(m_d3d9->CheckDeviceMultiSampleType(m_adapter
|
||||||
, m_deviceType
|
, m_deviceType
|
||||||
, s_textureFormat[ii].m_fmt
|
, s_textureFormat[ii].m_fmt
|
||||||
, true
|
, true
|
||||||
, D3DMULTISAMPLE_2_SAMPLES
|
, D3DMULTISAMPLE_2_SAMPLES
|
||||||
, NULL
|
, NULL
|
||||||
) ) ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
) ) ? BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA : BGFX_CAPS_FORMAT_TEXTURE_NONE;
|
||||||
|
|
||||||
g_caps.formats[ii] = support;
|
g_caps.formats[ii] = support;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_fmtDepth = D3DFMT_D24S8;
|
m_fmtDepth = D3DFMT_D24S8;
|
||||||
|
@ -2913,13 +2913,7 @@ namespace bgfx { namespace d3d9
|
||||||
, mip.m_format
|
, mip.m_format
|
||||||
);
|
);
|
||||||
|
|
||||||
uint32_t dstpitch = pitch;
|
bx::memcpy(bits, temp, pitch, height, srcpitch, pitch);
|
||||||
for (uint32_t yy = 0; yy < height; ++yy)
|
|
||||||
{
|
|
||||||
uint8_t* src = &temp[yy*srcpitch];
|
|
||||||
uint8_t* dst = &bits[yy*dstpitch];
|
|
||||||
memcpy(dst, src, dstpitch);
|
|
||||||
}
|
|
||||||
|
|
||||||
BX_FREE(g_allocator, temp);
|
BX_FREE(g_allocator, temp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue