gl: Extend mipcount support for reconstructed images
This commit is contained in:
@@ -384,7 +384,21 @@ void GLGSRender::load_texture_env()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_fs_sampler_states[i].apply(tex, fs_sampler_state[i].get());
|
u32 actual_mipcount = 1;
|
||||||
|
if (sampler_state->upload_context == rsx::texture_upload_context::shader_read)
|
||||||
|
{
|
||||||
|
actual_mipcount = tex.get_exact_mipmap_count();
|
||||||
|
}
|
||||||
|
else if (sampler_state->external_subresource_desc.op == rsx::deferred_request_command::mipmap_gather)
|
||||||
|
{
|
||||||
|
actual_mipcount = sampler_state->external_subresource_desc.sections_to_copy.size();
|
||||||
|
}
|
||||||
|
else if (sampler_state->external_subresource_desc.op == rsx::deferred_request_command::cubemap_unwrap)
|
||||||
|
{
|
||||||
|
actual_mipcount = sampler_state->external_subresource_desc.mipmaps;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_fs_sampler_states[i].apply(tex, fs_sampler_state[i].get(), actual_mipcount > 1);
|
||||||
|
|
||||||
const auto texture_format = sampler_state->format_ex.format();
|
const auto texture_format = sampler_state->format_ex.format();
|
||||||
// Depth format redirected to BGRA8 resample stage. Do not filter to avoid bits leaking.
|
// Depth format redirected to BGRA8 resample stage. Do not filter to avoid bits leaking.
|
||||||
|
|||||||
@@ -586,7 +586,8 @@ namespace gl
|
|||||||
gl::texture_view* generate_cubemap_from_images(gl::command_context& cmd, u32 gcm_format, u16 size, const rsx::simple_array<copy_region_descriptor>& sources, const rsx::texture_channel_remap_t& remap_vector) override
|
gl::texture_view* generate_cubemap_from_images(gl::command_context& cmd, u32 gcm_format, u16 size, const rsx::simple_array<copy_region_descriptor>& sources, const rsx::texture_channel_remap_t& remap_vector) override
|
||||||
{
|
{
|
||||||
auto _template = get_template_from_collection_impl(sources);
|
auto _template = get_template_from_collection_impl(sources);
|
||||||
auto result = create_temporary_subresource_impl(cmd, _template, GL_NONE, GL_TEXTURE_CUBE_MAP, gcm_format, 0, 0, size, size, 1, 1, remap_vector, false);
|
const u8 mip_count = 1 + sources.reduce(0, FN(std::max<u8>(x, y.level)));
|
||||||
|
auto result = create_temporary_subresource_impl(cmd, _template, GL_NONE, GL_TEXTURE_CUBE_MAP, gcm_format, 0, 0, size, size, 1, mip_count, remap_vector, false);
|
||||||
|
|
||||||
copy_transfer_regions_impl(cmd, result->image(), sources);
|
copy_transfer_regions_impl(cmd, result->image(), sources);
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ namespace gl
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Apply sampler state settings
|
// Apply sampler state settings
|
||||||
void sampler_state::apply(const rsx::fragment_texture& tex, const rsx::sampled_image_descriptor_base* sampled_image)
|
void sampler_state::apply(const rsx::fragment_texture& tex, const rsx::sampled_image_descriptor_base* sampled_image, bool allow_mipmaps)
|
||||||
{
|
{
|
||||||
set_parameteri(GL_TEXTURE_WRAP_S, wrap_mode(tex.wrap_s()));
|
set_parameteri(GL_TEXTURE_WRAP_S, wrap_mode(tex.wrap_s()));
|
||||||
set_parameteri(GL_TEXTURE_WRAP_T, wrap_mode(tex.wrap_t()));
|
set_parameteri(GL_TEXTURE_WRAP_T, wrap_mode(tex.wrap_t()));
|
||||||
@@ -114,8 +114,7 @@ namespace gl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sampled_image->upload_context != rsx::texture_upload_context::shader_read ||
|
if (!allow_mipmaps || tex.get_exact_mipmap_count() == 1)
|
||||||
tex.get_exact_mipmap_count() == 1)
|
|
||||||
{
|
{
|
||||||
GLint min_filter = tex_min_filter(tex.min_filter());
|
GLint min_filter = tex_min_filter(tex.min_filter());
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ namespace gl
|
|||||||
return (prop == m_propertiesf.end()) ? 0 : prop->second;
|
return (prop == m_propertiesf.end()) ? 0 : prop->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
void apply(const rsx::fragment_texture& tex, const rsx::sampled_image_descriptor_base* sampled_image);
|
void apply(const rsx::fragment_texture& tex, const rsx::sampled_image_descriptor_base* sampled_image, bool allow_mipmaps = true);
|
||||||
void apply(const rsx::vertex_texture& tex, const rsx::sampled_image_descriptor_base* sampled_image);
|
void apply(const rsx::vertex_texture& tex, const rsx::sampled_image_descriptor_base* sampled_image);
|
||||||
|
|
||||||
void apply_defaults(GLenum default_filter = GL_NEAREST);
|
void apply_defaults(GLenum default_filter = GL_NEAREST);
|
||||||
|
|||||||
Reference in New Issue
Block a user