Commit 4d4654a0 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Set the arb_program_shader.c GLINFO_LOCATION to *gl_info.

parent 11bda6e0
......@@ -5537,11 +5537,10 @@ static void arbfp_get_caps(const struct wined3d_gl_info *gl_info, struct fragmen
caps->MaxTextureBlendStages = 8;
caps->MaxSimultaneousTextures = min(gl_info->limits.fragment_samplers, 8);
}
#undef GLINFO_LOCATION
#define GLINFO_LOCATION stateblock->device->adapter->gl_info
static void state_texfactor_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
IWineD3DDeviceImpl *device = stateblock->device;
float col[4];
......@@ -5563,6 +5562,7 @@ static void state_texfactor_arbfp(DWORD state, IWineD3DStateBlockImpl *statebloc
static void state_arb_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
IWineD3DDeviceImpl *device = stateblock->device;
float col[4];
......@@ -5591,6 +5591,7 @@ static void state_arb_specularenable(DWORD state, IWineD3DStateBlockImpl *stateb
static void set_bumpmat_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
const struct wined3d_gl_info *gl_info = context->gl_info;
IWineD3DDeviceImpl *device = stateblock->device;
float mat[2][2];
......@@ -5627,6 +5628,7 @@ static void set_bumpmat_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, s
static void tex_bumpenvlum_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
DWORD stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
const struct wined3d_gl_info *gl_info = context->gl_info;
IWineD3DDeviceImpl *device = stateblock->device;
float param[4];
......@@ -5874,6 +5876,7 @@ static void gen_ffp_instr(struct wined3d_shader_buffer *buffer, unsigned int sta
/* The stateblock is passed for GLINFO_LOCATION */
static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, IWineD3DStateBlockImpl *stateblock)
{
const struct wined3d_gl_info *gl_info = &stateblock->device->adapter->gl_info;
unsigned int stage;
struct wined3d_shader_buffer buffer;
BOOL tex_read[MAX_TEXTURES] = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE};
......@@ -6148,6 +6151,7 @@ static GLuint gen_arbfp_ffp_shader(const struct ffp_frag_settings *settings, IWi
static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d_context *context)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
IWineD3DDeviceImpl *device = stateblock->device;
struct shader_arb_priv *priv = device->fragment_priv;
BOOL use_pshader = use_ps(stateblock);
......@@ -6184,7 +6188,7 @@ static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock,
return;
}
new_desc->num_textures_used = 0;
for (i = 0; i < context->gl_info->limits.texture_stages; ++i)
for (i = 0; i < gl_info->limits.texture_stages; ++i)
{
if(settings.op[i].cop == WINED3DTOP_DISABLE) break;
new_desc->num_textures_used = i;
......@@ -6280,8 +6284,6 @@ static void textransform(DWORD state, IWineD3DStateBlockImpl *stateblock, struct
}
}
#undef GLINFO_LOCATION
static const struct StateEntryTemplate arbfp_fragmentstate_template[] = {
{STATE_RENDER(WINED3DRS_TEXTUREFACTOR), { STATE_RENDER(WINED3DRS_TEXTUREFACTOR), state_texfactor_arbfp }, WINED3D_GL_EXT_NONE },
{STATE_TEXTURESTAGE(0, WINED3DTSS_COLOROP), { STATE_PIXELSHADER, NULL }, WINED3D_GL_EXT_NONE },
......@@ -6443,8 +6445,6 @@ const struct fragment_pipeline arbfp_fragment_pipeline = {
TRUE /* We can disable projected textures */
};
#define GLINFO_LOCATION device->adapter->gl_info
struct arbfp_blit_priv {
GLenum yuy2_rect_shader, yuy2_2d_shader;
GLenum uyvy_rect_shader, uyvy_2d_shader;
......@@ -6466,6 +6466,7 @@ static HRESULT arbfp_blit_alloc(IWineD3DDevice *iface) {
/* Context activation is done by the caller. */
static void arbfp_blit_free(IWineD3DDevice *iface) {
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) iface;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
struct arbfp_blit_priv *priv = device->blit_priv;
ENTER_GL();
......@@ -6722,6 +6723,7 @@ static BOOL gen_yv12_read(struct wined3d_shader_buffer *buffer, GLenum textype,
static GLuint gen_p8_shader(IWineD3DDeviceImpl *device, GLenum textype)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
GLenum shader;
struct wined3d_shader_buffer buffer;
struct arbfp_blit_priv *priv = device->blit_priv;
......@@ -6791,6 +6793,7 @@ static void upload_palette(IWineD3DSurfaceImpl *surface)
{
BYTE table[256][4];
IWineD3DDeviceImpl *device = surface->resource.device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
struct arbfp_blit_priv *priv = device->blit_priv;
BOOL colorkey = (surface->CKeyFlags & WINEDDSD_CKSRCBLT) ? TRUE : FALSE;
......@@ -6821,6 +6824,7 @@ static void upload_palette(IWineD3DSurfaceImpl *surface)
/* Context activation is done by the caller. */
static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, enum complex_fixup yuv_fixup, GLenum textype)
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
GLenum shader;
struct wined3d_shader_buffer buffer;
char luminance_component;
......@@ -6979,6 +6983,7 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surfac
{
GLenum shader;
IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) iface;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
float size[4] = {surface->pow2Width, surface->pow2Height, 1, 1};
struct arbfp_blit_priv *priv = device->blit_priv;
enum complex_fixup fixup;
......@@ -7182,5 +7187,3 @@ const struct blit_shader arbfp_blit = {
arbfp_blit_supported,
arbfp_blit_color_fill
};
#undef GLINFO_LOCATION
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment