aboutsummaryrefslogtreecommitdiff
path: root/sokol_gfx.h
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2025-10-23 18:46:57 +0200
committerGitHub <noreply@github.com>2025-10-23 18:46:57 +0200
commit78d2c6db1c37f045862c79cd9040c46c405a150f (patch)
tree8b1be8e1825d98d7a9c40a44ec353ede2dd524ca /sokol_gfx.h
parentf0e8e1d563fe7519a723e7eb9eb2c01c3b1b9d66 (diff)
parent2971f120dee1bbb06529a2ad8b8b8376d2d7eb1f (diff)
Merge pull request #1362 from floooh/issue1348/wgpu-updates
sokol_gfx.h wgpu: remove viewport clipping
Diffstat (limited to 'sokol_gfx.h')
-rw-r--r--sokol_gfx.h13
1 files changed, 4 insertions, 9 deletions
diff --git a/sokol_gfx.h b/sokol_gfx.h
index c5a5c7cd..5f2fd6f7 100644
--- a/sokol_gfx.h
+++ b/sokol_gfx.h
@@ -18018,15 +18018,10 @@ _SOKOL_PRIVATE void _sg_wgpu_commit(void) {
_SOKOL_PRIVATE void _sg_wgpu_apply_viewport(int x, int y, int w, int h, bool origin_top_left) {
SOKOL_ASSERT(_sg.wgpu.rpass_enc);
- // FIXME FIXME FIXME: CLIPPING THE VIEWPORT HERE IS WRONG!!!
- // (but currently required because WebGPU insists that the viewport rectangle must be
- // fully contained inside the framebuffer, but this doesn't make any sense, and also
- // isn't required by the backend APIs)
- const _sg_recti_t clip = _sg_clipi(x, y, w, h, _sg.cur_pass.dim.width, _sg.cur_pass.dim.height);
- float xf = (float) clip.x;
- float yf = (float) (origin_top_left ? clip.y : (_sg.cur_pass.dim.height - (clip.y + clip.h)));
- float wf = (float) clip.w;
- float hf = (float) clip.h;
+ float xf = (float) x;
+ float yf = (float) (origin_top_left ? y : (_sg.cur_pass.dim.height - (y + h)));
+ float wf = (float) w;
+ float hf = (float) h;
wgpuRenderPassEncoderSetViewport(_sg.wgpu.rpass_enc, xf, yf, wf, hf, 0.0f, 1.0f);
}