[Bf-blender-cvs] [3e725b55cf8] xr-dev: Merge branch 'temp-xr-virtual-camera-experiment' into xr-dev

Peter Kim noreply at git.blender.org
Wed Nov 23 05:53:17 CET 2022


Commit: 3e725b55cf87287cdd65f99b2d654306b6766c9c
Author: Peter Kim
Date:   Wed Nov 23 13:51:44 2022 +0900
Branches: xr-dev
https://developer.blender.org/rB3e725b55cf87287cdd65f99b2d654306b6766c9c

Merge branch 'temp-xr-virtual-camera-experiment' into xr-dev

===================================================================



===================================================================

diff --cc source/blender/gpu/intern/gpu_node_graph.cc
index 72c1867416c,52a55b7fe13..6a9c3926bc9
--- a/source/blender/gpu/intern/gpu_node_graph.cc
+++ b/source/blender/gpu/intern/gpu_node_graph.cc
@@@ -481,10 -479,10 +485,10 @@@ static GPUMaterialTexture *gpu_node_gra
  {
    /* Find existing texture. */
    int num_textures = 0;
 -  GPUMaterialTexture *tex = graph->textures.first;
 +  GPUMaterialTexture *tex = static_cast<GPUMaterialTexture *>(graph->textures.first);
    for (; tex; tex = tex->next) {
      if (tex->ima == ima && tex->colorband == colorband && tex->sky == sky &&
-         tex->sampler_state == sampler_state) {
+         tex->camera == camera && tex->sampler_state == sampler_state) {
        break;
      }
      num_textures++;
@@@ -631,7 -630,24 +636,24 @@@ GPUNodeLink *GPU_image(GPUMaterial *mat
    GPUNodeLink *link = gpu_node_link_create();
    link->link_type = GPU_NODE_LINK_IMAGE;
    link->texture = gpu_node_graph_add_texture(
-       graph, ima, iuser, nullptr, nullptr, link->link_type, sampler_state);
 -      graph, ima, iuser, NULL, NULL, NULL, link->link_type, sampler_state);
++      graph, ima, iuser, nullptr, nullptr, nullptr, link->link_type, sampler_state);
+   return link;
+ }
+ 
+ GPUNodeLink *GPU_image_camera(GPUMaterial *mat, Camera *camera, eGPUSamplerState sampler_state)
+ {
+   GPUNodeGraph *graph = gpu_material_node_graph(mat);
+   GPUNodeLink *link = gpu_node_link_create();
+   link->link_type = GPU_NODE_LINK_IMAGE_CAMERA;
+   link->texture = gpu_node_graph_add_texture(graph,
 -                                             NULL,
 -                                             NULL,
 -                                             NULL,
 -                                             NULL,
++                                             nullptr,
++                                             nullptr,
++                                             nullptr,
++                                             nullptr,
+                                              &camera->runtime.offscreen_color_texture,
+                                              link->link_type,
+                                              sampler_state);
+   GPU_material_flag_set(mat, GPU_MATFLAG_VIRTUAL_MONITOR);
    return link;
  }
  
@@@ -648,7 -664,7 +670,7 @@@ GPUNodeLink *GPU_image_sky(GPUMaterial 
    GPUNodeLink *link = gpu_node_link_create();
    link->link_type = GPU_NODE_LINK_IMAGE_SKY;
    link->texture = gpu_node_graph_add_texture(
-       graph, nullptr, nullptr, nullptr, sky, link->link_type, sampler_state);
 -      graph, NULL, NULL, NULL, sky, NULL, link->link_type, sampler_state);
++      graph, nullptr, nullptr, nullptr, sky, nullptr, link->link_type, sampler_state);
    return link;
  }
  
@@@ -661,7 -677,7 +683,7 @@@ GPUNodeLink *GPU_image_tiled(GPUMateria
    GPUNodeLink *link = gpu_node_link_create();
    link->link_type = GPU_NODE_LINK_IMAGE_TILED;
    link->texture = gpu_node_graph_add_texture(
-       graph, ima, iuser, nullptr, nullptr, link->link_type, sampler_state);
 -      graph, ima, iuser, NULL, NULL, NULL, link->link_type, sampler_state);
++      graph, ima, iuser, nullptr, nullptr, nullptr, link->link_type, sampler_state);
    return link;
  }
  
@@@ -671,7 -687,7 +693,7 @@@ GPUNodeLink *GPU_image_tiled_mapping(GP
    GPUNodeLink *link = gpu_node_link_create();
    link->link_type = GPU_NODE_LINK_IMAGE_TILED_MAPPING;
    link->texture = gpu_node_graph_add_texture(
-       graph, ima, iuser, nullptr, nullptr, link->link_type, GPU_SAMPLER_MAX);
 -      graph, ima, iuser, NULL, NULL, NULL, link->link_type, GPU_SAMPLER_MAX);
++      graph, ima, iuser, nullptr, nullptr, nullptr, link->link_type, GPU_SAMPLER_MAX);
    return link;
  }
  
@@@ -684,7 -700,7 +706,7 @@@ GPUNodeLink *GPU_color_band(GPUMateria
    GPUNodeLink *link = gpu_node_link_create();
    link->link_type = GPU_NODE_LINK_COLORBAND;
    link->texture = gpu_node_graph_add_texture(
-       graph, nullptr, nullptr, colorband, nullptr, link->link_type, GPU_SAMPLER_MAX);
 -      graph, NULL, NULL, colorband, NULL, NULL, link->link_type, GPU_SAMPLER_MAX);
++      graph, nullptr, nullptr, colorband, nullptr, nullptr, link->link_type, GPU_SAMPLER_MAX);
    return link;
  }



More information about the Bf-blender-cvs mailing list