[vk] Fix fallback viewport/scissor origin handling #294

Open
Shinmegumi wants to merge 2 commits from viewport-fallback into master
Owner

When viewport_scale_offset_enabled is disabled, the fallback path
previously assumed a top-left origin for both viewport and scissor.
This caused incorrect positioning or inverted geometry when the GPU
state expected a lower-left origin.

This change:

  • Adjusts viewport setup: if window_origin is lower-left, shift Y and
    flip height negative to emulate lower-left in Vulkan’s top-left space.
  • Updates scissor setup: recalculates Y for lower-left origin and
    ensures width/height fall back to 1 if zero, avoiding invalid extents.

This aligns Vulkan’s viewport/scissor behavior with Maxwell state,
fixing rendering issues in paths without scale/offset enabled.

When viewport_scale_offset_enabled is disabled, the fallback path previously assumed a top-left origin for both viewport and scissor. This caused incorrect positioning or inverted geometry when the GPU state expected a lower-left origin. This change: - Adjusts viewport setup: if window_origin is lower-left, shift Y and flip height negative to emulate lower-left in Vulkan’s top-left space. - Updates scissor setup: recalculates Y for lower-left origin and ensures width/height fall back to 1 if zero, avoiding invalid extents. This aligns Vulkan’s viewport/scissor behavior with Maxwell state, fixing rendering issues in paths without scale/offset enabled.
Shinmegumi added 1 commit 2025-08-21 21:38:57 +02:00
[vk] Apply fallback patch for Viewport
All checks were successful
eden-license / license-header (pull_request) Successful in 28s
52379c383d
Will add details if this solves the issue we are testing for.
Shinmegumi changed title from [vk] Apply fallback patch for Viewport to [vk] Fix fallback viewport/scissor origin handling 2025-08-21 21:43:30 +02:00
Shinmegumi added 1 commit 2025-08-21 21:45:40 +02:00
[vk] Fix dynamic vertex input state handling
All checks were successful
eden-license / license-header (pull_request) Successful in 19s
7571a36993
Previously, UpdateVertexInput() was always called when
has_dynamic_vertex_input was true, even if the current graphics pipeline
was not created with VK_DYNAMIC_STATE_VERTEX_INPUT_EXT. This could lead
to unnecessary or invalid state updates.

This change:
- Adds GraphicsPipeline::HasDynamicVertexInput() to check whether the
  pipeline was created with dynamic vertex input enabled.
- Calls UpdateVertexInput() only when the current pipeline supports
  VK_DYNAMIC_STATE_VERTEX_INPUT_EXT.

This ensures vertex input state updates are applied only when valid,
improving correctness and preventing redundant updates.
Author
Owner

Added a fix for Dynamic Vertex Input state handling as well.

Added a fix for Dynamic Vertex Input state handling as well.
Shinmegumi changed title from [vk] Fix fallback viewport/scissor origin handling to [vk] More vulkan fixes 2025-08-21 21:47:24 +02:00
Shinmegumi changed title from [vk] More vulkan fixes to [vk] Fix fallback viewport/scissor origin handling 2025-08-21 21:52:18 +02:00
Shinmegumi added 1 commit 2025-08-21 21:52:55 +02:00
revert 7571a36993
All checks were successful
eden-license / license-header (pull_request) Successful in 22s
c1a9c6b1ca
revert [vk] Fix dynamic vertex input state handling

Previously, UpdateVertexInput() was always called when
has_dynamic_vertex_input was true, even if the current graphics pipeline
was not created with VK_DYNAMIC_STATE_VERTEX_INPUT_EXT. This could lead
to unnecessary or invalid state updates.

This change:
- Adds GraphicsPipeline::HasDynamicVertexInput() to check whether the
  pipeline was created with dynamic vertex input enabled.
- Calls UpdateVertexInput() only when the current pipeline supports
  VK_DYNAMIC_STATE_VERTEX_INPUT_EXT.

This ensures vertex input state updates are applied only when valid,
improving correctness and preventing redundant updates.
MaranBr force-pushed viewport-fallback from c1a9c6b1ca to 194031096e 2025-09-28 16:36:35 +02:00 Compare
All checks were successful
eden-license / license-header (pull_request) Successful in 21s
Required
Details
This pull request doesn't have enough approvals yet. 0 of 2 approvals granted.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin viewport-fallback:viewport-fallback
git checkout viewport-fallback
Sign in to join this conversation.
No description provided.