Disable HyperZ

This is a simple UI library doing everything on the same depth / in a 2D space, so using fast Z buffer techniques like HyperZ is overkill. Also disabling it saves a bit of MEM1 for other use.

Signed-off-by: Thomas Rohloff <v10lator@myway.de>
This commit is contained in:
Thomas Rohloff 2020-05-16 13:43:42 +02:00
parent 45bad52a0c
commit 5a19ff0d0f

View File

@ -111,10 +111,7 @@ CVideo::CVideo(int32_t forceTvScanMode, int32_t forceDrcScanMode) {
GX2Invalidate(GX2_INVALIDATE_MODE_CPU, tvDepthBuffer.surface.image, tvDepthBuffer.surface.imageSize); GX2Invalidate(GX2_INVALIDATE_MODE_CPU, tvDepthBuffer.surface.image, tvDepthBuffer.surface.imageSize);
//! Setup TV HiZ buffer //! Setup TV HiZ buffer
GX2CalcDepthBufferHiZInfo(&tvDepthBuffer, &size, &align); GX2InitDepthBufferHiZEnable(&tvDepthBuffer, GX2_DISABLE);
tvDepthBuffer.hiZPtr = MEM1_alloc(size, align);
GX2Invalidate(GX2_INVALIDATE_MODE_CPU, tvDepthBuffer.hiZPtr, size);
GX2InitDepthBufferHiZEnable(&tvDepthBuffer, GX2_ENABLE);
//! Setup color buffer for DRC rendering //! Setup color buffer for DRC rendering
GX2InitColorBuffer(&drcColorBuffer, GX2_SURFACE_DIM_TEXTURE_2D, 854, 480, 1, GX2_SURFACE_FORMAT_UNORM_R8_G8_B8_A8, (GX2AAMode)drcAAMode); GX2InitColorBuffer(&drcColorBuffer, GX2_SURFACE_DIM_TEXTURE_2D, 854, 480, 1, GX2_SURFACE_FORMAT_UNORM_R8_G8_B8_A8, (GX2AAMode)drcAAMode);
@ -127,10 +124,7 @@ CVideo::CVideo(int32_t forceTvScanMode, int32_t forceDrcScanMode) {
GX2Invalidate(GX2_INVALIDATE_MODE_CPU, drcDepthBuffer.surface.image, drcDepthBuffer.surface.imageSize); GX2Invalidate(GX2_INVALIDATE_MODE_CPU, drcDepthBuffer.surface.image, drcDepthBuffer.surface.imageSize);
//! Setup DRC HiZ buffer //! Setup DRC HiZ buffer
GX2CalcDepthBufferHiZInfo(&drcDepthBuffer, &size, &align); GX2InitDepthBufferHiZEnable(&drcDepthBuffer, GX2_DISABLE);
drcDepthBuffer.hiZPtr = MEM1_alloc(size, align);
GX2Invalidate(GX2_INVALIDATE_MODE_CPU, drcDepthBuffer.hiZPtr, size);
GX2InitDepthBufferHiZEnable(&drcDepthBuffer, GX2_ENABLE);
//! allocate auxilary buffer last as there might not be enough MEM1 left for other stuff after that //! allocate auxilary buffer last as there might not be enough MEM1 left for other stuff after that
@ -216,9 +210,7 @@ CVideo::~CVideo() {
MEM1_free(drcColorBuffer.surface.image); MEM1_free(drcColorBuffer.surface.image);
//! free depth buffers //! free depth buffers
MEM1_free(tvDepthBuffer.surface.image); MEM1_free(tvDepthBuffer.surface.image);
MEM1_free(tvDepthBuffer.hiZPtr);
MEM1_free(drcDepthBuffer.surface.image); MEM1_free(drcDepthBuffer.surface.image);
MEM1_free(drcDepthBuffer.hiZPtr);
//! free context buffers //! free context buffers
MEM2_free(tvContextState); MEM2_free(tvContextState);
MEM2_free(drcContextState); MEM2_free(drcContextState);