wined3d: Allow drawPrim to create and use the GLSL program.

This commit is contained in:
Jason Green 2006-06-09 03:37:45 -04:00 committed by Alexandre Julliard
parent b67cda248d
commit d5d4568450
2 changed files with 17 additions and 1 deletions

View File

@ -1920,7 +1920,20 @@ UINT numberOfvertices, UINT numberOfIndicies, GLenum glPrimType, const void *idx
TRACE("Loaded arrays\n"); TRACE("Loaded arrays\n");
/* TODO: Bind the correct GLSL shader program here. */ /* Bind the correct GLSL shader program based on the currently set vertex & pixel shaders. */
if (wined3d_settings.shader_mode == SHADER_GLSL) {
GLhandleARB programId;
set_glsl_shader_program(iface);
programId = This->stateBlock->shaderPrgId;
if (programId != 0) {
/* Start using this program ID */
TRACE_(d3d_shader)("Using GLSL program %u\n", programId);
GL_EXTCALL(glUseProgramObjectARB(programId));
checkGLcall("glUseProgramObjectARB");
}
}
if (useVertexShaderFunction) { if (useVertexShaderFunction) {

View File

@ -1317,6 +1317,9 @@ extern const SHADER_OPCODE* shader_get_opcode(
/* ARB shader program Prototypes */ /* ARB shader program Prototypes */
extern void shader_hw_def(SHADER_OPCODE_ARG *arg); extern void shader_hw_def(SHADER_OPCODE_ARG *arg);
/* GLSL helper programs */
extern void set_glsl_shader_program(IWineD3DDevice *iface);
/** The following translate DirectX pixel/vertex shader opcodes to GLSL lines */ /** The following translate DirectX pixel/vertex shader opcodes to GLSL lines */
extern void shader_glsl_map2gl(SHADER_OPCODE_ARG* arg); extern void shader_glsl_map2gl(SHADER_OPCODE_ARG* arg);
extern void shader_glsl_arith(SHADER_OPCODE_ARG* arg); extern void shader_glsl_arith(SHADER_OPCODE_ARG* arg);