Skip to content

Conversation

@atty303
Copy link

@atty303 atty303 commented Jul 26, 2025

Summary

This PR adds new options to control PipeWire capture behavior in Gamescope, allowing users to:

  1. Select between source (pre-upscaled) and output (post-upscaled) textures
  2. Specify fixed capture dimensions instead of using output dimensions

New Options

  • --pipewire-source=<output|source> - Select which texture to capture:
    • output (default): Capture the final composited and upscaled texture
    • source: Capture the original window texture before upscaling
  • --pipewire-width=<width> - Set a fixed width for PipeWire capture (overrides output width)
  • --pipewire-height=<height> - Set a fixed height for PipeWire capture (overrides output height)

Use Cases

This is particularly useful for:

  1. Streaming/recording applications that need the original game resolution
  2. Capturing content at a specific resolution regardless of display scaling
  3. Avoiding quality loss from multiple scaling operations

My primary objective is the first one, and because the image‑analysis tool requires the game’s original resolution, this modification became necessary.

Examples

# Capture source texture at 1920x1080
gamescope --pipewire-source=source --pipewire-width=1920 --pipewire-height=1080 -- game

# Capture at fixed 720p while displaying at 4K
gamescope -W 3840 -H 2160 --pipewire-width=1280 --pipewire-height=720 -- game

Implementation Details

  • When --pipewire-source=source is used, the source texture (vulkanTex) is selected instead of the upscaled texture
  • A new PaintWindowFlag::PipeWire flag identifies PipeWire paint operations
  • Scaling calculations are adapted to use PipeWire dimensions when the flag is set
  • The implementation maintains full backward compatibility - default behavior is unchanged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant