GPU: Shaders fail to compile on NVIDIA

NVIDIA fails with segmentation fault when compiling shaders due to recent changes.
This PR tweaks the shader code to work around the segmentation fault.

Issue introduced by: 7f43699ebf

Pull Request: https://projects.blender.org/blender/blender/pulls/118744
This commit is contained in:
Jeroen Bakker
2024-02-26 13:01:10 +01:00
parent d45e6ab0a1
commit e3ac2ac93e
3 changed files with 5 additions and 4 deletions

View File

@@ -15,7 +15,7 @@
void main()
{
ivec3 gid = ivec3(gl_GlobalInvocationID);
ivec3 nthreads = ivec3(gl_NumWorkGroups) * ivec3(gl_WorkGroupSize);
ivec3 nthreads = ivec3(gl_NumWorkGroups * gl_WorkGroupSize);
for (int y = gid.y + gid.z * nthreads.y; y < ncurves; y += nthreads.y * nthreads.z) {
for (int x = gid.x; x < elements_per_curve; x += nthreads.x) {
int store_index = (x + y * elements_per_curve) * 2;

View File

@@ -11,7 +11,7 @@
void main()
{
ivec3 gid = ivec3(gl_GlobalInvocationID);
ivec3 nthreads = ivec3(gl_NumWorkGroups) * ivec3(gl_WorkGroupSize);
ivec3 nthreads = ivec3(gl_NumWorkGroups * gl_WorkGroupSize);
for (int y = gid.y + gid.z * nthreads.y; y < ncurves; y += nthreads.y * nthreads.z) {
for (int x = gid.x; x < elements_per_curve; x += nthreads.x) {
int store_index = x + y * elements_per_curve;

View File

@@ -11,8 +11,8 @@
void main()
{
ivec3 gid = ivec3(gl_GlobalInvocationID);
ivec3 nthreads = ivec3(gl_NumWorkGroups) * ivec3(gl_WorkGroupSize);
for (int y = gid.y + gid.z * nthreads.y; y < ncurves; y += nthreads.y * nthreads.z)
ivec3 nthreads = ivec3(gl_NumWorkGroups * gl_WorkGroupSize);
for (int y = gid.y + gid.z * nthreads.y; y < ncurves; y += nthreads.y * nthreads.z) {
for (int x = gid.x; x < elements_per_curve; x += nthreads.x) {
int store_index = (x + y * elements_per_curve) * 6;
uint t = x + y * (elements_per_curve * 2 + 2);
@@ -23,4 +23,5 @@ void main()
out_indices[store_index + 4] = t + 3u;
out_indices[store_index + 5] = t + 2u;
}
}
}