wined3d: Fix some GLINFO_LOCATION abuse.
This commit is contained in:
parent
571125455e
commit
55047f811a
|
@ -53,7 +53,7 @@ static BOOL need_mova_const(IWineD3DBaseShader *shader, const struct wined3d_gl_
|
|||
static inline BOOL use_nv_clip(const struct wined3d_gl_info *gl_info)
|
||||
{
|
||||
return GL_SUPPORT(NV_VERTEX_PROGRAM2_OPTION) &&
|
||||
!(GLINFO_LOCATION.quirks & WINED3D_QUIRK_NV_CLIP_BROKEN);
|
||||
!(gl_info->quirks & WINED3D_QUIRK_NV_CLIP_BROKEN);
|
||||
}
|
||||
|
||||
static BOOL need_helper_const(const struct wined3d_gl_info *gl_info)
|
||||
|
@ -3394,8 +3394,8 @@ static GLuint shader_arb_generate_pshader(IWineD3DPixelShaderImpl *This, struct
|
|||
}
|
||||
|
||||
/* Base Declarations */
|
||||
next_local = shader_generate_arb_declarations( (IWineD3DBaseShader*) This, reg_maps, buffer, &GLINFO_LOCATION,
|
||||
lconst_map, NULL, &priv_ctx);
|
||||
next_local = shader_generate_arb_declarations((IWineD3DBaseShader *)This,
|
||||
reg_maps, buffer, gl_info, lconst_map, NULL, &priv_ctx);
|
||||
|
||||
for (i = 0, map = reg_maps->bumpmat; map; map >>= 1, ++i)
|
||||
{
|
||||
|
@ -3867,8 +3867,8 @@ static GLuint shader_arb_generate_vshader(IWineD3DVertexShaderImpl *This, struct
|
|||
shader_addline(buffer, "TEMP TA;\n");
|
||||
|
||||
/* Base Declarations */
|
||||
next_local = shader_generate_arb_declarations( (IWineD3DBaseShader*) This, reg_maps, buffer, &GLINFO_LOCATION,
|
||||
lconst_map, &priv_ctx.vs_clipplanes, &priv_ctx);
|
||||
next_local = shader_generate_arb_declarations((IWineD3DBaseShader *)This,
|
||||
reg_maps, buffer, gl_info, lconst_map, &priv_ctx.vs_clipplanes, &priv_ctx);
|
||||
|
||||
for(i = 0; i < MAX_CONST_I; i++)
|
||||
{
|
||||
|
@ -3909,7 +3909,7 @@ static GLuint shader_arb_generate_vshader(IWineD3DVertexShaderImpl *This, struct
|
|||
if(!GL_SUPPORT(NV_VERTEX_PROGRAM)) {
|
||||
shader_addline(buffer, "MOV result.color.secondary, -helper_const.wwwy;\n");
|
||||
|
||||
if ((GLINFO_LOCATION).quirks & WINED3D_QUIRK_SET_TEXCOORD_W && !device->frag_pipe->ffp_proj_control)
|
||||
if (gl_info->quirks & WINED3D_QUIRK_SET_TEXCOORD_W && !device->frag_pipe->ffp_proj_control)
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i < min(8, MAX_REG_TEXCRD); i++) {
|
||||
|
|
|
@ -821,7 +821,7 @@ static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, st
|
|||
}
|
||||
|
||||
memcpy(&new_desc->parent.settings, &settings, sizeof(settings));
|
||||
new_desc->shader = gen_ati_shader(settings.op, &GLINFO_LOCATION);
|
||||
new_desc->shader = gen_ati_shader(settings.op, context->gl_info);
|
||||
add_ffp_frag_shader(&priv->fragment_shaders, &new_desc->parent);
|
||||
TRACE("Allocated fixed function replacement shader descriptor %p\n", new_desc);
|
||||
desc = new_desc;
|
||||
|
|
|
@ -1108,7 +1108,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSwapChain(IWineD3DDevice *iface,
|
|||
object->orig_width = Mode.Width;
|
||||
object->orig_height = Mode.Height;
|
||||
object->orig_fmt = Mode.Format;
|
||||
format_desc = getFormatDescEntry(Mode.Format, &GLINFO_LOCATION);
|
||||
format_desc = getFormatDescEntry(Mode.Format, &This->adapter->gl_info);
|
||||
|
||||
if (pPresentationParameters->Windowed &&
|
||||
((pPresentationParameters->BackBufferWidth == 0) ||
|
||||
|
@ -2135,7 +2135,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetDisplayMode(IWineD3DDevice *iface, U
|
|||
DEVMODEW devmode;
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
LONG ret;
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(pMode->Format, &GLINFO_LOCATION);
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(pMode->Format, &This->adapter->gl_info);
|
||||
RECT clip_rc;
|
||||
|
||||
TRACE("(%p)->(%d,%p) Mode=%dx%dx@%d, %s\n", This, iSwapChain, pMode, pMode->Width, pMode->Height, pMode->RefreshRate, debug_d3dformat(pMode->Format));
|
||||
|
@ -6285,7 +6285,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetCursorProperties(IWineD3DDevice* i
|
|||
if (SUCCEEDED(IWineD3DSurface_LockRect(pCursorBitmap, &rect, NULL, WINED3DLOCK_READONLY)))
|
||||
{
|
||||
const struct GlPixelFormatDesc *glDesc =
|
||||
getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, &GLINFO_LOCATION);
|
||||
getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, &This->adapter->gl_info);
|
||||
char *mem, *bits = rect.pBits;
|
||||
GLint intfmt = glDesc->glInternal;
|
||||
GLint format = glDesc->glFormat;
|
||||
|
|
|
@ -862,7 +862,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
|
|||
*/
|
||||
max_constantsF -= count_bits(This->baseShader.reg_maps.boolean_constants);
|
||||
/* Set by driver quirks in directx.c */
|
||||
max_constantsF -= GLINFO_LOCATION.reserved_glsl_constants;
|
||||
max_constantsF -= gl_info->reserved_glsl_constants;
|
||||
} else {
|
||||
max_constantsF = GL_LIMITS(vs_glsl_constantsF);
|
||||
}
|
||||
|
@ -3575,7 +3575,7 @@ static GLhandleARB generate_param_reorder_function(struct wined3d_shader_buffer
|
|||
* Take care about the texcoord .w fixup though if we're using the fixed function fragment pipeline
|
||||
*/
|
||||
device = (IWineD3DDeviceImpl *) vs->baseShader.device;
|
||||
if (((GLINFO_LOCATION).quirks & WINED3D_QUIRK_SET_TEXCOORD_W)
|
||||
if ((gl_info->quirks & WINED3D_QUIRK_SET_TEXCOORD_W)
|
||||
&& ps_major == 0 && vs_major > 0 && !device->frag_pipe->ffp_proj_control)
|
||||
{
|
||||
shader_addline(buffer, "void order_ps_input() {\n");
|
||||
|
@ -3622,7 +3622,7 @@ static GLhandleARB generate_param_reorder_function(struct wined3d_shader_buffer
|
|||
{
|
||||
if (semantic_idx < 8)
|
||||
{
|
||||
if (!((GLINFO_LOCATION).quirks & WINED3D_QUIRK_SET_TEXCOORD_W) || ps_major > 0)
|
||||
if (!(gl_info->quirks & WINED3D_QUIRK_SET_TEXCOORD_W) || ps_major > 0)
|
||||
write_mask |= WINED3DSP_WRITEMASK_3;
|
||||
|
||||
shader_addline(buffer, "gl_TexCoord[%u]%s = OUT[%u]%s;\n",
|
||||
|
@ -3809,7 +3809,7 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context
|
|||
TRACE("Compiling shader object %u\n", shader_obj);
|
||||
GL_EXTCALL(glShaderSourceARB(shader_obj, 1, (const char**)&buffer->buffer, NULL));
|
||||
GL_EXTCALL(glCompileShaderARB(shader_obj));
|
||||
print_glsl_info_log(&GLINFO_LOCATION, shader_obj);
|
||||
print_glsl_info_log(gl_info, shader_obj);
|
||||
|
||||
/* Store the shader object */
|
||||
return shader_obj;
|
||||
|
@ -3878,7 +3878,7 @@ static GLuint shader_glsl_generate_vshader(const struct wined3d_context *context
|
|||
TRACE("Compiling shader object %u\n", shader_obj);
|
||||
GL_EXTCALL(glShaderSourceARB(shader_obj, 1, (const char**)&buffer->buffer, NULL));
|
||||
GL_EXTCALL(glCompileShaderARB(shader_obj));
|
||||
print_glsl_info_log(&GLINFO_LOCATION, shader_obj);
|
||||
print_glsl_info_log(gl_info, shader_obj);
|
||||
|
||||
return shader_obj;
|
||||
}
|
||||
|
@ -4130,7 +4130,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context,
|
|||
/* Link the program */
|
||||
TRACE("Linking GLSL shader program %u\n", programId);
|
||||
GL_EXTCALL(glLinkProgramARB(programId));
|
||||
print_glsl_info_log(&GLINFO_LOCATION, programId);
|
||||
print_glsl_info_log(gl_info, programId);
|
||||
|
||||
entry->vuniformF_locations = HeapAlloc(GetProcessHeap(), 0, sizeof(GLhandleARB) * GL_LIMITS(vs_glsl_constantsF));
|
||||
for (i = 0; i < GL_LIMITS(vs_glsl_constantsF); ++i) {
|
||||
|
@ -4278,7 +4278,7 @@ static GLhandleARB create_glsl_blt_shader(const struct wined3d_gl_info *gl_info,
|
|||
GL_EXTCALL(glAttachObjectARB(program_id, pshader_id));
|
||||
GL_EXTCALL(glLinkProgramARB(program_id));
|
||||
|
||||
print_glsl_info_log(&GLINFO_LOCATION, program_id);
|
||||
print_glsl_info_log(gl_info, program_id);
|
||||
|
||||
/* Once linked we can mark the shaders for deletion. They will be deleted once the program
|
||||
* is destroyed
|
||||
|
|
|
@ -4322,7 +4322,7 @@ static void loadVertexData(const struct wined3d_context *context, IWineD3DStateB
|
|||
curVBO = e->buffer_object;
|
||||
}
|
||||
|
||||
if(format != 4 || (GLINFO_LOCATION.quirks & WINED3D_QUIRK_ALLOWS_SPECULAR_ALPHA))
|
||||
if (format != 4 || (context->gl_info->quirks & WINED3D_QUIRK_ALLOWS_SPECULAR_ALPHA))
|
||||
{
|
||||
/* Usually specular colors only allow 3 components, since they have no alpha. In D3D, the specular alpha
|
||||
* contains the fog coordinate, which is passed to GL with GL_EXT_fog_coord. However, the fixed function
|
||||
|
|
|
@ -126,7 +126,7 @@ HRESULT surface_init(IWineD3DSurfaceImpl *surface, WINED3DSURFTYPE surface_type,
|
|||
WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
|
||||
{
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, &GLINFO_LOCATION);
|
||||
const struct GlPixelFormatDesc *format_desc = getFormatDescEntry(format, gl_info);
|
||||
void (*cleanup)(IWineD3DSurfaceImpl *This);
|
||||
unsigned int resource_size;
|
||||
HRESULT hr;
|
||||
|
|
Loading…
Reference in New Issue