gx2: Add const to pointers where possible.

This commit is contained in:
James Benton 2019-11-22 17:42:16 +00:00
parent 0742efdf06
commit 159284a93d
8 changed files with 47 additions and 47 deletions

View File

@ -52,7 +52,7 @@ GX2SetupContextStateEx(GX2ContextState *state,
BOOL unk1); BOOL unk1);
void void
GX2GetContextStateDisplayList(GX2ContextState *state, GX2GetContextStateDisplayList(const GX2ContextState *state,
void *outDisplayList, void *outDisplayList,
uint32_t *outSize); uint32_t *outSize);

View File

@ -20,11 +20,11 @@ uint32_t
GX2EndDisplayList(void *displayList); GX2EndDisplayList(void *displayList);
void void
GX2DirectCallDisplayList(void *displayList, GX2DirectCallDisplayList(const void *displayList,
uint32_t bytes); uint32_t bytes);
void void
GX2CallDisplayList(void *displayList, GX2CallDisplayList(const void *displayList,
uint32_t bytes); uint32_t bytes);
BOOL BOOL
@ -35,7 +35,7 @@ GX2GetCurrentDisplayList(void **outDisplayList,
uint32_t *outSize); uint32_t *outSize);
void void
GX2CopyDisplayList(void *displayList, GX2CopyDisplayList(const void *displayList,
uint32_t bytes); uint32_t bytes);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -16,7 +16,7 @@ void
GX2SetAttribBuffer(uint32_t index, GX2SetAttribBuffer(uint32_t index,
uint32_t size, uint32_t size,
uint32_t stride, uint32_t stride,
void *buffer); const void *buffer);
void void
GX2DrawEx(GX2PrimitiveMode mode, GX2DrawEx(GX2PrimitiveMode mode,
@ -35,7 +35,7 @@ void
GX2DrawIndexedEx(GX2PrimitiveMode mode, GX2DrawIndexedEx(GX2PrimitiveMode mode,
uint32_t count, uint32_t count,
GX2IndexType indexType, GX2IndexType indexType,
void *indices, const void *indices,
uint32_t offset, uint32_t offset,
uint32_t numInstances); uint32_t numInstances);
@ -43,7 +43,7 @@ void
GX2DrawIndexedEx2(GX2PrimitiveMode mode, GX2DrawIndexedEx2(GX2PrimitiveMode mode,
uint32_t count, uint32_t count,
GX2IndexType indexType, GX2IndexType indexType,
void *indices, const void *indices,
uint32_t offset, uint32_t offset,
uint32_t numInstances, uint32_t numInstances,
uint32_t baseInstance); uint32_t baseInstance);
@ -52,7 +52,7 @@ void
GX2DrawIndexedImmediateEx(GX2PrimitiveMode mode, GX2DrawIndexedImmediateEx(GX2PrimitiveMode mode,
uint32_t count, uint32_t count,
GX2IndexType indexType, GX2IndexType indexType,
void *indices, const void *indices,
uint32_t offset, uint32_t offset,
uint32_t numInstances); uint32_t numInstances);

View File

@ -207,7 +207,7 @@ GX2GetAAMaskReg(GX2AAMaskReg *reg,
uint8_t *lowerRight); uint8_t *lowerRight);
void void
GX2SetAAMaskReg(GX2AAMaskReg *reg); GX2SetAAMaskReg(const GX2AAMaskReg *reg);
void void
GX2SetAlphaTest(BOOL alphaTest, GX2SetAlphaTest(BOOL alphaTest,
@ -227,7 +227,7 @@ GX2GetAlphaTestReg(const GX2AlphaTestReg *reg,
float *ref); float *ref);
void void
GX2SetAlphaTestReg(GX2AlphaTestReg *reg); GX2SetAlphaTestReg(const GX2AlphaTestReg *reg);
void void
GX2SetAlphaToMask(BOOL alphaToMask, GX2SetAlphaToMask(BOOL alphaToMask,
@ -244,7 +244,7 @@ GX2GetAlphaToMaskReg(const GX2AlphaToMaskReg *reg,
GX2AlphaToMaskMode *mode); GX2AlphaToMaskMode *mode);
void void
GX2SetAlphaToMaskReg(GX2AlphaToMaskReg *reg); GX2SetAlphaToMaskReg(const GX2AlphaToMaskReg *reg);
void void
GX2SetBlendConstantColor(float red, GX2SetBlendConstantColor(float red,
@ -267,7 +267,7 @@ GX2GetBlendConstantColorReg(GX2BlendConstantColorReg *reg,
float *alpha); float *alpha);
void void
GX2SetBlendConstantColorReg(GX2BlendConstantColorReg *reg); GX2SetBlendConstantColorReg(const GX2BlendConstantColorReg *reg);
void void
GX2SetBlendControl(GX2RenderTarget target, GX2SetBlendControl(GX2RenderTarget target,
@ -302,7 +302,7 @@ GX2GetBlendControlReg(GX2BlendControlReg *reg,
GX2BlendCombineMode *alphaCombine); GX2BlendCombineMode *alphaCombine);
void void
GX2SetBlendControlReg(GX2BlendControlReg *reg); GX2SetBlendControlReg(const GX2BlendControlReg *reg);
void void
GX2SetColorControl(GX2LogicOp rop3, GX2SetColorControl(GX2LogicOp rop3,
@ -325,7 +325,7 @@ GX2GetColorControlReg(GX2ColorControlReg *reg,
BOOL *colorWriteEnable); BOOL *colorWriteEnable);
void void
GX2SetColorControlReg(GX2ColorControlReg *reg); GX2SetColorControlReg(const GX2ColorControlReg *reg);
void void
GX2SetDepthOnlyControl(BOOL depthTest, GX2SetDepthOnlyControl(BOOL depthTest,
@ -380,7 +380,7 @@ GX2GetDepthStencilControlReg(GX2DepthStencilControlReg *reg,
GX2StencilFunction *backStencilFail); GX2StencilFunction *backStencilFail);
void void
GX2SetDepthStencilControlReg(GX2DepthStencilControlReg *reg); GX2SetDepthStencilControlReg(const GX2DepthStencilControlReg *reg);
void void
GX2SetStencilMask(uint8_t frontMask, GX2SetStencilMask(uint8_t frontMask,
@ -409,7 +409,7 @@ GX2GetStencilMaskReg(GX2StencilMaskReg *reg,
uint8_t *backRef); uint8_t *backRef);
void void
GX2SetStencilMaskReg(GX2StencilMaskReg *reg); GX2SetStencilMaskReg(const GX2StencilMaskReg *reg);
void void
GX2SetLineWidth(float width); GX2SetLineWidth(float width);
@ -423,7 +423,7 @@ GX2GetLineWidthReg(GX2LineWidthReg *reg,
float *width); float *width);
void void
GX2SetLineWidthReg(GX2LineWidthReg *reg); GX2SetLineWidthReg(const GX2LineWidthReg *reg);
void void
GX2SetPointSize(float width, GX2SetPointSize(float width,
@ -440,7 +440,7 @@ GX2GetPointSizeReg(GX2PointSizeReg *reg,
float *height); float *height);
void void
GX2SetPointSizeReg(GX2PointSizeReg *reg); GX2SetPointSizeReg(const GX2PointSizeReg *reg);
void void
GX2SetPointLimits(float min, GX2SetPointLimits(float min,
@ -457,7 +457,7 @@ GX2GetPointLimitsReg(GX2PointLimitsReg *reg,
float *max); float *max);
void void
GX2SetPointLimitsReg(GX2PointLimitsReg *reg); GX2SetPointLimitsReg(const GX2PointLimitsReg *reg);
void void
GX2SetCullOnlyControl(GX2FrontFace frontFace, GX2SetCullOnlyControl(GX2FrontFace frontFace,
@ -500,7 +500,7 @@ GX2GetPolygonControlReg(GX2PolygonControlReg *reg,
BOOL *polyOffsetParaEnable); BOOL *polyOffsetParaEnable);
void void
GX2SetPolygonControlReg(GX2PolygonControlReg *reg); GX2SetPolygonControlReg(const GX2PolygonControlReg *reg);
void void
GX2SetPolygonOffset(float frontOffset, GX2SetPolygonOffset(float frontOffset,
@ -526,7 +526,7 @@ GX2GetPolygonOffsetReg(GX2PolygonOffsetReg *reg,
float *clamp); float *clamp);
void void
GX2SetPolygonOffsetReg(GX2PolygonOffsetReg *reg); GX2SetPolygonOffsetReg(const GX2PolygonOffsetReg *reg);
void void
GX2SetScissor(uint32_t x, GX2SetScissor(uint32_t x,
@ -549,7 +549,7 @@ GX2GetScissorReg(GX2ScissorReg *reg,
uint32_t *height); uint32_t *height);
void void
GX2SetScissorReg(GX2ScissorReg *reg); GX2SetScissorReg(const GX2ScissorReg *reg);
void void
GX2SetTargetChannelMasks(GX2ChannelMask mask0, GX2SetTargetChannelMasks(GX2ChannelMask mask0,
@ -584,7 +584,7 @@ GX2GetTargetChannelMasksReg(GX2TargetChannelMaskReg *reg,
GX2ChannelMask *mask7); GX2ChannelMask *mask7);
void void
GX2SetTargetChannelMasksReg(GX2TargetChannelMaskReg *reg); GX2SetTargetChannelMasksReg(const GX2TargetChannelMaskReg *reg);
void void
GX2SetViewport(float x, GX2SetViewport(float x,
@ -613,7 +613,7 @@ GX2GetViewportReg(GX2ViewportReg *reg,
float *farZ); float *farZ);
void void
GX2SetViewportReg(GX2ViewportReg *reg); GX2SetViewportReg(const GX2ViewportReg *reg);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -372,32 +372,32 @@ void
GX2InitFetchShaderEx(GX2FetchShader *fetchShader, GX2InitFetchShaderEx(GX2FetchShader *fetchShader,
uint8_t *buffer, uint8_t *buffer,
uint32_t attribCount, uint32_t attribCount,
GX2AttribStream *attribs, const GX2AttribStream *attribs,
GX2FetchShaderType type, GX2FetchShaderType type,
GX2TessellationMode tessMode); GX2TessellationMode tessMode);
void void
GX2SetFetchShader(GX2FetchShader *shader); GX2SetFetchShader(const GX2FetchShader *shader);
void void
GX2SetVertexShader(GX2VertexShader *shader); GX2SetVertexShader(const GX2VertexShader *shader);
void void
GX2SetPixelShader(GX2PixelShader *shader); GX2SetPixelShader(const GX2PixelShader *shader);
void void
GX2SetGeometryShader(GX2GeometryShader *shader); GX2SetGeometryShader(const GX2GeometryShader *shader);
void void
GX2SetVertexSampler(GX2Sampler *sampler, GX2SetVertexSampler(const GX2Sampler *sampler,
uint32_t id); uint32_t id);
void void
GX2SetPixelSampler(GX2Sampler *sampler, GX2SetPixelSampler(const GX2Sampler *sampler,
uint32_t id); uint32_t id);
void void
GX2SetGeometrySampler(GX2Sampler *sampler, GX2SetGeometrySampler(const GX2Sampler *sampler,
uint32_t id); uint32_t id);
void void
@ -435,7 +435,7 @@ void
GX2SetStreamOutEnable(BOOL enable); GX2SetStreamOutEnable(BOOL enable);
void void
GX2SetGeometryShaderInputRingBuffer(void *buffer, GX2SetGeometryShaderInputRingBuffer(const void *buffer,
uint32_t size); uint32_t size);
void void
@ -443,22 +443,22 @@ GX2SetGeometryShaderOutputRingBuffer(void *buffer,
uint32_t size); uint32_t size);
uint32_t uint32_t
GX2GetPixelShaderGPRs(GX2PixelShader *shader); GX2GetPixelShaderGPRs(const GX2PixelShader *shader);
uint32_t uint32_t
GX2GetPixelShaderStackEntries(GX2PixelShader *shader); GX2GetPixelShaderStackEntries(const GX2PixelShader *shader);
uint32_t uint32_t
GX2GetVertexShaderGPRs(GX2VertexShader *shader); GX2GetVertexShaderGPRs(const GX2VertexShader *shader);
uint32_t uint32_t
GX2GetVertexShaderStackEntries(GX2VertexShader *shader); GX2GetVertexShaderStackEntries(const GX2VertexShader *shader);
uint32_t uint32_t
GX2GetGeometryShaderGPRs(GX2GeometryShader *shader); GX2GetGeometryShaderGPRs(const GX2GeometryShader *shader);
uint32_t uint32_t
GX2GetGeometryShaderStackEntries(GX2GeometryShader *shader); GX2GetGeometryShaderStackEntries(const GX2GeometryShader *shader);
static inline GX2UniformBlock * static inline GX2UniformBlock *
GX2GetGeometryUniformBlock(const GX2GeometryShader *shader, GX2GetGeometryUniformBlock(const GX2GeometryShader *shader,

View File

@ -118,11 +118,11 @@ GX2CalcColorBufferAuxInfo(GX2ColorBuffer *surface,
uint32_t *outAlignment); uint32_t *outAlignment);
void void
GX2SetColorBuffer(GX2ColorBuffer *colorBuffer, GX2SetColorBuffer(const GX2ColorBuffer *colorBuffer,
GX2RenderTarget target); GX2RenderTarget target);
void void
GX2SetDepthBuffer(GX2DepthBuffer *depthBuffer); GX2SetDepthBuffer(const GX2DepthBuffer *depthBuffer);
void void
GX2InitColorBufferRegs(GX2ColorBuffer *colorBuffer); GX2InitColorBufferRegs(GX2ColorBuffer *colorBuffer);
@ -135,14 +135,14 @@ GX2InitDepthBufferHiZEnable(GX2DepthBuffer *depthBuffer,
BOOL enable); BOOL enable);
uint32_t uint32_t
GX2GetSurfaceSwizzle(GX2Surface *surface); GX2GetSurfaceSwizzle(const GX2Surface *surface);
void void
GX2SetSurfaceSwizzle(GX2Surface *surface, GX2SetSurfaceSwizzle(GX2Surface *surface,
uint32_t swizzle); uint32_t swizzle);
void void
GX2CopySurface(GX2Surface *src, GX2CopySurface(const GX2Surface *src,
uint32_t srcLevel, uint32_t srcLevel,
uint32_t srcDepth, uint32_t srcDepth,
GX2Surface *dst, GX2Surface *dst,

View File

@ -16,7 +16,7 @@ typedef struct GX2ColorBuffer GX2ColorBuffer;
typedef struct GX2Texture GX2Texture; typedef struct GX2Texture GX2Texture;
void void
GX2CopyColorBufferToScanBuffer(GX2ColorBuffer *buffer, GX2CopyColorBufferToScanBuffer(const GX2ColorBuffer *buffer,
GX2ScanTarget scanTarget); GX2ScanTarget scanTarget);
void void

View File

@ -38,15 +38,15 @@ void
GX2InitTextureRegs(GX2Texture *texture); GX2InitTextureRegs(GX2Texture *texture);
void void
GX2SetPixelTexture(GX2Texture *texture, GX2SetPixelTexture(const GX2Texture *texture,
uint32_t unit); uint32_t unit);
void void
GX2SetVertexTexture(GX2Texture *texture, GX2SetVertexTexture(const GX2Texture *texture,
uint32_t unit); uint32_t unit);
void void
GX2SetGeometryTexture(GX2Texture *texture, GX2SetGeometryTexture(const GX2Texture *texture,
uint32_t unit); uint32_t unit);
#ifdef __cplusplus #ifdef __cplusplus