{"id":269,"date":"2018-09-03T20:25:11","date_gmt":"2018-09-03T11:25:11","guid":{"rendered":"http:\/\/www.sciement.com\/tech-blog\/?p=269"},"modified":"2018-09-03T20:28:40","modified_gmt":"2018-09-03T11:28:40","slug":"structured_buffer_compute_shader_ue4_part3","status":"publish","type":"post","link":"https:\/\/www.sciement.com\/tech-blog\/c\/structured_buffer_compute_shader_ue4_part3\/","title":{"rendered":"[UE4][ComputeShader][HLSL][C++]Unreal Engine 4\u3067(RW)StructuredBuffer\u3092\u7528\u3044\u305fComputeShader\u3092\u5229\u7528\u3059\u308b\uff08\u305d\u306e\uff13\uff1a\u5b9f\u969b\u306b\u7528\u3044\u308b\uff09"},"content":{"rendered":"<p><a href=\"http:\/\/www.sciement.com\/tech-blog\/c\/structured_buffer_compute_shader_ue4_part1\/\" rel=\"noopener\" target=\"_blank\"><strong>\u305d\u306e\uff11\uff1a\u30a4\u30f3\u30c8\u30ed<\/strong><\/a>\u3001<a href=\"http:\/\/www.sciement.com\/tech-blog\/c\/structured_buffer_compute_shader_ue4_part2\/\" rel=\"noopener\" target=\"_blank\"><strong>\u305d\u306e\uff12\uff1aC++\u5074\u30b7\u30a7\u30fc\u30c0\u30af\u30e9\u30b9<\/strong><\/a>\u306b\u7d9a\u304d\u3001\u4eca\u56de\u3067\u3088\u3046\u3084\u304f\u5b8c\u7d50\u3067\u3059\u3002<\/p>\n<p><a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/ShaderCore\/FGlobalShader\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>FGlobalShader\u30af\u30e9\u30b9<\/strong><\/a>\u3092\u7d99\u627f\u3057\u305f\u30af\u30e9\u30b9\u3092\u3069\u306e\u3088\u3046\u306b\u547c\u3073\u51fa\u3059\u306e\u304b\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u4e00\u5f0f\u3092GitHub\u4e0a\u3067\u516c\u958b\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/github.com\/HSeo\/ComputeShaderUE419Test\" rel=\"noopener\" target=\"_blank\"><strong>https:\/\/github.com\/HSeo\/ComputeShaderUE419Test<\/strong><\/a><\/p>\n<p>\u4eca\u56de\u3084\u308a\u305f\u304b\u3063\u305f\u3053\u3068\u306f\u3053\u308c\u3067\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSample.jpg\" alt=\"\" width=\"2466\" height=\"578\" class=\"alignnone size-full wp-image-251\" srcset=\"https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSample.jpg 2466w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSample-300x70.jpg 300w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSample-768x180.jpg 768w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSample-1024x240.jpg 1024w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSample-640x150.jpg 640w\" sizes=\"auto, (max-width: 2466px) 100vw, 2466px\" \/><\/p>\n<p>\u305d\u3053\u3067\u3001test_input_position, test_input_scalar, test_offset_X, OffsetYZ\u3092BluePrints\u4e0a\u3067\u6307\u5b9a\u3067\u304d\u308b\u3088\u3046\u306bC++ Actor\u3092\u4f5c\u308a\u307e\u3059\u3002<br \/>\n\u3053\u306eActor\u306e\u4e2d\u3067\u3001\u5909\u6570\u3092\u30b7\u30a7\u30fc\u30c0\u5074\u306b\u6e21\u3057\u305f\u308a\u3001ComputeShader\u3092\u8d77\u52d5\u3057\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/09\/BP_TestComputeShaderActor.jpg\" alt=\"\" width=\"1894\" height=\"927\" class=\"alignnone size-full wp-image-270\" srcset=\"https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/09\/BP_TestComputeShaderActor.jpg 1894w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/09\/BP_TestComputeShaderActor-300x147.jpg 300w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/09\/BP_TestComputeShaderActor-768x376.jpg 768w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/09\/BP_TestComputeShaderActor-1024x501.jpg 1024w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/09\/BP_TestComputeShaderActor-640x313.jpg 640w\" sizes=\"auto, (max-width: 1894px) 100vw, 1894px\" \/><\/p>\n<p>\u4eca\u56de\u306f\u8aac\u660e\u306e\u90fd\u5408\u4e0a\u3001.hpp \/ .cpp\u3092\u9069\u5b9c\u540c\u6642\u306b\u898b\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><strong>1. (RW)StructuredBuffer\u3078\u306e\u5024\u306e\u8a2d\u5b9a<\/strong><\/p>\n<pre class=\"start-line:69 lang:default decode:true \" title=\"TestComputeShaderActor.h\" >  TResourceArray&lt;FVector&gt; input_positions_RA_;\r\n  FRHIResourceCreateInfo input_positions_resource_;\r\n  FStructuredBufferRHIRef input_positions_buffer_;\r\n  FShaderResourceViewRHIRef input_positions_SRV_;\r\n\r\n  TResourceArray&lt;float&gt; input_scalars_RA_;\r\n  FRHIResourceCreateInfo input_scalars_resource_;\r\n  FStructuredBufferRHIRef input_scalars_buffer_;\r\n  FShaderResourceViewRHIRef input_scalars_SRV_;\r\n\r\n  TResourceArray&lt;FVector&gt; output_RA_; \/\/ Not necessary.\r\n  FRHIResourceCreateInfo output_resource_;\r\n  FStructuredBufferRHIRef output_buffer_;\r\n  FUnorderedAccessViewRHIRef output_UAV_;<\/pre>\n<pre class=\"start-line:43 lang:default decode:true \" title=\"TestComputeShaderActor.cpp\" >bool ATestComputeShaderActor::InitializeInputPositions(\r\n  \/*  input *\/const TArray&lt;FVector&gt;&amp; input_positions) {\r\n  if (input_positions.Num() == 0) {\r\n    UE_LOG(LogTemp, Warning, TEXT(\"Error: input_positions is empty at ATestComputeShaderActor::InitializeInputPosition.\"));\r\n    return false;\r\n  }\r\n  num_input_ = input_positions.Num();\r\n\r\n  \/\/ We need to copy TArray to TResourceArray to set RHICreateStructuredBuffer.\r\n  input_positions_RA_.SetNum(num_input_);\r\n  FMemory::Memcpy(input_positions_RA_.GetData(), input_positions.GetData(), sizeof(FVector) * num_input_);\r\n\r\n  input_positions_resource_.ResourceArray = &amp;input_positions_RA_;\r\n  \/\/ Note: In D3D11StructuredBuffer.cpp, ResourceArray-&gt;Discard() function is called, but not discarded??\r\n  input_positions_buffer_ = RHICreateStructuredBuffer(sizeof(FVector), sizeof(FVector) * num_input_, BUF_ShaderResource, input_positions_resource_);\r\n  input_positions_SRV_ = RHICreateShaderResourceView(input_positions_buffer_);\r\n  return true;\r\n}\r\n\r\nbool ATestComputeShaderActor::InitializeInputScalars(\r\n  \/*  input *\/const TArray&lt;float&gt;&amp; input_scalars) {\r\n  if (input_scalars.Num() == 0) {\r\n    UE_LOG(LogTemp, Warning, TEXT(\"Error: input_scalars is empty at ATestComputeShaderActor::InitializeInputScalar.\"));\r\n    return false;\r\n  }\r\n  if (input_scalars.Num() != num_input_) {\r\n    UE_LOG(LogTemp, Warning, TEXT(\"Error: input_scalars and input_positions do not have the same elements at ATestComputeShaderActor::InitializeInputScalar.\"));\r\n    return false;\r\n  }\r\n\r\n  input_scalars_RA_.SetNum(num_input_);\r\n  FMemory::Memcpy(input_scalars_RA_.GetData(), input_scalars.GetData(), sizeof(float) * num_input_);\r\n\r\n  input_scalars_resource_.ResourceArray = &amp;input_scalars_RA_;\r\n  input_scalars_buffer_ = RHICreateStructuredBuffer(sizeof(float), sizeof(float) * num_input_, BUF_ShaderResource, input_scalars_resource_);\r\n  input_scalars_SRV_ = RHICreateShaderResourceView(input_scalars_buffer_);\r\n  return true;\r\n}<\/pre>\n<pre class=\"start-line:121 lang:default decode:true \" title=\"TestComputeShaderActor.cpp\" >  \/\/ In this sample code, output_buffer_ has not input values, so what we need here is just the pointer to output_resource_.\r\n  \/\/output_RA_.SetNum(num_input_);\r\n  \/\/output_resource_.ResourceArray = &amp;output_RA_;\r\n  output_buffer_ = RHICreateStructuredBuffer(sizeof(FVector), sizeof(FVector) * num_input_, BUF_ShaderResource | BUF_UnorderedAccess, output_resource_);\r\n  output_UAV_ = RHICreateUnorderedAccessView(output_buffer_, \/* bool bUseUAVCounter *\/ false, \/* bool bAppendBuffer *\/ false);<\/pre>\n<p><strong>1. GPU\u5074\u306b\u6e21\u3057\u305f\u3044\u914d\u5217\u3092<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/Core\/Containers\/TResourceArray\/index.html\" rel=\"noopener\" target=\"_blank\">TResourceArray<\/a>\u306b\u4ee3\u5165<br \/>\n2. \u305d\u306eTResourceArray\u306e\u30dd\u30a4\u30f3\u30bf\u3092<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RHI\/FRHIResourceCreateInfo\/index.html\" rel=\"noopener\" target=\"_blank\">FRHIResourceCreateInfo<\/a>\u306b\u6e21\u3059<br \/>\n3. \u305d\u306eFRHIResourceCreateInfo\u3068\u3001\u914d\u52171\u8981\u7d20\u306e\u5927\u304d\u3055\uff08uint32 Stride\uff09\u3001\u78ba\u4fdd\u3057\u305f\u3044\u914d\u5217\u306e\u5927\u304d\u3055\uff08uint32 Size\uff09\u3001\u4f7f\u3044\u65b9\u306e\u6307\u5b9a\uff08uint32 InUsage\uff09\u3092<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RHI\/FDynamicRHI\/RHICreateStructuredBuffer\/index.html\" rel=\"noopener\" target=\"_blank\">RHICreateStructuredBuffer<\/a>\u306b\u6e21\u3057\u3066FStructuredBufferRHIRef\u3092\u4f5c\u308b<br \/>\n4. FRHIResourceCreateInfo\u306bShader Resource View (SRV)\u307e\u305f\u306fUnordered Access View (UAV)\u306e\u3069\u3061\u3089\u304b\u3001\u6216\u3044\u306f\u4e21\u65b9\u3092\u5272\u308a\u5f53\u3066\u308b<\/strong><\/p>\n<p>\u3068\u3044\u30464\u6bb5\u968e\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30b5\u30f3\u30d7\u30eb\u3067\u306f<strong>ATestComputeShaderActor::InitializeInputPositions<\/strong>\u53ca\u3073<strong>ATestComputeShaderActor::InitializeInputScalars<\/strong>\u306b\u3066\u5165\u529b\u5024\u3092Shader Resource View\u306b\u6e21\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/Core\/Containers\/TResourceArray\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>TResourceArray<\/strong><\/a>\u306f<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/Core\/Containers\/TArray\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>TArray<\/strong><\/a>\u3092\u7d99\u627f\u3057\u305f\u30af\u30e9\u30b9\u3067\u3001\u516c\u5f0f\u8a18\u4e8b\u306b\u3088\u308b\u3068<\/p>\n<blockquote><p>A array which allocates memory which can be used for UMA rendering resources. In the dynamically bound RHI, it isn&#8217;t any different from the default array type, since none of the dynamically bound RHI implementations have UMA.<\/p><\/blockquote>\n<p>\u3068\u306e\u3053\u3068\u306a\u306e\u3067\u3059\u304c\u3001<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RHI\/FDynamicRHI\/RHICreateStructuredBuffer\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>RHICreateStructuredBuffer<\/strong><\/a>\u304cFDynamicRHI\u306e\u30e1\u30f3\u30d0\u95a2\u6570\u3067\u3042\u308b\u3053\u3068\u304b\u3089\u8003\u3048\u308b\u3068\u3001dynamically bound RHI\u306a\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u3044\u3046\u6c17\u304c\u3057\u306a\u304f\u3082\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u826f\u304f\u308f\u304b\u308a\u307e\u305b\u3093\u2026\u3002\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p>UMA\u306f<a href=\"https:\/\/ja.wikipedia.org\/wiki\/%E3%83%A6%E3%83%8B%E3%83%95%E3%82%A1%E3%82%A4%E3%83%89%E3%83%A1%E3%83%A2%E3%83%AA%E3%82%A2%E3%83%BC%E3%82%AD%E3%83%86%E3%82%AF%E3%83%81%E3%83%A3\" rel=\"noopener\" target=\"_blank\"><strong>Unified Memory Architechture<\/strong><\/a>\u306e\u3053\u3068\u3067\u306f\u306a\u3044\u304b\u3068\u4e88\u60f3\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u3088\u304f\u308f\u304b\u308a\u307e\u305b\u3093\u2026\u3002\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p><strong>UAV\u4e14\u3064UAV\u3092ComputeShader\u3067\u306e\u8a08\u7b97\u7d50\u679c\u306e\u4ee3\u5165\u306e\u307f\u306b\u4f7f\u3046\u5834\u5408\uff08\u5165\u529b\u5024\u304c\u7121\u3044\u5834\u5408\uff09\u306b\u306f\u3001TResourceArray\u306e\u51e6\u7406\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002<\/strong><\/p>\n<p>\u306a\u304a\u3001\u307b\u3068\u3093\u3069\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u306f\u3053\u306e4\u6bb5\u968e\u306e\u51e6\u7406\u3092RenderThread\u306e\u4e2d\u3067\u884c\u3063\u3066\u304a\u308a\u3001FShaderResourceViewRHIRef\u306a\u3069\u3092\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001\u4e00\u5ea6\u5165\u529b\u3057\u305f\u3089\u5024\u304c\u5909\u308f\u3089\u306a\u3044\u3088\u3046\u306a\u5834\u5408\u3084\u3001\u6ec5\u591a\u306b\u5024\u304c\u5909\u308f\u3089\u306a\u3044\u5834\u5408\u306b\u306f\u3042\u307e\u308a\u306b\u3082\u975e\u52b9\u7387\u3067\u3059\u3002<br \/>\n\u5b9f\u306f\u3001\u4eca\u56de\u4f5c\u3063\u305f\u30b5\u30f3\u30d7\u30eb\u306e\u3088\u3046\u306b\u3001\u30e1\u30f3\u30d0\u5909\u6570\u3068\u3057\u3066\u6301\u3064\u3053\u3068\u304c\u51fa\u6765\u3001\u4e00\u5ea6\u5024\u3092\u4ee3\u5165\u3057\u3066\u3057\u307e\u3048\u3070\u305a\u3063\u3068\u305d\u306e\u5024\u3092\u4fdd\u6301\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002\u3053\u3061\u3089\u306e\u307b\u3046\u304c\u305a\u3063\u3068\u52b9\u7387\u7684\u3067\u3059\u306d\u3002<\/p>\n<p>TArray\u3084std::vector\u306e\u4e2d\u8eab\u3092TResourceArray\u306b\u6e21\u3059\u90e8\u5206\u306f\u3001\u304a\u305d\u3089\u304fFMemory::Memcpy\u3067\u4e00\u6c17\u306b\u30b3\u30d4\u30fc\u3059\u308b\u3057\u304b\u306a\u3044\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001\u4f55\u3068\u304b\u30b3\u30d4\u30fc\u3057\u306a\u3044\u3067\u5148\u982d\u30dd\u30a4\u30f3\u30bf\u306e\u307f\u3092\u6e21\u3057\u3066\u3042\u3052\u308c\u3070OK\u306b\u3059\u308b\u3088\u3046\u306a\u3053\u3068\u3063\u3066\u51fa\u6765\u306a\u3044\u306e\u3067\u3059\u304b\u306d\u3047\u3002<br \/>\nTArray\u3068TResouceArray\u3001std::vector\u3068TResouceArray\u3001std::vector\u3068TArray\u3068\u306e\u5024\u306e\u3084\u308a\u53d6\u308a\u306e\u52b9\u7387\u7684\u306a\u65b9\u6cd5\u304c\u3044\u307e\u3060\u306b\u308f\u304b\u308a\u307e\u305b\u3093\u2026\u3002\u3069\u306a\u305f\u304b\u65b9\u6cd5\u3054\u5b58\u77e5\u3067\u3057\u3087\u3046\u304b\u2026\uff1f\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p><a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RHI\/FDynamicRHI\/RHICreateStructuredBuffer\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>RHICreateStructuredBuffer<\/strong><\/a>\u3067\u306f\u3001BUF_ShaderResource\u3084BUF_UnorderedAccess\u306a\u3069\u3092\u6b63\u78ba\u306b\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RHI\/EBufferUsageFlags\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>EBufferUsageFlags<\/strong><\/a>\u3068\u3057\u3066\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u3001FStructuredBufferRHIRef, FShaderResourceViewRHIRef, FUnorderedAccessViewRHIRef\u306f\u3044\u305a\u308c\u3082\uff08\u304a\u305d\u3089\u304f\uff09\u624b\u52d5\u3067\u89e3\u653e\u3057\u3066\u3042\u3052\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001\u30c7\u30b9\u30c8\u30e9\u30af\u30bf\u3067\u884c\u3048\u3070\u3088\u3044\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001Unreal Engine\u306eActor\u306e\u5834\u5408\u3001\u3069\u308c\u304c\u30c7\u30b9\u30c8\u30e9\u30af\u30bf\u306b\u8a72\u5f53\u3059\u308b\u306e\u304b\u30a4\u30de\u30a4\u30c1\u3088\u304f\u308f\u304b\u3089\u305a\u3001\u3053\u3053\u3067\u306fEndPlay\u3092override\u3057\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"start-line:23 lang:default decode:true \" title=\"TestComputeShaderActor.cpp\" >void ATestComputeShaderActor::EndPlay(const EEndPlayReason::Type EndPlayReason) {\r\n  \/\/ I'm not sure where is the appropriate place to call the following SafeRelease methods.\r\n  \/\/ Destructor? EndPlay? BeginDestroy??\r\n  input_positions_buffer_.SafeRelease();\r\n  input_positions_SRV_.SafeRelease();\r\n\r\n  input_scalars_buffer_.SafeRelease();\r\n  input_scalars_SRV_.SafeRelease();\r\n\r\n  output_buffer_.SafeRelease();\r\n  output_UAV_.SafeRelease();\r\n\r\n  Super::EndPlay(EndPlayReason);\r\n}\r\n<\/pre>\n<p><a href=\"http:\/\/papersloth.hatenablog.com\/entry\/2018\/04\/13\/223631\" rel=\"noopener\" target=\"_blank\"><strong>UE4 Unreal C++\u3067\u30c7\u30b9\u30c8\u30e9\u30af\u30bf &#8211; PaperSloth\u2019s diary<\/strong><\/a>\u306b\u3088\u308c\u3070\u3001EndPlay\u3067\u826f\u3044\u2026\u306e\u3067\u3057\u3087\u3046\u304b\uff1f\uff1f\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p><strong>\uff12\uff0eComputeShader\u3092\u547c\u3073\u51fa\u3059<\/strong><\/p>\n<p>Unreal Engine\u306eRenderingThread\u3067\u547c\u3073\u51fa\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"start-line:130 lang:default decode:true \" title=\"TestComputeShaderActor.cpp\" >  ENQUEUE_UNIQUE_RENDER_COMMAND_FOURPARAMETER(CalculateCommand,\r\n    ATestComputeShaderActor*, compute_shader_actor, this,\r\n    const FVector, offset, offset_,\r\n    const bool, yz_updated, false,\r\n    TArray&lt;FVector&gt;*, output, &amp;output, {\r\n      compute_shader_actor-&gt;Calculate_RenderThread(offset, yz_updated, output);\r\n    });\r\n  render_command_fence_.BeginFence();\r\n  render_command_fence_.Wait(); \/\/ Waits for pending fence commands to retire.<\/pre>\n<p>\u6211\u3005\u304c\u666e\u6bb5Unreal C++\u3067\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3068\u304d\u3001\u305d\u308c\u306f\u666e\u901aGameThread\u3067\u306e\u51e6\u7406\uff08\u306e\u306f\u305a\uff09\u3067\u3059\u3002Unreal Engine\u306fGameThread\u3068RenderingThread\u306e\u5927\u304d\u304f2\u3064\u304b\u3089\u69cb\u6210\u3055\u308c\u3066\u3044\u307e\u3059\uff08<a href=\"http:\/\/api.unrealengine.com\/JPN\/Programming\/Rendering\/ThreadedRendering\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>\u30b9\u30ec\u30c3\u30c9\u5316\u3057\u305f\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0 | Unreal Engine<\/strong><\/a>\uff09\u3002<br \/>\n\u3067\u3001ComputeShader\u306fRenderThread\u304b\u3089\u547c\u3073\u51fa\u3059\u5fc5\u8981\u304c\u3042\u308a\u3001\u305d\u306e\u305f\u3081\u306e\u30de\u30af\u30ed\u304c<br \/>\n<strong>ENQUEUE_UNIQUE_RENDER_COMMAND_xxxPARAMETER<\/strong><br \/>\n\u3067\u3059\u3002xxx\u306b\u306fONE, TWO, THREE, FOUR, FIVE\u306e\u3044\u305a\u308c\u304b\u304c\u5165\u308a\u307e\u3059\u3002\u30b5\u30f3\u30d7\u30eb\u3092\u898b\u3066\u9802\u3051\u308c\u3070\u4f55\u3068\u306a\u304f\u308f\u304b\u308b\u304b\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001RenderingThread\u306b\u6e21\u3057\u305f\u3044\u578b\u3001GameThread\u4e0a\u3067\u306e\u5909\u6570\u540d\u3001RenderThread\u4e0a\u3067\u306e\u5909\u6570\u540d\u3001\u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<br \/>\n\u4e00\u756a\u6700\u521d\u306eCalculateCommand\u3068\u66f8\u304b\u308c\u3066\u3044\u308b\u3068\u3053\u308d\u306f\u3001\u304a\u305d\u3089\u304f\u6587\u5b57\u5217\u306a\u3089\u4f55\u3067\u3082\u826f\u3044\u2026\u3088\u3046\u306a\u6c17\u304c\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3044\u307e\u3044\u3061\u3088\u304f\u308f\u304b\u308a\u307e\u305b\u3093\u2026\u3002<br \/>\n\u6e21\u3057\u305f\u3044\u5909\u6570\u304c6\u500b\u4ee5\u4e0a\u306e\u5834\u5408\u306f\u3001\u8907\u6570\u306e\u5909\u6570\u3092\u307e\u3068\u3081\u3066\u69cb\u9020\u4f53\u5909\u6570\u3068\u3059\u308b\u306e\u304c\u308f\u304b\u308a\u3084\u3059\u3044\u89e3\u6c7a\u65b9\u6cd5\u3067\u3059\u3002\u3053\u306e\u307b\u304b\u306b\u30e9\u30e0\u30c0\u5f0f\u306b\u3088\u308b\u8a18\u8ff0\u65b9\u6cd5\u3082\u3042\u308b\u3063\u307d\u3044\u306e\u3067\u3059\u304c\u3001\u691c\u8a3c\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u3088\u304f\u308f\u304b\u308a\u307e\u305b\u3093\u3002\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p><a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/RenderCore\/FRenderCommandFence\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>FRenderCommandFence<\/strong><\/a>\u306f\u5fc5\u9808\u306a\u306e\u304b\u4e0d\u8981\u306a\u306e\u304b\u30a4\u30de\u30a4\u30c1\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u306e\u3067\u3059\u304c\u3001RenderingThread\u3067\u306e\u51e6\u7406\u304c\u7d42\u308f\u308b\u307e\u3067\u5f85\u3063\u3066\u304f\u308c\u308b\uff1f\u3082\u306e\u306e\u3088\u3046\u3067\u3059\uff08\u2026\u3068\u306a\u308b\u3068\u5fc5\u9808\u3060\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001\u79c1\u304c\u8abf\u3079\u305f\u8907\u6570\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u3053\u308c\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u306f1\u3064\u3057\u304b\u3042\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u2026\uff09\u3002\u3084\u3063\u3071\u308a\u3088\u304f\u308f\u304b\u308a\u307e\u305b\u3093\u3002\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p>\u3067\u3001RenderingThread\u5185\u3067\u547c\u3073\u51fa\u3059\u95a2\u6570\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"start-line:175 lang:default decode:true \" title=\"TestComputeShaderActor.cpp\" >void ATestComputeShaderActor::Calculate_RenderThread(\r\n  \/*  input *\/const FVector xyz, const bool yz_updated,\r\n  \/* output *\/TArray&lt;FVector&gt;* output) {\r\n  check(IsInRenderingThread());\r\n\r\n  \/\/ Get global RHI command list\r\n  FRHICommandListImmediate&amp; rhi_command_list = GRHICommandList.GetImmediateCommandList();\r\n\r\n  \/\/ Get the actual shader instance off the ShaderMap\r\n  TShaderMapRef&lt;FTestComputeShader&gt; test_compute_shader_(shader_map);\r\n\r\n  rhi_command_list.SetComputeShader(test_compute_shader_-&gt;GetComputeShader());\r\n  test_compute_shader_-&gt;SetOffsetX(rhi_command_list, xyz.X);\r\n  if (yz_updated) {\r\n    test_compute_shader_-&gt;SetOffsetYZ(rhi_command_list, xyz.Y, xyz.Z);\r\n  }\r\n  test_compute_shader_-&gt;SetInputPosition(rhi_command_list, input_positions_SRV_);\r\n  test_compute_shader_-&gt;SetInputScalar(rhi_command_list, input_scalars_SRV_);\r\n  test_compute_shader_-&gt;SetOutput(rhi_command_list, output_UAV_);\r\n\r\n  DispatchComputeShader(rhi_command_list, *test_compute_shader_, num_input_, 1, 1);\r\n\r\n  test_compute_shader_-&gt;ClearOutput(rhi_command_list);\r\n  test_compute_shader_-&gt;ClearParameters(rhi_command_list);\r\n\r\n  const FVector* shader_data = (const FVector*)rhi_command_list.LockStructuredBuffer(output_buffer_, 0, sizeof(FVector) * num_input_, EResourceLockMode::RLM_ReadOnly);\r\n  FMemory::Memcpy(output-&gt;GetData(), shader_data, sizeof(FVector) * num_input_);\r\n  \/\/ If you would like to get the partial data, (*output)[index] = *(shader_data + index) is more efficient??\r\n\r\n  \/\/for (int32 index = 0; index &lt; num_input_; ++index) {\r\n  \/\/  (*output)[index] = *(shader_data + index);\r\n  \/\/}\r\n\r\n  rhi_command_list.UnlockStructuredBuffer(output_buffer_);\r\n}<\/pre>\n<p>\u307e\u305a\u3001check(IsInRenderingThread());\u3067RenderingThread\u5185\u3067\u547c\u3073\u51fa\u3055\u308c\u305f\u304b\u3069\u3046\u304b\u3092\u7c21\u5358\u306b\u30c1\u30a7\u30c3\u30af\u3067\u304d\u307e\u3059\u3002<br \/>\nShader\u3068\u306e\u3084\u308a\u53d6\u308a\u3067\u5fc5\u9808\u306b\u306a\u308bFRHICommandListImmediate\u306f\u3001GRHICommandList.GetImmediateCommandList();\u3067\u53d6\u5f97\u3057\u307e\u3059\u3002\u3053\u308c\u4ee5\u5916\u306e\u65b9\u6cd5\u304c\u3042\u308b\u306e\u304b\u3069\u3046\u304b\u306f\u5168\u304f\u5206\u304b\u308a\u307e\u305b\u3093\u2026\u3002\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<br \/>\n\u305d\u306e\u5f8c\u3001Shader\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306b<\/p>\n<pre class=\"start-line:184 lang:default decode:true \" title=\"TestComputeShaderActor.cpp\" >TShaderMapRef&lt;FTestComputeShader&gt; test_compute_shader_(shader_map);<\/pre>\n<p>\u3068\u3057\u307e\u3059\u3002<br \/>\n\u3053\u3053\u3067\u3001shader_map\u306fconst TShaderMap<FGlobalShaderType>*\u3067\u3001<a href=\"https:\/\/api.unrealengine.com\/INT\/API\/Runtime\/ShaderCore\/GetGlobalShaderMap\/2\/index.html\" rel=\"noopener\" target=\"_blank\"><strong>GetGlobalShaderMap\u95a2\u6570<\/strong><\/a>\u3092\u7528\u3044\u3066\u53d6\u5f97\u3059\u308b\u306e\u3067\u3059\u304c\u3001\u3053\u306e\u95a2\u6570\u306e\u5f15\u6570\u3067\u3042\u308b<br \/>\n ERHIFeatureLevel::Type\u306e\u53d6\u5f97\u65b9\u6cd5\u304c\u3044\u307e\u3044\u3061\u3088\u304f\u308f\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002<br \/>\n\u304a\u4f5c\u6cd5\u7684\u306b\u306fBeginPlay\u5185\u3067<\/p>\n<pre class=\"start-line:16 lang:default decode:true \" title=\"TestComputeShaderActor.cpp\" >  ERHIFeatureLevel::Type shader_feature_level_test = GetWorld()-&gt;Scene-&gt;GetFeatureLevel();<\/pre>\n<p>\u3068\u3059\u308b\u3088\u3046\u306a\u306e\u3067\u3059\u304c\u3001\u3053\u308c\u3092BeginPlay\u3067\u306f\u306a\u304f\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u5185\u3067\u884c\u304a\u3046\u3068\u3059\u308b\u3068\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3059\u3002\u304a\u305d\u3089\u304f\u3001UWorld\u5185\u306bSpawn\u3055\u308c\u3066\u3044\u306a\u3044\u3068GetWorld\u3067\u4f55\u3082\u53d6\u5f97\u3067\u304d\u306a\u3044\u304b\u3089\u3060\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001\u3053\u308c\u3067\u306f\u30e1\u30f3\u30d0\u5909\u6570\u3068\u3057\u3066\u6301\u305f\u305b\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u305b\u3093\u3002<br \/>\n\u8272\u3005\u8abf\u3079\u308b\u3068\u3001<\/p>\n<pre class=\"start-line:60 lang:default decode:true \" title=\"TestComputeShaderActor.hpp\" >  const TShaderMap&lt;FGlobalShaderType&gt;* shader_map = GetGlobalShaderMap(GMaxRHIFeatureLevel);<\/pre>\n<p>\u3067\u3082\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u3067\u3057\u305f\u306e\u3067\u3001\u4eca\u56de\u306f\u3053\u3061\u3089\u3092\u4f7f\u3044\u307e\u3057\u305f\u3002\u305f\u3060\u3001MaxRHIFeatureLevel\u304c\u73fe\u5728\u4f7f\u308f\u308c\u3066\u3044\u308bFeatureLevel\u3068\u672c\u5f53\u306b\u3044\u3064\u3067\u3082\u30a4\u30b3\u30fc\u30eb\u306a\u306e\u304b\u306f\u3088\u304f\u308f\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u2026\u3002\u6559\u3048\u3066\u3001\u8a73\u3057\u3044\u4eba\uff01<\/p>\n<p>\u305d\u306e\u3042\u3068\u306f\u3001\u898b\u308c\u3070\u308f\u304b\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>DispatchComputeShader\u3067\u8a08\u7b97\u3057\u305f\u5f8c\u306f\u3001Shader\u5185\u3067\u306e\u89e3\u653e\u95a2\u6570\u3092\u3057\u3063\u304b\u308a\u547c\u3073\u51fa\u3057\u3066\u3042\u3052\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u6700\u5f8c\u306b\u8a08\u7b97\u7d50\u679c\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306b\u3001LockStructuredBuffer\u3068UnlockStructuredBuffer\u3068\u3067\u631f\u307f\u3001\u8a08\u7b97\u7d50\u679c\u3092CPU\u5074\u306b\u30b3\u30d4\u30fc\u3057\u3066\u3042\u3052\u308c\u3070\u5b8c\u6210\u3067\u3059\u3002<\/p>\n<p>\u3061\u306a\u307f\u306bTShaderMapRef&lt;FTestComputeShader&gt;\u3092\u6bce\u56de\u4f5c\u308b\u306e\u306f\u975e\u52b9\u7387\u3060\u3068\u601d\u3044\u3001\u30e1\u30f3\u30d0\u5909\u6570\u3068\u3057\u3066\u6301\u305f\u305b\u3088\u3046\u3068\u3057\u305f\u306e\u3067\u3059\u304c\u3001<\/p>\n<pre class=\"start-line:66 lang:default decode:true \" title=\"TestComputeShaderActor.hpp\" >  \/\/\/\/ Get the actual shader instance off the ShaderMap\r\n  \/\/TShaderMapRef&lt;FTestComputeShader&gt; test_compute_shader_{ shader_map }; \/\/ Note: test_compute_shader_(shader_map) causes error.<\/pre>\n<p>\u306b\u30b3\u30e1\u30f3\u30c8\u3067\u8a18\u8f09\u3057\u305f\u3088\u3046\u306b\u3001()\u3067\u62ec\u308b\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308a\u3001\u8a66\u3057\u306b{}\u306b\u3057\u3066\u307f\u308b\u3068\u30b3\u30f3\u30d1\u30a4\u30eb\u304c\u901a\u308b\u3068\u3044\u3046\u8b0e\u306e\u73fe\u8c61\u306b\u60a9\u307e\u3055\u308c\u307e\u3057\u305f\u3002<br \/>\nTwitter\u4e0a\u3067\u8272\u3005\u306a\u65b9\u304c\u691c\u8a3c\u3057\u3066\u304f\u3060\u3055\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u4f55\u3068\u9042\u306b\u6c5f\u6dfb\u3055\u3093\u307e\u3067\u767b\u5834\u3057\u3066\u304f\u3060\u3055\u308a\u307e\u3057\u305f\u3002<\/p>\n<blockquote class=\"twitter-tweet\" data-conversation=\"none\" data-lang=\"ja\">\n<p lang=\"ja\" dir=\"ltr\">\u3044\u307e\u3044\u3061\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u304c\u5909\u6570\u5ba3\u8a00\u3068\u95a2\u6570\u5ba3\u8a00\u306e\u6587\u6cd5\u304c\u885d\u7a81\u3057\u3066\u3044\u308b\u305f\u3081\u306b\u95a2\u6570\u5ba3\u8a00\u304c\u512a\u5148\u3055\u308c\u308b\u30eb\u30fc\u30eb\u306b\u5f15\u3063\u304b\u304b\u3063\u3066\u3044\u308b\u306e\u304b\u306a\u3002<\/p>\n<p>&mdash; Ryou Ezoe (@EzoeRyou) <a href=\"https:\/\/twitter.com\/EzoeRyou\/status\/1031147426420158465?ref_src=twsrc%5Etfw\">2018\u5e748\u670819\u65e5<\/a><\/p><\/blockquote>\n<p><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<blockquote class=\"twitter-tweet\" data-conversation=\"none\" data-lang=\"ja\">\n<p lang=\"ja\" dir=\"ltr\">\u8981\u3059\u308b\u306b\u30af\u30e9\u30b9\u30b9\u30b3\u30fc\u30d7\u306b\u304a\u3051\u308b<br \/>Hoge a(b);<br \/>\u306f\u3001\u623b\u308a\u5024\u306e\u578b\u304cHoge\u3067\u5f15\u6570\u306e\u578b\u304cb\u306e\u975estatic\u30e1\u30f3\u30d0\u30fc\u95a2\u6570a\u3067\u3042\u3063\u3066\u3001<br \/>\u578bHoge\u306e\u5909\u6570a\u3067\u521d\u671f\u5316\u5b50\u304c(b)\u3067\u306f\u306a\u3044\u3002<\/p>\n<p>&mdash; Ryou Ezoe (@EzoeRyou) <a href=\"https:\/\/twitter.com\/EzoeRyou\/status\/1031148749886611457?ref_src=twsrc%5Etfw\">2018\u5e748\u670819\u65e5<\/a><\/p><\/blockquote>\n<p><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<blockquote class=\"twitter-tweet\" data-conversation=\"none\" data-lang=\"ja\">\n<p lang=\"ja\" dir=\"ltr\">C++\u304c\u5f15\u6570\u540d\u306e\u7701\u7565\u3092\u53ef\u80fd\u306b\u3057\u3066\u3057\u307e\u3063\u305f\u305f\u3081\u767a\u751f\u3057\u305f\u6587\u6cd5\u4e0a\u306e\u66d6\u6627\u6027\u3067\u3001C++\u898f\u683c\u3067\u306f\u4e00\u90e8\u306e\u66d6\u6627\u306a\u6587\u6cd5\u306b\u5bfe\u3057\u3066\u4e00\u65b9\u306b\u5f37\u5236\u7684\u306b\u89e3\u91c8\u3059\u308b\u3053\u3068\u3067\u89e3\u6c7a\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>&mdash; Ryou Ezoe (@EzoeRyou) <a href=\"https:\/\/twitter.com\/EzoeRyou\/status\/1031467305056722944?ref_src=twsrc%5Etfw\">2018\u5e748\u670820\u65e5<\/a><\/p><\/blockquote>\n<p><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<p>\u8a73\u7d30\u306fTwitter\u3067\u306e\u3084\u308a\u53d6\u308a\u3092\u8ffd\u3063\u3066\u9802\u3051\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u304c\u3001test_compute_shader_(shader_map);\u3068\u66f8\u304f\u3068\u3001shader_map\u578b\u306e\u5f15\u6570\u3092\u53d6\u308b\u95a2\u6570\u3068\u307f\u306a\u3055\u308c\u3066\u3057\u307e\u3046\u3088\u3046\u3067\u3059\u3002\u30e1\u30f3\u30d0\u5909\u6570\u3068\u3057\u3066\u5b9a\u7fa9\u3057\u305f\u6642\u306b\u3060\u3051\u51fa\u308b\u30a8\u30e9\u30fc\u3067\u8b0e\u904e\u304e\u305f\u306e\u3067\u3059\u304c\u3001\u305d\u3046\u3044\u3046\u3053\u3068\u3060\u3063\u305f\u306e\u3067\u3059\u306d\u3002<\/p>\n<p>\u3067\u3001\u3081\u3067\u305f\u304f\u30e1\u30f3\u30d0\u5909\u6570\u306b\u51fa\u6765\u305f\u3064\u3082\u308a\u3060\u3063\u305f\u306e\u3067\u3059\u304c\u3001Shader\u3092\u66f4\u65b0\u3057\u305f\u969b\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u2026\u3002\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3001\u5148\u306b\u30b7\u30a7\u30fc\u30c0\u30b3\u30f3\u30d1\u30a4\u30eb\u304c\u5b8c\u4e86\u3055\u308c\u3066\u3044\u308c\u3070\u554f\u984c\u306a\u3044\u3088\u3046\u306a\u306e\u3067\u3059\u304c\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u306e\u9806\u756a\u6307\u5b9a\u306e\u65b9\u6cd5\u304c\u308f\u304b\u3089\u305a\u3001\u7d50\u5c40RenderingThread\u5185\u3067\u6bce\u56de\u5909\u6570\u5b9a\u7fa9\u3092\u3059\u308b\u5f62\u306b\u306a\u308a\u307e\u3057\u305f\u3002<br \/>\n\u30e1\u30f3\u30d0\u5909\u6570\u3068\u3057\u3066TShaderMapRef&lt;FTestComputeShader&gt;\u304c\u3042\u308c\u3070\u3001UniformBufferStruct\u3082\u4fdd\u6301\u3055\u308c\u308b\u3060\u308d\u3046\u3068\u601d\u3063\u3066\u8272\u3005\u8a66\u3057\u305f\u306e\u3067\u3059\u304c\u3001\u6b8b\u5ff5\u306a\u304c\u3089\u4fdd\u6301\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u2026\u3002<\/p>\n<p><strong>\uff13\uff0e\u307e\u3068\u3081<\/strong><\/p>\n<p>\u2026\u3068\u3001\u9577\u3044\u9577\u3044\u9053\u306e\u308a\u3092\u7d4c\u3066\u3001\u4ee5\u4e0b\u306eOutput Log\u3092\u8868\u793a\u51fa\u6765\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSampleUE4.jpg\" alt=\"\" width=\"933\" height=\"439\" class=\"alignnone size-full wp-image-252\" srcset=\"https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSampleUE4.jpg 933w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSampleUE4-300x141.jpg 300w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSampleUE4-768x361.jpg 768w, https:\/\/www.sciement.com\/tech-blog\/wp-content\/uploads\/2018\/08\/20180821ComputeShaderSampleUE4-640x301.jpg 640w\" sizes=\"auto, (max-width: 933px) 100vw, 933px\" \/><\/p>\n<p>\u7d10\u89e3\u3044\u3066\u3044\u3051\u3070\u4f55\u3068\u304b\u66f8\u3051\u308b\u3088\u3046\u306b\u306f\u306a\u308b\u3082\u306e\u306e\u3001<strong>Unity\u3068\u6bd4\u8f03\u3059\u308b\u3068\u6fc0\u3057\u304f\u9762\u5012\u81ed\u304f\u3001\u3068\u3066\u3082\u3084\u308b\u6c17\u304c\u8d77\u304d\u307e\u305b\u3093\u2026<\/strong>\u3002<\/p>\n<p>\u3053\u308c\u3060\u3051\u3084\u3063\u3066\u3082\u3001<a href=\"http:\/\/www.sciement.com\/tech-blog\/c\/structured_buffer_compute_shader_ue4_part1\/\" rel=\"noopener\" target=\"_blank\"><strong>\u305d\u306e\uff11\uff1a\u30a4\u30f3\u30c8\u30ed<\/strong><\/a>\u3067\u611a\u75f4\u3063\u305f\u3088\u3046\u306b\u3001\u8a08\u7b97\u7d50\u679c\u3092\u305d\u306e\u307e\u307e\u30e1\u30c3\u30b7\u30e5\u306e\u9802\u70b9\u60c5\u5831\u3068\u3057\u3066\u4f7f\u3063\u305f\u308a\u3001\u30d1\u30fc\u30c6\u30a3\u30af\u30eb\u3084Instanced Static Mesh\u306e\u30c8\u30e9\u30f3\u30b9\u30d5\u30a9\u30fc\u30e0\u5024\u306b\u76f4\u63a5\u4f7f\u3063\u305f\u308a\u51fa\u6765\u306a\u3044\u306e\u3067\u3059\u3088\u2026\u3002<\/p>\n<p>\u4eca\u56de\u3092\u304d\u3063\u304b\u3051\u306b\u8272\u3005\u306a\u30b5\u30f3\u30d7\u30eb\u304c\u5897\u3048\u308c\u3070\u3088\u3044\u306a\u3068\u601d\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u305d\u306e\uff11\uff1a\u30a4\u30f3\u30c8\u30ed\u3001\u305d\u306e\uff12\uff1aC++\u5074\u30b7\u30a7\u30fc\u30c0\u30af\u30e9\u30b9\u306b\u7d9a\u304d\u3001\u4eca\u56de\u3067\u3088\u3046\u3084\u304f\u5b8c\u7d50\u3067\u3059\u3002 FGlobalShader\u30af\u30e9\u30b9\u3092\u7d99\u627f\u3057\u305f\u30af\u30e9\u30b9\u3092\u3069\u306e\u3088\u3046\u306b\u547c\u3073\u51fa\u3059\u306e\u304b\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002 \u30b5\u30f3\u30d7\u30eb\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u4e00\u5f0f\u3092GitHub\u4e0a\u3067\u516c &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,12,11,6],"tags":[],"class_list":["post-269","post","type-post","status-publish","format-standard","hentry","category-c","category-computeshader","category-hlsl","category-unreal-engine-4"],"_links":{"self":[{"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/posts\/269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/comments?post=269"}],"version-history":[{"count":3,"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/posts\/269\/revisions"}],"predecessor-version":[{"id":319,"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/posts\/269\/revisions\/319"}],"wp:attachment":[{"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/media?parent=269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/categories?post=269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sciement.com\/tech-blog\/wp-json\/wp\/v2\/tags?post=269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}