Rename types to conform to mjr naming conventions.
PiperOrigin-RevId: 904456797 Change-Id: I759b1430a43c7072ed9750d084679d02f0c9cb6e
This commit is contained in:
committed by
Copybara-Service
parent
4345a2a09f
commit
3d13d43c9c
@@ -130,8 +130,8 @@ void MjrFilamentRenderer::ReadPixels(mjrRect viewport, unsigned char* rgb,
|
||||
render_requests_[1].height = viewport.height;
|
||||
|
||||
if (rgb) {
|
||||
RenderTargetConfig config;
|
||||
DefaultRenderTargetConfig(&config);
|
||||
mjrRenderTargetConfig config;
|
||||
mjr_defaultRenderTargetConfig(&config);
|
||||
config.color_format = mjPIXEL_FORMAT_RGB8;
|
||||
config.depth_format = mjPIXEL_FORMAT_DEPTH32F;
|
||||
auto target = std::make_unique<RenderTarget>(GetEngine(), config);
|
||||
@@ -154,8 +154,8 @@ void MjrFilamentRenderer::ReadPixels(mjrRect viewport, unsigned char* rgb,
|
||||
}
|
||||
|
||||
if (depth) {
|
||||
RenderTargetConfig config;
|
||||
DefaultRenderTargetConfig(&config);
|
||||
mjrRenderTargetConfig config;
|
||||
mjr_defaultRenderTargetConfig(&config);
|
||||
config.color_format = mjPIXEL_FORMAT_R32F;
|
||||
config.depth_format = mjPIXEL_FORMAT_DEPTH32F;
|
||||
auto target = std::make_unique<RenderTarget>(GetEngine(), config);
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
|
||||
namespace mujoco {
|
||||
|
||||
void DefaultRenderTargetConfig(RenderTargetConfig* config) {
|
||||
void mjr_defaultRenderTargetConfig(mjrRenderTargetConfig* config) {
|
||||
config->color_format = mjPIXEL_FORMAT_RGBA8;
|
||||
config->depth_format = mjPIXEL_FORMAT_DEPTH32F;
|
||||
}
|
||||
|
||||
RenderTarget::RenderTarget(filament::Engine* engine,
|
||||
const RenderTargetConfig& config)
|
||||
const mjrRenderTargetConfig& config)
|
||||
: engine_(engine), config_(config) {}
|
||||
|
||||
RenderTarget::~RenderTarget() noexcept {
|
||||
|
||||
@@ -26,20 +26,20 @@
|
||||
namespace mujoco {
|
||||
|
||||
// Defines the basic properties of a render target.
|
||||
struct RenderTargetConfig {
|
||||
struct mjrRenderTargetConfig {
|
||||
mjrPixelFormat color_format;
|
||||
mjrPixelFormat depth_format;
|
||||
};
|
||||
|
||||
// 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.
|
||||
class RenderTarget {
|
||||
public:
|
||||
// Defines the types of textures to create for the color and depth
|
||||
// attachments.
|
||||
RenderTarget(filament::Engine* engine, const RenderTargetConfig& config);
|
||||
RenderTarget(filament::Engine* engine, const mjrRenderTargetConfig& config);
|
||||
~RenderTarget() noexcept;
|
||||
|
||||
RenderTarget(const RenderTarget&) = delete;
|
||||
@@ -66,7 +66,7 @@ class RenderTarget {
|
||||
void Destroy();
|
||||
|
||||
filament::Engine* engine_ = nullptr;
|
||||
RenderTargetConfig config_;
|
||||
mjrRenderTargetConfig config_;
|
||||
filament::RenderTarget* render_target_ = nullptr;
|
||||
std::unique_ptr<Texture> color_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
|
||||
// renderables.
|
||||
while (reflect_targets_.size() < reflectives_.size()) {
|
||||
RenderTargetConfig config;
|
||||
DefaultRenderTargetConfig(&config);
|
||||
mjrRenderTargetConfig config;
|
||||
mjr_defaultRenderTargetConfig(&config);
|
||||
|
||||
config.color_format = mjPIXEL_FORMAT_RGBA8;
|
||||
config.depth_format = mjPIXEL_FORMAT_DEPTH32F;
|
||||
|
||||
Reference in New Issue
Block a user