diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index 7248d9924..c65f46ae3 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -1275,6 +1275,9 @@ bool GPU_HW::CompilePipelines(Error* error) const bool uv_limits = ShouldClampUVs(sprite ? m_sprite_texture_filtering : m_texture_filtering); const BatchTextureMode shader_texmode = static_cast( texture_mode - (sprite ? static_cast(BatchTextureMode::SpriteStart) : 0)); + const GPUTextureFilter texture_filter = sprite ? m_sprite_texture_filtering : m_texture_filtering; + const bool texture_filter_is_blended = + (shader_texmode != BatchTextureMode::Disabled && IsBlendedTextureFiltering(texture_filter)); const bool use_rov = (render_mode == static_cast(BatchRenderMode::ShaderBlend) && m_use_rov_for_shader_blend); const bool rov_depth_test = (use_rov && depth_test != 0); @@ -1282,11 +1285,11 @@ bool GPU_HW::CompilePipelines(Error* error) GPUTransparencyMode::Disabled); const std::string fs = shadergen.GenerateBatchFragmentShader( static_cast(render_mode), static_cast(transparency_mode), - shader_texmode, sprite ? m_sprite_texture_filtering : m_texture_filtering, upscaled, msaa, - per_sample_shading, uv_limits, !sprite && force_round_texcoords, true_color, - ConvertToBoolUnchecked(dithering), scaled_dithering, disable_color_perspective, - ConvertToBoolUnchecked(interlacing), scaled_interlacing, ConvertToBoolUnchecked(check_mask), - m_write_mask_as_depth, use_rov, needs_rov_depth, rov_depth_test, rov_depth_write); + shader_texmode, texture_filter, texture_filter_is_blended, upscaled, msaa, per_sample_shading, + uv_limits, !sprite && force_round_texcoords, true_color, ConvertToBoolUnchecked(dithering), + scaled_dithering, disable_color_perspective, ConvertToBoolUnchecked(interlacing), scaled_interlacing, + ConvertToBoolUnchecked(check_mask), m_write_mask_as_depth, use_rov, needs_rov_depth, rov_depth_test, + rov_depth_write); if (!(batch_fragment_shaders[depth_test][render_mode][transparency_mode][texture_mode][check_mask] [dithering][interlacing] = g_gpu_device->CreateShader( diff --git a/src/core/gpu_hw_shadergen.cpp b/src/core/gpu_hw_shadergen.cpp index 6a3f5f9a9..05bfb7585 100644 --- a/src/core/gpu_hw_shadergen.cpp +++ b/src/core/gpu_hw_shadergen.cpp @@ -1078,10 +1078,10 @@ void FilteredSampleFromVRAM(TEXPAGE_VALUE texpage, float2 coords, float4 uv_limi std::string GPU_HW_ShaderGen::GenerateBatchFragmentShader( GPU_HW::BatchRenderMode render_mode, GPUTransparencyMode transparency, GPU_HW::BatchTextureMode texture_mode, - GPUTextureFilter texture_filtering, bool upscaled, bool msaa, bool per_sample_shading, bool uv_limits, - bool force_round_texcoords, bool true_color, bool dithering, bool scaled_dithering, bool disable_color_perspective, - bool interlacing, bool scaled_interlacing, bool check_mask, bool write_mask_as_depth, bool use_rov, - bool use_rov_depth, bool rov_depth_test, bool rov_depth_write) const + GPUTextureFilter texture_filtering, bool is_blended_texture_filtering, bool upscaled, bool msaa, + bool per_sample_shading, bool uv_limits, bool force_round_texcoords, bool true_color, bool dithering, + bool scaled_dithering, bool disable_color_perspective, bool interlacing, bool scaled_interlacing, bool check_mask, + bool write_mask_as_depth, bool use_rov, bool use_rov_depth, bool rov_depth_test, bool rov_depth_write) const { DebugAssert(!true_color || !dithering); // Should not be doing dithering+true color. @@ -1096,7 +1096,7 @@ std::string GPU_HW_ShaderGen::GenerateBatchFragmentShader( const bool use_dual_source = (!shader_blending && !use_rov && m_supports_dual_source_blend && ((render_mode != GPU_HW::BatchRenderMode::TransparencyDisabled && render_mode != GPU_HW::BatchRenderMode::OnlyOpaque) || - texture_filtering != GPUTextureFilter::Nearest)); + is_blended_texture_filtering)); std::stringstream ss; WriteHeader(ss, use_rov, shader_blending && !use_rov, use_dual_source); diff --git a/src/core/gpu_hw_shadergen.h b/src/core/gpu_hw_shadergen.h index d2e4a7f1b..13c1bf67c 100644 --- a/src/core/gpu_hw_shadergen.h +++ b/src/core/gpu_hw_shadergen.h @@ -20,12 +20,12 @@ public: bool disable_color_perspective) const; std::string GenerateBatchFragmentShader(GPU_HW::BatchRenderMode render_mode, GPUTransparencyMode transparency, GPU_HW::BatchTextureMode texture_mode, GPUTextureFilter texture_filtering, - bool upscaled, bool msaa, bool per_sample_shading, bool uv_limits, - bool force_round_texcoords, bool true_color, bool dithering, - bool scaled_dithering, bool disable_color_perspective, bool interlacing, - bool scaled_interlacing, bool check_mask, bool write_mask_as_depth, - bool use_rov, bool use_rov_depth, bool rov_depth_test, - bool rov_depth_write) const; + bool is_blended_texture_filtering, bool upscaled, bool msaa, + bool per_sample_shading, bool uv_limits, bool force_round_texcoords, + bool true_color, bool dithering, bool scaled_dithering, + bool disable_color_perspective, bool interlacing, bool scaled_interlacing, + bool check_mask, bool write_mask_as_depth, bool use_rov, bool use_rov_depth, + bool rov_depth_test, bool rov_depth_write) const; std::string GenerateWireframeGeometryShader() const; std::string GenerateWireframeFragmentShader() const; std::string GenerateVRAMReadFragmentShader(u32 resolution_scale, u32 multisamples) const;