X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fshader%2Fnvprogram.c;h=50358cf10761afbcd2704160bf6e470e180756e8;hb=548be3846db59ad43934a159c051b359db6e56db;hp=337784bfe259b71641c48d0598bad4675215b0ac;hpb=d619cceea47dc3070ebb7f7ea4f8b6b31a672d38;p=mesa.git diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 337784bfe25..50358cf1076 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -37,17 +37,17 @@ * including any use thereof or modifications thereto. */ -#include "glheader.h" -#include "context.h" -#include "hash.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/hash.h" +#include "main/imports.h" +#include "main/macros.h" +#include "program.h" #include "prog_parameter.h" #include "prog_instruction.h" #include "nvfragparse.h" #include "nvvertparse.h" #include "nvprogram.h" -#include "program.h" @@ -246,8 +246,7 @@ _mesa_GetProgramivNV(GLuint id, GLenum pname, GLint *params) struct gl_program *prog; GET_CURRENT_CONTEXT(ctx); - if (!ctx->_CurrentProgram) - ASSERT_OUTSIDE_BEGIN_END(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); prog = _mesa_lookup_program(ctx, id); if (!prog) { @@ -283,8 +282,7 @@ _mesa_GetProgramStringNV(GLuint id, GLenum pname, GLubyte *program) struct gl_program *prog; GET_CURRENT_CONTEXT(ctx); - if (!ctx->_CurrentProgram) - ASSERT_OUTSIDE_BEGIN_END(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); if (pname != GL_PROGRAM_STRING_NV) { _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramStringNV(pname)"); @@ -469,10 +467,6 @@ _mesa_GetVertexAttribivNV(GLuint index, GLenum pname, GLint *params) params[3] = (GLint) ctx->Current.Attrib[index][3]; break; case GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB: - if (!ctx->Extensions.ARB_vertex_buffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetVertexAttribdvNV"); - return; - } params[0] = ctx->Array.ArrayObj->VertexAttrib[index].BufferObj->Name; break; default: @@ -575,75 +569,6 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, -/** - * Set a program parameter register. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_ProgramParameter4dNV(GLenum target, GLuint index, - GLdouble x, GLdouble y, GLdouble z, GLdouble w) -{ - _mesa_ProgramParameter4fNV(target, index, - (GLfloat)x, (GLfloat)y, (GLfloat)z, (GLfloat)w); -} - - -/** - * Set a program parameter register. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_ProgramParameter4dvNV(GLenum target, GLuint index, - const GLdouble *params) -{ - _mesa_ProgramParameter4fNV(target, index, - (GLfloat)params[0], (GLfloat)params[1], - (GLfloat)params[2], (GLfloat)params[3]); -} - - -/** - * Set a program parameter register. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_ProgramParameter4fNV(GLenum target, GLuint index, - GLfloat x, GLfloat y, GLfloat z, GLfloat w) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (target == GL_VERTEX_PROGRAM_NV && ctx->Extensions.NV_vertex_program) { - if (index < MAX_NV_VERTEX_PROGRAM_PARAMS) { - FLUSH_VERTICES(ctx, _NEW_PROGRAM); - ASSIGN_4V(ctx->VertexProgram.Parameters[index], x, y, z, w); - } - else { - _mesa_error(ctx, GL_INVALID_VALUE, "glProgramParameterNV(index)"); - return; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramParameterNV"); - return; - } -} - - -/** - * Set a program parameter register. - * \note Called from the GL API dispatcher. - */ -void GLAPIENTRY -_mesa_ProgramParameter4fvNV(GLenum target, GLuint index, - const GLfloat *params) -{ - _mesa_ProgramParameter4fNV(target, index, - params[0], params[1], params[2], params[3]); -} - - - /** * Set a sequence of program parameter registers. * \note Called from the GL API dispatcher. @@ -846,8 +771,7 @@ _mesa_GetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, GET_CURRENT_CONTEXT(ctx); - if (!ctx->_CurrentProgram) - ASSERT_OUTSIDE_BEGIN_END(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); prog = _mesa_lookup_program(ctx, id); if (!prog || prog->Target != GL_FRAGMENT_PROGRAM_NV) {