mirror of https://github.com/xemu-project/xemu.git
n2va/vk: Key textures on sampler state for now
This commit is contained in:
parent
69b5318cb5
commit
f26b8c32d6
|
@ -203,6 +203,9 @@ typedef struct TextureKey {
|
||||||
hwaddr palette_vram_offset;
|
hwaddr palette_vram_offset;
|
||||||
hwaddr palette_length;
|
hwaddr palette_length;
|
||||||
float scale;
|
float scale;
|
||||||
|
uint32_t filter;
|
||||||
|
uint32_t address;
|
||||||
|
uint32_t border_color;
|
||||||
} TextureKey;
|
} TextureKey;
|
||||||
|
|
||||||
typedef struct TextureBinding {
|
typedef struct TextureBinding {
|
||||||
|
|
|
@ -1090,6 +1090,13 @@ static void create_texture(PGRAPHState *pg, int texture_idx)
|
||||||
|
|
||||||
size_t texture_length = pgraph_get_texture_length(pg, &state);
|
size_t texture_length = pgraph_get_texture_length(pg, &state);
|
||||||
|
|
||||||
|
uint32_t filter =
|
||||||
|
pgraph_reg_r(pg, NV_PGRAPH_TEXFILTER0 + texture_idx * 4);
|
||||||
|
uint32_t address =
|
||||||
|
pgraph_reg_r(pg, NV_PGRAPH_TEXADDRESS0 + texture_idx * 4);
|
||||||
|
uint32_t border_color_pack32 =
|
||||||
|
pgraph_reg_r(pg, NV_PGRAPH_BORDERCOLOR0 + texture_idx * 4);
|
||||||
|
|
||||||
TextureKey key;
|
TextureKey key;
|
||||||
memset(&key, 0, sizeof(key));
|
memset(&key, 0, sizeof(key));
|
||||||
key.state = state;
|
key.state = state;
|
||||||
|
@ -1099,6 +1106,11 @@ static void create_texture(PGRAPHState *pg, int texture_idx)
|
||||||
key.palette_length = texture_palette_data_size;
|
key.palette_length = texture_palette_data_size;
|
||||||
key.scale = 1;
|
key.scale = 1;
|
||||||
|
|
||||||
|
// FIXME: Separate sampler from texture
|
||||||
|
key.filter = filter;
|
||||||
|
key.address = address;
|
||||||
|
key.border_color = border_color_pack32;
|
||||||
|
|
||||||
bool is_indexed = (state.color_format ==
|
bool is_indexed = (state.color_format ==
|
||||||
NV097_SET_TEXTURE_FORMAT_COLOR_SZ_I8_A8R8G8B8);
|
NV097_SET_TEXTURE_FORMAT_COLOR_SZ_I8_A8R8G8B8);
|
||||||
|
|
||||||
|
@ -1244,8 +1256,6 @@ static void create_texture(PGRAPHState *pg, int texture_idx)
|
||||||
|
|
||||||
VkSamplerCustomBorderColorCreateInfoEXT custom_border_color_create_info;
|
VkSamplerCustomBorderColorCreateInfoEXT custom_border_color_create_info;
|
||||||
VkBorderColor vk_border_color;
|
VkBorderColor vk_border_color;
|
||||||
uint32_t border_color_pack32 =
|
|
||||||
pgraph_reg_r(pg, NV_PGRAPH_BORDERCOLOR0 + texture_idx * 4);
|
|
||||||
|
|
||||||
bool is_integer_type = vkf.vk_format == VK_FORMAT_R32_UINT;
|
bool is_integer_type = vkf.vk_format == VK_FORMAT_R32_UINT;
|
||||||
|
|
||||||
|
@ -1285,7 +1295,6 @@ static void create_texture(PGRAPHState *pg, int texture_idx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t filter = pgraph_reg_r(pg, NV_PGRAPH_TEXFILTER0 + texture_idx * 4);
|
|
||||||
if (filter & NV_PGRAPH_TEXFILTER0_ASIGNED)
|
if (filter & NV_PGRAPH_TEXFILTER0_ASIGNED)
|
||||||
NV2A_UNIMPLEMENTED("NV_PGRAPH_TEXFILTER0_ASIGNED");
|
NV2A_UNIMPLEMENTED("NV_PGRAPH_TEXFILTER0_ASIGNED");
|
||||||
if (filter & NV_PGRAPH_TEXFILTER0_RSIGNED)
|
if (filter & NV_PGRAPH_TEXFILTER0_RSIGNED)
|
||||||
|
@ -1320,9 +1329,6 @@ static void create_texture(PGRAPHState *pg, int texture_idx)
|
||||||
min_filter == NV_PGRAPH_TEXFILTER0_MIN_BOX_NEARESTLOD ||
|
min_filter == NV_PGRAPH_TEXFILTER0_MIN_BOX_NEARESTLOD ||
|
||||||
min_filter == NV_PGRAPH_TEXFILTER0_MIN_TENT_NEARESTLOD;
|
min_filter == NV_PGRAPH_TEXFILTER0_MIN_TENT_NEARESTLOD;
|
||||||
|
|
||||||
uint32_t address =
|
|
||||||
pgraph_reg_r(pg, NV_PGRAPH_TEXADDRESS0 + texture_idx * 4);
|
|
||||||
|
|
||||||
VkSamplerCreateInfo sampler_create_info = {
|
VkSamplerCreateInfo sampler_create_info = {
|
||||||
.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO,
|
||||||
.magFilter = vk_mag_filter,
|
.magFilter = vk_mag_filter,
|
||||||
|
|
Loading…
Reference in New Issue