summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-07-22 17:17:27 +0200
committerGitHub <noreply@github.com>2023-07-22 17:17:27 +0200
commit0ea138fb5b6545a80e0d4dad29fee866eb1861ce (patch)
tree971d2178fb05ae767b33fa10bb642c5dc9173ec1 /src
parentMerge pull request #11113 from liamwhite/nsd1 (diff)
parentbuffer_cache: Increase number of texture buffers (diff)
downloadyuzu-0ea138fb5b6545a80e0d4dad29fee866eb1861ce.tar
yuzu-0ea138fb5b6545a80e0d4dad29fee866eb1861ce.tar.gz
yuzu-0ea138fb5b6545a80e0d4dad29fee866eb1861ce.tar.bz2
yuzu-0ea138fb5b6545a80e0d4dad29fee866eb1861ce.tar.lz
yuzu-0ea138fb5b6545a80e0d4dad29fee866eb1861ce.tar.xz
yuzu-0ea138fb5b6545a80e0d4dad29fee866eb1861ce.tar.zst
yuzu-0ea138fb5b6545a80e0d4dad29fee866eb1861ce.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h10
-rw-r--r--src/video_core/buffer_cache/buffer_cache_base.h2
2 files changed, 11 insertions, 1 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index 6ed4b78f2..f0f450edb 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -442,6 +442,11 @@ void BufferCache<P>::UnbindComputeStorageBuffers() {
template <class P>
void BufferCache<P>::BindComputeStorageBuffer(size_t ssbo_index, u32 cbuf_index, u32 cbuf_offset,
bool is_written) {
+ if (ssbo_index >= channel_state->compute_storage_buffers.size()) [[unlikely]] {
+ LOG_ERROR(HW_GPU, "Storage buffer index {} exceeds maximum storage buffer count",
+ ssbo_index);
+ return;
+ }
channel_state->enabled_compute_storage_buffers |= 1U << ssbo_index;
channel_state->written_compute_storage_buffers |= (is_written ? 1U : 0U) << ssbo_index;
@@ -464,6 +469,11 @@ void BufferCache<P>::UnbindComputeTextureBuffers() {
template <class P>
void BufferCache<P>::BindComputeTextureBuffer(size_t tbo_index, GPUVAddr gpu_addr, u32 size,
PixelFormat format, bool is_written, bool is_image) {
+ if (tbo_index >= channel_state->compute_texture_buffers.size()) [[unlikely]] {
+ LOG_ERROR(HW_GPU, "Texture buffer index {} exceeds maximum texture buffer count",
+ tbo_index);
+ return;
+ }
channel_state->enabled_compute_texture_buffers |= 1U << tbo_index;
channel_state->written_compute_texture_buffers |= (is_written ? 1U : 0U) << tbo_index;
if constexpr (SEPARATE_IMAGE_BUFFERS_BINDINGS) {
diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h
index 460fc7551..0b7135d49 100644
--- a/src/video_core/buffer_cache/buffer_cache_base.h
+++ b/src/video_core/buffer_cache/buffer_cache_base.h
@@ -67,7 +67,7 @@ constexpr u32 NUM_TRANSFORM_FEEDBACK_BUFFERS = 4;
constexpr u32 NUM_GRAPHICS_UNIFORM_BUFFERS = 18;
constexpr u32 NUM_COMPUTE_UNIFORM_BUFFERS = 8;
constexpr u32 NUM_STORAGE_BUFFERS = 16;
-constexpr u32 NUM_TEXTURE_BUFFERS = 16;
+constexpr u32 NUM_TEXTURE_BUFFERS = 32;
constexpr u32 NUM_STAGES = 5;
using UniformBufferSizes = std::array<std::array<u32, NUM_GRAPHICS_UNIFORM_BUFFERS>, NUM_STAGES>;