mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
Remove OpenGL ES2 leftovers that caused crash in Vulkan
Signed-off-by: renderexpert <expert@renderconsulting.co.uk>
This commit is contained in:
committed by
Konstantin Pastbin
parent
4d702ec541
commit
01c2f02c86
@@ -306,11 +306,6 @@ Arrow3d::Arrow3d(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::TextureManage
|
|||||||
{
|
{
|
||||||
m_state.SetDepthTestEnabled(true);
|
m_state.SetDepthTestEnabled(true);
|
||||||
|
|
||||||
// Workaround for OpenGL: some devices require any texture to be set in the rendering pipeline.
|
|
||||||
auto const apiVersion = context->GetApiVersion();
|
|
||||||
if (apiVersion == dp::ApiVersion::OpenGLES3)
|
|
||||||
m_state.SetColorTexture(texMng->GetSymbolsTexture());
|
|
||||||
|
|
||||||
m_isValid = preloadedData.m_meshData.has_value();
|
m_isValid = preloadedData.m_meshData.has_value();
|
||||||
|
|
||||||
// Init arrow mesh.
|
// Init arrow mesh.
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ void BackendRenderer::AcceptMessage(ref_ptr<Message> message)
|
|||||||
drape_ptr<CirclesPackRenderData> data = make_unique_dp<CirclesPackRenderData>();
|
drape_ptr<CirclesPackRenderData> data = make_unique_dp<CirclesPackRenderData>();
|
||||||
data->m_pointsCount = msg->GetPointsCount();
|
data->m_pointsCount = msg->GetPointsCount();
|
||||||
CHECK(m_context != nullptr, ());
|
CHECK(m_context != nullptr, ());
|
||||||
CirclesPackShape::Draw(m_context, m_texMng, *data.get());
|
CirclesPackShape::Draw(m_context, *data.get());
|
||||||
m_commutator->PostMessage(ThreadsCommutator::RenderThread,
|
m_commutator->PostMessage(ThreadsCommutator::RenderThread,
|
||||||
make_unique_dp<FlushCirclesPackMessage>(
|
make_unique_dp<FlushCirclesPackMessage>(
|
||||||
std::move(data), msg->GetDestination()),
|
std::move(data), msg->GetDestination()),
|
||||||
|
|||||||
@@ -28,10 +28,9 @@ struct CirclesPackStaticVertex
|
|||||||
TNormal m_normal;
|
TNormal m_normal;
|
||||||
};
|
};
|
||||||
|
|
||||||
dp::RenderState GetCirclesPackState(ref_ptr<dp::TextureManager> texMng)
|
dp::RenderState GetCirclesPackState()
|
||||||
{
|
{
|
||||||
auto state = CreateRenderState(gpu::Program::CirclePoint, DepthLayer::OverlayLayer);
|
auto state = CreateRenderState(gpu::Program::CirclePoint, DepthLayer::OverlayLayer);
|
||||||
state.SetColorTexture(texMng->GetSymbolsTexture());
|
|
||||||
state.SetDepthTestEnabled(false);
|
state.SetDepthTestEnabled(false);
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
@@ -139,8 +138,7 @@ size_t CirclesPackHandle::GetPointsCount() const
|
|||||||
return m_buffer.size() / dp::Batcher::VertexPerQuad;
|
return m_buffer.size() / dp::Batcher::VertexPerQuad;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CirclesPackShape::Draw(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::TextureManager> texMng,
|
void CirclesPackShape::Draw(ref_ptr<dp::GraphicsContext> context, CirclesPackRenderData & data)
|
||||||
CirclesPackRenderData & data)
|
|
||||||
{
|
{
|
||||||
ASSERT_NOT_EQUAL(data.m_pointsCount, 0, ());
|
ASSERT_NOT_EQUAL(data.m_pointsCount, 0, ());
|
||||||
|
|
||||||
@@ -178,7 +176,7 @@ void CirclesPackShape::Draw(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::Te
|
|||||||
make_ref(staticVertexData.data()));
|
make_ref(staticVertexData.data()));
|
||||||
provider.InitStream(1 /* stream index */, GetCirclesPackDynamicBindingInfo(),
|
provider.InitStream(1 /* stream index */, GetCirclesPackDynamicBindingInfo(),
|
||||||
make_ref(dynamicVertexData.data()));
|
make_ref(dynamicVertexData.data()));
|
||||||
batcher.InsertListOfStrip(context, GetCirclesPackState(texMng), make_ref(&provider),
|
batcher.InsertListOfStrip(context, GetCirclesPackState(), make_ref(&provider),
|
||||||
std::move(handle), kVerticesInPoint);
|
std::move(handle), kVerticesInPoint);
|
||||||
|
|
||||||
context->Flush();
|
context->Flush();
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ private:
|
|||||||
class CirclesPackShape
|
class CirclesPackShape
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void Draw(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::TextureManager> texMng,
|
static void Draw(ref_ptr<dp::GraphicsContext> context, CirclesPackRenderData & data);
|
||||||
CirclesPackRenderData & data);
|
|
||||||
};
|
};
|
||||||
} // namespace df
|
} // namespace df
|
||||||
|
|||||||
@@ -29,8 +29,7 @@ void RouteBuilder::Build(ref_ptr<dp::GraphicsContext> context, dp::DrapeID subro
|
|||||||
ASSERT(!subroute->m_style.empty(), ());
|
ASSERT(!subroute->m_style.empty(), ());
|
||||||
for (size_t styleIndex = 0; styleIndex < subroute->m_style.size(); ++styleIndex)
|
for (size_t styleIndex = 0; styleIndex < subroute->m_style.size(); ++styleIndex)
|
||||||
{
|
{
|
||||||
subrouteData.push_back(RouteShape::CacheRoute(context, subrouteId, subroute,
|
subrouteData.push_back(RouteShape::CacheRoute(context, subrouteId, subroute, styleIndex, recacheId));
|
||||||
styleIndex, recacheId, textures));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto markersData = RouteShape::CacheMarkers(context, subrouteId, subroute, recacheId, textures);
|
auto markersData = RouteShape::CacheMarkers(context, subrouteId, subroute, recacheId, textures);
|
||||||
|
|||||||
@@ -539,8 +539,7 @@ void RouteShape::CacheRouteArrows(ref_ptr<dp::GraphicsContext> context,
|
|||||||
|
|
||||||
drape_ptr<df::SubrouteData> RouteShape::CacheRoute(ref_ptr<dp::GraphicsContext> context,
|
drape_ptr<df::SubrouteData> RouteShape::CacheRoute(ref_ptr<dp::GraphicsContext> context,
|
||||||
dp::DrapeID subrouteId, SubrouteConstPtr subroute,
|
dp::DrapeID subrouteId, SubrouteConstPtr subroute,
|
||||||
size_t styleIndex, int recacheId,
|
size_t styleIndex, int recacheId)
|
||||||
ref_ptr<dp::TextureManager> textures)
|
|
||||||
{
|
{
|
||||||
size_t startIndex;
|
size_t startIndex;
|
||||||
size_t endIndex;
|
size_t endIndex;
|
||||||
@@ -596,7 +595,6 @@ drape_ptr<df::SubrouteData> RouteShape::CacheRoute(ref_ptr<dp::GraphicsContext>
|
|||||||
|
|
||||||
auto state = CreateRenderState(subroute->m_style[styleIndex].m_pattern.m_isDashed ?
|
auto state = CreateRenderState(subroute->m_style[styleIndex].m_pattern.m_isDashed ?
|
||||||
gpu::Program::RouteDash : gpu::Program::Route, DepthLayer::GeometryLayer);
|
gpu::Program::RouteDash : gpu::Program::Route, DepthLayer::GeometryLayer);
|
||||||
state.SetColorTexture(textures->GetSymbolsTexture());
|
|
||||||
|
|
||||||
for (auto & data : geometryBufferData)
|
for (auto & data : geometryBufferData)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -208,8 +208,7 @@ public:
|
|||||||
|
|
||||||
static drape_ptr<df::SubrouteData> CacheRoute(ref_ptr<dp::GraphicsContext> context,
|
static drape_ptr<df::SubrouteData> CacheRoute(ref_ptr<dp::GraphicsContext> context,
|
||||||
dp::DrapeID subrouteId, SubrouteConstPtr subroute,
|
dp::DrapeID subrouteId, SubrouteConstPtr subroute,
|
||||||
size_t styleIndex, int recacheId,
|
size_t styleIndex, int recacheId);
|
||||||
ref_ptr<dp::TextureManager> textures);
|
|
||||||
|
|
||||||
static drape_ptr<df::SubrouteMarkersData> CacheMarkers(ref_ptr<dp::GraphicsContext> context,
|
static drape_ptr<df::SubrouteMarkersData> CacheMarkers(ref_ptr<dp::GraphicsContext> context,
|
||||||
dp::DrapeID subrouteId,
|
dp::DrapeID subrouteId,
|
||||||
|
|||||||
Reference in New Issue
Block a user