aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2025-10-23 18:28:05 +0200
committerAndre Weissflog <floooh@gmail.com>2025-10-23 18:28:05 +0200
commitc6bb18fa2c7908d0a41cfd4e0b5956550d224a1a (patch)
tree6e331559e7f39d27cd1c97cb7bd628f5519a0ceb
parentf0e8e1d563fe7519a723e7eb9eb2c01c3b1b9d66 (diff)
sokol_gfx.h wgpu: remove viewport clipping, no longer needed
-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);
}