mirror of
https://git.freebsd.org/ports.git
synced 2025-04-28 09:36:41 -04:00
games/0ad: Import patch to fix crash with OpenGL rendering
- Remove patch used to work around the issue Obtained from: https://gitea.wildfiregames.com/0ad/0ad/pulls/7605
This commit is contained in:
parent
29cd6b11db
commit
abff0fc56a
3 changed files with 49 additions and 12 deletions
|
@ -1,6 +1,6 @@
|
|||
PORTNAME= 0ad
|
||||
DISTVERSION= 0.27.0
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= games
|
||||
MASTER_SITES= https://releases.wildfiregames.com/
|
||||
DISTFILES= ${PORTNAME}-${DISTVERSION}-unix-build.tar.xz \
|
||||
|
|
48
games/0ad/files/patch-GL-OOB-fix
Normal file
48
games/0ad/files/patch-GL-OOB-fix
Normal file
|
@ -0,0 +1,48 @@
|
|||
From a1f7568df9814d0dc399fc1e4f1c122da24a8f05 Mon Sep 17 00:00:00 2001
|
||||
From: Vladislav Belov <vladislavbelovdev@gmail.com>
|
||||
Date: Fri, 7 Feb 2025 22:24:00 +0100
|
||||
Subject: [PATCH] Fixes out of bounds during GL buffer binding.
|
||||
|
||||
---
|
||||
source/renderer/backend/gl/DeviceCommandContext.cpp | 4 ++++
|
||||
source/renderer/backend/gl/DeviceCommandContext.h | 2 +-
|
||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/source/renderer/backend/gl/DeviceCommandContext.cpp b/source/renderer/backend/gl/DeviceCommandContext.cpp
|
||||
index dacdd4377b..87bc323305 100644
|
||||
--- source/renderer/backend/gl/DeviceCommandContext.cpp
|
||||
+++ source/renderer/backend/gl/DeviceCommandContext.cpp
|
||||
@@ -246,6 +246,9 @@ CDeviceCommandContext::CDeviceCommandContext(CDevice* device)
|
||||
for (size_t index = 0; index < m_BoundBuffers.size(); ++index)
|
||||
{
|
||||
const CBuffer::Type type = static_cast<CBuffer::Type>(index);
|
||||
+ // Currently we don't support upload buffers for GL.
|
||||
+ if (type == CBuffer::Type::UPLOAD)
|
||||
+ continue;
|
||||
const GLenum target = BufferTypeToGLTarget(type);
|
||||
const GLuint handle = 0;
|
||||
m_BoundBuffers[index].first = target;
|
||||
@@ -1456,6 +1459,7 @@ CDeviceCommandContext::ScopedBufferBind::ScopedBufferBind(
|
||||
{
|
||||
ENSURE(buffer);
|
||||
m_CacheIndex = static_cast<size_t>(buffer->GetType());
|
||||
+ ENSURE(m_CacheIndex < m_DeviceCommandContext->m_BoundBuffers.size());
|
||||
const GLenum target = BufferTypeToGLTarget(buffer->GetType());
|
||||
const GLuint handle = buffer->GetHandle();
|
||||
if (m_DeviceCommandContext->m_BoundBuffers[m_CacheIndex].first == target &&
|
||||
diff --git a/source/renderer/backend/gl/DeviceCommandContext.h b/source/renderer/backend/gl/DeviceCommandContext.h
|
||||
index 5f1a251007..3d23d89c06 100644
|
||||
--- source/renderer/backend/gl/DeviceCommandContext.h
|
||||
+++ source/renderer/backend/gl/DeviceCommandContext.h
|
||||
@@ -221,7 +221,7 @@ private:
|
||||
};
|
||||
|
||||
using BoundBuffer = std::pair<GLenum, GLuint>;
|
||||
- std::array<BoundBuffer, 2> m_BoundBuffers;
|
||||
+ std::array<BoundBuffer, 4> m_BoundBuffers;
|
||||
class ScopedBufferBind
|
||||
{
|
||||
public:
|
||||
--
|
||||
2.43.5
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
--- binaries/data/config/default.cfg.orig 2025-01-28 19:44:19 UTC
|
||||
+++ binaries/data/config/default.cfg
|
||||
@@ -154,7 +154,7 @@ textures.maxanisotropy = 2
|
||||
textures.maxanisotropy = 2
|
||||
|
||||
; GPU skinning via compute shaders, requires up-to-date drivers
|
||||
-gpuskinning = true
|
||||
+gpuskinning = false
|
||||
|
||||
; Use smooth LOS interpolation
|
||||
smoothlos = true
|
Loading…
Add table
Reference in a new issue