Further shader compilation development.

This commit is contained in:
zy4n
2025-03-22 17:40:08 +01:00
parent e01b8c2e09
commit 510398423a
45 changed files with 1567 additions and 1097 deletions

View File

@@ -1,6 +1,6 @@
#include "rendering/batch_renderers/mesh_batch_renderer.hpp"
#include "shader_program/uniforms/mesh_uniforms.hpp"
#include "shading/uniforms/mesh_uniforms.hpp"
#include "util/unroll_bool_template.hpp"
#include "util/logger.hpp" // TODO remove
#include <bitset> // TODOE remove
@@ -65,7 +65,7 @@ std::optional<mesh_batch_renderer::id_type> mesh_batch_renderer::add(
ztu::logger::debug("vertex_comps: %", std::bitset<32>{ static_cast<unsigned long long>(static_cast<int>(vertex_comps)) });
ztu::logger::debug("material_comps: %", std::bitset<32>{ static_cast<unsigned long long>(static_cast<int>(material_comps)) });
ztu::logger::debug("lit reqs: %", std::bitset<32>{ static_cast<unsigned long long>(static_cast<int>(shader_program::features::mesh::lit.uniforms)) });
ztu::logger::debug("lit reqs: %", std::bitset<32>{ static_cast<unsigned long long>(static_cast<int>(shading::features::mesh::lit.uniforms)) });
for (std::size_t i{}; i != requirements::mesh::all.size(); ++i)
@@ -198,7 +198,7 @@ void render_mesh_batch(
ztu::logger::debug("textured: % alpha: % lit: %", Textured, Alpha, Lit);*/
namespace uniforms = shader_program::uniforms::mesh;
namespace uniforms = shading::uniforms::mesh;
for (std::size_t i{}; i != meshes.size(); ++i)
{
@@ -254,7 +254,7 @@ void mesh_batch_renderer::render(
const lighting_setup& lights
) {
namespace uniforms = shader_program::uniforms::mesh;
namespace uniforms = shading::uniforms::mesh;
const auto render_mode_index = static_cast<int>(render_mode);

View File

@@ -3,7 +3,7 @@
#include <algorithm>
#include "rendering/requirements/point_cloud_requirements.hpp"
#include "shader_program/uniforms/point_cloud_uniforms.hpp"
#include "shading/uniforms/point_cloud_uniforms.hpp"
#include "util/unroll_bool_template.hpp"
namespace rendering
@@ -149,7 +149,7 @@ void render_point_cloud_batch(
const auto point_clouds = batch.point_clouds();
const auto transforms = batch.transforms();
namespace uniforms = shader_program::uniforms::point_cloud;
namespace uniforms = shading::uniforms::point_cloud;
for (std::size_t i{}; i != point_clouds.size(); ++i)
{
@@ -194,7 +194,7 @@ void point_cloud_batch_renderer::render(
const lighting_setup&
) {
namespace uniforms = shader_program::uniforms::point_cloud;
namespace uniforms = shading::uniforms::point_cloud;
const auto render_mode_index = static_cast<std::size_t>(render_mode);

View File

@@ -11,15 +11,15 @@ void mesh_lookup::add(
) {
m_shader_program_lookup.add(
shader_program_handle,
shader_program::attributes::mesh::all,
shader_program::uniforms::mesh::all
shading::attributes::mesh::all,
shading::uniforms::mesh::all
);
}
std::optional<zgl::shader_program_handle> mesh_lookup::find(
requirements::mesh::flags requirements
) const {
auto capability = shader_program::features::mesh::type{};
auto capability = shading::features::mesh::type{};
auto index = std::size_t{};
@@ -30,7 +30,7 @@ std::optional<zgl::shader_program_handle> mesh_lookup::find(
if (requirement_flags & 1)
{
const auto shader_requirements_index = requirements::mesh::all[index].shader_program_requirement_index;
const auto& [ attributes, uniforms ] = shader_program::features::mesh::all[shader_requirements_index];
const auto& [ attributes, uniforms ] = shading::features::mesh::all[shader_requirements_index];
capability.attributes |= attributes;
capability.uniforms |= uniforms;
}
@@ -47,7 +47,7 @@ std::optional<zgl::shader_program_handle> mesh_lookup::find(
return m_shader_program_lookup.find(
static_cast<ztu::u32>(capability.attributes),
static_cast<ztu::u32>(capability.uniforms),
shader_program::attributes::mesh::all
shading::attributes::mesh::all
);
}

View File

@@ -8,8 +8,8 @@ void point_cloud_lookup::add(
) {
m_program_lookup.add(
shader_program_handle,
shader_program::attributes::point_cloud::all,
shader_program::uniforms::point_cloud::all
shading::attributes::point_cloud::all,
shading::uniforms::point_cloud::all
);
}
@@ -17,7 +17,7 @@ void point_cloud_lookup::add(
std::optional<zgl::shader_program_handle> point_cloud_lookup::find(
requirements::point_cloud::flags requirements
) const {
auto capability = shader_program::features::point_cloud::type{};
auto capability = shading::features::point_cloud::type{};
auto index = std::size_t{};
@@ -28,7 +28,7 @@ std::optional<zgl::shader_program_handle> point_cloud_lookup::find(
if (requirement_flags & 1)
{
const auto shader_requirements_index = requirements::point_cloud::all[index].shader_program_requirement_index;
const auto& [ attributes, uniforms ] = shader_program::features::point_cloud::all[shader_requirements_index];
const auto& [ attributes, uniforms ] = shading::features::point_cloud::all[shader_requirements_index];
capability.attributes |= attributes;
capability.uniforms |= uniforms;
}
@@ -40,7 +40,7 @@ std::optional<zgl::shader_program_handle> point_cloud_lookup::find(
return m_program_lookup.find(
static_cast<ztu::u32>(capability.attributes),
static_cast<ztu::u32>(capability.uniforms),
shader_program::attributes::point_cloud::all
shading::attributes::point_cloud::all
);
}