Texture wrapping modes.

This commit is contained in:
Ben Vanik 2014-01-21 08:31:25 -08:00
parent 3a2c2beca4
commit 7d8aaaaea7
2 changed files with 20 additions and 4 deletions

View File

@ -1490,9 +1490,19 @@ int D3D11GraphicsDriver::PrepareTextureSampler(
},
};
sampler_desc.Filter = filter_matrix[min_filter][mag_filter][mip_filter];
sampler_desc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
sampler_desc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
sampler_desc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
static const D3D11_TEXTURE_ADDRESS_MODE mode_map[] = {
D3D11_TEXTURE_ADDRESS_WRAP,
D3D11_TEXTURE_ADDRESS_MIRROR,
D3D11_TEXTURE_ADDRESS_CLAMP, // ?
D3D11_TEXTURE_ADDRESS_MIRROR_ONCE, // ?
D3D11_TEXTURE_ADDRESS_CLAMP, // ?
D3D11_TEXTURE_ADDRESS_MIRROR_ONCE, // ?
D3D11_TEXTURE_ADDRESS_BORDER, // ?
D3D11_TEXTURE_ADDRESS_MIRROR, // ?
};
sampler_desc.AddressU = mode_map[fetcher.fetch.clamp_x];
sampler_desc.AddressV = mode_map[fetcher.fetch.clamp_y];
sampler_desc.AddressW = mode_map[fetcher.fetch.clamp_z];
sampler_desc.MipLODBias;
sampler_desc.MaxAnisotropy = 1;
sampler_desc.ComparisonFunc = D3D11_COMPARISON_ALWAYS;

View File

@ -138,7 +138,13 @@ XEPACKEDUNION(xe_gpu_vertex_fetch_t, {
XEPACKEDUNION(xe_gpu_texture_fetch_t, {
XEPACKEDSTRUCTANONYMOUS({
uint32_t type : 2; // dword_0
uint32_t unk0 : 20;
uint32_t sign_x : 2;
uint32_t sign_y : 2;
uint32_t sign_z : 2;
uint32_t clamp_x : 2;
uint32_t clamp_y : 2;
uint32_t clamp_z : 2;
uint32_t unk0 : 3;
uint32_t pitch : 9;
uint32_t tiled : 1;
uint32_t format : 6; // dword_1