diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-07-22 15:50:21 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-07-22 15:56:15 +0300 |
commit | ccd51bb9224899b4b7d50170267d94d9b9f2567f (patch) | |
tree | 81f15e6f905296989df3081ba557cad2dafdee47 /intern/opensubdiv | |
parent | 48c4b700dce0b326e1b905e133c0db1217a5cae0 (diff) |
OpenSubdiv: Properly support active UV layer in textured view
Diffstat (limited to 'intern/opensubdiv')
-rw-r--r-- | intern/opensubdiv/opensubdiv_gpu_capi.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/intern/opensubdiv/opensubdiv_gpu_capi.cc b/intern/opensubdiv/opensubdiv_gpu_capi.cc index a7c42aea07f..16a86f66265 100644 --- a/intern/opensubdiv/opensubdiv_gpu_capi.cc +++ b/intern/opensubdiv/opensubdiv_gpu_capi.cc @@ -439,7 +439,10 @@ void bindProgram(OpenSubdiv_GLMesh *gl_mesh, int program) /* See notes below about why we use such values. */ /* TOO(sergey): Get proper value for FVar width. */ glUniform1i(glGetUniformLocation(program, "osd_fvar_count"), 2); - if (gl_mesh->fvar_data->channel_offsets.size() > 0 && g_active_uv_index >= 0) { + if (gl_mesh->fvar_data != NULL && + gl_mesh->fvar_data->channel_offsets.size() > 0 && + g_active_uv_index >= 0) + { glUniform1i(glGetUniformLocation(program, "osd_active_uv_offset"), gl_mesh->fvar_data->channel_offsets[g_active_uv_index]); } else { @@ -624,7 +627,10 @@ static GLuint prepare_patchDraw(OpenSubdiv_GLMesh *gl_mesh, location = glGetUniformLocation(program, "osd_active_uv_offset"); if (location != -1) { - if (gl_mesh->fvar_data->channel_offsets.size() > 0 && g_active_uv_index >= 0) { + if (gl_mesh->fvar_data != NULL && + gl_mesh->fvar_data->channel_offsets.size() > 0 && + g_active_uv_index >= 0) + { glUniform1i(location, gl_mesh->fvar_data->channel_offsets[g_active_uv_index]); } else { |