mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Added border texture address mode.
This commit is contained in:
parent
2b428af00d
commit
72446e998b
5 changed files with 13 additions and 2 deletions
|
@ -263,14 +263,17 @@
|
|||
#define BGFX_TEXTURE_NONE UINT32_C(0x00000000) //!<
|
||||
#define BGFX_TEXTURE_U_MIRROR UINT32_C(0x00000001) //!<
|
||||
#define BGFX_TEXTURE_U_CLAMP UINT32_C(0x00000002) //!<
|
||||
#define BGFX_TEXTURE_U_BORDER UINT32_C(0x00000003) //!<
|
||||
#define BGFX_TEXTURE_U_SHIFT 0 //!<
|
||||
#define BGFX_TEXTURE_U_MASK UINT32_C(0x00000003) //!<
|
||||
#define BGFX_TEXTURE_V_MIRROR UINT32_C(0x00000004) //!<
|
||||
#define BGFX_TEXTURE_V_CLAMP UINT32_C(0x00000008) //!<
|
||||
#define BGFX_TEXTURE_V_BORDER UINT32_C(0x0000000c) //!<
|
||||
#define BGFX_TEXTURE_V_SHIFT 2 //!<
|
||||
#define BGFX_TEXTURE_V_MASK UINT32_C(0x0000000c) //!<
|
||||
#define BGFX_TEXTURE_W_MIRROR UINT32_C(0x00000010) //!<
|
||||
#define BGFX_TEXTURE_W_CLAMP UINT32_C(0x00000020) //!<
|
||||
#define BGFX_TEXTURE_W_BORDER UINT32_C(0x00000030) //!<
|
||||
#define BGFX_TEXTURE_W_SHIFT 4 //!<
|
||||
#define BGFX_TEXTURE_W_MASK UINT32_C(0x00000030) //!<
|
||||
#define BGFX_TEXTURE_MIN_POINT UINT32_C(0x00000040) //!<
|
||||
|
|
|
@ -141,6 +141,7 @@ namespace bgfx { namespace d3d11
|
|||
D3D11_TEXTURE_ADDRESS_WRAP,
|
||||
D3D11_TEXTURE_ADDRESS_MIRROR,
|
||||
D3D11_TEXTURE_ADDRESS_CLAMP,
|
||||
D3D11_TEXTURE_ADDRESS_BORDER,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -125,6 +125,7 @@ namespace bgfx { namespace d3d12
|
|||
D3D12_TEXTURE_ADDRESS_MODE_WRAP,
|
||||
D3D12_TEXTURE_ADDRESS_MODE_MIRROR,
|
||||
D3D12_TEXTURE_ADDRESS_MODE_CLAMP,
|
||||
D3D12_TEXTURE_ADDRESS_MODE_BORDER,
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -2804,11 +2805,15 @@ data.NumQualityLevels = 0;
|
|||
sd.AddressU = s_textureAddress[(flags&BGFX_TEXTURE_U_MASK)>>BGFX_TEXTURE_U_SHIFT];
|
||||
sd.AddressV = s_textureAddress[(flags&BGFX_TEXTURE_V_MASK)>>BGFX_TEXTURE_V_SHIFT];
|
||||
sd.AddressW = s_textureAddress[(flags&BGFX_TEXTURE_W_MASK)>>BGFX_TEXTURE_W_SHIFT];
|
||||
sd.MinLOD = 0;
|
||||
sd.MaxLOD = D3D12_FLOAT32_MAX;
|
||||
sd.MipLODBias = 0.0f;
|
||||
sd.MaxAnisotropy = 1; //m_maxAnisotropy;
|
||||
sd.ComparisonFunc = 0 == cmpFunc ? D3D12_COMPARISON_FUNC_NEVER : s_cmpFunc[cmpFunc];
|
||||
sd.BorderColor[0] = 0.0f;
|
||||
sd.BorderColor[1] = 0.0f;
|
||||
sd.BorderColor[2] = 0.0f;
|
||||
sd.BorderColor[3] = 0.0f;
|
||||
sd.MinLOD = 0;
|
||||
sd.MaxLOD = D3D12_FLOAT32_MAX;
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE cpuHandle =
|
||||
{
|
||||
|
|
|
@ -153,6 +153,7 @@ namespace bgfx { namespace d3d9
|
|||
D3DTADDRESS_WRAP,
|
||||
D3DTADDRESS_MIRROR,
|
||||
D3DTADDRESS_CLAMP,
|
||||
D3DTADDRESS_BORDER,
|
||||
};
|
||||
|
||||
static const D3DTEXTUREFILTERTYPE s_textureFilter[] =
|
||||
|
|
|
@ -160,6 +160,7 @@ namespace bgfx { namespace gl
|
|||
GL_REPEAT,
|
||||
GL_MIRRORED_REPEAT,
|
||||
GL_CLAMP_TO_EDGE,
|
||||
GL_CLAMP,
|
||||
};
|
||||
|
||||
static const GLenum s_textureFilterMag[] =
|
||||
|
|
Loading…
Reference in a new issue