VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
compute.cpp
Go to the documentation of this file.
1
// SPDX-License-Identifier: Apache-2.0
2
// Copyright 2025-2026 Arnis Lektauers
3
//
4
// Created by Arnis on 19.10.2025.
5
//
6
7
#include "
compute.h
"
8
9
#include <algorithm>
10
#include <utility>
11
12
namespace
visutwin::canvas
13
{
14
Compute::Compute
(
GraphicsDevice
*
graphicsDevice
,
const
std::shared_ptr<Shader>&
shader
, std::string
name
)
15
: _graphicsDevice(
graphicsDevice
), _shader(
shader
), _name(std::move(
name
))
16
{
17
}
18
19
void
Compute::setParameter
(
const
std::string&
name
,
Texture
* texture)
20
{
21
_textureParameters[
name
] = texture;
22
}
23
24
Texture
*
Compute::getTextureParameter
(
const
std::string&
name
)
const
25
{
26
const
auto
it = _textureParameters.find(
name
);
27
return
it != _textureParameters.end() ? it->second :
nullptr
;
28
}
29
30
void
Compute::setupDispatch
(uint32_t x, uint32_t y, uint32_t z)
31
{
32
_dispatchX = std::max(1u, x);
33
_dispatchY = std::max(1u, y);
34
_dispatchZ = std::max(1u, z);
35
}
36
}
// visutwin
visutwin::canvas::Compute::setupDispatch
void setupDispatch(uint32_t x, uint32_t y, uint32_t z)
Definition
compute.cpp:30
visutwin::canvas::Compute::shader
const std::shared_ptr< Shader > & shader() const
Definition
compute.h:28
visutwin::canvas::Compute::graphicsDevice
GraphicsDevice * graphicsDevice() const
Definition
compute.h:29
visutwin::canvas::Compute::Compute
Compute(GraphicsDevice *graphicsDevice, const std::shared_ptr< Shader > &shader, std::string name="")
Definition
compute.cpp:14
visutwin::canvas::Compute::setParameter
void setParameter(const std::string &name, Texture *texture)
Definition
compute.cpp:19
visutwin::canvas::Compute::getTextureParameter
Texture * getTextureParameter(const std::string &name) const
Definition
compute.cpp:24
visutwin::canvas::Compute::name
const std::string & name() const
Definition
compute.h:30
visutwin::canvas::GraphicsDevice
Abstract GPU interface for resource creation, state management, and draw submission.
Definition
graphicsDevice.h:239
visutwin::canvas::Texture
GPU texture resource supporting 2D, cubemap, volume, and array formats with mipmap management.
Definition
texture.h:57
compute.h
visutwin::canvas
Definition
eventHandler.cpp:9
platform
graphics
compute.cpp
Generated by
1.16.1