Rename types to conform to mjr naming conventions.

PiperOrigin-RevId: 904456797
Change-Id: I759b1430a43c7072ed9750d084679d02f0c9cb6e
This commit is contained in:
Haroon Qureshi
2026-04-23 07:53:08 -07:00
committed by Copybara-Service
parent 4345a2a09f
commit 3d13d43c9c
4 changed files with 12 additions and 12 deletions
@@ -130,8 +130,8 @@ void MjrFilamentRenderer::ReadPixels(mjrRect viewport, unsigned char* rgb,
render_requests_[1].height = viewport.height; render_requests_[1].height = viewport.height;
if (rgb) { if (rgb) {
RenderTargetConfig config; mjrRenderTargetConfig config;
DefaultRenderTargetConfig(&config); mjr_defaultRenderTargetConfig(&config);
config.color_format = mjPIXEL_FORMAT_RGB8; config.color_format = mjPIXEL_FORMAT_RGB8;
config.depth_format = mjPIXEL_FORMAT_DEPTH32F; config.depth_format = mjPIXEL_FORMAT_DEPTH32F;
auto target = std::make_unique<RenderTarget>(GetEngine(), config); auto target = std::make_unique<RenderTarget>(GetEngine(), config);
@@ -154,8 +154,8 @@ void MjrFilamentRenderer::ReadPixels(mjrRect viewport, unsigned char* rgb,
} }
if (depth) { if (depth) {
RenderTargetConfig config; mjrRenderTargetConfig config;
DefaultRenderTargetConfig(&config); mjr_defaultRenderTargetConfig(&config);
config.color_format = mjPIXEL_FORMAT_R32F; config.color_format = mjPIXEL_FORMAT_R32F;
config.depth_format = mjPIXEL_FORMAT_DEPTH32F; config.depth_format = mjPIXEL_FORMAT_DEPTH32F;
auto target = std::make_unique<RenderTarget>(GetEngine(), config); auto target = std::make_unique<RenderTarget>(GetEngine(), config);
@@ -30,13 +30,13 @@
namespace mujoco { namespace mujoco {
void DefaultRenderTargetConfig(RenderTargetConfig* config) { void mjr_defaultRenderTargetConfig(mjrRenderTargetConfig* config) {
config->color_format = mjPIXEL_FORMAT_RGBA8; config->color_format = mjPIXEL_FORMAT_RGBA8;
config->depth_format = mjPIXEL_FORMAT_DEPTH32F; config->depth_format = mjPIXEL_FORMAT_DEPTH32F;
} }
RenderTarget::RenderTarget(filament::Engine* engine, RenderTarget::RenderTarget(filament::Engine* engine,
const RenderTargetConfig& config) const mjrRenderTargetConfig& config)
: engine_(engine), config_(config) {} : engine_(engine), config_(config) {}
RenderTarget::~RenderTarget() noexcept { RenderTarget::~RenderTarget() noexcept {
@@ -26,20 +26,20 @@
namespace mujoco { namespace mujoco {
// Defines the basic properties of a render target. // Defines the basic properties of a render target.
struct RenderTargetConfig { struct mjrRenderTargetConfig {
mjrPixelFormat color_format; mjrPixelFormat color_format;
mjrPixelFormat depth_format; mjrPixelFormat depth_format;
}; };
// Initializes the RenderTargetConfig to default values. // Initializes the RenderTargetConfig to default values.
void DefaultRenderTargetConfig(RenderTargetConfig* config); void mjr_defaultRenderTargetConfig(mjrRenderTargetConfig* config);
// Manages a filament RenderTarget and the textures which are bound to it. // Manages a filament RenderTarget and the textures which are bound to it.
class RenderTarget { class RenderTarget {
public: public:
// Defines the types of textures to create for the color and depth // Defines the types of textures to create for the color and depth
// attachments. // attachments.
RenderTarget(filament::Engine* engine, const RenderTargetConfig& config); RenderTarget(filament::Engine* engine, const mjrRenderTargetConfig& config);
~RenderTarget() noexcept; ~RenderTarget() noexcept;
RenderTarget(const RenderTarget&) = delete; RenderTarget(const RenderTarget&) = delete;
@@ -66,7 +66,7 @@ class RenderTarget {
void Destroy(); void Destroy();
filament::Engine* engine_ = nullptr; filament::Engine* engine_ = nullptr;
RenderTargetConfig config_; mjrRenderTargetConfig config_;
filament::RenderTarget* render_target_ = nullptr; filament::RenderTarget* render_target_ = nullptr;
std::unique_ptr<Texture> color_texture_ = nullptr; std::unique_ptr<Texture> color_texture_ = nullptr;
std::unique_ptr<Texture> depth_texture_ = nullptr; std::unique_ptr<Texture> depth_texture_ = nullptr;
@@ -286,8 +286,8 @@ void SceneView::AddReflectiveRenderable(Renderable* renderable) {
// Ensure we have the same number of render targets as we do reflective // Ensure we have the same number of render targets as we do reflective
// renderables. // renderables.
while (reflect_targets_.size() < reflectives_.size()) { while (reflect_targets_.size() < reflectives_.size()) {
RenderTargetConfig config; mjrRenderTargetConfig config;
DefaultRenderTargetConfig(&config); mjr_defaultRenderTargetConfig(&config);
config.color_format = mjPIXEL_FORMAT_RGBA8; config.color_format = mjPIXEL_FORMAT_RGBA8;
config.depth_format = mjPIXEL_FORMAT_DEPTH32F; config.depth_format = mjPIXEL_FORMAT_DEPTH32F;