36 std::string vertex_shader =
"texture.vert.spv";
37 std::string fragment_shader =
"texture.frag.spv";
38 std::string default_texture_binding =
"texSampler";
59 const void* initial_pixel_data =
nullptr);
69 [[nodiscard]] uint32_t
get_width()
const {
return m_width; }
70 [[nodiscard]] uint32_t
get_height()
const {
return m_height; }
81 [[nodiscard]] std::shared_ptr<Core::VKImage>
get_texture()
const {
return m_gpu_texture; }
82 [[nodiscard]]
bool has_texture()
const {
return m_gpu_texture !=
nullptr; }
86 return m_texture_processor;
96 void set_pixel_data(
const void* data,
size_t size);
102 void mark_pixels_dirty();
115 void set_position(
float x,
float y);
124 void set_scale(
float width,
float height);
132 void set_rotation(
float angle_radians);
135 [[nodiscard]] glm::vec2
get_scale()
const {
return m_scale; }
154 void set_custom_vertices(
const std::vector<QuadVertex>& vertices);
160 void use_default_quad();
162 [[nodiscard]]
const std::vector<uint8_t>&
get_pixel_data()
const {
return m_pixel_data; }
172 void setup_rendering(
const RenderConfig& config);
176 return m_render_processor;
191 bool m_texture_dirty =
true;
194 glm::vec2 m_position { 0.0F, 0.0F };
195 glm::vec2 m_scale { 1.0F, 1.0F };
196 float m_rotation { 0.0F };
197 bool m_geometry_dirty =
true;
201 bool m_uses_custom_vertices =
false;
208 void generate_default_quad();
209 void generate_quad_with_transform();
210 static size_t calculate_quad_vertex_size();
static MayaFlux::Nodes::ProcessingToken token
std::shared_ptr< TextureProcessor > get_texture_processor() const
uint32_t get_width() const
std::shared_ptr< TextureProcessor > m_texture_processor
std::shared_ptr< Core::VKImage > m_gpu_texture
Portal::Graphics::ImageFormat get_format() const
std::vector< uint8_t > m_pixel_data
void mark_texture_dirty()
std::shared_ptr< RenderProcessor > m_render_processor
bool is_texture_dirty() const
float get_rotation() const
~TextureBuffer() override=default
glm::vec2 get_scale() const
uint32_t get_height() const
glm::vec2 get_position() const
const std::vector< uint8_t > & get_pixel_data() const
Portal::Graphics::ImageFormat m_format
std::shared_ptr< Core::VKImage > get_texture() const
Get GPU texture image Suitable for binding to shaders via RenderProcessor::bind_texture()
std::vector< uint8_t > m_vertex_bytes
std::shared_ptr< RenderProcessor > get_render_processor() const
A hybrid buffer managing both a textured quad geometry and its pixel data.
Internal processor: handles CPU→GPU transfers for TextureBuffer.
Vulkan-backed buffer wrapper used in processing chains.
ProcessingToken
Bitfield enum defining processing characteristics and backend requirements for buffer operations.
ImageFormat
User-friendly image format enum.
PrimitiveTopology
Vertex assembly primitive topology.
Use custom vertex geometry instead of default quad.
std::vector< std::pair< std::string, std::shared_ptr< Core::VKImage > > > additional_textures
std::shared_ptr< Core::Window > target_window