The PlayStation 2 texture cache provides the functions used to upload textures to GS memory and set up the texture registers on the GS.
It implements both a default behavior and an overload API so that in applications where a specific texture access pattern can be guaranteed, the default behavior can be replaced with a custom cache.
|
|
|
|
|
RpSkyTexCacheAccessRaster uploads the raster to the GS (if required) and sets up the GS state to use it for texturing. This function can fail if the raster is too big to fit into cache. This may be because too many textures are locked into cache. This function will not evict textures from cache.
|
|
RpSkyTexCacheAccessSpeculate attempts an asynscronous upload of the raster. This fails silently as it is not a fail to fail, so to speak. Even if it does upload the raster, it doesn't dispatch any state to the GS.
|
|
RpSkyTexCacheDisable disables the texture cache. Must be called before RwEngineStart().
|
|
RpSkyTexCacheFlush immediately flushes the cache. It does not remove locked rasters from memory. |
|
RpSkyTexCacheGetCallBack gets the callback invoked when a raster must be uploaded.
|
|
RpSkyTexCacheGetReleaseCallBack gets the callback invoked when a raster must be released. The callback will only be used when the cache is disabled. It may be NULL.
|
|
Get the current (word) start address of the texture cache
|
|
RpSkyTexCacheRasterGetAddr gets the current address in GS memory of a particular raster. This is not zero'd when a raster is ejected from cache.
|
|
RpSkyTexCacheRasterLock locks or unlocks a raster in cache. This locks the raster in GS memory. It attempts to pack the locked rasters at the top end on memory to avoid fragmentation, but locking several rasters then unlocking all bar the last locked, will not release the space, until the last one is finally unlocked.
|
|
RpSkyTexCacheRasterUnlockAll unlocks all rasters that have been locked into the cache and expels them. |
|
RpSkyTexCacheReleaseRaster removes the raster from cache. This does not check the reference count on the object, so this should be done from the parent if required.
|
|
RpSkyTexCacheRestore restores the current texture context. This is required as the FSAA modes which use blit destroy the GS texture registers. Note that this does not reupload any data. It assumes that content of the cache is unchanged. |
|
RpSkyTexCacheSetCallBack specifies the callback invoked when a raster must be uploaded. Note that the callback's signature has changed since RW 3.10.
|
|
RpSkyTexCacheSetReleaseCallBack specifies the callback invoked when a raster must be released. The callback will only be used when the cache is disabled. It may be NULL.
|
|
RpSkyTexCacheSetStartAddress sets the start address of the texture cache to be a new value. This value must be >= the value that the texture cache was opened with and must < the value of the lowest locked texture or the top of the texture memory. This function causes the cache to be flushed. The start address will be rounded to 2K words.
|
|
RpSkyTexCacheUploadRaster uploads an entire raster and all its miplevels and palette to the address specified. This will be faster than calling RpSkyUploadPixelData() on several mip levels and will take advantage of inlined dma data, if present, in the raster. It will update the tex0 extension field.
|
|
RpSkyTexCacheValidateRaster marks the raster as in cache or not in cache. The upload callback will be called when the raster is required if it has not been marked as in cache.
|
|
RpSkyTexCalcTex1 gets the contents of the mipmap raster extenstion fields on a raster and calculates the TEX1 register value required for these settings and the filter mode.
|
|
RpSkyTexGetMiptbp1 gets the contents of the miptbp1 raster extension fields on a raster
|
|
RpSkyTexGetMiptbp12 gets the contents of the miptbp1 and miptbp2 extension fields on a raster
|
|
RpSkyTexGetSize gets the size of the texture cache in words
|
|
RpSkyTexGetStartAddress gets the start word address of the texture cache
|
|
RpSkyTexGetTex0 gets the contents of the tex0 raster extension fields on a raster
|
|
RpSkyTexSetMiptbp1 sets the value of miptbp1 in the raster extension on the raster. This will be set in the GS registers when the main library uses this raster as a texture
|
|
RpSkyTexSetMiptbp12 sets the value of miptbp1 and miptbp2 in the extension on the raster. This will be set in the GS registers when the main library uses this raster as a texture
|
|
RpSkyTexSetTex0 sets the value of tex0 in the raster extension on the raster. This will be set in the GS registers when the main library uses this raster as a texture
|
|
RpSkyUploadPixelData uploads some pixel data to GS memory. The pixels must be flushed from DCache. Additionally the start address must be quad word aligned, and in the case where the data cannot be uploaded in a single dma transfer, each restart point must be quad word aligned (For example, if the stride is not equal to the pixel depth*width, each scan line must be aligned)
|
Converted from CHM to HTML with chm2web Pro 2.85 (unicode) |