Multi-threaded asset uploading with proper ordering first draft.

master
Dave Parks 2010-02-11 18:00:00 -06:00
parent bf087b74d3
commit ffcbbf4aaa
7 changed files with 61 additions and 7 deletions

View File

@ -5614,19 +5614,31 @@ void LLVolumeFace::createBinormals()
}
}
void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& transform, LLMatrix4& norm_transform)
void LLVolumeFace::appendFace(const LLVolumeFace& face, LLMatrix4& mat, LLMatrix4& norm_mat)
{
U16 offset = mVertices.size();
for (U32 i = 0; i < face.mVertices.size(); ++i)
{
VertexData v = face.mVertices[i];
v.mPosition *= mat;
v.mNormal *= norm_transform;
v.mPosition = v.mPosition*mat;
v.mNormal = v.mNormal * norm_mat;
mVertices.push_back(v);
if (offset == 0 && i == 0)
{
mExtents[0] = mExtents[1] = v.mPosition;
}
else
{
update_min_max(mExtents[0], mExtents[1], v.mPosition);
}
}
U16 offset = mIndices.size();
for (U32 i = 0; i < face.mIndices.size(); ++i)
{
mIndices.push_back(face.mIndices[i]+offset);

View File

@ -805,7 +805,7 @@ public:
void createBinormals();
void makeTriStrip();
void appendFace(const LLVolumeFace& face);
void appendFace(const LLVolumeFace& face, LLMatrix4& transform, LLMatrix4& normal_tranform);
class VertexData
{

View File

@ -55,6 +55,7 @@
#include "llstl.h"
#include "llsdserialize.h"
#include "llthread.h"
#include "llvfile.h"
//////////////////////////////////////////////////////////////////////////////
/*
@ -801,7 +802,34 @@ bool LLCurlRequest::post(const std::string& url,
bool res = addEasy(easy);
return res;
}
bool LLCurlRequest::post(const std::string& url,
const headers_t& headers,
const std::string& data,
LLCurl::ResponderPtr responder)
{
LLCurl::Easy* easy = allocEasy();
if (!easy)
{
return false;
}
easy->prepRequest(url, headers, responder);
easy->getInput().write(data.data(), data.size());
S32 bytes = easy->getInput().str().length();
easy->setopt(CURLOPT_POST, 1);
easy->setopt(CURLOPT_POSTFIELDS, (void*)NULL);
easy->setopt(CURLOPT_POSTFIELDSIZE, bytes);
easy->slist_append("Content-Type: application/octet-stream");
easy->setHeaders();
lldebugs << "POSTING: " << bytes << " bytes." << llendl;
bool res = addEasy(easy);
return res;
}
// Note: call once per frame
S32 LLCurlRequest::process()
{

View File

@ -44,6 +44,7 @@
#include <boost/intrusive_ptr.hpp>
#include <curl/curl.h> // TODO: remove dependency
#include "llassettype.h"
#include "llbuffer.h"
#include "lliopipe.h"
#include "llsd.h"
@ -213,6 +214,8 @@ public:
void get(const std::string& url, LLCurl::ResponderPtr responder);
bool getByteRange(const std::string& url, const headers_t& headers, S32 offset, S32 length, LLCurl::ResponderPtr responder);
bool post(const std::string& url, const headers_t& headers, const LLSD& data, LLCurl::ResponderPtr responder);
bool post(const std::string& url, const headers_t& headers, const std::string& data, LLCurl::ResponderPtr responder);
S32 process();
S32 getQueued();

View File

@ -194,6 +194,7 @@ namespace
fileBuffer = new U8 [fileSize];
vfile.read(fileBuffer, fileSize);
ostream.write((char*)fileBuffer, fileSize);
delete [] fileBuffer;
eos = true;
return STATUS_DONE;
}

View File

@ -1081,14 +1081,14 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex);
if (LLPipeline::sUseTriStrips)
{
for (U16 i = 0; i < num_indices; i++)
for (U32 i = 0; i < num_indices; i++)
{
*indicesp++ = vf.mTriStrip[i] + index_offset;
}
}
else
{
for (U16 i = 0; i < num_indices; i++)
for (U32 i = 0; i < num_indices; i++)
{
*indicesp++ = vf.mIndices[i] + index_offset;
}

View File

@ -100,4 +100,14 @@ void assign_defaults_and_show_upload_message(
const std::string& display_name,
std::string& description);
LLSD generate_new_resource_upload_capability_body(
LLAssetType::EType asset_type,
const std::string& name,
const std::string& desc,
LLFolderType::EType destination_folder_type,
LLInventoryType::EType inv_type,
U32 next_owner_perms,
U32 group_perms,
U32 everyone_perms);
#endif