Browse Source

크래시 수정. (이미 Locked 된 버퍼를 또 Lock 하려고 했음)

Hongtae Kim 6 years ago
parent
commit
41d0a7f323
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      TestApp1/TestApp1.cpp

+ 3
- 3
TestApp1/TestApp1.cpp View File

340
                 DKMatrix4 viewMatrix;
340
                 DKMatrix4 viewMatrix;
341
             } ubo;
341
             } ubo;
342
 
342
 
343
-            DKObject<DKGpuBuffer> uboBuffer = device->CreateBuffer(sizeof(ubo), DKGpuBuffer::StorageModePrivate, DKCpuCacheModeDefault);
343
+            DKObject<DKGpuBuffer> uboBuffer = device->CreateBuffer(sizeof(ubo), DKGpuBuffer::StorageModeShared, DKCpuCacheModeDefault);
344
             if (uboBuffer)
344
             if (uboBuffer)
345
             {
345
             {
346
                 ubo.projectionMatrix = DKMatrix4::identity;
346
                 ubo.projectionMatrix = DKMatrix4::identity;
350
                 void* p = uboBuffer->Lock(0);
350
                 void* p = uboBuffer->Lock(0);
351
                 if (p)
351
                 if (p)
352
                 {
352
                 {
353
-                    memcpy(uboBuffer->Lock(0), &ubo, sizeof(ubo));
353
+                    memcpy(p, &ubo, sizeof(ubo));
354
                     uboBuffer->Unlock();
354
                     uboBuffer->Unlock();
355
 
355
 
356
-                    bindSet->SetBuffer(0, uboBuffer);
356
+                    bindSet->SetBuffer(0, uboBuffer, 0, sizeof(ubo));
357
                 }
357
                 }
358
                 else
358
                 else
359
                 {
359
                 {