2 * Copyright (C) 2008-2009 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 * Richard Li <RichardZ.Li@amd.com>, <richardradeon@gmail.com>
34 #include "main/imports.h"
35 #include "main/mtypes.h"
37 #include "tnl/t_context.h"
38 #include "program/program.h"
39 #include "program/prog_parameter.h"
40 #include "program/prog_statevars.h"
42 #include "radeon_debug.h"
43 #include "r600_context.h"
44 #include "r600_cmdbuf.h"
45 #include "r600_emit.h"
46 #include "program/programopt.h"
48 #include "r700_debug.h"
49 #include "r700_vertprog.h"
51 unsigned int Map_Vertex_Output(r700_AssemblerBase
*pAsm
,
52 struct gl_vertex_program
*mesa_vp
,
57 unsigned int unTotal
= unStart
;
59 //!!!!!!! THE ORDER MATCH FS INPUT
61 unBit
= 1 << VERT_RESULT_HPOS
;
62 if(mesa_vp
->Base
.OutputsWritten
& unBit
)
64 pAsm
->ucVP_OutputMap
[VERT_RESULT_HPOS
] = unTotal
++;
67 unBit
= 1 << VERT_RESULT_COL0
;
68 if(mesa_vp
->Base
.OutputsWritten
& unBit
)
70 pAsm
->ucVP_OutputMap
[VERT_RESULT_COL0
] = unTotal
++;
73 unBit
= 1 << VERT_RESULT_COL1
;
74 if(mesa_vp
->Base
.OutputsWritten
& unBit
)
76 pAsm
->ucVP_OutputMap
[VERT_RESULT_COL1
] = unTotal
++;
79 //TODO : dealing back face.
80 unBit
= 1 << VERT_RESULT_BFC0
;
81 if(mesa_vp
->Base
.OutputsWritten
& unBit
)
83 pAsm
->ucVP_OutputMap
[VERT_RESULT_BFC0
] = unTotal
++;
86 unBit
= 1 << VERT_RESULT_BFC1
;
87 if(mesa_vp
->Base
.OutputsWritten
& unBit
)
89 pAsm
->ucVP_OutputMap
[VERT_RESULT_BFC1
] = unTotal
++;
93 unBit
= 1 << VERT_RESULT_FOGC
;
94 if(mesa_vp
->Base
.OutputsWritten
& unBit
)
96 pAsm
->ucVP_OutputMap
[VERT_RESULT_FOGC
] = unTotal
++;
99 //TODO : dealing point size.
100 unBit
= 1 << VERT_RESULT_PSIZ
;
101 if(mesa_vp
->Base
.OutputsWritten
& unBit
)
103 pAsm
->ucVP_OutputMap
[VERT_RESULT_PSIZ
] = unTotal
++;
108 unBit
= 1 << (VERT_RESULT_TEX0
+ i
);
109 if(mesa_vp
->Base
.OutputsWritten
& unBit
)
111 pAsm
->ucVP_OutputMap
[VERT_RESULT_TEX0
+ i
] = unTotal
++;
115 for(i
=VERT_RESULT_VAR0
; i
<VERT_RESULT_MAX
; i
++)
118 if(mesa_vp
->Base
.OutputsWritten
& unBit
)
120 pAsm
->ucVP_OutputMap
[i
] = unTotal
++;
124 return (unTotal
- unStart
);
127 unsigned int Map_Vertex_Input(r700_AssemblerBase
*pAsm
,
128 struct gl_vertex_program
*mesa_vp
,
129 unsigned int unStart
)
133 unsigned int unTotal
= unStart
;
134 for(i
=0; i
<VERT_ATTRIB_MAX
; i
++)
137 if(mesa_vp
->Base
.InputsRead
& unBit
)
139 pAsm
->ucVP_AttributeMap
[i
] = unTotal
++;
142 return (unTotal
- unStart
);
145 GLboolean
Process_Vertex_Program_Vfetch_Instructions(
146 struct r700_vertex_program
*vp
,
147 struct gl_vertex_program
*mesa_vp
)
151 VTX_FETCH_METHOD vtxFetchMethod
;
152 vtxFetchMethod
.bEnableMini
= GL_FALSE
;
153 vtxFetchMethod
.mega_fetch_remainder
= 0;
155 for(i
=0; i
<VERT_ATTRIB_MAX
; i
++)
158 if(mesa_vp
->Base
.InputsRead
& unBit
)
160 assemble_vfetch_instruction(&vp
->r700AsmCode
,
162 vp
->r700AsmCode
.ucVP_AttributeMap
[i
],
163 vp
->aos_desc
[i
].size
,
164 vp
->aos_desc
[i
].type
,
172 GLboolean
Process_Vertex_Program_Vfetch_Instructions2(
174 struct r700_vertex_program
*vp
,
175 struct gl_vertex_program
*mesa_vp
)
178 context_t
*context
= R700_CONTEXT(ctx
);
180 VTX_FETCH_METHOD vtxFetchMethod
;
181 vtxFetchMethod
.bEnableMini
= GL_FALSE
;
182 vtxFetchMethod
.mega_fetch_remainder
= 0;
184 for(i
=0; i
<context
->nNumActiveAos
; i
++)
186 assemble_vfetch_instruction2(&vp
->r700AsmCode
,
187 vp
->r700AsmCode
.ucVP_AttributeMap
[context
->stream_desc
[i
].element
],
188 context
->stream_desc
[i
].type
,
189 context
->stream_desc
[i
].size
,
190 context
->stream_desc
[i
].element
,
191 context
->stream_desc
[i
]._signed
,
192 context
->stream_desc
[i
].normalize
,
193 context
->stream_desc
[i
].format
,
200 void Map_Vertex_Program(GLcontext
*ctx
,
201 struct r700_vertex_program
*vp
,
202 struct gl_vertex_program
*mesa_vp
)
205 r700_AssemblerBase
*pAsm
= &(vp
->r700AsmCode
);
206 unsigned int num_inputs
;
208 // R0 will always be used for index into vertex buffer
209 pAsm
->number_used_registers
= 1;
210 pAsm
->starting_vfetch_register_number
= pAsm
->number_used_registers
;
212 // Map Inputs: Add 1 to mapping since R0 is used for index
213 num_inputs
= Map_Vertex_Input(pAsm
, mesa_vp
, pAsm
->number_used_registers
);
214 pAsm
->number_used_registers
+= num_inputs
;
216 // Create VFETCH instructions for inputs
217 if (GL_TRUE
!= Process_Vertex_Program_Vfetch_Instructions2(ctx
, vp
, mesa_vp
) )
219 radeon_error("Calling Process_Vertex_Program_Vfetch_Instructions2 return error. \n");
224 pAsm
->number_of_exports
= Map_Vertex_Output(pAsm
, mesa_vp
, pAsm
->number_used_registers
);
226 pAsm
->starting_export_register_number
= pAsm
->number_used_registers
;
228 pAsm
->number_used_registers
+= pAsm
->number_of_exports
;
230 pAsm
->pucOutMask
= (unsigned char*) MALLOC(pAsm
->number_of_exports
);
232 for(ui
=0; ui
<pAsm
->number_of_exports
; ui
++)
234 pAsm
->pucOutMask
[ui
] = 0x0;
237 /* Map temporary registers (GPRs) */
238 pAsm
->starting_temp_register_number
= pAsm
->number_used_registers
;
240 if(mesa_vp
->Base
.NumNativeTemporaries
>= mesa_vp
->Base
.NumTemporaries
)
241 { /* arb uses NumNativeTemporaries */
242 pAsm
->number_used_registers
+= mesa_vp
->Base
.NumNativeTemporaries
;
245 { /* fix func t_vp uses NumTemporaries */
246 pAsm
->number_used_registers
+= mesa_vp
->Base
.NumTemporaries
;
249 pAsm
->flag_reg_index
= pAsm
->number_used_registers
++;
251 pAsm
->uFirstHelpReg
= pAsm
->number_used_registers
;
254 GLboolean
Find_Instruction_Dependencies_vp(struct r700_vertex_program
*vp
,
255 struct gl_vertex_program
*mesa_vp
)
258 GLint
* puiTEMPwrites
;
259 struct prog_instruction
*pILInst
;
262 puiTEMPwrites
= (GLint
*) MALLOC(sizeof(GLuint
)*mesa_vp
->Base
.NumTemporaries
);
263 for(i
=0; i
<mesa_vp
->Base
.NumTemporaries
; i
++)
265 puiTEMPwrites
[i
] = -1;
268 pInstDeps
= (InstDeps
*)MALLOC(sizeof(InstDeps
)*mesa_vp
->Base
.NumInstructions
);
270 for(i
=0; i
<mesa_vp
->Base
.NumInstructions
; i
++)
272 pInstDeps
[i
].nDstDep
= -1;
273 pILInst
= &(mesa_vp
->Base
.Instructions
[i
]);
276 if(pILInst
->DstReg
.File
== PROGRAM_TEMPORARY
)
278 //Set lastwrite for the temp
279 puiTEMPwrites
[pILInst
->DstReg
.Index
] = i
;
285 if(pILInst
->SrcReg
[j
].File
== PROGRAM_TEMPORARY
)
288 pInstDeps
[i
].nSrcDeps
[j
] = puiTEMPwrites
[pILInst
->SrcReg
[j
].Index
];
292 pInstDeps
[i
].nSrcDeps
[j
] = -1;
297 vp
->r700AsmCode
.pInstDeps
= pInstDeps
;
304 struct r700_vertex_program
* r700TranslateVertexShader(GLcontext
*ctx
,
305 struct gl_vertex_program
*mesa_vp
)
307 context_t
*context
= R700_CONTEXT(ctx
);
308 struct r700_vertex_program
*vp
;
311 vp
= calloc(1, sizeof(*vp
));
312 vp
->mesa_program
= _mesa_clone_vertex_program(ctx
, mesa_vp
);
314 if (mesa_vp
->IsPositionInvariant
)
316 _mesa_insert_mvp_code(ctx
, vp
->mesa_program
);
319 for(i
=0; i
<context
->nNumActiveAos
; i
++)
321 vp
->aos_desc
[i
].size
= context
->stream_desc
[i
].size
;
322 vp
->aos_desc
[i
].stride
= context
->stream_desc
[i
].stride
;
323 vp
->aos_desc
[i
].type
= context
->stream_desc
[i
].type
;
324 vp
->aos_desc
[i
].format
= context
->stream_desc
[i
].format
;
327 if (context
->radeon
.radeonScreen
->chip_family
< CHIP_FAMILY_RV770
)
329 vp
->r700AsmCode
.bR6xx
= 1;
333 Init_r700_AssemblerBase(SPT_VP
, &(vp
->r700AsmCode
), &(vp
->r700Shader
) );
334 Map_Vertex_Program(ctx
, vp
, vp
->mesa_program
);
336 if(GL_FALSE
== Find_Instruction_Dependencies_vp(vp
, vp
->mesa_program
))
341 InitShaderProgram(&(vp
->r700AsmCode
));
343 for(i
=0; i
< MAX_SAMPLERS
; i
++)
345 vp
->r700AsmCode
.SamplerUnits
[i
] = vp
->mesa_program
->Base
.SamplerUnits
[i
];
348 vp
->r700AsmCode
.unCurNumILInsts
= vp
->mesa_program
->Base
.NumInstructions
;
350 if(GL_FALSE
== AssembleInstr(0,
352 vp
->mesa_program
->Base
.NumInstructions
,
353 &(vp
->mesa_program
->Base
.Instructions
[0]),
354 &(vp
->r700AsmCode
)) )
359 if(GL_FALSE
== Process_Vertex_Exports(&(vp
->r700AsmCode
), vp
->mesa_program
->Base
.OutputsWritten
) )
364 if( GL_FALSE
== RelocProgram(&(vp
->r700AsmCode
), &(vp
->mesa_program
->Base
)) )
369 vp
->r700Shader
.nRegs
= (vp
->r700AsmCode
.number_used_registers
== 0) ? 0
370 : (vp
->r700AsmCode
.number_used_registers
- 1);
372 vp
->r700Shader
.nParamExports
= vp
->r700AsmCode
.number_of_exports
;
374 vp
->translated
= GL_TRUE
;
379 void r700SelectVertexShader(GLcontext
*ctx
)
381 context_t
*context
= R700_CONTEXT(ctx
);
382 struct r700_vertex_program_cont
*vpc
;
383 struct r700_vertex_program
*vp
;
386 GLbitfield InputsRead
;
388 vpc
= (struct r700_vertex_program_cont
*)ctx
->VertexProgram
._Current
;
390 InputsRead
= vpc
->mesa_program
.Base
.InputsRead
;
391 if (vpc
->mesa_program
.IsPositionInvariant
)
393 InputsRead
|= VERT_BIT_POS
;
396 for (vp
= vpc
->progs
; vp
; vp
= vp
->next
)
399 for(i
=0; i
<context
->nNumActiveAos
; i
++)
401 if (vp
->aos_desc
[i
].size
!= context
->stream_desc
[i
].size
||
402 vp
->aos_desc
[i
].format
!= context
->stream_desc
[i
].format
)
410 context
->selected_vp
= vp
;
415 vp
= r700TranslateVertexShader(ctx
, &(vpc
->mesa_program
));
418 radeon_error("Failed to translate vertex shader. \n");
421 vp
->next
= vpc
->progs
;
423 context
->selected_vp
= vp
;
427 int getTypeSize(GLenum type
)
432 return sizeof(GLdouble
);
434 return sizeof(GLfloat
);
436 return sizeof(GLint
);
437 case GL_UNSIGNED_INT
:
438 return sizeof(GLuint
);
440 return sizeof(GLshort
);
441 case GL_UNSIGNED_SHORT
:
442 return sizeof(GLushort
);
444 return sizeof(GLbyte
);
445 case GL_UNSIGNED_BYTE
:
446 return sizeof(GLubyte
);
453 static void r700TranslateAttrib(GLcontext
*ctx
, GLuint unLoc
, int count
, const struct gl_client_array
*input
)
455 context_t
*context
= R700_CONTEXT(ctx
);
457 StreamDesc
* pStreamDesc
= &(context
->stream_desc
[context
->nNumActiveAos
]);
461 stride
= (input
->StrideB
== 0) ? getTypeSize(input
->Type
) * input
->Size
464 if (input
->Type
== GL_DOUBLE
|| input
->Type
== GL_UNSIGNED_INT
|| input
->Type
== GL_INT
||
466 getTypeSize(input
->Type
) != 4 ||
470 pStreamDesc
->type
= GL_FLOAT
;
472 if (input
->StrideB
== 0)
474 pStreamDesc
->stride
= 0;
478 pStreamDesc
->stride
= sizeof(GLfloat
) * input
->Size
;
480 pStreamDesc
->dwords
= input
->Size
;
481 pStreamDesc
->is_named_bo
= GL_FALSE
;
485 pStreamDesc
->type
= input
->Type
;
486 pStreamDesc
->dwords
= (getTypeSize(input
->Type
) * input
->Size
+ 3)/ 4;
487 if (!input
->BufferObj
->Name
)
489 if (input
->StrideB
== 0)
491 pStreamDesc
->stride
= 0;
495 pStreamDesc
->stride
= (getTypeSize(pStreamDesc
->type
) * input
->Size
+ 3) & ~3;
498 pStreamDesc
->is_named_bo
= GL_FALSE
;
502 pStreamDesc
->size
= input
->Size
;
503 pStreamDesc
->dst_loc
= context
->nNumActiveAos
;
504 pStreamDesc
->element
= unLoc
;
505 pStreamDesc
->format
= input
->Format
;
507 switch (pStreamDesc
->type
)
510 pStreamDesc
->_signed
= 0;
511 pStreamDesc
->normalize
= GL_FALSE
;
514 pStreamDesc
->_signed
= 1;
515 pStreamDesc
->normalize
= input
->Normalized
;
518 pStreamDesc
->_signed
= 1;
519 pStreamDesc
->normalize
= input
->Normalized
;
521 case GL_UNSIGNED_SHORT
:
522 pStreamDesc
->_signed
= 0;
523 pStreamDesc
->normalize
= input
->Normalized
;
525 case GL_UNSIGNED_BYTE
:
526 pStreamDesc
->_signed
= 0;
527 pStreamDesc
->normalize
= input
->Normalized
;
531 case GL_UNSIGNED_INT
:
536 context
->nNumActiveAos
++;
539 void r700SetVertexFormat(GLcontext
*ctx
, const struct gl_client_array
*arrays
[], int count
)
541 context_t
*context
= R700_CONTEXT(ctx
);
542 struct r700_vertex_program
*vpc
543 = (struct r700_vertex_program
*)ctx
->VertexProgram
._Current
;
545 struct gl_vertex_program
* mesa_vp
= (struct gl_vertex_program
*)&(vpc
->mesa_program
);
546 unsigned int unLoc
= 0;
547 unsigned int unBit
= mesa_vp
->Base
.InputsRead
;
548 context
->nNumActiveAos
= 0;
550 if (mesa_vp
->IsPositionInvariant
)
552 unBit
|= VERT_BIT_POS
;
559 r700TranslateAttrib(ctx
, unLoc
, count
, arrays
[unLoc
]);
565 context
->radeon
.tcl
.aos_count
= context
->nNumActiveAos
;
568 void * r700GetActiveVpShaderBo(GLcontext
* ctx
)
570 context_t
*context
= R700_CONTEXT(ctx
);
571 struct r700_vertex_program
*vp
= context
->selected_vp
;;
579 GLboolean
r700SetupVertexProgram(GLcontext
* ctx
)
581 context_t
*context
= R700_CONTEXT(ctx
);
582 R700_CHIP_CONTEXT
*r700
= (R700_CHIP_CONTEXT
*)(&context
->hw
);
583 struct r700_vertex_program
*vp
= context
->selected_vp
;
585 struct gl_program_parameter_list
*paramList
;
586 unsigned int unNumParamData
;
589 if(GL_FALSE
== vp
->loaded
)
591 if(vp
->r700Shader
.bNeedsAssembly
== GL_TRUE
)
593 Assemble( &(vp
->r700Shader
) );
599 (GLvoid
*)(vp
->r700Shader
.pProgram
),
600 vp
->r700Shader
.uShaderBinaryDWORDSize
,
603 vp
->loaded
= GL_TRUE
;
606 DumpHwBinary(DUMP_VERTEX_SHADER
, (GLvoid
*)(vp
->r700Shader
.pProgram
),
607 vp
->r700Shader
.uShaderBinaryDWORDSize
);
609 /* TODO : enable this after MemUse fixed *=
610 (context->chipobj.MemUse)(context, vp->shadercode.buf->id);
613 R600_STATECHANGE(context
, vs
);
614 R600_STATECHANGE(context
, fs
); /* hack */
616 r700
->vs
.SQ_PGM_RESOURCES_VS
.u32All
= 0;
617 SETbit(r700
->vs
.SQ_PGM_RESOURCES_VS
.u32All
, PGM_RESOURCES__PRIME_CACHE_ON_DRAW_bit
);
619 r700
->vs
.SQ_PGM_START_VS
.u32All
= 0; /* set from buffer object. */
621 SETfield(r700
->vs
.SQ_PGM_RESOURCES_VS
.u32All
, vp
->r700Shader
.nRegs
+ 1,
622 NUM_GPRS_shift
, NUM_GPRS_mask
);
624 if(vp
->r700Shader
.uStackSize
) /* we don't use branch for now, it should be zero. */
626 SETfield(r700
->vs
.SQ_PGM_RESOURCES_VS
.u32All
, vp
->r700Shader
.uStackSize
,
627 STACK_SIZE_shift
, STACK_SIZE_mask
);
630 R600_STATECHANGE(context
, spi
);
632 if(vp
->mesa_program
->Base
.OutputsWritten
& (1 << VERT_RESULT_PSIZ
)) {
633 R600_STATECHANGE(context
, cl
);
634 SETbit(r700
->PA_CL_VS_OUT_CNTL
.u32All
, USE_VTX_POINT_SIZE_bit
);
635 SETbit(r700
->PA_CL_VS_OUT_CNTL
.u32All
, VS_OUT_MISC_VEC_ENA_bit
);
636 } else if (r700
->PA_CL_VS_OUT_CNTL
.u32All
!= 0) {
637 R600_STATECHANGE(context
, cl
);
638 CLEARbit(r700
->PA_CL_VS_OUT_CNTL
.u32All
, USE_VTX_POINT_SIZE_bit
);
639 CLEARbit(r700
->PA_CL_VS_OUT_CNTL
.u32All
, VS_OUT_MISC_VEC_ENA_bit
);
642 SETfield(r700
->SPI_VS_OUT_CONFIG
.u32All
,
643 vp
->r700Shader
.nParamExports
? (vp
->r700Shader
.nParamExports
- 1) : 0,
644 VS_EXPORT_COUNT_shift
, VS_EXPORT_COUNT_mask
);
645 SETfield(r700
->SPI_PS_IN_CONTROL_0
.u32All
, vp
->r700Shader
.nParamExports
,
646 NUM_INTERP_shift
, NUM_INTERP_mask
);
649 SETbit(r700->SPI_PS_IN_CONTROL_0.u32All, PERSP_GRADIENT_ENA_bit);
650 CLEARbit(r700->SPI_PS_IN_CONTROL_0.u32All, LINEAR_GRADIENT_ENA_bit);
653 /* sent out shader constants. */
654 paramList
= vp
->mesa_program
->Base
.Parameters
;
656 if(NULL
!= paramList
) {
657 /* vp->mesa_program was cloned, not updated by glsl shader api. */
658 /* _mesa_reference_program has already checked glsl shProg is ok and set ctx->VertexProgem._Current */
659 /* so, use ctx->VertexProgem._Current */
660 struct gl_program_parameter_list
*paramListOrginal
=
661 ctx
->VertexProgram
._Current
->Base
.Parameters
;
663 _mesa_load_state_parameters(ctx
, paramList
);
665 if (paramList
->NumParameters
> R700_MAX_DX9_CONSTS
)
668 R600_STATECHANGE(context
, vs_consts
);
670 r700
->vs
.num_consts
= paramList
->NumParameters
;
672 unNumParamData
= paramList
->NumParameters
;
674 for(ui
=0; ui
<unNumParamData
; ui
++) {
675 if(paramList
->Parameters
[ui
].Type
== PROGRAM_UNIFORM
)
677 r700
->vs
.consts
[ui
][0].f32All
= paramListOrginal
->ParameterValues
[ui
][0];
678 r700
->vs
.consts
[ui
][1].f32All
= paramListOrginal
->ParameterValues
[ui
][1];
679 r700
->vs
.consts
[ui
][2].f32All
= paramListOrginal
->ParameterValues
[ui
][2];
680 r700
->vs
.consts
[ui
][3].f32All
= paramListOrginal
->ParameterValues
[ui
][3];
684 r700
->vs
.consts
[ui
][0].f32All
= paramList
->ParameterValues
[ui
][0];
685 r700
->vs
.consts
[ui
][1].f32All
= paramList
->ParameterValues
[ui
][1];
686 r700
->vs
.consts
[ui
][2].f32All
= paramList
->ParameterValues
[ui
][2];
687 r700
->vs
.consts
[ui
][3].f32All
= paramList
->ParameterValues
[ui
][3];
691 r700
->vs
.num_consts
= 0;
693 COMPILED_SUB
* pCompiledSub
;
695 GLuint unConstOffset
= r700
->vs
.num_consts
;
696 for(ui
=0; ui
<vp
->r700AsmCode
.unNumPresub
; ui
++)
698 pCompiledSub
= vp
->r700AsmCode
.presubs
[ui
].pCompiledSub
;
700 r700
->vs
.num_consts
+= pCompiledSub
->NumParameters
;
702 for(uj
=0; uj
<pCompiledSub
->NumParameters
; uj
++)
704 r700
->vs
.consts
[uj
+ unConstOffset
][0].f32All
= pCompiledSub
->ParameterValues
[uj
][0];
705 r700
->vs
.consts
[uj
+ unConstOffset
][1].f32All
= pCompiledSub
->ParameterValues
[uj
][1];
706 r700
->vs
.consts
[uj
+ unConstOffset
][2].f32All
= pCompiledSub
->ParameterValues
[uj
][2];
707 r700
->vs
.consts
[uj
+ unConstOffset
][3].f32All
= pCompiledSub
->ParameterValues
[uj
][3];
709 unConstOffset
+= pCompiledSub
->NumParameters
;