2 Commits

Author SHA1 Message Date
  Heedong Arkiny Lee cfaad9195b UV 좌표 정리 6 years ago
  Heedong Arkiny Lee 278ac2b1ad Source also should be storage tex 6 years ago
1 changed files with 5 additions and 11 deletions
  1. 5
    11
      Samples/ComputeShader/ComputeShader.cpp

+ 5
- 11
Samples/ComputeShader/ComputeShader.cpp View File

@@ -13,10 +13,10 @@ private:
13 13
 
14 14
     DKArray<UVQuad::Vertex> vertices =
15 15
     {
16
-        { { 1.0f, 1.0f, 0.0f }, { 1.0f, 1.0f } },
17
-        { { -1.0f, 1.0f, 0.0f }, { 0.0f, 1.0f } },
18
-        { { -1.0f, -1.0f, 0.0f }, { 0.0f, 0.0f } },
19
-        { { 1.0f, -1.0f, 0.0f }, { 1.0f, 0.0f } }
16
+        { { 1.0f, 1.0f, 0.0f }, { 1.0f, 0.0f } },
17
+        { { -1.0f, 1.0f, 0.0f }, { 0.0f, 0.0f } },
18
+        { { -1.0f, -1.0f, 0.0f }, { 0.0f, 1.0f } },
19
+        { { 1.0f, -1.0f, 0.0f }, { 1.0f, 1.0f } }
20 20
     };
21 21
 
22 22
     DKArray<uint32_t> indices = { 0,1,2,2,3,0 };
@@ -185,12 +185,6 @@ public:
185 185
                 descriptorSetPostCompute->SetBuffer(0, uniformBuffer, 0, sizeof(UBO));
186 186
             }
187 187
         }
188
-
189
-
190
-
191
-
192
-        //descriptorSetPreCompute->SetTexture(1, texture);
193
-        //descriptorSetPreCompute->SetSamplerState(1, sampler);
194 188
     }
195 189
 
196 190
     DKGpuBuffer* UniformBuffer() { return uniformBuffer; }
@@ -228,7 +222,7 @@ public:
228 222
             texDesc.mipmapLevels = 1;
229 223
             texDesc.sampleCount = 1;
230 224
             texDesc.arrayLength = 1;
231
-            texDesc.usage = DKTexture::UsageCopyDestination | DKTexture::UsageSampled;
225
+            texDesc.usage = DKTexture::UsageStorage | DKTexture::UsageShaderRead | DKTexture::UsageCopyDestination | DKTexture::UsageSampled;
232 226
             DKObject<DKTexture> tex = device->CreateTexture(texDesc);
233 227
             if (tex)
234 228
             {