Hongtae Kim пре 5 година
родитељ
комит
a2fa0452b2
1 измењених фајлова са 15 додато и 3 уклоњено
  1. 15
    3
      Samples/ComputeShader/ComputeShader.cpp

+ 15
- 3
Samples/ComputeShader/ComputeShader.cpp Прегледај датотеку

@@ -230,9 +230,21 @@ public:
230 230
     {
231 231
         // Device and Queue Preperation
232 232
         DKObject<DKGraphicsDevice> device = DKGraphicsDevice::SharedInstance();
233
-        DKObject<DKCommandQueue> graphicsQueue = device->CreateCommandQueue(DKCommandQueue::Graphics| DKCommandQueue::Compute);
234
-        //DKObject<DKCommandQueue> computeQueue = device->CreateCommandQueue(DKCommandQueue::Compute);
235
-        DKObject<DKCommandQueue> computeQueue = graphicsQueue;
233
+
234
+        DKObject<DKCommandQueue> graphicsQueue;
235
+        DKObject<DKCommandQueue> computeQueue;
236
+
237
+        bool useSingleQueue = false;
238
+        if (useSingleQueue)
239
+        {
240
+            graphicsQueue = device->CreateCommandQueue(DKCommandQueue::Graphics | DKCommandQueue::Compute);
241
+            computeQueue = graphicsQueue;
242
+        }
243
+        else
244
+        {
245
+            graphicsQueue = device->CreateCommandQueue(DKCommandQueue::Graphics);
246
+            computeQueue = device->CreateCommandQueue(DKCommandQueue::Compute);
247
+        }
236 248
 
237 249
         // Geometry Initialzie
238 250
         quad->InitializeGpuResource(graphicsQueue);