Hongtae Kim 5 vuotta sitten
vanhempi
commit
1d9116b13a
1 muutettua tiedostoa jossa 4 lisäystä ja 0 poistoa
  1. 4
    0
      Samples/Texture/Texture.cpp

+ 4
- 0
Samples/Texture/Texture.cpp Näytä tiedosto

@@ -50,6 +50,7 @@ public:
50 50
                 cb->Commit();
51 51
 
52 52
                 DKLog("Texture created!");
53
+                return tex;
53 54
             }
54 55
         }
55 56
         return nullptr;
@@ -101,9 +102,11 @@ public:
101 102
 
102 103
 		DKObject<DKGpuBuffer> vertexBuffer = device->CreateBuffer(vertexBufferSize, DKGpuBuffer::StorageModeShared, DKCpuCacheModeReadWrite);
103 104
 		memcpy(vertexBuffer->Contents(), vertexData, vertexBufferSize);
105
+        vertexBuffer->Flush();
104 106
 
105 107
 		DKObject<DKGpuBuffer> indexBuffer = device->CreateBuffer(indexBufferSize, DKGpuBuffer::StorageModeShared, DKCpuCacheModeReadWrite);
106 108
 		memcpy(indexBuffer->Contents(), indexData, indexBufferSize);
109
+        indexBuffer->Flush();
107 110
 
108 111
 		DKRenderPipelineDescriptor pipelineDescriptor;
109 112
 		pipelineDescriptor.vertexFunction = vertShaderFunction;
@@ -163,6 +166,7 @@ public:
163 166
 
164 167
                 memcpy(uboBuffer->Contents(), &ubo, sizeof(ubo));
165 168
                 bindSet->SetBuffer(0, uboBuffer, 0, sizeof(ubo));
169
+                uboBuffer->Flush();
166 170
             }
167 171
         }
168 172