Lines Matching defs:rsc

24 Mesh::Mesh(Context *rsc) : ObjectBase(rsc) {
38 Mesh::Mesh(Context *rsc,
40 uint32_t primitivesCount) : ObjectBase(rsc) {
81 void Mesh::serialize(Context *rsc, OStream *stream) const {
91 mHal.state.vertexBuffers[vCount]->serialize(rsc, stream);
101 mHal.state.indexBuffers[pCount]->serialize(rsc, stream);
108 Mesh *Mesh::createFromStream(Context *rsc, IStream *stream) {
125 Allocation *vertexAlloc = Allocation::createFromStream(rsc, stream);
144 Allocation *indexAlloc = Allocation::createFromStream(rsc, stream);
150 Mesh *mesh = new Mesh(rsc, vertexBuffersCount, primitivesCount);
170 mesh->uploadAll(rsc);
175 void Mesh::render(Context *rsc) const {
177 renderPrimitive(rsc, ct);
181 void Mesh::renderPrimitive(Context *rsc, uint32_t primIndex) const {
188 renderPrimitiveRange(rsc, primIndex, 0, mHal.state.indexBuffers[primIndex]->getType()->getDimX());
192 renderPrimitiveRange(rsc, primIndex, 0, mHal.state.vertexBuffers[0]->getType()->getDimX());
195 void Mesh::renderPrimitiveRange(Context *rsc, uint32_t primIndex, uint32_t start, uint32_t len) const {
204 void Mesh::uploadAll(Context *rsc) {
207 rsc->mHal.funcs.allocation.markDirty(rsc, mHal.state.vertexBuffers[ct]);
213 rsc->mHal.funcs.allocation.markDirty(rsc, mHal.state.indexBuffers[ct]);
218 void Mesh::computeBBox(Context *rsc) {
235 const uint8_t *bp = (const uint8_t *)rsc->mHal.funcs.allocation.lock1D(
236 rsc, posAlloc);
265 rsc->mHal.funcs.allocation.unlock1D(rsc, posAlloc);
272 RsMesh rsi_MeshCreate(Context *rsc,
277 Mesh *sm = new Mesh(rsc, vtxCount, idxCount);