port: GrpImageInstance/GrpExpandedImageInstance verbatim; fix SCREEN blend factor

Both units are the 40250 bodies; only the PDT-stream draw becomes
UIRenderAddImage (with the rendering mode). SCREEN/COLOR_DODGE were packed as
0x28 (INVDESTALPHA+ONE); 40250 uses INVDESTCOLOR+ONE (0x2A). OnIsType calls the
base OnIsType instead of 40250's recursing IsType. port.grp_resource covers the
quads, UVs, colour and blend mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-09-30 14:21:13 +09:00
co-authored by Claude Opus 5.5
parent 010e99f070
commit 65777331f7
8 changed files with 819 additions and 231 deletions
+3 -3
View File
@@ -138,10 +138,10 @@ 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();
// CGraphicExpandedImageInstance: SCREEN/COLOR_DODGE use
// INVDESTCOLOR + ONE; MODULATE uses ZERO + SRCCOLOR.
// 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) ? 0x28 : (cmd.blend == 3 ? 0x31 : 1))
? ((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);