Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

be more explicit #16

Merged
merged 2 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/openmw/mwrender/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ namespace MWRender
for (auto& r : requests)
{
mData->at(0) = r.rect;
mData->at(1) = { r.center.x, r.center.y, 0, 0 };
mData->at(1) = vsg::vec4(r.center.x, r.center.y, 0, 0);
visitor.apply(*r.bds);

#include <files/shaders/comp/fogofwar/workgroupsize.glsl>
Expand Down Expand Up @@ -427,8 +427,8 @@ namespace MWRender
return d;
}
auto sceneData = std::make_unique<View::Scene>();
sceneData->value().lightDiffuse = {0.7, 0.7, 0.7, 1};
sceneData->value().ambient = {0.3, 0.3, 0.3, 1};
sceneData->value().lightDiffuse = vsg::vec4(0.7, 0.7, 0.7, 1);
sceneData->value().ambient = vsg::vec4(0.3, 0.3, 0.3, 1);

auto descriptors = View::createLightingDescriptors(mLightData, false);
descriptors.emplace_back(View::dummyEnvMap());
Expand Down
8 changes: 4 additions & 4 deletions apps/openmw/mwrender/preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ namespace MWRender
};

auto& sceneData = mSceneData->value();
sceneData.lightDiffuse = { Fallback::Map::getFloat("Inventory_DirectionalDiffuseR"),
sceneData.lightDiffuse = vsg::vec4(Fallback::Map::getFloat("Inventory_DirectionalDiffuseR"),
Fallback::Map::getFloat("Inventory_DirectionalDiffuseG"),
Fallback::Map::getFloat("Inventory_DirectionalDiffuseB"), 1 };
sceneData.ambient = { Fallback::Map::getFloat("Inventory_DirectionalAmbientR"),
Fallback::Map::getFloat("Inventory_DirectionalDiffuseB"), 1 );
sceneData.ambient = vsg::vec4(Fallback::Map::getFloat("Inventory_DirectionalAmbientR"),
Fallback::Map::getFloat("Inventory_DirectionalAmbientG"),
Fallback::Map::getFloat("Inventory_DirectionalAmbientB"), 1 };
Fallback::Map::getFloat("Inventory_DirectionalAmbientB"), 1 );

vsg::ref_ptr<vsg::RenderGraph> renderGraph;
std::tie(renderGraph, mTexture) = Render::createRenderTexture(ctx, samples, extent);
Expand Down
2 changes: 1 addition & 1 deletion apps/openmw/mwrender/weather.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ namespace MWRender
share(sampler, textureOptions);
auto descriptorImage = vsg::DescriptorImage::create(sampler, flashTex);

sunFlashMaterial.value().emissive = { 1, 1, 1, 1 };
sunFlashMaterial.value().emissive = vsg::vec4(1, 1, 1, 1 );
auto bds = vsg::BindDescriptorSet::create(VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline->pipeline->layout,
Pipeline::TEXTURE_SET, vsg::Descriptors{ descriptorImage, sunFlashMaterial.descriptor() });
sg->stateCommands = { pipeline, bds };
Expand Down
12 changes: 6 additions & 6 deletions components/esm3terrain/storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ namespace ESMTerrain
const ESM::Land::LandData* data = land ? land->getData(ESM::Land::DATA_VCLR) : nullptr;
if (data)
{
color = { data->mColours[col * ESM::Land::LAND_SIZE * 3 + row * 3],
color = vsg::ubvec4(data->mColours[col * ESM::Land::LAND_SIZE * 3 + row * 3],
data->mColours[col * ESM::Land::LAND_SIZE * 3 + row * 3 + 1],
data->mColours[col * ESM::Land::LAND_SIZE * 3 + row * 3 + 2], 0xff };
data->mColours[col * ESM::Land::LAND_SIZE * 3 + row * 3 + 2], 0xff );
}
else
{
color = { 0xff, 0xff, 0xff, 0xff };
color = vsg::ubvec4(0xff, 0xff, 0xff, 0xff);
}
}

Expand Down Expand Up @@ -210,11 +210,11 @@ namespace ESMTerrain

if (colourData)
{
color = { colourData->mColours[srcArrayIndex], colourData->mColours[srcArrayIndex + 1],
colourData->mColours[srcArrayIndex + 2], 0xff };
color = vsg::ubvec4(colourData->mColours[srcArrayIndex], colourData->mColours[srcArrayIndex + 1],
colourData->mColours[srcArrayIndex + 2], 0xff);
}
else
color = { 0xff, 0xff, 0xff, 0xff };
color = vsg::ubvec4(0xff, 0xff, 0xff, 0xff);
//if (alteration)
//adjustColor(col, row, heightData, color); // Does nothing by default, override in OpenMW-CS

Expand Down
2 changes: 1 addition & 1 deletion components/mwanimation/color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace MWAnim
// we can
float targetBrightnessIncreaseFactor = minLuminance / relativeLuminance;
if (col.r == 0.f && col.g == 0.f && col.b == 0.f)
col = { minLuminance, minLuminance, minLuminance, col.a };
col = vsg::vec4(minLuminance, minLuminance, minLuminance, col.a);
else
col *= targetBrightnessIncreaseFactor;
}
Expand Down
5 changes: 3 additions & 2 deletions components/render/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ namespace Render
graph = vsg::CommandGraph::create(mHeadless->getOrCreateDevice(), mHeadless->getQueueFamily());
//int maxSlot = 1 + maxDescriptorSet;
int maxSlot = 4; // At the moment, reducing maxSlot won't help because vsg::updateViewer will update the maxSlot for all command graphs.
graph->recordTraversal = vsg::RecordTraversal::create(nullptr, maxSlot);
graph->recordTraversal = new vsg::RecordTraversal;
graph->maxSlot = maxSlot;
return graph;
}
Expand All @@ -199,7 +199,8 @@ namespace Render
graph = vsg::SecondaryCommandGraph::create(mHeadless->getOrCreateDevice(), mHeadless->getQueueFamily());
graph->framebuffer = inherit_framebuffer->framebuffer;
}
graph->recordTraversal = vsg::RecordTraversal::create(nullptr, maxDescriptorSet + 1);
graph->recordTraversal = new vsg::RecordTraversal;
graph->maxSlot = maxDescriptorSet + 1;
return graph;
}

Expand Down
2 changes: 1 addition & 1 deletion components/view/collectlights.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace View
void traverse(vsg::ConstVisitor& visitor) const override {}

void compile(vsg::Context&) override {}
void pack() override;
void pack();
};
}

Expand Down
4 changes: 2 additions & 2 deletions components/vsgadapters/nif/particle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@ namespace vsgAdapters
if (active->value(time) && emitterVisible())
{
data.emitMatrix = calculateEmitMatrix();
data.emitCount = { calculateEmitCount(dt), 0, 0, 0 };
data.emitCount = vsg::ivec4(calculateEmitCount(dt), 0, 0, 0 );
}
else
data.emitCount = {};
data.emitCount = vsg::ivec4();
}

void ParticleSystem::link(Anim::Context& ctx, vsg::Object&)
Expand Down
4 changes: 2 additions & 2 deletions components/vsgutil/projection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ namespace vsgUtil
auto state = record.getState();
auto prev_projection = state->projectionMatrixStack.top();
auto modelviewMatrix = state->modelviewMatrixStack.top();
record.setProjectionAndViewMatrix(projection->transform(), modelviewMatrix);
state->setProjectionAndViewMatrix(projection->transform(), modelviewMatrix);
traverse(record);
record.setProjectionAndViewMatrix(prev_projection, modelviewMatrix);
state->setProjectionAndViewMatrix(prev_projection, modelviewMatrix);
}
};

Expand Down
Loading