Skip to content

Commit 46def2c

Browse files
authored
Merge pull request #3763 from Eiton/fix2
fix: Vulkan scissor
2 parents e3e4ecb + abaa2d6 commit 46def2c

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/render_vk.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5664,10 +5664,18 @@ func (r *Renderer_VK) ReadPixels(data []uint8, width, height int) {
56645664
}
56655665

56665666
func (r *Renderer_VK) EnableScissor(x, y, width, height int32) {
5667+
if x < 0 {
5668+
width += x
5669+
x = 0
5670+
}
5671+
if y < 0 {
5672+
height += y
5673+
y = 0
5674+
}
56675675
r.VKState.scissor = vk.Rect2D{
56685676
Offset: vk.Offset2D{
5669-
X: int32(Max(int(x), 0)),
5670-
Y: int32(Max(int(y), 0)),
5677+
X: int32(x),
5678+
Y: int32(y),
56715679
},
56725680
Extent: vk.Extent2D{
56735681
Width: uint32(width),

0 commit comments

Comments
 (0)