diff options
author | Jeroen Bakker <jeroen@blender.org> | 2022-11-09 15:18:12 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-11-09 15:18:12 +0300 |
commit | 0a01bec40061cea4070c9d21b93f6123c7c1a356 (patch) | |
tree | e848f693a2c958702825ea6b6e6c52f4509fee9d /source/blender/gpu/intern | |
parent | d63d2c8b9ea151750d38a391dc1083992b5d53c8 (diff) |
Fixed using correct texture.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.cc | 4 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_node_graph.c | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.cc b/source/blender/gpu/intern/gpu_codegen.cc index aa0f86d46e4..da00f9850c8 100644 --- a/source/blender/gpu/intern/gpu_codegen.cc +++ b/source/blender/gpu/intern/gpu_codegen.cc @@ -392,9 +392,9 @@ void GPUCodegen::generate_resources() const char *name = info.name_buffer.append_sampler_name(tex->sampler_name); info.sampler(0, ImageType::FLOAT_2D_ARRAY, name, Frequency::BATCH); } - else if (tex->camera) { + else if (tex->camera && tex->camera[0]) { const char *name = info.name_buffer.append_sampler_name(tex->sampler_name); - info.sampler(0, ImageType::FLOAT_2D, name, Frequency::BATCH); + info.sampler(slot++, ImageType::FLOAT_2D, name, Frequency::BATCH); } else if (tex->tiled_mapping_name[0] != '\0') { const char *name = info.name_buffer.append_sampler_name(tex->sampler_name); diff --git a/source/blender/gpu/intern/gpu_node_graph.c b/source/blender/gpu/intern/gpu_node_graph.c index 81b9d373951..153906675b0 100644 --- a/source/blender/gpu/intern/gpu_node_graph.c +++ b/source/blender/gpu/intern/gpu_node_graph.c @@ -638,10 +638,9 @@ GPUNodeLink *GPU_image_camera(GPUMaterial *mat, Camera *camera, eGPUSamplerState { GPUNodeGraph *graph = gpu_material_node_graph(mat); GPUNodeLink *link = gpu_node_link_create(); - GPUTexture *texture = GPU_offscreen_color_texture(camera->runtime.virtual_display_texture); link->link_type = GPU_NODE_LINK_IMAGE_CAMERA; link->texture = gpu_node_graph_add_texture( - graph, NULL, NULL, NULL, NULL, &texture, link->link_type, sampler_state); + graph, NULL, NULL, NULL, NULL, &camera->runtime.gpu_texture, link->link_type, sampler_state); GPU_material_flag_set(mat, GPU_MATFLAG_VIRTUAL_CAMERA); return link; } |