Code: Select all
OGRE EXCEPTION(-2147467259:RenderingAPIException): Cannot compile D3D11 high-level shader 0ComputeTest Errors:
D:\Development\SDK\OGRE\OGRE\build\bin\Debug\0ComputeTest.hlsl(3,47-48): error X3530: buffer requires a 't' register
in D3D11HLSLProgram::compileMicrocode at D:\Development\SDK\OGRE\OGRE\RenderSystems\Direct3D11\src\OgreD3D11HLSLProgram.cpp (line 549)
Code: Select all
From c4051b7d2ffba6acdbd20925ca59f6be60f3cca7 Mon Sep 17 00:00:00 2001
From: TaaTT4 <raffaele.bratta@gmail.com>
Date: Mon, 6 Jul 2020 12:42:02 +0200
Subject: [PATCH] COMPUTE
---
.../materials/TutorialCompute01_UavTexture/Compute.compositor | 2 ++
.../TutorialCompute01_UavTexture/ComputeJobs.material.json | 2 +-
.../TutorialCompute01_UavTexture/HLSL/ComputeTest.hlsl | 3 ++-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Samples/Media/2.0/scripts/materials/TutorialCompute01_UavTexture/Compute.compositor b/Samples/Media/2.0/scripts/materials/TutorialCompute01_UavTexture/Compute.compositor
index 47aa1977d..66f8f3d8d 100644
--- a/Samples/Media/2.0/scripts/materials/TutorialCompute01_UavTexture/Compute.compositor
+++ b/Samples/Media/2.0/scripts/materials/TutorialCompute01_UavTexture/Compute.compositor
@@ -3,6 +3,7 @@ compositor_node TutorialComputeTest01_UavTextureRenderingNode
in 0 rt_renderwindow
texture testTexture target_width target_height PFG_RGBA8_UNORM depth_pool 0 uav
+ buffer testBuffer 1 4 target_width target_height
target
{
@@ -12,6 +13,7 @@ compositor_node TutorialComputeTest01_UavTextureRenderingNode
//uav # textureName read write allow_write_after_write
uav 0 testTexture write
+ uav_buffer 1 testBuffer read
//input 0 mrtTexture 1
}
}
diff --git a/Samples/Media/2.0/scripts/materials/TutorialCompute01_UavTexture/ComputeJobs.material.json b/Samples/Media/2.0/scripts/materials/TutorialCompute01_UavTexture/ComputeJobs.material.json
index 01b94e9da..5d90a33e2 100644
--- a/Samples/Media/2.0/scripts/materials/TutorialCompute01_UavTexture/ComputeJobs.material.json
+++ b/Samples/Media/2.0/scripts/materials/TutorialCompute01_UavTexture/ComputeJobs.material.json
@@ -9,7 +9,7 @@
"source" : "ComputeTest",
- "uav_units" : 1,
+ "uav_units" : 2,
"params" :
[
diff --git a/Samples/Media/2.0/scripts/materials/TutorialCompute01_UavTexture/HLSL/ComputeTest.hlsl b/Samples/Media/2.0/scripts/materials/TutorialCompute01_UavTexture/HLSL/ComputeTest.hlsl
index af25e5ebf..630ad7aeb 100644
--- a/Samples/Media/2.0/scripts/materials/TutorialCompute01_UavTexture/HLSL/ComputeTest.hlsl
+++ b/Samples/Media/2.0/scripts/materials/TutorialCompute01_UavTexture/HLSL/ComputeTest.hlsl
@@ -1,5 +1,6 @@
RWTexture2D<float4> testTexture : register(u0);
+StructuredBuffer<uint> pixelBuffer : register(u1);
[numthreads(@value( threads_per_group_x ), @value( threads_per_group_y ), @value( threads_per_group_z ))]
void main
@@ -8,5 +9,5 @@ void main
uint3 gl_GlobalInvocationID : SV_DispatchThreadId
)
{
- testTexture[gl_GlobalInvocationID.xy].xyzw = float4( float2(gl_LocalInvocationID.xy) / 16.0f, 0.0f, 1.0f );
+ testTexture[gl_GlobalInvocationID.xy].xyzw = float4( float2(gl_LocalInvocationID.xy) / 16.0f, pixelBuffer[0], 1.0f );
}
--
2.24.0.windows.2