Lines Matching refs:ctx
76 GET_CURRENT_CONTEXT(ctx);
77 ASSERT_OUTSIDE_BEGIN_END(ctx);
81 (ctx->Extensions.NV_vertex_program ||
82 ctx->Extensions.ARB_vertex_program)) {
83 curProg = &ctx->VertexProgram.Current->Base;
86 && ctx->Extensions.NV_fragment_program) ||
88 && ctx->Extensions.ARB_fragment_program)) {
89 curProg = &ctx->FragmentProgram.Current->Base;
92 _mesa_error(ctx, GL_INVALID_ENUM, "glBindProgramNV/ARB(target)");
105 newProg = &ctx->Shared->DefaultVertexProgram->Base;
107 newProg = &ctx->Shared->DefaultFragmentProgram->Base;
111 newProg = _mesa_lookup_program(ctx, id);
114 newProg = ctx->Driver.NewProgram(ctx, target, id);
116 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindProgramNV/ARB");
119 _mesa_HashInsert(ctx->Shared->Programs, id, newProg);
122 _mesa_error(ctx, GL_INVALID_OPERATION,
136 FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS);
140 _mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current,
145 _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current,
150 ASSERT(ctx->VertexProgram.Current);
151 ASSERT(ctx->FragmentProgram.Current);
153 if (ctx->Driver.BindProgram)
154 ctx->Driver.BindProgram(ctx, target, newProg);
167 GET_CURRENT_CONTEXT(ctx);
168 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
171 _mesa_error( ctx, GL_INVALID_VALUE, "glDeleteProgramsNV" );
177 struct gl_program *prog = _mesa_lookup_program(ctx, ids[i]);
179 _mesa_HashRemove(ctx->Shared->Programs, ids[i]);
186 if (ctx->VertexProgram.Current &&
187 ctx->VertexProgram.Current->Base.Id == ids[i]) {
194 if (ctx->FragmentProgram.Current &&
195 ctx->FragmentProgram.Current->Base.Id == ids[i]) {
201 _mesa_problem(ctx, "bad target in glDeleteProgramsNV");
205 _mesa_HashRemove(ctx->Shared->Programs, ids[i]);
206 _mesa_reference_program(ctx, &prog, NULL);
223 GET_CURRENT_CONTEXT(ctx);
224 ASSERT_OUTSIDE_BEGIN_END(ctx);
227 _mesa_error(ctx, GL_INVALID_VALUE, "glGenPrograms");
234 first = _mesa_HashFindFreeKeyBlock(ctx->Shared->Programs, n);
238 _mesa_HashInsert(ctx->Shared->Programs, first + i, &_mesa_DummyProgram);
259 GET_CURRENT_CONTEXT(ctx);
260 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
265 prog = _mesa_lookup_program(ctx, id);
273 get_local_param_pointer(struct gl_context *ctx, const char *func,
280 && ctx->Extensions.ARB_vertex_program) {
281 prog = &(ctx->VertexProgram.Current->Base);
282 maxParams = ctx->Const.VertexProgram.MaxLocalParams;
285 && ctx->Extensions.ARB_fragment_program) {
286 prog = &(ctx->FragmentProgram.Current->Base);
287 maxParams = ctx->Const.FragmentProgram.MaxLocalParams;
290 && ctx->Extensions.NV_fragment_program) {
291 prog = &(ctx->FragmentProgram.Current->Base);
295 _mesa_error(ctx, GL_INVALID_ENUM,
301 _mesa_error(ctx, GL_INVALID_VALUE, "%s(index)", func);
311 get_env_param_pointer(struct gl_context *ctx, const char *func,
315 && ctx->Extensions.ARB_fragment_program) {
316 if (index >= ctx->Const.FragmentProgram.MaxEnvParams) {
317 _mesa_error(ctx, GL_INVALID_VALUE, "%s(index)", func);
320 *param = ctx->FragmentProgram.Parameters[index];
324 (ctx->Extensions.ARB_vertex_program ||
325 ctx->Extensions.NV_vertex_program)) {
326 if (index >= ctx->Const.VertexProgram.MaxEnvParams) {
327 _mesa_error(ctx, GL_INVALID_VALUE, "%s(index)", func);
330 *param = ctx->VertexProgram.Parameters[index];
333 _mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", func);
343 GET_CURRENT_CONTEXT(ctx);
344 ASSERT_OUTSIDE_BEGIN_END(ctx);
346 FLUSH_VERTICES(ctx, _NEW_PROGRAM);
348 if (!ctx->Extensions.ARB_vertex_program
349 && !ctx->Extensions.ARB_fragment_program) {
350 _mesa_error(ctx, GL_INVALID_OPERATION, "glProgramStringARB()");
355 _mesa_error(ctx, GL_INVALID_ENUM, "glProgramStringARB(format)");
365 && ctx->Extensions.ARB_vertex_program
367 || !ctx->Extensions.NV_vertex_program)) {
368 struct gl_vertex_program *prog = ctx->VertexProgram.Current;
369 _mesa_parse_arb_vertex_program(ctx, target, string, len, prog);
375 && ctx->Extensions.NV_vertex_program) {
376 struct gl_vertex_program *prog = ctx->VertexProgram.Current;
377 _mesa_parse_nv_vertex_program(ctx, target, string, len, prog);
382 && ctx->Extensions.ARB_fragment_program) {
383 struct gl_fragment_program *prog = ctx->FragmentProgram.Current;
384 _mesa_parse_arb_fragment_program(ctx, target, string, len, prog);
389 && ctx->Extensions.NV_fragment_program) {
390 struct gl_fragment_program *prog = ctx->FragmentProgram.Current;
391 _mesa_parse_nv_fragment_program(ctx, target, string, len, prog);
396 _mesa_error(ctx, GL_INVALID_ENUM, "glProgramStringARB(target)");
400 if (ctx->Program.ErrorPos == -1) {
402 if (!ctx->Driver.ProgramStringNotify(ctx, target, base)) {
403 _mesa_error(ctx, GL_INVALID_OPERATION,
453 GET_CURRENT_CONTEXT(ctx);
454 ASSERT_OUTSIDE_BEGIN_END(ctx);
456 FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS);
458 if (get_env_param_pointer(ctx, "glProgramEnvParameter",
478 GET_CURRENT_CONTEXT(ctx);
479 ASSERT_OUTSIDE_BEGIN_END(ctx);
481 FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS);
483 if (get_env_param_pointer(ctx, "glProgramEnvParameter4fv",
494 GET_CURRENT_CONTEXT(ctx);
496 ASSERT_OUTSIDE_BEGIN_END(ctx);
498 FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS);
501 _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameters4fv(count)");
505 && ctx->Extensions.ARB_fragment_program) {
506 if ((index + count) > ctx->Const.FragmentProgram.MaxEnvParams) {
507 _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameters4fv(index + count)");
510 dest = ctx->FragmentProgram.Parameters[index];
513 && ctx->Extensions.ARB_vertex_program) {
514 if ((index + count) > ctx->Const.VertexProgram.MaxEnvParams) {
515 _mesa_error(ctx, GL_INVALID_VALUE, "glProgramEnvParameters4fv(index + count)");
518 dest = ctx->VertexProgram.Parameters[index];
521 _mesa_error(ctx, GL_INVALID_ENUM, "glProgramEnvParameters4fv(target)");
533 GET_CURRENT_CONTEXT(ctx);
536 if (get_env_param_pointer(ctx, "glGetProgramEnvParameterdv",
549 GET_CURRENT_CONTEXT(ctx);
551 ASSERT_OUTSIDE_BEGIN_END(ctx);
553 if (get_env_param_pointer(ctx, "glGetProgramEnvParameterfv",
567 GET_CURRENT_CONTEXT(ctx);
569 ASSERT_OUTSIDE_BEGIN_END(ctx);
571 FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS);
573 if (get_local_param_pointer(ctx, "glProgramLocalParameterARB",
597 GET_CURRENT_CONTEXT(ctx);
599 ASSERT_OUTSIDE_BEGIN_END(ctx);
601 FLUSH_VERTICES(ctx, _NEW_PROGRAM_CONSTANTS);
604 _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameters4fv(count)");
608 && ctx->Extensions.ARB_fragment_program) {
609 if ((index + count) > ctx->Const.FragmentProgram.MaxLocalParams) {
610 _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameters4fvEXT(index + count)");
613 dest = ctx->FragmentProgram.Current->Base.LocalParams[index];
616 && ctx->Extensions.ARB_vertex_program) {
617 if ((index + count) > ctx->Const.VertexProgram.MaxLocalParams) {
618 _mesa_error(ctx, GL_INVALID_VALUE, "glProgramLocalParameters4fvEXT(index + count)");
621 dest = ctx->VertexProgram.Current->Base.LocalParams[index];
624 _mesa_error(ctx, GL_INVALID_ENUM, "glProgramLocalParameters4fvEXT(target)");
666 GET_CURRENT_CONTEXT(ctx);
667 ASSERT_OUTSIDE_BEGIN_END(ctx);
669 if (get_local_param_pointer(ctx, "glProgramLocalParameters4fvEXT",
684 GET_CURRENT_CONTEXT(ctx);
685 ASSERT_OUTSIDE_BEGIN_END(ctx);
687 if (get_local_param_pointer(ctx, "glProgramLocalParameters4fvEXT",
699 GET_CURRENT_CONTEXT(ctx);
701 ASSERT_OUTSIDE_BEGIN_END(ctx);
704 && ctx->Extensions.ARB_vertex_program) {
705 prog = &(ctx->VertexProgram.Current->Base);
706 limits = &ctx->Const.VertexProgram;
709 && ctx->Extensions.ARB_fragment_program) {
710 prog = &(ctx->FragmentProgram.Current->Base);
711 limits = &ctx->Const.FragmentProgram;
714 _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramivARB(target)");
811 else if (ctx->Driver.IsProgramNative) {
813 *params = ctx->Driver.IsProgramNative( ctx, target, prog );
829 const struct gl_fragment_program *fp = ctx->FragmentProgram.Current;
868 _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramivARB(pname)");
872 _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramivARB(pname)");
883 GET_CURRENT_CONTEXT(ctx);
885 ASSERT_OUTSIDE_BEGIN_END(ctx);
888 prog = &(ctx->VertexProgram.Current->Base);
891 prog = &(ctx->FragmentProgram.Current->Base);
894 _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramStringARB(target)");
901 _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramStringARB(pname)");