Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-04-20 21:56:56 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-04-21 12:09:06 +0300
commit52d1cc75defb9a6a4d7c46679a933da7400c39dc (patch)
treebfb4d88aa9811a1a5df123f50a0ef81c41eb3d62
parentd55ac32732bdf2e06c596ab48697fa8afed0f4cf (diff)
Revert "Fix GPU subdivision: Crash on adding subdivision surface modifier"
The fix does not fix the case of shaders comming from the OpenSubdiv API. This reverts commit f5191b87608f6607aa1dbd4b9409174db351984b.
-rw-r--r--intern/opensubdiv/internal/evaluator/shaders/glsl_compute_kernel.glsl6
-rw-r--r--source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl12
2 files changed, 9 insertions, 9 deletions
diff --git a/intern/opensubdiv/internal/evaluator/shaders/glsl_compute_kernel.glsl b/intern/opensubdiv/internal/evaluator/shaders/glsl_compute_kernel.glsl
index 08ba1239cb9..2f60aee0999 100644
--- a/intern/opensubdiv/internal/evaluator/shaders/glsl_compute_kernel.glsl
+++ b/intern/opensubdiv/internal/evaluator/shaders/glsl_compute_kernel.glsl
@@ -329,10 +329,10 @@ void main()
int current = int(gl_GlobalInvocationID.x);
OsdPatchCoord coord = GetPatchCoord(current);
- OsdPatchArray arr = GetPatchArray(coord.arrayIndex);
+ OsdPatchArray array = GetPatchArray(coord.arrayIndex);
OsdPatchParam param = GetPatchParam(coord.patchIndex);
- int patchType = OsdPatchParamIsRegular(param) ? arr.regDesc : arr.desc;
+ int patchType = OsdPatchParamIsRegular(param) ? array.regDesc : array.desc;
float wP[20], wDu[20], wDv[20], wDuu[20], wDuv[20], wDvv[20];
int nPoints = OsdEvaluatePatchBasis(
@@ -346,7 +346,7 @@ void main()
clear(duv);
clear(dvv);
- int indexBase = arr.indexBase + arr.stride * (coord.patchIndex - arr.primitiveIdBase);
+ int indexBase = array.indexBase + array.stride * (coord.patchIndex - array.primitiveIdBase);
for (int cv = 0; cv < nPoints; ++cv) {
int index = patchIndexBuffer[indexBase + cv];
diff --git a/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl b/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl
index c48735a55f9..65cf4ebb90f 100644
--- a/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl
+++ b/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl
@@ -248,16 +248,16 @@ OsdPatchCoord GetPatchCoord(int face_index, float u, float v)
void evaluate_patches_limits(int patch_index, float u, float v, inout vec2 dst)
{
OsdPatchCoord coord = GetPatchCoord(patch_index, u, v);
- OsdPatchArray arr = GetPatchArray(coord.arrayIndex);
+ OsdPatchArray array = GetPatchArray(coord.arrayIndex);
OsdPatchParam param = GetPatchParam(coord.patchIndex);
- int patchType = OsdPatchParamIsRegular(param) ? arr.regDesc : arr.desc;
+ int patchType = OsdPatchParamIsRegular(param) ? array.regDesc : array.desc;
float wP[20], wDu[20], wDv[20], wDuu[20], wDuv[20], wDvv[20];
int nPoints = OsdEvaluatePatchBasis(
patchType, param, coord.s, coord.t, wP, wDu, wDv, wDuu, wDuv, wDvv);
- int indexBase = arr.indexBase + arr.stride * (coord.patchIndex - arr.primitiveIdBase);
+ int indexBase = array.indexBase + array.stride * (coord.patchIndex - array.primitiveIdBase);
for (int cv = 0; cv < nPoints; ++cv) {
int index = patchIndexBuffer[indexBase + cv];
@@ -270,16 +270,16 @@ void evaluate_patches_limits(
int patch_index, float u, float v, inout vec3 dst, inout vec3 du, inout vec3 dv)
{
OsdPatchCoord coord = GetPatchCoord(patch_index, u, v);
- OsdPatchArray arr = GetPatchArray(coord.arrayIndex);
+ OsdPatchArray array = GetPatchArray(coord.arrayIndex);
OsdPatchParam param = GetPatchParam(coord.patchIndex);
- int patchType = OsdPatchParamIsRegular(param) ? arr.regDesc : arr.desc;
+ int patchType = OsdPatchParamIsRegular(param) ? array.regDesc : array.desc;
float wP[20], wDu[20], wDv[20], wDuu[20], wDuv[20], wDvv[20];
int nPoints = OsdEvaluatePatchBasis(
patchType, param, coord.s, coord.t, wP, wDu, wDv, wDuu, wDuv, wDvv);
- int indexBase = arr.indexBase + arr.stride * (coord.patchIndex - arr.primitiveIdBase);
+ int indexBase = array.indexBase + array.stride * (coord.patchIndex - array.primitiveIdBase);
for (int cv = 0; cv < nPoints; ++cv) {
int index = patchIndexBuffer[indexBase + cv];