Remove the usage of Texture::setImage that uses FaceOffsets
PiperOrigin-RevId: 926092842 Change-Id: I8010804c6dda89d41ebaf650af776505e5c5ed34
This commit is contained in:
committed by
Copybara-Service
parent
4d70b18048
commit
36f5c4899c
@@ -13,7 +13,7 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
set(MUJOCO_DEP_VERSION_filament
|
set(MUJOCO_DEP_VERSION_filament
|
||||||
06793c4a80dd467025b2db1b3b7ea63bf1a865bb
|
da22932b543b59810caf490d7f9e8859ec3fe204
|
||||||
CACHE STRING "Tag/version of `filament` to be fetched."
|
CACHE STRING "Tag/version of `filament` to be fetched."
|
||||||
)
|
)
|
||||||
mark_as_advanced(MUJOCO_DEP_VERSION_filament)
|
mark_as_advanced(MUJOCO_DEP_VERSION_filament)
|
||||||
|
|||||||
@@ -200,7 +200,6 @@ void Texture::Upload(const mjrTextureData& data) {
|
|||||||
} else {
|
} else {
|
||||||
const int face_size = config_.width * GetFaceHeight(config_) * num_channels;
|
const int face_size = config_.width * GetFaceHeight(config_) * num_channels;
|
||||||
const int num_bytes = face_size * kNumFacesPerCube;
|
const int num_bytes = face_size * kNumFacesPerCube;
|
||||||
filament::Texture::FaceOffsets offsets(face_size);
|
|
||||||
|
|
||||||
if (config_.width == config_.height) {
|
if (config_.width == config_.height) {
|
||||||
uint8_t* copy = new uint8_t[num_bytes];
|
uint8_t* copy = new uint8_t[num_bytes];
|
||||||
@@ -212,7 +211,9 @@ void Texture::Upload(const mjrTextureData& data) {
|
|||||||
}
|
}
|
||||||
filament::Texture::PixelBufferDescriptor desc(copy, num_bytes, format,
|
filament::Texture::PixelBufferDescriptor desc(copy, num_bytes, format,
|
||||||
type, release_callback);
|
type, release_callback);
|
||||||
texture_->setImage(*engine_, 0, std::move(desc), offsets);
|
texture_->setImage(*engine_, /*level=*/0, /*xoffset=*/0, /*yoffset=*/0,
|
||||||
|
/*zoffset=*/0, config_.width, GetFaceHeight(config_),
|
||||||
|
/*depth=*/6, std::move(desc));
|
||||||
ReleaseData();
|
ReleaseData();
|
||||||
} else {
|
} else {
|
||||||
if (num_bytes != data.nbytes) {
|
if (num_bytes != data.nbytes) {
|
||||||
@@ -223,7 +224,9 @@ void Texture::Upload(const mjrTextureData& data) {
|
|||||||
};
|
};
|
||||||
filament::Texture::PixelBufferDescriptor desc(
|
filament::Texture::PixelBufferDescriptor desc(
|
||||||
data.bytes, data.nbytes, format, type, callback, this);
|
data.bytes, data.nbytes, format, type, callback, this);
|
||||||
texture_->setImage(*engine_, 0, std::move(desc), offsets);
|
texture_->setImage(*engine_, /*level=*/0, /*xoffset=*/0, /*yoffset=*/0,
|
||||||
|
/*zoffset=*/0, config_.width, GetFaceHeight(config_),
|
||||||
|
/*depth=*/6, std::move(desc));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user