Improve macOS Retina UI clarity and bundle HD assets
This commit is contained in:
+11
-1
@@ -1,5 +1,6 @@
|
||||
// VulkanWindow::build_ui_batches: UIRenderCommand quads into the frame UI buffer, batched by texture and blend.
|
||||
#include "vulkan_window.h"
|
||||
#include "ui_quality.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
@@ -138,13 +139,22 @@ void VulkanWindow::build_ui_batches(
|
||||
const std::string& tex_name = cmd.kind == UIRenderCommand::Image ? cmd.text : std::string();
|
||||
const std::string& mask_name = cmd.kind == UIRenderCommand::Image ? cmd.mask : std::string();
|
||||
const bool is_masked = !mask_name.empty();
|
||||
const float sx = float(extent_.width) / float(ui_width);
|
||||
const float sy = float(extent_.height) / float(ui_height);
|
||||
const bool aligned = cmd.kind == UIRenderCommand::Image && align_ui_quad(qx, qy, sx, sy);
|
||||
bool point = false;
|
||||
if (aligned && !is_masked && !tex_name.empty()) {
|
||||
const auto& texture = get_gpu_texture(tex_name, capture_textures);
|
||||
point = ui_texels_match_pixels(std::fabs(qx[1]-qx[0])*sx, std::fabs(qy[2]-qy[0])*sy,
|
||||
std::fabs(eu-su)*texture.width, std::fabs(ev-sv)*texture.height);
|
||||
}
|
||||
// CGraphicExpandedImageInstance: SCREEN/COLOR_DODGE use INVDESTCOLOR (10) + ONE (2);
|
||||
// MODULATE uses ZERO (1) + SRCCOLOR (3). Packed as src | dst << 4.
|
||||
const std::uint8_t blend_mode = cmd.kind == UIRenderCommand::Image
|
||||
? ((cmd.blend == 1 || cmd.blend == 2) ? 0x2A : (cmd.blend == 3 ? 0x31 : 1))
|
||||
: 1;
|
||||
const VkPipeline pipeline = get_pipeline(0, 0, blend_mode);
|
||||
const VkDescriptorSet descriptor = get_ui_texture_descriptor(tex_name, mask_name, capture_textures);
|
||||
const VkDescriptorSet descriptor = get_ui_texture_descriptor(tex_name, mask_name, capture_textures, point);
|
||||
|
||||
for (int k = 0; k < 4; ++k) {
|
||||
Vertex& vert = vertices[v_count + k];
|
||||
|
||||
Reference in New Issue
Block a user