Skip to content

Commit 3b0d163

Browse files
authored
Merge branch 'dev' into camera-refactor
2 parents 1a4924e + 26a9590 commit 3b0d163

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

axmol/3d/Bundle3D.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ bool Bundle3D::loadMeshDatasJson(MeshDatas& meshdatas)
739739
auto&& mesh_data_vertex_array = mesh_data[VERTICES].get_array();
740740
for (auto&& vertex_val : mesh_data_vertex_array)
741741
{
742-
meshData->vertex.emplace_back(static_cast<double>(vertex_val));
742+
meshData->vertex.emplace_back(static_cast<float>(vertex_val.get_double().value()));
743743
}
744744
meshData->vertexSizeInFloat = meshData->vertex.size();
745745
// mesh part

axmol/rhi/VertexLayout.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ void VertexLayoutDesc::addAttrib(const VertexInputDesc* desc,
158158
else
159159
_strides[1] += static_cast<uint32_t>(sizeInBytes);
160160

161-
_bindings.emplace_back(desc->semantic.name, desc->location, format, offset, needToBeNormallized, instanceStepRate);
161+
_bindings.emplace_back(desc->semantic.name, desc->location, format, static_cast<unsigned int>(offset),
162+
needToBeNormallized, instanceStepRate);
162163
}
163164

164165
} // namespace ax::rhi

axmol/rhi/d3d11/Texture11.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,10 @@ void TextureImpl::updateCompressedSubData(int xoffset,
228228
box.bottom = static_cast<UINT>(yoffset + height);
229229
box.back = 1;
230230

231-
auto context = static_cast<DriverImpl*>(axdrv)->getContext();
232-
UINT subresource = D3D11CalcSubresource(level, layerIndex, _desc.mipLevels);
233-
context->UpdateSubresource(_nativeTexture, subresource, &box, data, 0, 0);
231+
auto context = static_cast<DriverImpl*>(axdrv)->getContext();
232+
UINT subresource = D3D11CalcSubresource(level, layerIndex, _desc.mipLevels);
233+
const auto rowPitch = RHIUtils::computeRowPitch(_desc.pixelFormat, width);
234+
context->UpdateSubresource(_nativeTexture, subresource, &box, data, rowPitch, 0);
234235

235236
if (shouldGenMipmaps(level))
236237
generateMipmaps(context);

0 commit comments

Comments
 (0)