Merge pull request #8858 from vonchenplus/mipmap

video_core: Generate mipmap texture by drawing
This commit is contained in:
bunnei 2022-11-03 22:21:58 -07:00 committed by GitHub
commit 38e4382f53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 259 additions and 8 deletions

View file

@ -503,6 +503,17 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
float_image_scaling_mask, down_factor, 0.0f);
}
}
if (info.uses_render_area) {
const auto render_area_width(static_cast<GLfloat>(regs.render_area.width));
const auto render_area_height(static_cast<GLfloat>(regs.render_area.height));
if (use_assembly) {
glProgramLocalParameter4fARB(AssemblyStage(stage), 1, render_area_width,
render_area_height, 0.0f, 0.0f);
} else {
glProgramUniform4f(source_programs[stage].handle, 1, render_area_width,
render_area_height, 0.0f, 0.0f);
}
}
}};
if constexpr (Spec::enabled_stages[0]) {
prepare_stage(0);

View file

@ -618,6 +618,16 @@ void RasterizerOpenGL::SyncViewport() {
}
flags[Dirty::Viewport0 + index] = false;
if (!regs.viewport_transform_enabled) {
const auto x = static_cast<GLfloat>(regs.render_area.x);
const auto y = static_cast<GLfloat>(regs.render_area.y);
const auto width = static_cast<GLfloat>(regs.render_area.width);
const auto height = static_cast<GLfloat>(regs.render_area.height);
glViewportIndexedf(static_cast<GLuint>(index), x, y, width != 0.0f ? width : 1.0f,
height != 0.0f ? height : 1.0f);
continue;
}
const auto& src = regs.viewport_transform[index];
GLfloat x = conv(src.translate_x - src.scale_x);
GLfloat y = conv(src.translate_y - src.scale_y);

View file

@ -49,7 +49,7 @@ using VideoCommon::LoadPipelines;
using VideoCommon::SerializePipeline;
using Context = ShaderContext::Context;
constexpr u32 CACHE_VERSION = 6;
constexpr u32 CACHE_VERSION = 7;
template <typename Container>
auto MakeSpan(Container& container) {