Lines Matching refs:lod
93 uint32_t lod, RsAllocationCubemapFace face) { in GetOffsetPtr() argument
94 uint8_t *ptr = (uint8_t *)alloc->mHal.drvState.lod[lod].mallocPtr; in GetOffsetPtr()
96 ptr += zoff * alloc->mHal.drvState.lod[lod].dimY * alloc->mHal.drvState.lod[lod].stride; in GetOffsetPtr()
97 ptr += yoff * alloc->mHal.drvState.lod[lod].stride; in GetOffsetPtr()
104 uint32_t xoff, uint32_t yoff, uint32_t lod, in Update2DTexture() argument
116 RSD_CALL_GL(glTexSubImage2D, t, lod, xoff, yoff, w, h, drv->glFormat, drv->glType, ptr); in Update2DTexture()
135 for (uint32_t lod = 0; lod < alloc->mHal.state.type->getLODCount(); lod++) { in Upload2DTexture() local
136 const uint8_t *p = GetOffsetPtr(alloc, 0, 0, 0, lod, (RsAllocationCubemapFace)face); in Upload2DTexture()
144 RSD_CALL_GL(glTexImage2D, t, lod, drv->glFormat, in Upload2DTexture()
145 alloc->mHal.state.type->getLODDimX(lod), in Upload2DTexture()
146 alloc->mHal.state.type->getLODDimY(lod), in Upload2DTexture()
149 RSD_CALL_GL(glTexSubImage2D, t, lod, 0, 0, in Upload2DTexture()
150 alloc->mHal.state.type->getLODDimX(lod), in Upload2DTexture()
151 alloc->mHal.state.type->getLODDimY(lod), in Upload2DTexture()
179 if (!alloc->mHal.drvState.lod[0].mallocPtr) { in UploadToTexture()
193 if (alloc->mHal.drvState.lod[0].mallocPtr) { in UploadToTexture()
194 free(alloc->mHal.drvState.lod[0].mallocPtr); in UploadToTexture()
195 alloc->mHal.drvState.lod[0].mallocPtr = nullptr; in UploadToTexture()
221 alloc->mHal.drvState.lod[0].dimX, alloc->mHal.drvState.lod[0].dimY); in AllocateRenderTarget()
247 alloc->mHal.drvState.lod[0].mallocPtr, GL_DYNAMIC_DRAW); in UploadToBufferObject()
267 state->lod[1].dimX = state->lod[0].dimX / 2; in DeriveYUVLayout()
268 state->lod[1].dimY = state->lod[0].dimY / 2; in DeriveYUVLayout()
269 state->lod[2].dimX = state->lod[0].dimX / 2; in DeriveYUVLayout()
270 state->lod[2].dimY = state->lod[0].dimY / 2; in DeriveYUVLayout()
278 state->lod[2].stride = rsRound(state->lod[0].stride >> 1, 16); in DeriveYUVLayout()
279 state->lod[2].mallocPtr = ((uint8_t *)state->lod[0].mallocPtr) + in DeriveYUVLayout()
280 (state->lod[0].stride * state->lod[0].dimY); in DeriveYUVLayout()
281 uvSize += state->lod[2].stride * state->lod[2].dimY; in DeriveYUVLayout()
283 state->lod[1].stride = state->lod[2].stride; in DeriveYUVLayout()
284 state->lod[1].mallocPtr = ((uint8_t *)state->lod[2].mallocPtr) + in DeriveYUVLayout()
285 (state->lod[2].stride * state->lod[2].dimY); in DeriveYUVLayout()
286 uvSize += state->lod[1].stride * state->lod[2].dimY; in DeriveYUVLayout()
290 state->lod[1].stride = state->lod[0].stride; in DeriveYUVLayout()
291 state->lod[2].stride = state->lod[0].stride; in DeriveYUVLayout()
292 state->lod[2].mallocPtr = ((uint8_t *)state->lod[0].mallocPtr) + in DeriveYUVLayout()
293 (state->lod[0].stride * state->lod[0].dimY); in DeriveYUVLayout()
294 state->lod[1].mallocPtr = ((uint8_t *)state->lod[2].mallocPtr) + 1; in DeriveYUVLayout()
295 uvSize += state->lod[1].stride * state->lod[1].dimY; in DeriveYUVLayout()
308 alloc->mHal.drvState.lod[0].dimX = type->getDimX(); in AllocationBuildPointerTable()
309 alloc->mHal.drvState.lod[0].dimY = type->getDimY(); in AllocationBuildPointerTable()
310 alloc->mHal.drvState.lod[0].dimZ = type->getDimZ(); in AllocationBuildPointerTable()
311 alloc->mHal.drvState.lod[0].mallocPtr = 0; in AllocationBuildPointerTable()
313 size_t stride = alloc->mHal.drvState.lod[0].dimX * type->getElementSizeBytes(); in AllocationBuildPointerTable()
314 alloc->mHal.drvState.lod[0].stride = rsRound(stride, 16); in AllocationBuildPointerTable()
321 size_t o = alloc->mHal.drvState.lod[0].stride * rsMax(alloc->mHal.drvState.lod[0].dimY, 1u) * in AllocationBuildPointerTable()
322 rsMax(alloc->mHal.drvState.lod[0].dimZ, 1u); in AllocationBuildPointerTable()
327 offsets[ct] = (size_t)alloc->mHal.drvState.lod[ct].mallocPtr; in AllocationBuildPointerTable()
330 uint32_t tx = alloc->mHal.drvState.lod[0].dimX; in AllocationBuildPointerTable()
331 uint32_t ty = alloc->mHal.drvState.lod[0].dimY; in AllocationBuildPointerTable()
332 uint32_t tz = alloc->mHal.drvState.lod[0].dimZ; in AllocationBuildPointerTable()
333 for (uint32_t lod=1; lod < alloc->mHal.drvState.lodCount; lod++) { in AllocationBuildPointerTable() local
334 alloc->mHal.drvState.lod[lod].dimX = tx; in AllocationBuildPointerTable()
335 alloc->mHal.drvState.lod[lod].dimY = ty; in AllocationBuildPointerTable()
336 alloc->mHal.drvState.lod[lod].dimZ = tz; in AllocationBuildPointerTable()
337 alloc->mHal.drvState.lod[lod].stride = in AllocationBuildPointerTable()
339 offsets[lod] = o; in AllocationBuildPointerTable()
340 o += alloc->mHal.drvState.lod[lod].stride * rsMax(ty, 1u) * rsMax(tz, 1u); in AllocationBuildPointerTable()
349 alloc->mHal.drvState.lod[0].mallocPtr = ptr; in AllocationBuildPointerTable()
350 for (uint32_t lod=1; lod < alloc->mHal.drvState.lodCount; lod++) { in AllocationBuildPointerTable() local
351 alloc->mHal.drvState.lod[lod].mallocPtr = ptr + offsets[lod]; in AllocationBuildPointerTable()
494 for (uint32_t lod=0; lod < lodCount; lod++) { in rsdAllocationAdapterOffset() local
495 alloc->mHal.drvState.lod[lod] = base->mHal.drvState.lod[lod + lodBias]; in rsdAllocationAdapterOffset()
496 alloc->mHal.drvState.lod[lod].mallocPtr = GetOffsetPtr(alloc, in rsdAllocationAdapterOffset()
536 if (alloc->mHal.drvState.lod[0].mallocPtr) { in rsdAllocationDestroy()
541 free(alloc->mHal.drvState.lod[0].mallocPtr); in rsdAllocationDestroy()
543 alloc->mHal.drvState.lod[0].mallocPtr = nullptr; in rsdAllocationDestroy()
576 const uint32_t oldDimX = alloc->mHal.drvState.lod[0].dimX; in rsdAllocationResize()
584 void * oldPtr = alloc->mHal.drvState.lod[0].mallocPtr; in rsdAllocationResize()
597 memset(((uint8_t *)alloc->mHal.drvState.lod[0].mallocPtr) + stride * oldDimX, in rsdAllocationResize()
626 RSD_CALL_GL(glReadPixels, 0, 0, alloc->mHal.drvState.lod[0].dimX, in rsdAllocationSyncFromFBO()
627 alloc->mHal.drvState.lod[0].dimY, in rsdAllocationSyncFromFBO()
628 drv->glFormat, drv->glType, alloc->mHal.drvState.lod[0].mallocPtr); in rsdAllocationSyncFromFBO()
704 alloc->mHal.drvState.lod[0].mallocPtr = dst; in IoGetBuffer()
705 … alloc->mHal.drvState.lod[0].stride = drv->wndBuffer->stride * alloc->mHal.state.elementSizeBytes; in IoGetBuffer()
706 rsAssert((alloc->mHal.drvState.lod[0].stride & 0xf) == 0); in IoGetBuffer()
762 r = native_window_set_buffers_dimensions(nw, alloc->mHal.drvState.lod[0].dimX, in rsdAllocationSetSurface()
763 alloc->mHal.drvState.lod[0].dimY); in rsdAllocationSetSurface()
844 uint32_t xoff, uint32_t lod, size_t count, in rsdAllocationData1D() argument
864 uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face, in rsdAllocationData2D() argument
874 if (alloc->mHal.drvState.lod[0].mallocPtr) { in rsdAllocationData2D()
876 uint8_t *dst = GetOffsetPtr(alloc, xoff, yoff, 0, lod, face); in rsdAllocationData2D()
891 dst += alloc->mHal.drvState.lod[lod].stride; in rsdAllocationData2D()
895 int lod = 1; in rsdAllocationData2D() local
901 lod = 2; in rsdAllocationData2D()
905 while (lod < maxLod) { in rsdAllocationData2D()
906 uint8_t *dst = GetOffsetPtr(alloc, xoff, yoff, 0, lod, face); in rsdAllocationData2D()
910 src += alloc->mHal.drvState.lod[lod].stride; in rsdAllocationData2D()
911 dst += alloc->mHal.drvState.lod[lod].stride; in rsdAllocationData2D()
913 lod++; in rsdAllocationData2D()
919 Update2DTexture(rsc, alloc, data, xoff, yoff, lod, face, w, h); in rsdAllocationData2D()
925 uint32_t lod, in rsdAllocationData3D() argument
936 if (alloc->mHal.drvState.lod[0].mallocPtr) { in rsdAllocationData3D()
939 uint8_t *dst = GetOffsetPtr(alloc, xoff, yoff, z, lod, in rsdAllocationData3D()
955 dst += alloc->mHal.drvState.lod[lod].stride; in rsdAllocationData3D()
963 uint32_t xoff, uint32_t lod, size_t count, in rsdAllocationRead1D() argument
975 … uint32_t xoff, uint32_t yoff, uint32_t lod, RsAllocationCubemapFace face, in rsdAllocationRead2D() argument
983 if (alloc->mHal.drvState.lod[0].mallocPtr) { in rsdAllocationRead2D()
985 const uint8_t *src = GetOffsetPtr(alloc, xoff, yoff, 0, lod, face); in rsdAllocationRead2D()
995 src += alloc->mHal.drvState.lod[lod].stride; in rsdAllocationRead2D()
1005 uint32_t lod, in rsdAllocationRead3D() argument
1013 if (alloc->mHal.drvState.lod[0].mallocPtr) { in rsdAllocationRead3D()
1016 const uint8_t *src = GetOffsetPtr(alloc, xoff, yoff, z, lod, in rsdAllocationRead3D()
1027 src += alloc->mHal.drvState.lod[lod].stride; in rsdAllocationRead3D()
1035 return alloc->mHal.drvState.lod[0].mallocPtr; in rsdAllocationLock1D()
1157 static void mip565(const Allocation *alloc, int lod, RsAllocationCubemapFace face) { in mip565() argument
1158 uint32_t w = alloc->mHal.drvState.lod[lod + 1].dimX; in mip565()
1159 uint32_t h = alloc->mHal.drvState.lod[lod + 1].dimY; in mip565()
1162 uint16_t *oPtr = (uint16_t *)GetOffsetPtr(alloc, 0, y, 0, lod + 1, face); in mip565()
1163 const uint16_t *i1 = (uint16_t *)GetOffsetPtr(alloc, 0, 0, y*2, lod, face); in mip565()
1164 const uint16_t *i2 = (uint16_t *)GetOffsetPtr(alloc, 0, 0, y*2+1, lod, face); in mip565()
1175 static void mip8888(const Allocation *alloc, int lod, RsAllocationCubemapFace face) { in mip8888() argument
1176 uint32_t w = alloc->mHal.drvState.lod[lod + 1].dimX; in mip8888()
1177 uint32_t h = alloc->mHal.drvState.lod[lod + 1].dimY; in mip8888()
1180 uint32_t *oPtr = (uint32_t *)GetOffsetPtr(alloc, 0, y, 0, lod + 1, face); in mip8888()
1181 const uint32_t *i1 = (uint32_t *)GetOffsetPtr(alloc, 0, y*2, 0, lod, face); in mip8888()
1182 const uint32_t *i2 = (uint32_t *)GetOffsetPtr(alloc, 0, y*2+1, 0, lod, face); in mip8888()
1193 static void mip8(const Allocation *alloc, int lod, RsAllocationCubemapFace face) { in mip8() argument
1194 uint32_t w = alloc->mHal.drvState.lod[lod + 1].dimX; in mip8()
1195 uint32_t h = alloc->mHal.drvState.lod[lod + 1].dimY; in mip8()
1198 uint8_t *oPtr = GetOffsetPtr(alloc, 0, y, 0, lod + 1, face); in mip8()
1199 const uint8_t *i1 = GetOffsetPtr(alloc, 0, y*2, 0, lod, face); in mip8()
1200 const uint8_t *i2 = GetOffsetPtr(alloc, 0, y*2+1, 0, lod, face); in mip8()
1212 if(!alloc->mHal.drvState.lod[0].mallocPtr) { in rsdAllocationGenerateMipmaps()
1217 for (uint32_t lod=0; lod < (alloc->getType()->getLODCount() -1); lod++) { in rsdAllocationGenerateMipmaps() local
1220 mip8888(alloc, lod, (RsAllocationCubemapFace)face); in rsdAllocationGenerateMipmaps()
1223 mip565(alloc, lod, (RsAllocationCubemapFace)face); in rsdAllocationGenerateMipmaps()
1226 mip8(alloc, lod, (RsAllocationCubemapFace)face); in rsdAllocationGenerateMipmaps()
1246 obj->r = alloc->mHal.drvState.lod[0].mallocPtr; in rsdAllocationUpdateCachedObject()
1248 obj->v2 = (void *)alloc->mHal.drvState.lod[0].stride; in rsdAllocationUpdateCachedObject()