summaryrefslogtreecommitdiffstats
path: root/src/video_core/transform_feedback.cpp
diff options
context:
space:
mode:
authorKelebek1 <eeeedddccc@hotmail.co.uk>2023-05-23 15:45:54 +0200
committerKelebek1 <eeeedddccc@hotmail.co.uk>2023-06-22 09:05:10 +0200
commit5da70f719703084482933e103e561cc98163f370 (patch)
tree1926842ed2b90bf92b89cec6a314bb28c7287fe9 /src/video_core/transform_feedback.cpp
parentMerge pull request #10086 from Morph1984/coretiming-ng-1 (diff)
downloadyuzu-5da70f719703084482933e103e561cc98163f370.tar
yuzu-5da70f719703084482933e103e561cc98163f370.tar.gz
yuzu-5da70f719703084482933e103e561cc98163f370.tar.bz2
yuzu-5da70f719703084482933e103e561cc98163f370.tar.lz
yuzu-5da70f719703084482933e103e561cc98163f370.tar.xz
yuzu-5da70f719703084482933e103e561cc98163f370.tar.zst
yuzu-5da70f719703084482933e103e561cc98163f370.zip
Diffstat (limited to 'src/video_core/transform_feedback.cpp')
-rw-r--r--src/video_core/transform_feedback.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/video_core/transform_feedback.cpp b/src/video_core/transform_feedback.cpp
index 155599316..1f353d2df 100644
--- a/src/video_core/transform_feedback.cpp
+++ b/src/video_core/transform_feedback.cpp
@@ -13,7 +13,7 @@
namespace VideoCommon {
-std::vector<Shader::TransformFeedbackVarying> MakeTransformFeedbackVaryings(
+std::pair<std::array<Shader::TransformFeedbackVarying, 256>, u32> MakeTransformFeedbackVaryings(
const TransformFeedbackState& state) {
static constexpr std::array VECTORS{
28U, // gl_Position
@@ -62,7 +62,8 @@ std::vector<Shader::TransformFeedbackVarying> MakeTransformFeedbackVaryings(
216U, // gl_TexCoord[6]
220U, // gl_TexCoord[7]
};
- std::vector<Shader::TransformFeedbackVarying> xfb(256);
+ std::array<Shader::TransformFeedbackVarying, 256> xfb{};
+ u32 count{0};
for (size_t buffer = 0; buffer < state.layouts.size(); ++buffer) {
const auto& locations = state.varyings[buffer];
const auto& layout = state.layouts[buffer];
@@ -103,11 +104,12 @@ std::vector<Shader::TransformFeedbackVarying> MakeTransformFeedbackVaryings(
}
}
xfb[attribute] = varying;
+ count = std::max(count, attribute);
highest = std::max(highest, (base_offset + varying.components) * 4);
}
UNIMPLEMENTED_IF(highest != layout.stride);
}
- return xfb;
+ return {xfb, count + 1};
}
} // namespace VideoCommon