Lines Matching refs:pShader

23 BOOL DEMOGfxLoadShaders(DEMOGfxShader *pShader, u32 index, const void *pData)  in DEMOGfxLoadShaders()  argument
25 memset(pShader, 0, sizeof(DEMOGfxShader)); in DEMOGfxLoadShaders()
28 if(!DEMOGFDReadVertexShader(&pShader->pVertexShader, index, pData)) in DEMOGfxLoadShaders()
33 if(!DEMOGFDReadPixelShader(&pShader->pPixelShader, index, pData)) in DEMOGfxLoadShaders()
39 if(!DEMOGFDReadGeometryShader(&pShader->pGeometryShader, index, pData)) in DEMOGfxLoadShaders()
48 BOOL DEMOGfxInitShaderAttribute(DEMOGfxShader *pShader, const char *name, in DEMOGfxInitShaderAttribute() argument
51 if(!pShader) in DEMOGfxInitShaderAttribute()
63 u32 location = (u32)GX2GetVertexAttribVarLocation(pShader->pVertexShader, name); in DEMOGfxInitShaderAttribute()
67 GX2InitAttribStream(&pShader->attribs[pShader->attribCount], in DEMOGfxInitShaderAttribute()
71 pShader->attribCount++; in DEMOGfxInitShaderAttribute()
75 BOOL DEMOGfxGetVertexShaderSamplerLocation(DEMOGfxShader *pShader, const char *name) in DEMOGfxGetVertexShaderSamplerLocation() argument
77 if(!pShader) in DEMOGfxGetVertexShaderSamplerLocation()
82 if(pShader->samplersVS.count > GX2_MAX_SAMPLERS ) in DEMOGfxGetVertexShaderSamplerLocation()
84 …OSReport("Warning : The sampler count (%d) in VS is over %d\n", pShader->samplersVS.count, GX2_MAX… in DEMOGfxGetVertexShaderSamplerLocation()
89 pShader->samplersVS.location[pShader->samplersVS.count] = in DEMOGfxGetVertexShaderSamplerLocation()
90 (u32)GX2GetVertexSamplerVarLocation(pShader->pVertexShader, name); in DEMOGfxGetVertexShaderSamplerLocation()
91 ASSERT(DEMOGfxCheckShaderLocation(pShader->samplersVS.location[pShader->samplersVS.count])); in DEMOGfxGetVertexShaderSamplerLocation()
94 pShader->samplersVS.count++; in DEMOGfxGetVertexShaderSamplerLocation()
98 BOOL DEMOGfxGetPixelShaderSamplerLocation(DEMOGfxShader *pShader, const char *name) in DEMOGfxGetPixelShaderSamplerLocation() argument
100 if(!pShader) in DEMOGfxGetPixelShaderSamplerLocation()
105 if(pShader->samplersPS.count > GX2_MAX_SAMPLERS ) in DEMOGfxGetPixelShaderSamplerLocation()
107 …OSReport("Warning : The sampler count (%d) in PS is over %d\n", pShader->samplersPS.count, GX2_MAX… in DEMOGfxGetPixelShaderSamplerLocation()
112 pShader->samplersPS.location[pShader->samplersPS.count] = in DEMOGfxGetPixelShaderSamplerLocation()
113 (u32)GX2GetPixelSamplerVarLocation(pShader->pPixelShader, name); in DEMOGfxGetPixelShaderSamplerLocation()
114 ASSERT(DEMOGfxCheckShaderLocation(pShader->samplersPS.location[pShader->samplersPS.count])); in DEMOGfxGetPixelShaderSamplerLocation()
117 pShader->samplersPS.count++; in DEMOGfxGetPixelShaderSamplerLocation()
121 BOOL DEMOGfxGetGeometryShaderSamplerLocation(DEMOGfxShader *pShader, const char *name) in DEMOGfxGetGeometryShaderSamplerLocation() argument
123 if(!pShader) in DEMOGfxGetGeometryShaderSamplerLocation()
128 if(pShader->samplersGS.count > GX2_MAX_SAMPLERS ) in DEMOGfxGetGeometryShaderSamplerLocation()
130 …OSReport("Warning : The sampler count (%d) in GS is over %d\n", pShader->samplersGS.count, GX2_MAX… in DEMOGfxGetGeometryShaderSamplerLocation()
135 pShader->samplersGS.location[pShader->samplersGS.count] = in DEMOGfxGetGeometryShaderSamplerLocation()
136 (u32)GX2GetGeometrySamplerVarLocation(pShader->pGeometryShader, name); in DEMOGfxGetGeometryShaderSamplerLocation()
137 ASSERT(DEMOGfxCheckShaderLocation(pShader->samplersGS.location[pShader->samplersGS.count])); in DEMOGfxGetGeometryShaderSamplerLocation()
140 pShader->samplersGS.count++; in DEMOGfxGetGeometryShaderSamplerLocation()
144 BOOL DEMOGfxGetVertexShaderUniformLocation(DEMOGfxShader *pShader, const char *name) in DEMOGfxGetVertexShaderUniformLocation() argument
146 if(!pShader) in DEMOGfxGetVertexShaderUniformLocation()
151 if(pShader->uniformsVS.count > GX2_MAX_VS_UNIFORM_VARS ) in DEMOGfxGetVertexShaderUniformLocation()
153 …OSReport("Warning : The uniform count (%d) in VS is over %d\n", pShader->uniformsVS.count, GX2_MAX… in DEMOGfxGetVertexShaderUniformLocation()
158 pShader->uniformsVS.location[pShader->uniformsVS.count] = in DEMOGfxGetVertexShaderUniformLocation()
159 (u32)GX2GetVertexUniformVarOffset(pShader->pVertexShader, name); in DEMOGfxGetVertexShaderUniformLocation()
160 ASSERT(DEMOGfxCheckShaderLocation(pShader->uniformsVS.location[pShader->uniformsVS.count])); in DEMOGfxGetVertexShaderUniformLocation()
163 pShader->uniformsVS.count++; in DEMOGfxGetVertexShaderUniformLocation()
167 BOOL DEMOGfxGetPixelShaderUniformLocation(DEMOGfxShader *pShader, const char *name) in DEMOGfxGetPixelShaderUniformLocation() argument
169 if(!pShader) in DEMOGfxGetPixelShaderUniformLocation()
174 if(pShader->uniformsPS.count > GX2_MAX_PS_UNIFORM_VARS ) in DEMOGfxGetPixelShaderUniformLocation()
176 …OSReport("Warning : The uniform count (%d) in PS is over %d\n", pShader->uniformsPS.count, GX2_MAX… in DEMOGfxGetPixelShaderUniformLocation()
180 pShader->uniformsPS.location[pShader->uniformsPS.count] = in DEMOGfxGetPixelShaderUniformLocation()
181 (u32)GX2GetPixelUniformVarOffset(pShader->pPixelShader, name); in DEMOGfxGetPixelShaderUniformLocation()
182 ASSERT(DEMOGfxCheckShaderLocation(pShader->uniformsPS.location[pShader->uniformsPS.count])); in DEMOGfxGetPixelShaderUniformLocation()
185 pShader->uniformsPS.count++; in DEMOGfxGetPixelShaderUniformLocation()
189 BOOL DEMOGfxGetVertexShaderUniformBlockLocation(DEMOGfxShader *pShader, const char *name) in DEMOGfxGetVertexShaderUniformBlockLocation() argument
191 if(!pShader) in DEMOGfxGetVertexShaderUniformBlockLocation()
196 if(pShader->uniformBlocksVS.count > GX2_MAX_UNIFORM_BLOCKS ) in DEMOGfxGetVertexShaderUniformBlockLocation()
198 …OSReport("Warning : The uniform block count (%d) in VS is over %d\n", pShader->uniformBlocksVS.cou… in DEMOGfxGetVertexShaderUniformBlockLocation()
201 GX2UniformBlock *block = GX2GetVertexUniformBlock(pShader->pVertexShader, name); in DEMOGfxGetVertexShaderUniformBlockLocation()
204 pShader->uniformBlocksVS.location[pShader->uniformBlocksVS.count] = block->location; in DEMOGfxGetVertexShaderUniformBlockLocation()
205 pShader->uniformBlocksVS.size[pShader->uniformBlocksVS.count] = block->size; in DEMOGfxGetVertexShaderUniformBlockLocation()
206 …ASSERT(DEMOGfxCheckShaderLocation(pShader->uniformBlocksVS.location[pShader->uniformBlocksVS.count… in DEMOGfxGetVertexShaderUniformBlockLocation()
209 pShader->uniformBlocksVS.count++; in DEMOGfxGetVertexShaderUniformBlockLocation()
213 BOOL DEMOGfxGetPixelShaderUniformBlockLocation(DEMOGfxShader *pShader, const char *name) in DEMOGfxGetPixelShaderUniformBlockLocation() argument
215 if(!pShader) in DEMOGfxGetPixelShaderUniformBlockLocation()
220 if(pShader->uniformBlocksPS.count > GX2_MAX_UNIFORM_BLOCKS ) in DEMOGfxGetPixelShaderUniformBlockLocation()
222 …OSReport("Warning : The uniform block count (%d) in PS is over %d\n", pShader->uniformBlocksPS.cou… in DEMOGfxGetPixelShaderUniformBlockLocation()
225 GX2UniformBlock *block = GX2GetPixelUniformBlock(pShader->pPixelShader, name); in DEMOGfxGetPixelShaderUniformBlockLocation()
228 pShader->uniformBlocksPS.location[pShader->uniformBlocksPS.count] = block->location; in DEMOGfxGetPixelShaderUniformBlockLocation()
229 pShader->uniformBlocksPS.size[pShader->uniformBlocksPS.count] = block->size; in DEMOGfxGetPixelShaderUniformBlockLocation()
230 …ASSERT(DEMOGfxCheckShaderLocation(pShader->uniformBlocksPS.location[pShader->uniformBlocksPS.count… in DEMOGfxGetPixelShaderUniformBlockLocation()
233 pShader->uniformBlocksPS.count++; in DEMOGfxGetPixelShaderUniformBlockLocation()
237 BOOL DEMOGfxGetGeometryShaderUniformBlockLocation(DEMOGfxShader *pShader, const char *name) in DEMOGfxGetGeometryShaderUniformBlockLocation() argument
239 if(!pShader) in DEMOGfxGetGeometryShaderUniformBlockLocation()
244 if(pShader->uniformBlocksGS.count > GX2_MAX_UNIFORM_BLOCKS ) in DEMOGfxGetGeometryShaderUniformBlockLocation()
246 …OSReport("Warning : The uniform block count (%d) in GS is over %d\n", pShader->uniformBlocksGS.cou… in DEMOGfxGetGeometryShaderUniformBlockLocation()
249 GX2UniformBlock *block = GX2GetGeometryUniformBlock(pShader->pGeometryShader, name); in DEMOGfxGetGeometryShaderUniformBlockLocation()
252 pShader->uniformBlocksGS.location[pShader->uniformBlocksGS.count] = block->location; in DEMOGfxGetGeometryShaderUniformBlockLocation()
253 pShader->uniformBlocksGS.size[pShader->uniformBlocksGS.count] = block->size; in DEMOGfxGetGeometryShaderUniformBlockLocation()
254 …ASSERT(DEMOGfxCheckShaderLocation(pShader->uniformBlocksGS.location[pShader->uniformBlocksGS.count… in DEMOGfxGetGeometryShaderUniformBlockLocation()
257 pShader->uniformBlocksGS.count++; in DEMOGfxGetGeometryShaderUniformBlockLocation()
261 BOOL DEMOGfxInitFetchShader(DEMOGfxShader *pShader) in DEMOGfxInitFetchShader() argument
263 if(!pShader) in DEMOGfxInitFetchShader()
270 u32 shaderSize = GX2CalcFetchShaderSize(pShader->attribCount); // size in bytes in DEMOGfxInitFetchShader()
271 pShader->pFetchShaderBuffer = DEMOGfxAllocMEM2(shaderSize, GX2_SHADER_ALIGNMENT); in DEMOGfxInitFetchShader()
275 GX2InitFetchShader(&pShader->fetchShader, in DEMOGfxInitFetchShader()
276 pShader->pFetchShaderBuffer, in DEMOGfxInitFetchShader()
277 pShader->attribCount, in DEMOGfxInitFetchShader()
278 pShader->attribs); in DEMOGfxInitFetchShader()
280 ASSERT(pShader->fetchShader.shaderSize == shaderSize); in DEMOGfxInitFetchShader()
282 GX2Invalidate(GX2_INVALIDATE_CPU_SHADER, pShader->pFetchShaderBuffer, shaderSize); in DEMOGfxInitFetchShader()
286 BOOL DEMOGfxFreeShaders(DEMOGfxShader *pShader) in DEMOGfxFreeShaders() argument
288 if(!pShader) in DEMOGfxFreeShaders()
294 if(pShader->pFetchShaderBuffer) in DEMOGfxFreeShaders()
295 DEMOGfxFreeMEM2(pShader->pFetchShaderBuffer); in DEMOGfxFreeShaders()
296 if(pShader->pVertexShader) in DEMOGfxFreeShaders()
297 DEMOGFDFreeVertexShader(pShader->pVertexShader); in DEMOGfxFreeShaders()
298 if(pShader->pPixelShader) in DEMOGfxFreeShaders()
299 DEMOGFDFreePixelShader(pShader->pPixelShader); in DEMOGfxFreeShaders()
300 if(pShader->pGeometryShader) in DEMOGfxFreeShaders()
301 DEMOGFDFreeGeometryShader(pShader->pGeometryShader); in DEMOGfxFreeShaders()