[Bf-blender-cvs] [cde2bd1828e] master: Merge branch 'blender-v2.91-release'
Brecht Van Lommel
noreply at git.blender.org
Mon Nov 9 17:41:53 CET 2020
Commit: cde2bd1828ea9f2f5f6a4b5001593695ccf224d7
Author: Brecht Van Lommel
Date: Mon Nov 9 17:37:21 2020 +0100
Branches: master
https://developer.blender.org/rBcde2bd1828ea9f2f5f6a4b5001593695ccf224d7
Merge branch 'blender-v2.91-release'
===================================================================
===================================================================
diff --cc intern/cycles/kernel/geom/geom_subd_triangle.h
index 2a569852659,317f3984a9a..9eceb996926
--- a/intern/cycles/kernel/geom/geom_subd_triangle.h
+++ b/intern/cycles/kernel/geom/geom_subd_triangle.h
@@@ -624,20 -581,14 +624,24 @@@ ccl_device_noinline float4 subd_triangl
int corners[4];
subd_triangle_patch_corners(kg, patch, corners);
- float4 f0 = color_srgb_to_linear_v4(
- color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[0] + desc.offset)));
- float4 f1 = color_srgb_to_linear_v4(
- color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[1] + desc.offset)));
- float4 f2 = color_srgb_to_linear_v4(
- color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[2] + desc.offset)));
- float4 f3 = color_srgb_to_linear_v4(
- color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[3] + desc.offset)));
+ float4 f0, f1, f2, f3;
+
+ if (desc.element == ATTR_ELEMENT_CORNER_BYTE) {
- f0 = color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[0] + desc.offset));
- f1 = color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[1] + desc.offset));
- f2 = color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[2] + desc.offset));
- f3 = color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[3] + desc.offset));
++ f0 = color_srgb_to_linear_v4(
++ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[0] + desc.offset)));
++ f1 = color_srgb_to_linear_v4(
++ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[1] + desc.offset)));
++ f2 = color_srgb_to_linear_v4(
++ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[2] + desc.offset)));
++ f3 = color_srgb_to_linear_v4(
++ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[3] + desc.offset)));
+ }
+ else {
+ f0 = kernel_tex_fetch(__attributes_float3, corners[0] + desc.offset);
+ f1 = kernel_tex_fetch(__attributes_float3, corners[1] + desc.offset);
+ f2 = kernel_tex_fetch(__attributes_float3, corners[2] + desc.offset);
+ f3 = kernel_tex_fetch(__attributes_float3, corners[3] + desc.offset);
+ }
if (subd_triangle_patch_num_corners(kg, patch) != 4) {
f1 = (f1 + f0) * 0.5f;
diff --cc intern/cycles/kernel/geom/geom_subd_triangle.h.orig
index 2a569852659,317f3984a9a..cce71b0bec1
--- a/intern/cycles/kernel/geom/geom_subd_triangle.h.orig
+++ b/intern/cycles/kernel/geom/geom_subd_triangle.h.orig
@@@ -624,20 -581,14 +624,35 @@@ ccl_device_noinline float4 subd_triangl
int corners[4];
subd_triangle_patch_corners(kg, patch, corners);
++<<<<<<< HEAD
+ float4 f0, f1, f2, f3;
+
+ if (desc.element == ATTR_ELEMENT_CORNER_BYTE) {
- f0 = color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[0] + desc.offset));
- f1 = color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[1] + desc.offset));
- f2 = color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[2] + desc.offset));
- f3 = color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[3] + desc.offset));
++ f0 = color_srgb_to_linear_v4(
++ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[0] + desc.offset)));
++ f1 = color_srgb_to_linear_v4(
++ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[1] + desc.offset)));
++ f2 = color_srgb_to_linear_v4(
++ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[2] + desc.offset)));
++ f3 = color_srgb_to_linear_v4(
++ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[3] + desc.offset)));
+ }
+ else {
+ f0 = kernel_tex_fetch(__attributes_float3, corners[0] + desc.offset);
+ f1 = kernel_tex_fetch(__attributes_float3, corners[1] + desc.offset);
+ f2 = kernel_tex_fetch(__attributes_float3, corners[2] + desc.offset);
+ f3 = kernel_tex_fetch(__attributes_float3, corners[3] + desc.offset);
+ }
++=======
+ float4 f0 = color_srgb_to_linear_v4(
+ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[0] + desc.offset)));
+ float4 f1 = color_srgb_to_linear_v4(
+ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[1] + desc.offset)));
+ float4 f2 = color_srgb_to_linear_v4(
+ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[2] + desc.offset)));
+ float4 f3 = color_srgb_to_linear_v4(
+ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, corners[3] + desc.offset)));
++>>>>>>> blender-v2.91-release
if (subd_triangle_patch_num_corners(kg, patch) != 4) {
f1 = (f1 + f0) * 0.5f;
@@@ -663,7 -614,8 +678,12 @@@
if (dy)
*dy = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
++<<<<<<< HEAD
+ return kernel_tex_fetch(__attributes_float3, desc.offset);
++=======
+ return color_srgb_to_linear_v4(
+ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, desc.offset)));
++>>>>>>> blender-v2.91-release
}
else {
if (dx)
diff --cc intern/cycles/kernel/geom/geom_triangle.h
index 2d9da23371e,5ecc2566815..e8e5d8c5b34
--- a/intern/cycles/kernel/geom/geom_triangle.h
+++ b/intern/cycles/kernel/geom/geom_triangle.h
@@@ -274,19 -330,6 +274,22 @@@ ccl_device float4 triangle_attribute_fl
f1 = kernel_tex_fetch(__attributes_float3, desc.offset + tri_vindex.y);
f2 = kernel_tex_fetch(__attributes_float3, desc.offset + tri_vindex.z);
}
+ else {
+ const int tri = desc.offset + sd->prim * 3;
+ if (desc.element == ATTR_ELEMENT_CORNER) {
+ f0 = kernel_tex_fetch(__attributes_float3, tri + 0);
+ f1 = kernel_tex_fetch(__attributes_float3, tri + 1);
+ f2 = kernel_tex_fetch(__attributes_float3, tri + 2);
+ }
+ else {
- f0 = color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, tri + 0));
- f1 = color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, tri + 1));
- f2 = color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, tri + 2));
++ f0 = color_srgb_to_linear_v4(
++ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, tri + 0)));
++ f1 = color_srgb_to_linear_v4(
++ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, tri + 1)));
++ f2 = color_srgb_to_linear_v4(
++ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, tri + 2)));
+ }
+ }
#ifdef __RAY_DIFFERENTIALS__
if (dx)
diff --cc intern/cycles/kernel/geom/geom_triangle.h.orig
index 2d9da23371e,5ecc2566815..768c168327e
--- a/intern/cycles/kernel/geom/geom_triangle.h.orig
+++ b/intern/cycles/kernel/geom/geom_triangle.h.orig
@@@ -264,29 -312,24 +264,46 @@@ ccl_device float4 triangle_attribute_fl
float4 *dx,
float4 *dy)
{
- if (desc.element == ATTR_ELEMENT_CORNER_BYTE || desc.element == ATTR_ELEMENT_VERTEX) {
+ if (desc.element & (ATTR_ELEMENT_VERTEX | ATTR_ELEMENT_VERTEX_MOTION | ATTR_ELEMENT_CORNER |
+ ATTR_ELEMENT_CORNER_BYTE)) {
float4 f0, f1, f2;
++<<<<<<< HEAD
+ if (desc.element & (ATTR_ELEMENT_VERTEX | ATTR_ELEMENT_VERTEX_MOTION)) {
+ const uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, sd->prim);
++=======
+ if (desc.element == ATTR_ELEMENT_CORNER_BYTE) {
+ int tri = desc.offset + sd->prim * 3;
+ f0 = color_srgb_to_linear_v4(
+ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, tri + 0)));
+ f1 = color_srgb_to_linear_v4(
+ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, tri + 1)));
+ f2 = color_srgb_to_linear_v4(
+ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, tri + 2)));
+ }
+ else {
+ uint4 tri_vindex = kernel_tex_fetch(__tri_vindex, sd->prim);
++>>>>>>> blender-v2.91-release
f0 = kernel_tex_fetch(__attributes_float3, desc.offset + tri_vindex.x);
f1 = kernel_tex_fetch(__attributes_float3, desc.offset + tri_vindex.y);
f2 = kernel_tex_fetch(__attributes_float3, desc.offset + tri_vindex.z);
}
+ else {
+ const int tri = desc.offset + sd->prim * 3;
+ if (desc.element == ATTR_ELEMENT_CORNER) {
+ f0 = kernel_tex_fetch(__attributes_float3, tri + 0);
+ f1 = kernel_tex_fetch(__attributes_float3, tri + 1);
+ f2 = kernel_tex_fetch(__attributes_float3, tri + 2);
+ }
+ else {
- f0 = color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, tri + 0));
- f1 = color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, tri + 1));
- f2 = color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, tri + 2));
++ f0 = color_srgb_to_linear_v4(
++ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, tri + 0)));
++ f1 = color_srgb_to_linear_v4(
++ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, tri + 1)));
++ f2 = color_srgb_to_linear_v4(
++ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, tri + 2)));
+ }
+ }
#ifdef __RAY_DIFFERENTIALS__
if (dx)
@@@ -297,8 -340,16 +314,20 @@@
return sd->u * f0 + sd->v * f1 + (1.0f - sd->u - sd->v) * f2;
}
++<<<<<<< HEAD
++=======
+ else if (desc.element == ATTR_ELEMENT_OBJECT || desc.element == ATTR_ELEMENT_MESH) {
+ if (dx)
+ *dx = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+ if (dy)
+ *dy = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
+
+ return color_srgb_to_linear_v4(
+ color_uchar4_to_float4(kernel_tex_fetch(__attributes_uchar4, desc.offset)));
+ }
++>>>>>>> blender-v2.91-release
else {
+#ifdef __RAY_DIFFERENTIALS__
if (dx)
*dx = make_float4(0.0f, 0.0f, 0.0f, 0.0f);
if (dy)
More information about the Bf-blender-cvs
mailing list