Commit 3a7f08a5 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Rename wined3d_format_desc to wined3d_format.

parent c568916f
...@@ -6987,10 +6987,10 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surfac ...@@ -6987,10 +6987,10 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surfac
enum complex_fixup fixup; enum complex_fixup fixup;
GLenum textype = surface->texture_target; GLenum textype = surface->texture_target;
if (!is_complex_fixup(surface->resource.format_desc->color_fixup)) if (!is_complex_fixup(surface->resource.format->color_fixup))
{ {
TRACE("Fixup:\n"); TRACE("Fixup:\n");
dump_color_fixup_desc(surface->resource.format_desc->color_fixup); dump_color_fixup_desc(surface->resource.format->color_fixup);
/* Don't bother setting up a shader for unconverted formats */ /* Don't bother setting up a shader for unconverted formats */
ENTER_GL(); ENTER_GL();
glEnable(textype); glEnable(textype);
...@@ -6999,7 +6999,7 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surfac ...@@ -6999,7 +6999,7 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surfac
return WINED3D_OK; return WINED3D_OK;
} }
fixup = get_complex_fixup(surface->resource.format_desc->color_fixup); fixup = get_complex_fixup(surface->resource.format->color_fixup);
switch(fixup) switch(fixup)
{ {
...@@ -7069,10 +7069,8 @@ static void arbfp_blit_unset(IWineD3DDevice *iface) { ...@@ -7069,10 +7069,8 @@ static void arbfp_blit_unset(IWineD3DDevice *iface) {
} }
static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info, enum blit_operation blit_op, static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info, enum blit_operation blit_op,
const RECT *src_rect, DWORD src_usage, WINED3DPOOL src_pool, const RECT *src_rect, DWORD src_usage, WINED3DPOOL src_pool, const struct wined3d_format *src_format,
const struct wined3d_format_desc *src_format_desc, const RECT *dst_rect, DWORD dst_usage, WINED3DPOOL dst_pool, const struct wined3d_format *dst_format)
const RECT *dst_rect, DWORD dst_usage, WINED3DPOOL dst_pool,
const struct wined3d_format_desc *dst_format_desc)
{ {
enum complex_fixup src_fixup; enum complex_fixup src_fixup;
...@@ -7082,27 +7080,27 @@ static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info, enum bli ...@@ -7082,27 +7080,27 @@ static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info, enum bli
return FALSE; return FALSE;
} }
src_fixup = get_complex_fixup(src_format_desc->color_fixup); src_fixup = get_complex_fixup(src_format->color_fixup);
if (TRACE_ON(d3d_shader) && TRACE_ON(d3d)) if (TRACE_ON(d3d_shader) && TRACE_ON(d3d))
{ {
TRACE("Checking support for fixup:\n"); TRACE("Checking support for fixup:\n");
dump_color_fixup_desc(src_format_desc->color_fixup); dump_color_fixup_desc(src_format->color_fixup);
} }
if (!is_identity_fixup(dst_format_desc->color_fixup)) if (!is_identity_fixup(dst_format->color_fixup))
{ {
TRACE("Destination fixups are not supported\n"); TRACE("Destination fixups are not supported\n");
return FALSE; return FALSE;
} }
if (is_identity_fixup(src_format_desc->color_fixup)) if (is_identity_fixup(src_format->color_fixup))
{ {
TRACE("[OK]\n"); TRACE("[OK]\n");
return TRUE; return TRUE;
} }
/* We only support YUV conversions. */ /* We only support YUV conversions. */
if (!is_complex_fixup(src_format_desc->color_fixup)) if (!is_complex_fixup(src_format->color_fixup))
{ {
TRACE("[FAILED]\n"); TRACE("[FAILED]\n");
return FALSE; return FALSE;
......
...@@ -29,13 +29,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture); ...@@ -29,13 +29,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture);
HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT layer_count, UINT level_count, HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT layer_count, UINT level_count,
WINED3DRESOURCETYPE resource_type, IWineD3DDeviceImpl *device, UINT size, DWORD usage, WINED3DRESOURCETYPE resource_type, IWineD3DDeviceImpl *device, UINT size, DWORD usage,
const struct wined3d_format_desc *format_desc, WINED3DPOOL pool, IUnknown *parent, const struct wined3d_format *format, WINED3DPOOL pool, IUnknown *parent,
const struct wined3d_parent_ops *parent_ops) const struct wined3d_parent_ops *parent_ops)
{ {
HRESULT hr; HRESULT hr;
hr = resource_init((IWineD3DResource *)texture, resource_type, device, hr = resource_init((IWineD3DResource *)texture, resource_type, device,
size, usage, format_desc, pool, parent, parent_ops); size, usage, format, pool, parent, parent_ops);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to initialize resource, returning %#x\n", hr); WARN("Failed to initialize resource, returning %#x\n", hr);
...@@ -60,7 +60,7 @@ HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT layer_count, UIN ...@@ -60,7 +60,7 @@ HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT layer_count, UIN
texture->baseTexture.is_srgb = FALSE; texture->baseTexture.is_srgb = FALSE;
texture->baseTexture.pow2Matrix_identity = TRUE; texture->baseTexture.pow2Matrix_identity = TRUE;
if (texture->resource.format_desc->Flags & WINED3DFMT_FLAG_FILTERING) if (texture->resource.format->Flags & WINED3DFMT_FLAG_FILTERING)
{ {
texture->baseTexture.minMipLookup = minMipLookup; texture->baseTexture.minMipLookup = minMipLookup;
texture->baseTexture.magLookup = magLookup; texture->baseTexture.magLookup = magLookup;
...@@ -520,10 +520,10 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface, ...@@ -520,10 +520,10 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
gl_tex->states[WINED3DTEXSTA_MAXANISOTROPY] = aniso; gl_tex->states[WINED3DTEXSTA_MAXANISOTROPY] = aniso;
} }
if (!(This->resource.format_desc->Flags & WINED3DFMT_FLAG_SHADOW) if (!(This->resource.format->Flags & WINED3DFMT_FLAG_SHADOW)
!= !gl_tex->states[WINED3DTEXSTA_SHADOW]) != !gl_tex->states[WINED3DTEXSTA_SHADOW])
{ {
if (This->resource.format_desc->Flags & WINED3DFMT_FLAG_SHADOW) if (This->resource.format->Flags & WINED3DFMT_FLAG_SHADOW)
{ {
glTexParameteri(textureDimensions, GL_DEPTH_TEXTURE_MODE_ARB, GL_LUMINANCE); glTexParameteri(textureDimensions, GL_DEPTH_TEXTURE_MODE_ARB, GL_LUMINANCE);
glTexParameteri(textureDimensions, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE_ARB); glTexParameteri(textureDimensions, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE_ARB);
......
...@@ -245,7 +245,7 @@ static BOOL buffer_process_converted_attribute(struct wined3d_buffer *This, ...@@ -245,7 +245,7 @@ static BOOL buffer_process_converted_attribute(struct wined3d_buffer *This,
if (!attrib->stride) if (!attrib->stride)
{ {
FIXME("%s used with stride 0, let's hope we get the vertex stride from somewhere else\n", FIXME("%s used with stride 0, let's hope we get the vertex stride from somewhere else\n",
debug_d3dformat(attrib->format_desc->id)); debug_d3dformat(attrib->format->id));
} }
else if(attrib->stride != *stride_this_run && *stride_this_run) else if(attrib->stride != *stride_this_run && *stride_this_run)
{ {
...@@ -269,7 +269,7 @@ static BOOL buffer_process_converted_attribute(struct wined3d_buffer *This, ...@@ -269,7 +269,7 @@ static BOOL buffer_process_converted_attribute(struct wined3d_buffer *This,
} }
data = (((DWORD_PTR)attrib->data) + offset) % This->stride; data = (((DWORD_PTR)attrib->data) + offset) % This->stride;
attrib_size = attrib->format_desc->component_count * attrib->format_desc->component_size; attrib_size = attrib->format->component_count * attrib->format->component_size;
for (i = 0; i < attrib_size; ++i) for (i = 0; i < attrib_size; ++i)
{ {
DWORD_PTR idx = (data + i) % This->stride; DWORD_PTR idx = (data + i) % This->stride;
...@@ -302,7 +302,7 @@ static BOOL buffer_check_attribute(struct wined3d_buffer *This, const struct win ...@@ -302,7 +302,7 @@ static BOOL buffer_check_attribute(struct wined3d_buffer *This, const struct win
|| attrib->buffer_object != This->buffer_object) || attrib->buffer_object != This->buffer_object)
return FALSE; return FALSE;
format = attrib->format_desc->id; format = attrib->format->id;
/* Look for newly appeared conversion */ /* Look for newly appeared conversion */
if (!gl_info->supported[ARB_HALF_FLOAT_VERTEX] if (!gl_info->supported[ARB_HALF_FLOAT_VERTEX]
&& (format == WINED3DFMT_R16G16_FLOAT || format == WINED3DFMT_R16G16B16A16_FLOAT)) && (format == WINED3DFMT_R16G16_FLOAT || format == WINED3DFMT_R16G16B16A16_FLOAT))
...@@ -350,7 +350,7 @@ static UINT *find_conversion_shift(struct wined3d_buffer *This, ...@@ -350,7 +350,7 @@ static UINT *find_conversion_shift(struct wined3d_buffer *This,
if (!(strided->use_map & (1 << i)) || strided->elements[i].buffer_object != This->buffer_object) continue; if (!(strided->use_map & (1 << i)) || strided->elements[i].buffer_object != This->buffer_object) continue;
format = strided->elements[i].format_desc->id; format = strided->elements[i].format->id;
if (format == WINED3DFMT_R16G16_FLOAT) if (format == WINED3DFMT_R16G16_FLOAT)
{ {
shift = 4; shift = 4;
...@@ -374,8 +374,8 @@ static UINT *find_conversion_shift(struct wined3d_buffer *This, ...@@ -374,8 +374,8 @@ static UINT *find_conversion_shift(struct wined3d_buffer *This,
if (shift) if (shift)
{ {
orig_type_size = strided->elements[i].format_desc->component_count orig_type_size = strided->elements[i].format->component_count
* strided->elements[i].format_desc->component_size; * strided->elements[i].format->component_size;
for (j = (DWORD_PTR)strided->elements[i].data + orig_type_size; j < stride; ++j) for (j = (DWORD_PTR)strided->elements[i].data + orig_type_size; j < stride; ++j)
{ {
ret[j] += shift; ret[j] += shift;
...@@ -1450,9 +1450,9 @@ HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device, ...@@ -1450,9 +1450,9 @@ HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
UINT size, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, GLenum bind_hint, UINT size, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, GLenum bind_hint,
const char *data, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) const char *data, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
{ {
const struct wined3d_format_desc *format_desc = getFormatDescEntry(format_id, &device->adapter->gl_info);
HRESULT hr;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_format *format = wined3d_get_format(gl_info, format_id);
HRESULT hr;
BOOL dynamic_buffer_ok; BOOL dynamic_buffer_ok;
if (!size) if (!size)
...@@ -1464,7 +1464,7 @@ HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device, ...@@ -1464,7 +1464,7 @@ HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
buffer->vtbl = &wined3d_buffer_vtbl; buffer->vtbl = &wined3d_buffer_vtbl;
hr = resource_init((IWineD3DResource *)buffer, WINED3DRTYPE_BUFFER, hr = resource_init((IWineD3DResource *)buffer, WINED3DRTYPE_BUFFER,
device, size, usage, format_desc, pool, parent, parent_ops); device, size, usage, format, pool, parent, parent_ops);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to initialize resource, hr %#x\n", hr); WARN("Failed to initialize resource, hr %#x\n", hr);
...@@ -1473,7 +1473,7 @@ HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device, ...@@ -1473,7 +1473,7 @@ HRESULT buffer_init(struct wined3d_buffer *buffer, IWineD3DDeviceImpl *device,
buffer->buffer_type_hint = bind_hint; buffer->buffer_type_hint = bind_hint;
TRACE("size %#x, usage %#x, format %s, memory @ %p, iface @ %p.\n", buffer->resource.size, buffer->resource.usage, TRACE("size %#x, usage %#x, format %s, memory @ %p, iface @ %p.\n", buffer->resource.size, buffer->resource.usage,
debug_d3dformat(buffer->resource.format_desc->id), buffer->resource.allocatedMemory, buffer); debug_d3dformat(buffer->resource.format->id), buffer->resource.allocatedMemory, buffer);
/* GL_ARB_map_buffer_range is disabled for now due to numerous bugs and no gains */ /* GL_ARB_map_buffer_range is disabled for now due to numerous bugs and no gains */
dynamic_buffer_ok = gl_info->supported[APPLE_FLUSH_BUFFER_RANGE]; dynamic_buffer_ok = gl_info->supported[APPLE_FLUSH_BUFFER_RANGE];
......
...@@ -201,7 +201,7 @@ void context_attach_depth_stencil_fbo(struct wined3d_context *context, ...@@ -201,7 +201,7 @@ void context_attach_depth_stencil_fbo(struct wined3d_context *context,
if (depth_stencil) if (depth_stencil)
{ {
DWORD format_flags = depth_stencil->resource.format_desc->Flags; DWORD format_flags = depth_stencil->resource.format->Flags;
if (use_render_buffer && depth_stencil->current_renderbuffer) if (use_render_buffer && depth_stencil->current_renderbuffer)
{ {
...@@ -333,7 +333,7 @@ static void context_check_fbo_status(struct wined3d_context *context, GLenum tar ...@@ -333,7 +333,7 @@ static void context_check_fbo_status(struct wined3d_context *context, GLenum tar
if (attachment) if (attachment)
{ {
FIXME("\tColor attachment %d: (%p) %s %ux%u\n", FIXME("\tColor attachment %d: (%p) %s %ux%u\n",
i, attachment, debug_d3dformat(attachment->resource.format_desc->id), i, attachment, debug_d3dformat(attachment->resource.format->id),
attachment->pow2Width, attachment->pow2Height); attachment->pow2Width, attachment->pow2Height);
} }
} }
...@@ -341,7 +341,7 @@ static void context_check_fbo_status(struct wined3d_context *context, GLenum tar ...@@ -341,7 +341,7 @@ static void context_check_fbo_status(struct wined3d_context *context, GLenum tar
if (attachment) if (attachment)
{ {
FIXME("\tDepth attachment: (%p) %s %ux%u\n", FIXME("\tDepth attachment: (%p) %s %ux%u\n",
attachment, debug_d3dformat(attachment->resource.format_desc->id), attachment, debug_d3dformat(attachment->resource.format->id),
attachment->pow2Width, attachment->pow2Height); attachment->pow2Width, attachment->pow2Height);
} }
} }
...@@ -1106,7 +1106,7 @@ static void Context_MarkStateDirty(struct wined3d_context *context, DWORD state, ...@@ -1106,7 +1106,7 @@ static void Context_MarkStateDirty(struct wined3d_context *context, DWORD state,
/* This function takes care of WineD3D pixel format selection. */ /* This function takes care of WineD3D pixel format selection. */
static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc,
const struct wined3d_format_desc *color_format_desc, const struct wined3d_format_desc *ds_format_desc, const struct wined3d_format *color_format, const struct wined3d_format *ds_format,
BOOL auxBuffers, int numSamples, BOOL findCompatible) BOOL auxBuffers, int numSamples, BOOL findCompatible)
{ {
int iPixelFormat=0; int iPixelFormat=0;
...@@ -1141,17 +1141,17 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, ...@@ -1141,17 +1141,17 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc,
int nCfgs = This->adapter->nCfgs; int nCfgs = This->adapter->nCfgs;
TRACE("ColorFormat=%s, DepthStencilFormat=%s, auxBuffers=%d, numSamples=%d, findCompatible=%d\n", TRACE("ColorFormat=%s, DepthStencilFormat=%s, auxBuffers=%d, numSamples=%d, findCompatible=%d\n",
debug_d3dformat(color_format_desc->id), debug_d3dformat(ds_format_desc->id), debug_d3dformat(color_format->id), debug_d3dformat(ds_format->id),
auxBuffers, numSamples, findCompatible); auxBuffers, numSamples, findCompatible);
if (!getColorBits(color_format_desc, &redBits, &greenBits, &blueBits, &alphaBits, &colorBits)) if (!getColorBits(color_format, &redBits, &greenBits, &blueBits, &alphaBits, &colorBits))
{ {
ERR("Unable to get color bits for format %s (%#x)!\n", ERR("Unable to get color bits for format %s (%#x)!\n",
debug_d3dformat(color_format_desc->id), color_format_desc->id); debug_d3dformat(color_format->id), color_format->id);
return 0; return 0;
} }
getDepthStencilBits(ds_format_desc, &depthBits, &stencilBits); getDepthStencilBits(ds_format, &depthBits, &stencilBits);
for(matchtry = 0; matchtry < (sizeof(matches) / sizeof(matches[0])) && !iPixelFormat; matchtry++) { for(matchtry = 0; matchtry < (sizeof(matches) / sizeof(matches[0])) && !iPixelFormat; matchtry++) {
for(i=0; i<nCfgs; i++) { for(i=0; i<nCfgs; i++) {
...@@ -1260,7 +1260,7 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, ...@@ -1260,7 +1260,7 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc,
} }
TRACE("Found iPixelFormat=%d for ColorFormat=%s, DepthStencilFormat=%s\n", TRACE("Found iPixelFormat=%d for ColorFormat=%s, DepthStencilFormat=%s\n",
iPixelFormat, debug_d3dformat(color_format_desc->id), debug_d3dformat(ds_format_desc->id)); iPixelFormat, debug_d3dformat(color_format->id), debug_d3dformat(ds_format->id));
return iPixelFormat; return iPixelFormat;
} }
...@@ -1276,12 +1276,12 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, ...@@ -1276,12 +1276,12 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc,
* pPresentParameters: contains the pixelformats to use for onscreen rendering * pPresentParameters: contains the pixelformats to use for onscreen rendering
* *
*****************************************************************************/ *****************************************************************************/
struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3DSurfaceImpl *target, struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain,
const struct wined3d_format_desc *ds_format_desc) IWineD3DSurfaceImpl *target, const struct wined3d_format *ds_format)
{ {
IWineD3DDeviceImpl *device = swapchain->device; IWineD3DDeviceImpl *device = swapchain->device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_format_desc *color_format_desc; const struct wined3d_format *color_format;
struct wined3d_context *ret; struct wined3d_context *ret;
PIXELFORMATDESCRIPTOR pfd; PIXELFORMATDESCRIPTOR pfd;
BOOL auxBuffers = FALSE; BOOL auxBuffers = FALSE;
...@@ -1307,7 +1307,7 @@ struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3 ...@@ -1307,7 +1307,7 @@ struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3
goto out; goto out;
} }
color_format_desc = target->resource.format_desc; color_format = target->resource.format;
/* In case of ORM_BACKBUFFER, make sure to request an alpha component for /* In case of ORM_BACKBUFFER, make sure to request an alpha component for
* X4R4G4B4/X8R8G8B8 as we might need it for the backbuffer. */ * X4R4G4B4/X8R8G8B8 as we might need it for the backbuffer. */
...@@ -1315,10 +1315,10 @@ struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3 ...@@ -1315,10 +1315,10 @@ struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3
{ {
auxBuffers = TRUE; auxBuffers = TRUE;
if (color_format_desc->id == WINED3DFMT_B4G4R4X4_UNORM) if (color_format->id == WINED3DFMT_B4G4R4X4_UNORM)
color_format_desc = getFormatDescEntry(WINED3DFMT_B4G4R4A4_UNORM, gl_info); color_format = wined3d_get_format(gl_info, WINED3DFMT_B4G4R4A4_UNORM);
else if (color_format_desc->id == WINED3DFMT_B8G8R8X8_UNORM) else if (color_format->id == WINED3DFMT_B8G8R8X8_UNORM)
color_format_desc = getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, gl_info); color_format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM);
} }
/* DirectDraw supports 8bit paletted render targets and these are used by /* DirectDraw supports 8bit paletted render targets and these are used by
...@@ -1327,8 +1327,8 @@ struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3 ...@@ -1327,8 +1327,8 @@ struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3
* conversion (ab)uses the alpha component for storing the palette index. * conversion (ab)uses the alpha component for storing the palette index.
* For this reason we require a format with 8bit alpha, so request * For this reason we require a format with 8bit alpha, so request
* A8R8G8B8. */ * A8R8G8B8. */
if (color_format_desc->id == WINED3DFMT_P8_UINT) if (color_format->id == WINED3DFMT_P8_UINT)
color_format_desc = getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, gl_info); color_format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM);
/* D3D only allows multisampling when SwapEffect is set to WINED3DSWAPEFFECT_DISCARD. */ /* D3D only allows multisampling when SwapEffect is set to WINED3DSWAPEFFECT_DISCARD. */
if (swapchain->presentParms.MultiSampleType && (swapchain->presentParms.SwapEffect == WINED3DSWAPEFFECT_DISCARD)) if (swapchain->presentParms.MultiSampleType && (swapchain->presentParms.SwapEffect == WINED3DSWAPEFFECT_DISCARD))
...@@ -1343,14 +1343,14 @@ struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3 ...@@ -1343,14 +1343,14 @@ struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3
} }
/* Try to find a pixel format which matches our requirements. */ /* Try to find a pixel format which matches our requirements. */
pixel_format = WineD3D_ChoosePixelFormat(device, hdc, color_format_desc, ds_format_desc, pixel_format = WineD3D_ChoosePixelFormat(device, hdc, color_format, ds_format,
auxBuffers, numSamples, FALSE /* findCompatible */); auxBuffers, numSamples, FALSE /* findCompatible */);
/* Try to locate a compatible format if we weren't able to find anything. */ /* Try to locate a compatible format if we weren't able to find anything. */
if (!pixel_format) if (!pixel_format)
{ {
TRACE("Trying to locate a compatible pixel format because an exact match failed.\n"); TRACE("Trying to locate a compatible pixel format because an exact match failed.\n");
pixel_format = WineD3D_ChoosePixelFormat(device, hdc, color_format_desc, ds_format_desc, pixel_format = WineD3D_ChoosePixelFormat(device, hdc, color_format, ds_format,
auxBuffers, 0 /* numSamples */, TRUE /* findCompatible */); auxBuffers, 0 /* numSamples */, TRUE /* findCompatible */);
} }
...@@ -2046,8 +2046,8 @@ static inline void context_set_render_offscreen(struct wined3d_context *context, ...@@ -2046,8 +2046,8 @@ static inline void context_set_render_offscreen(struct wined3d_context *context,
context->render_offscreen = offscreen; context->render_offscreen = offscreen;
} }
static BOOL match_depth_stencil_format(const struct wined3d_format_desc *existing, static BOOL match_depth_stencil_format(const struct wined3d_format *existing,
const struct wined3d_format_desc *required) const struct wined3d_format *required)
{ {
short existing_depth, existing_stencil, required_depth, required_stencil; short existing_depth, existing_stencil, required_depth, required_stencil;
...@@ -2071,7 +2071,7 @@ static void context_validate_onscreen_formats(IWineD3DDeviceImpl *device, ...@@ -2071,7 +2071,7 @@ static void context_validate_onscreen_formats(IWineD3DDeviceImpl *device,
IWineD3DSwapChainImpl *swapchain = context->current_rt->container.u.swapchain; IWineD3DSwapChainImpl *swapchain = context->current_rt->container.u.swapchain;
if (context->render_offscreen || !depth_stencil) return; if (context->render_offscreen || !depth_stencil) return;
if (match_depth_stencil_format(swapchain->ds_format, depth_stencil->resource.format_desc)) return; if (match_depth_stencil_format(swapchain->ds_format, depth_stencil->resource.format)) return;
/* TODO: If the requested format would satisfy the needs of the existing one(reverse match), /* TODO: If the requested format would satisfy the needs of the existing one(reverse match),
* or no onscreen depth buffer was created, the OpenGL drawable could be changed to the new * or no onscreen depth buffer was created, the OpenGL drawable could be changed to the new
...@@ -2253,8 +2253,8 @@ static void context_setup_target(IWineD3DDeviceImpl *device, ...@@ -2253,8 +2253,8 @@ static void context_setup_target(IWineD3DDeviceImpl *device,
} }
else else
{ {
const struct wined3d_format_desc *old = context->current_rt->resource.format_desc; const struct wined3d_format *old = context->current_rt->resource.format;
const struct wined3d_format_desc *new = target->resource.format_desc; const struct wined3d_format *new = target->resource.format;
if (old->id != new->id) if (old->id != new->id)
{ {
......
...@@ -70,8 +70,8 @@ static void cubetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3 ...@@ -70,8 +70,8 @@ static void cubetexture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3
context = context_acquire(device, NULL); context = context_acquire(device, NULL);
} }
if (This->resource.format_desc->id == WINED3DFMT_P8_UINT if (This->resource.format->id == WINED3DFMT_P8_UINT
|| This->resource.format_desc->id == WINED3DFMT_P8_UINT_A8_UNORM) || This->resource.format->id == WINED3DFMT_P8_UINT_A8_UNORM)
{ {
for (i = 0; i < sub_count; ++i) for (i = 0; i < sub_count; ++i)
{ {
...@@ -455,7 +455,7 @@ HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UIN ...@@ -455,7 +455,7 @@ HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UIN
IUnknown *parent, const struct wined3d_parent_ops *parent_ops) IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
{ {
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_format_desc *format_desc = getFormatDescEntry(format_id, gl_info); const struct wined3d_format *format = wined3d_get_format(gl_info, format_id);
UINT pow2_edge_length; UINT pow2_edge_length;
unsigned int i, j; unsigned int i, j;
UINT tmp_w; UINT tmp_w;
...@@ -501,7 +501,7 @@ HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UIN ...@@ -501,7 +501,7 @@ HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UIN
texture->lpVtbl = &IWineD3DCubeTexture_Vtbl; texture->lpVtbl = &IWineD3DCubeTexture_Vtbl;
hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, 6, levels, hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, 6, levels,
WINED3DRTYPE_CUBETEXTURE, device, 0, usage, format_desc, pool, parent, parent_ops); WINED3DRTYPE_CUBETEXTURE, device, 0, usage, format, pool, parent, parent_ops);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to initialize basetexture, returning %#x\n", hr); WARN("Failed to initialize basetexture, returning %#x\n", hr);
......
...@@ -125,8 +125,8 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context ...@@ -125,8 +125,8 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context
element = &si->elements[WINED3D_FFP_DIFFUSE]; element = &si->elements[WINED3D_FFP_DIFFUSE];
diffuse = element->data + streamOffset[element->stream_idx]; diffuse = element->data + streamOffset[element->stream_idx];
if (num_untracked_materials && element->format_desc->id != WINED3DFMT_B8G8R8A8_UNORM) if (num_untracked_materials && element->format->id != WINED3DFMT_B8G8R8A8_UNORM)
FIXME("Implement diffuse color tracking from %s\n", debug_d3dformat(element->format_desc->id)); FIXME("Implement diffuse color tracking from %s\n", debug_d3dformat(element->format->id));
} }
else else
{ {
...@@ -141,13 +141,13 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context ...@@ -141,13 +141,13 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context
/* special case where the fog density is stored in the specular alpha channel */ /* special case where the fog density is stored in the specular alpha channel */
if (This->stateBlock->renderState[WINED3DRS_FOGENABLE] if (This->stateBlock->renderState[WINED3DRS_FOGENABLE]
&& (This->stateBlock->renderState[WINED3DRS_FOGVERTEXMODE] == WINED3DFOG_NONE && (This->stateBlock->renderState[WINED3DRS_FOGVERTEXMODE] == WINED3DFOG_NONE
|| si->elements[WINED3D_FFP_POSITION].format_desc->id == WINED3DFMT_R32G32B32A32_FLOAT) || si->elements[WINED3D_FFP_POSITION].format->id == WINED3DFMT_R32G32B32A32_FLOAT)
&& This->stateBlock->renderState[WINED3DRS_FOGTABLEMODE] == WINED3DFOG_NONE) && This->stateBlock->renderState[WINED3DRS_FOGTABLEMODE] == WINED3DFOG_NONE)
{ {
if (gl_info->supported[EXT_FOG_COORD]) if (gl_info->supported[EXT_FOG_COORD])
{ {
if (element->format_desc->id == WINED3DFMT_B8G8R8A8_UNORM) specular_fog = TRUE; if (element->format->id == WINED3DFMT_B8G8R8A8_UNORM) specular_fog = TRUE;
else FIXME("Implement fog coordinates from %s\n", debug_d3dformat(element->format_desc->id)); else FIXME("Implement fog coordinates from %s\n", debug_d3dformat(element->format->id));
} }
else else
{ {
...@@ -243,7 +243,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context ...@@ -243,7 +243,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context
ptr = texCoords[coord_idx] + (SkipnStrides * si->elements[WINED3D_FFP_TEXCOORD0 + coord_idx].stride); ptr = texCoords[coord_idx] + (SkipnStrides * si->elements[WINED3D_FFP_TEXCOORD0 + coord_idx].stride);
texture_idx = This->texUnitMap[texture]; texture_idx = This->texUnitMap[texture];
multi_texcoord_funcs[si->elements[WINED3D_FFP_TEXCOORD0 + coord_idx].format_desc->emit_idx]( multi_texcoord_funcs[si->elements[WINED3D_FFP_TEXCOORD0 + coord_idx].format->emit_idx](
GL_TEXTURE0_ARB + texture_idx, ptr); GL_TEXTURE0_ARB + texture_idx, ptr);
} }
...@@ -251,7 +251,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context ...@@ -251,7 +251,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context
if (diffuse) { if (diffuse) {
const void *ptrToCoords = diffuse + SkipnStrides * si->elements[WINED3D_FFP_DIFFUSE].stride; const void *ptrToCoords = diffuse + SkipnStrides * si->elements[WINED3D_FFP_DIFFUSE].stride;
diffuse_funcs[si->elements[WINED3D_FFP_DIFFUSE].format_desc->emit_idx](ptrToCoords); diffuse_funcs[si->elements[WINED3D_FFP_DIFFUSE].format->emit_idx](ptrToCoords);
if (num_untracked_materials) if (num_untracked_materials)
{ {
DWORD diffuseColor = ((const DWORD *)ptrToCoords)[0]; DWORD diffuseColor = ((const DWORD *)ptrToCoords)[0];
...@@ -274,7 +274,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context ...@@ -274,7 +274,7 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context
if (specular) { if (specular) {
const void *ptrToCoords = specular + SkipnStrides * si->elements[WINED3D_FFP_SPECULAR].stride; const void *ptrToCoords = specular + SkipnStrides * si->elements[WINED3D_FFP_SPECULAR].stride;
specular_funcs[si->elements[WINED3D_FFP_SPECULAR].format_desc->emit_idx](ptrToCoords); specular_funcs[si->elements[WINED3D_FFP_SPECULAR].format->emit_idx](ptrToCoords);
if (specular_fog) if (specular_fog)
{ {
...@@ -286,13 +286,13 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context ...@@ -286,13 +286,13 @@ static void drawStridedSlow(IWineD3DDevice *iface, const struct wined3d_context
/* Normal -------------------------------- */ /* Normal -------------------------------- */
if (normal != NULL) { if (normal != NULL) {
const void *ptrToCoords = normal + SkipnStrides * si->elements[WINED3D_FFP_NORMAL].stride; const void *ptrToCoords = normal + SkipnStrides * si->elements[WINED3D_FFP_NORMAL].stride;
normal_funcs[si->elements[WINED3D_FFP_NORMAL].format_desc->emit_idx](ptrToCoords); normal_funcs[si->elements[WINED3D_FFP_NORMAL].format->emit_idx](ptrToCoords);
} }
/* Position -------------------------------- */ /* Position -------------------------------- */
if (position) { if (position) {
const void *ptrToCoords = position + SkipnStrides * si->elements[WINED3D_FFP_POSITION].stride; const void *ptrToCoords = position + SkipnStrides * si->elements[WINED3D_FFP_POSITION].stride;
position_funcs[si->elements[WINED3D_FFP_POSITION].format_desc->emit_idx](ptrToCoords); position_funcs[si->elements[WINED3D_FFP_POSITION].format->emit_idx](ptrToCoords);
} }
/* For non indexed mode, step onto next parts */ /* For non indexed mode, step onto next parts */
...@@ -468,7 +468,7 @@ static void drawStridedSlowVs(IWineD3DDevice *iface, const struct wined3d_stream ...@@ -468,7 +468,7 @@ static void drawStridedSlowVs(IWineD3DDevice *iface, const struct wined3d_stream
si->elements[i].stride * SkipnStrides + si->elements[i].stride * SkipnStrides +
stateblock->streamOffset[si->elements[i].stream_idx]; stateblock->streamOffset[si->elements[i].stream_idx];
send_attribute(This, si->elements[i].format_desc->id, i, ptr); send_attribute(This, si->elements[i].format->id, i, ptr);
} }
SkipnStrides++; SkipnStrides++;
} }
...@@ -539,7 +539,7 @@ static inline void drawStridedInstanced(IWineD3DDevice *iface, const struct wine ...@@ -539,7 +539,7 @@ static inline void drawStridedInstanced(IWineD3DDevice *iface, const struct wine
ptr += (ULONG_PTR)buffer_get_sysmem(vb, &This->adapter->gl_info); ptr += (ULONG_PTR)buffer_get_sysmem(vb, &This->adapter->gl_info);
} }
send_attribute(This, si->elements[instancedData[j]].format_desc->id, instancedData[j], ptr); send_attribute(This, si->elements[instancedData[j]].format->id, instancedData[j], ptr);
} }
glDrawElements(glPrimitiveType, numberOfVertices, idxSize == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, glDrawElements(glPrimitiveType, numberOfVertices, idxSize == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT,
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DEFAULT_DEBUG_CHANNEL(d3d);
HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type, HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type,
IWineD3DDeviceImpl *device, UINT size, DWORD usage, const struct wined3d_format_desc *format_desc, IWineD3DDeviceImpl *device, UINT size, DWORD usage, const struct wined3d_format *format,
WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
{ {
struct IWineD3DResourceClass *resource = &((IWineD3DResourceImpl *)iface)->resource; struct IWineD3DResourceClass *resource = &((IWineD3DResourceImpl *)iface)->resource;
...@@ -38,7 +38,7 @@ HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type ...@@ -38,7 +38,7 @@ HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type
resource->resourceType = resource_type; resource->resourceType = resource_type;
resource->ref = 1; resource->ref = 1;
resource->pool = pool; resource->pool = pool;
resource->format_desc = format_desc; resource->format = format;
resource->usage = usage; resource->usage = usage;
resource->size = size; resource->size = size;
resource->priority = 0; resource->priority = 0;
......
...@@ -2087,7 +2087,7 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, ...@@ -2087,7 +2087,7 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader,
if (stateblock->renderState[WINED3DRS_SRGBWRITEENABLE]) if (stateblock->renderState[WINED3DRS_SRGBWRITEENABLE])
{ {
IWineD3DSurfaceImpl *rt = device->render_targets[0]; IWineD3DSurfaceImpl *rt = device->render_targets[0];
if(rt->resource.format_desc->Flags & WINED3DFMT_FLAG_SRGB_WRITE) args->srgb_correction = 1; if(rt->resource.format->Flags & WINED3DFMT_FLAG_SRGB_WRITE) args->srgb_correction = 1;
} }
args->np2_fixup = 0; args->np2_fixup = 0;
...@@ -2101,9 +2101,9 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader, ...@@ -2101,9 +2101,9 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader,
args->color_fixup[i] = COLOR_FIXUP_IDENTITY; args->color_fixup[i] = COLOR_FIXUP_IDENTITY;
continue; continue;
} }
args->color_fixup[i] = texture->resource.format_desc->color_fixup; args->color_fixup[i] = texture->resource.format->color_fixup;
if (texture->resource.format_desc->Flags & WINED3DFMT_FLAG_SHADOW) if (texture->resource.format->Flags & WINED3DFMT_FLAG_SHADOW)
args->shadow |= 1 << i; args->shadow |= 1 << i;
/* Flag samplers that need NP2 texcoord fixup. */ /* Flag samplers that need NP2 texcoord fixup. */
......
...@@ -289,8 +289,8 @@ static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD ...@@ -289,8 +289,8 @@ static HRESULT WINAPI IWineGDISurfaceImpl_GetDC(IWineD3DSurface *iface, HDC *pHD
return hr; return hr;
} }
if (This->resource.format_desc->id == WINED3DFMT_P8_UINT if (This->resource.format->id == WINED3DFMT_P8_UINT
|| This->resource.format_desc->id == WINED3DFMT_P8_UINT_A8_UNORM) || This->resource.format->id == WINED3DFMT_P8_UINT_A8_UNORM)
{ {
unsigned int n; unsigned int n;
const PALETTEENTRY *pal = NULL; const PALETTEENTRY *pal = NULL;
......
...@@ -117,7 +117,7 @@ static void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context * ...@@ -117,7 +117,7 @@ static void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context *
GetClientRect(This->win_handle, &win_rect); GetClientRect(This->win_handle, &win_rect);
win_h = win_rect.bottom - win_rect.top; win_h = win_rect.bottom - win_rect.top;
if (gl_info->fbo_ops.glBlitFramebuffer && is_identity_fixup(backbuffer->resource.format_desc->color_fixup)) if (gl_info->fbo_ops.glBlitFramebuffer && is_identity_fixup(backbuffer->resource.format->color_fixup))
{ {
ENTER_GL(); ENTER_GL();
context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, backbuffer, NULL, SFLAG_INTEXTURE); context_apply_fbo_state_blit(context, GL_READ_FRAMEBUFFER, backbuffer, NULL, SFLAG_INTEXTURE);
...@@ -161,7 +161,7 @@ static void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context * ...@@ -161,7 +161,7 @@ static void swapchain_blit(IWineD3DSwapChainImpl *This, struct wined3d_context *
tex_bottom /= src_h; tex_bottom /= src_h;
} }
if (is_complex_fixup(backbuffer->resource.format_desc->color_fixup)) if (is_complex_fixup(backbuffer->resource.format->color_fixup))
gl_filter = GL_NEAREST; gl_filter = GL_NEAREST;
ENTER_GL(); ENTER_GL();
...@@ -261,7 +261,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO ...@@ -261,7 +261,7 @@ static HRESULT WINAPI IWineD3DSwapChainImpl_Present(IWineD3DSwapChain *iface, CO
cursor.resource.ref = 1; cursor.resource.ref = 1;
cursor.resource.device = This->device; cursor.resource.device = This->device;
cursor.resource.pool = WINED3DPOOL_SCRATCH; cursor.resource.pool = WINED3DPOOL_SCRATCH;
cursor.resource.format_desc = getFormatDescEntry(WINED3DFMT_B8G8R8A8_UNORM, gl_info); cursor.resource.format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM);
cursor.resource.resourceType = WINED3DRTYPE_SURFACE; cursor.resource.resourceType = WINED3DRTYPE_SURFACE;
cursor.texture_name = This->device->cursorTexture; cursor.texture_name = This->device->cursorTexture;
cursor.texture_target = GL_TEXTURE_2D; cursor.texture_target = GL_TEXTURE_2D;
...@@ -625,7 +625,7 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface ...@@ -625,7 +625,7 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface
IWineD3DDeviceImpl *device, WINED3DPRESENT_PARAMETERS *present_parameters, IUnknown *parent) IWineD3DDeviceImpl *device, WINED3DPRESENT_PARAMETERS *present_parameters, IUnknown *parent)
{ {
const struct wined3d_adapter *adapter = device->adapter; const struct wined3d_adapter *adapter = device->adapter;
const struct wined3d_format_desc *format_desc; const struct wined3d_format *format;
BOOL displaymode_set = FALSE; BOOL displaymode_set = FALSE;
WINED3DDISPLAYMODE mode; WINED3DDISPLAYMODE mode;
RECT client_rect; RECT client_rect;
...@@ -679,7 +679,7 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface ...@@ -679,7 +679,7 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface
swapchain->orig_width = mode.Width; swapchain->orig_width = mode.Width;
swapchain->orig_height = mode.Height; swapchain->orig_height = mode.Height;
swapchain->orig_fmt = mode.Format; swapchain->orig_fmt = mode.Format;
format_desc = getFormatDescEntry(mode.Format, &adapter->gl_info); format = wined3d_get_format(&adapter->gl_info, mode.Format);
GetClientRect(window, &client_rect); GetClientRect(window, &client_rect);
if (present_parameters->Windowed if (present_parameters->Windowed
...@@ -795,7 +795,7 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface ...@@ -795,7 +795,7 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface
* issue needs to be fixed. */ * issue needs to be fixed. */
for (i = 0; i < (sizeof(formats) / sizeof(*formats)); i++) for (i = 0; i < (sizeof(formats) / sizeof(*formats)); i++)
{ {
swapchain->ds_format = getFormatDescEntry(formats[i], gl_info); swapchain->ds_format = wined3d_get_format(gl_info, formats[i]);
swapchain->context[0] = context_create(swapchain, swapchain->front_buffer, swapchain->ds_format); swapchain->context[0] = context_create(swapchain, swapchain->front_buffer, swapchain->ds_format);
if (swapchain->context[0]) break; if (swapchain->context[0]) break;
TRACE("Depth stencil format %s is not supported, trying next format\n", TRACE("Depth stencil format %s is not supported, trying next format\n",
...@@ -886,7 +886,7 @@ err: ...@@ -886,7 +886,7 @@ err:
memset(&devmode, 0, sizeof(devmode)); memset(&devmode, 0, sizeof(devmode));
devmode.dmSize = sizeof(devmode); devmode.dmSize = sizeof(devmode);
devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT; devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
devmode.dmBitsPerPel = format_desc->byte_count * 8; devmode.dmBitsPerPel = format->byte_count * CHAR_BIT;
devmode.dmPelsWidth = swapchain->orig_width; devmode.dmPelsWidth = swapchain->orig_width;
devmode.dmPelsHeight = swapchain->orig_height; devmode.dmPelsHeight = swapchain->orig_height;
ChangeDisplaySettingsExW(adapter->DeviceName, &devmode, NULL, CDS_FULLSCREEN, NULL); ChangeDisplaySettingsExW(adapter->DeviceName, &devmode, NULL, CDS_FULLSCREEN, NULL);
......
...@@ -66,8 +66,8 @@ static void texture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3DSRG ...@@ -66,8 +66,8 @@ static void texture_internal_preload(IWineD3DBaseTexture *iface, enum WINED3DSRG
context = context_acquire(device, NULL); context = context_acquire(device, NULL);
} }
if (This->resource.format_desc->id == WINED3DFMT_P8_UINT if (This->resource.format->id == WINED3DFMT_P8_UINT
|| This->resource.format_desc->id == WINED3DFMT_P8_UINT_A8_UNORM) || This->resource.format->id == WINED3DFMT_P8_UINT_A8_UNORM)
{ {
for (i = 0; i < This->baseTexture.level_count; ++i) for (i = 0; i < This->baseTexture.level_count; ++i)
{ {
...@@ -466,7 +466,7 @@ HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT ...@@ -466,7 +466,7 @@ HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT
IUnknown *parent, const struct wined3d_parent_ops *parent_ops) IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
{ {
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_format_desc *format_desc = getFormatDescEntry(format_id, gl_info); const struct wined3d_format *format = wined3d_get_format(gl_info, format_id);
UINT pow2_width, pow2_height; UINT pow2_width, pow2_height;
UINT tmp_w, tmp_h; UINT tmp_w, tmp_h;
unsigned int i; unsigned int i;
...@@ -530,7 +530,7 @@ HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT ...@@ -530,7 +530,7 @@ HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT
texture->lpVtbl = &IWineD3DTexture_Vtbl; texture->lpVtbl = &IWineD3DTexture_Vtbl;
hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, 1, levels, hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, 1, levels,
WINED3DRTYPE_TEXTURE, device, 0, usage, format_desc, pool, parent, parent_ops); WINED3DRTYPE_TEXTURE, device, 0, usage, format, pool, parent, parent_ops);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to initialize basetexture, returning %#x.\n", hr); WARN("Failed to initialize basetexture, returning %#x.\n", hr);
...@@ -552,7 +552,7 @@ HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT ...@@ -552,7 +552,7 @@ HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT
texture->baseTexture.minMipLookup = minMipLookup_noFilter; texture->baseTexture.minMipLookup = minMipLookup_noFilter;
} }
else if (gl_info->supported[ARB_TEXTURE_RECTANGLE] && (width != pow2_width || height != pow2_height) else if (gl_info->supported[ARB_TEXTURE_RECTANGLE] && (width != pow2_width || height != pow2_height)
&& !(format_desc->id == WINED3DFMT_P8_UINT && gl_info->supported[EXT_PALETTED_TEXTURE] && !(format->id == WINED3DFMT_P8_UINT && gl_info->supported[EXT_PALETTED_TEXTURE]
&& wined3d_settings.rendertargetlock_mode == RTL_READTEX)) && wined3d_settings.rendertargetlock_mode == RTL_READTEX))
{ {
if ((width != 1) || (height != 1)) texture->baseTexture.pow2Matrix_identity = FALSE; if ((width != 1) || (height != 1)) texture->baseTexture.pow2Matrix_identity = FALSE;
...@@ -564,7 +564,7 @@ HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT ...@@ -564,7 +564,7 @@ HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT
texture->target = GL_TEXTURE_RECTANGLE_ARB; texture->target = GL_TEXTURE_RECTANGLE_ARB;
texture->cond_np2 = TRUE; texture->cond_np2 = TRUE;
if(texture->resource.format_desc->Flags & WINED3DFMT_FLAG_FILTERING) if(texture->resource.format->Flags & WINED3DFMT_FLAG_FILTERING)
{ {
texture->baseTexture.minMipLookup = minMipLookup_noMip; texture->baseTexture.minMipLookup = minMipLookup_noMip;
} }
...@@ -603,7 +603,7 @@ HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT ...@@ -603,7 +603,7 @@ HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT
/* Use the callback to create the texture surface. */ /* Use the callback to create the texture surface. */
hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_h, hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_h,
format_desc->id, usage, pool, i, 0, &surface); format->id, usage, pool, i, 0, &surface);
if (FAILED(hr)) if (FAILED(hr))
{ {
FIXME("Failed to create surface %p, hr %#x\n", texture, hr); FIXME("Failed to create surface %p, hr %#x\n", texture, hr);
......
...@@ -221,7 +221,7 @@ HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *declaration, IWine ...@@ -221,7 +221,7 @@ HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *declaration, IWine
{ {
struct wined3d_vertex_declaration_element *e = &declaration->elements[i]; struct wined3d_vertex_declaration_element *e = &declaration->elements[i];
e->format_desc = getFormatDescEntry(elements[i].format, gl_info); e->format = wined3d_get_format(gl_info, elements[i].format);
e->ffp_valid = declaration_element_valid_ffp(&elements[i]); e->ffp_valid = declaration_element_valid_ffp(&elements[i]);
e->input_slot = elements[i].input_slot; e->input_slot = elements[i].input_slot;
e->offset = elements[i].offset; e->offset = elements[i].offset;
...@@ -236,7 +236,7 @@ HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *declaration, IWine ...@@ -236,7 +236,7 @@ HRESULT vertexdeclaration_init(IWineD3DVertexDeclarationImpl *declaration, IWine
* to be loaded when drawing, but filter tesselation pseudo streams. */ * to be loaded when drawing, but filter tesselation pseudo streams. */
if (e->input_slot >= MAX_STREAMS) continue; if (e->input_slot >= MAX_STREAMS) continue;
if (!e->format_desc->gl_vtx_format) if (!e->format->gl_vtx_format)
{ {
FIXME("The application tries to use an unsupported format (%s), returning E_FAIL.\n", FIXME("The application tries to use an unsupported format (%s), returning E_FAIL.\n",
debug_d3dformat(elements[i].format)); debug_d3dformat(elements[i].format));
......
...@@ -189,7 +189,7 @@ static HRESULT WINAPI IWineD3DVolumeImpl_GetDesc(IWineD3DVolume *iface, WINED3DV ...@@ -189,7 +189,7 @@ static HRESULT WINAPI IWineD3DVolumeImpl_GetDesc(IWineD3DVolume *iface, WINED3DV
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface; IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
TRACE("(%p) : copying into %p\n", This, pDesc); TRACE("(%p) : copying into %p\n", This, pDesc);
pDesc->Format = This->resource.format_desc->id; pDesc->Format = This->resource.format->id;
pDesc->Type = This->resource.resourceType; pDesc->Type = This->resource.resourceType;
pDesc->Usage = This->resource.usage; pDesc->Usage = This->resource.usage;
pDesc->Pool = This->resource.pool; pDesc->Pool = This->resource.pool;
...@@ -212,8 +212,8 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LockBox(IWineD3DVolume *iface, WINED3DL ...@@ -212,8 +212,8 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LockBox(IWineD3DVolume *iface, WINED3DL
/* fixme: should we really lock as such? */ /* fixme: should we really lock as such? */
TRACE("(%p) : box=%p, output pbox=%p, allMem=%p\n", This, pBox, pLockedVolume, This->resource.allocatedMemory); TRACE("(%p) : box=%p, output pbox=%p, allMem=%p\n", This, pBox, pLockedVolume, This->resource.allocatedMemory);
pLockedVolume->RowPitch = This->resource.format_desc->byte_count * This->currentDesc.Width; /* Bytes / row */ pLockedVolume->RowPitch = This->resource.format->byte_count * This->currentDesc.Width; /* Bytes / row */
pLockedVolume->SlicePitch = This->resource.format_desc->byte_count pLockedVolume->SlicePitch = This->resource.format->byte_count
* This->currentDesc.Width * This->currentDesc.Height; /* Bytes / slice */ * This->currentDesc.Width * This->currentDesc.Height; /* Bytes / slice */
if (!pBox) { if (!pBox) {
TRACE("No box supplied - all is ok\n"); TRACE("No box supplied - all is ok\n");
...@@ -229,7 +229,7 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LockBox(IWineD3DVolume *iface, WINED3DL ...@@ -229,7 +229,7 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LockBox(IWineD3DVolume *iface, WINED3DL
pLockedVolume->pBits = This->resource.allocatedMemory pLockedVolume->pBits = This->resource.allocatedMemory
+ (pLockedVolume->SlicePitch * pBox->Front) /* FIXME: is front < back or vica versa? */ + (pLockedVolume->SlicePitch * pBox->Front) /* FIXME: is front < back or vica versa? */
+ (pLockedVolume->RowPitch * pBox->Top) + (pLockedVolume->RowPitch * pBox->Top)
+ (pBox->Left * This->resource.format_desc->byte_count); + (pBox->Left * This->resource.format->byte_count);
This->lockedBox.Left = pBox->Left; This->lockedBox.Left = pBox->Left;
This->lockedBox.Top = pBox->Top; This->lockedBox.Top = pBox->Top;
This->lockedBox.Front = pBox->Front; This->lockedBox.Front = pBox->Front;
...@@ -273,36 +273,21 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LoadTexture(IWineD3DVolume *iface, int ...@@ -273,36 +273,21 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LoadTexture(IWineD3DVolume *iface, int
{ {
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface; IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
const struct wined3d_gl_info *gl_info = &This->resource.device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &This->resource.device->adapter->gl_info;
const struct wined3d_format_desc *glDesc = This->resource.format_desc; const struct wined3d_format *format = This->resource.format;
TRACE("iface %p, level %u, srgb %#x, format %s (%#x).\n", TRACE("iface %p, level %u, srgb %#x, format %s (%#x).\n",
iface, gl_level, srgb_mode, debug_d3dformat(glDesc->id), glDesc->id); iface, gl_level, srgb_mode, debug_d3dformat(format->id), format->id);
volume_bind_and_dirtify(iface); volume_bind_and_dirtify(iface);
TRACE("Calling glTexImage3D %x level=%d, intfmt=%x, w=%d, h=%d,d=%d, 0=%d, glFmt=%x, glType=%x, Mem=%p\n", TRACE("Calling glTexImage3D %x level=%d, intfmt=%x, w=%d, h=%d,d=%d, 0=%d, glFmt=%x, glType=%x, Mem=%p\n",
GL_TEXTURE_3D, GL_TEXTURE_3D, gl_level, format->glInternal, This->currentDesc.Width, This->currentDesc.Height,
gl_level, This->currentDesc.Depth, 0, format->glFormat, format->glType, This->resource.allocatedMemory);
glDesc->glInternal,
This->currentDesc.Width,
This->currentDesc.Height,
This->currentDesc.Depth,
0,
glDesc->glFormat,
glDesc->glType,
This->resource.allocatedMemory);
ENTER_GL(); ENTER_GL();
GL_EXTCALL(glTexImage3DEXT(GL_TEXTURE_3D, GL_EXTCALL(glTexImage3DEXT(GL_TEXTURE_3D, gl_level, format->glInternal,
gl_level, This->currentDesc.Width, This->currentDesc.Height, This->currentDesc.Depth,
glDesc->glInternal, 0, format->glFormat, format->glType, This->resource.allocatedMemory));
This->currentDesc.Width,
This->currentDesc.Height,
This->currentDesc.Depth,
0,
glDesc->glFormat,
glDesc->glType,
This->resource.allocatedMemory));
checkGLcall("glTexImage3D"); checkGLcall("glTexImage3D");
LEAVE_GL(); LEAVE_GL();
...@@ -343,7 +328,7 @@ HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT ...@@ -343,7 +328,7 @@ HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT
IUnknown *parent, const struct wined3d_parent_ops *parent_ops) IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
{ {
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_format_desc *format_desc = getFormatDescEntry(format_id, gl_info); const struct wined3d_format *format = wined3d_get_format(gl_info, format_id);
HRESULT hr; HRESULT hr;
if (!gl_info->supported[EXT_TEXTURE3D]) if (!gl_info->supported[EXT_TEXTURE3D])
...@@ -355,7 +340,7 @@ HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT ...@@ -355,7 +340,7 @@ HRESULT volume_init(IWineD3DVolumeImpl *volume, IWineD3DDeviceImpl *device, UINT
volume->lpVtbl = &IWineD3DVolume_Vtbl; volume->lpVtbl = &IWineD3DVolume_Vtbl;
hr = resource_init((IWineD3DResource *)volume, WINED3DRTYPE_VOLUME, device, hr = resource_init((IWineD3DResource *)volume, WINED3DRTYPE_VOLUME, device,
width * height * depth * format_desc->byte_count, usage, format_desc, pool, parent, parent_ops); width * height * depth * format->byte_count, usage, format, pool, parent, parent_ops);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to initialize resource, returning %#x.\n", hr); WARN("Failed to initialize resource, returning %#x.\n", hr);
......
...@@ -388,7 +388,7 @@ HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT ...@@ -388,7 +388,7 @@ HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT
WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops)
{ {
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
const struct wined3d_format_desc *format_desc = getFormatDescEntry(format_id, gl_info); const struct wined3d_format *format = wined3d_get_format(gl_info, format_id);
UINT tmp_w, tmp_h, tmp_d; UINT tmp_w, tmp_h, tmp_d;
unsigned int i; unsigned int i;
HRESULT hr; HRESULT hr;
...@@ -433,7 +433,7 @@ HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT ...@@ -433,7 +433,7 @@ HRESULT volumetexture_init(IWineD3DVolumeTextureImpl *texture, UINT width, UINT
texture->lpVtbl = &IWineD3DVolumeTexture_Vtbl; texture->lpVtbl = &IWineD3DVolumeTexture_Vtbl;
hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, 1, levels, hr = basetexture_init((IWineD3DBaseTextureImpl *)texture, 1, levels,
WINED3DRTYPE_VOLUMETEXTURE, device, 0, usage, format_desc, pool, parent, parent_ops); WINED3DRTYPE_VOLUMETEXTURE, device, 0, usage, format, pool, parent, parent_ops);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to initialize basetexture, returning %#x.\n", hr); WARN("Failed to initialize basetexture, returning %#x.\n", hr);
......
...@@ -806,7 +806,7 @@ do { ...@@ -806,7 +806,7 @@ do {
/* Trace vector and strided data information */ /* Trace vector and strided data information */
#define TRACE_STRIDED(si, name) do { if (si->use_map & (1 << name)) \ #define TRACE_STRIDED(si, name) do { if (si->use_map & (1 << name)) \
TRACE( #name "=(data:%p, stride:%d, format:%#x, vbo %d, stream %u)\n", \ TRACE( #name "=(data:%p, stride:%d, format:%#x, vbo %d, stream %u)\n", \
si->elements[name].data, si->elements[name].stride, si->elements[name].format_desc->id, \ si->elements[name].data, si->elements[name].stride, si->elements[name].format->id, \
si->elements[name].buffer_object, si->elements[name].stream_idx); } while(0) si->elements[name].buffer_object, si->elements[name].stream_idx); } while(0)
/* Advance declaration of structures to satisfy compiler */ /* Advance declaration of structures to satisfy compiler */
...@@ -862,7 +862,7 @@ enum wined3d_ffp_emit_idx ...@@ -862,7 +862,7 @@ enum wined3d_ffp_emit_idx
struct wined3d_stream_info_element struct wined3d_stream_info_element
{ {
const struct wined3d_format_desc *format_desc; const struct wined3d_format *format;
GLsizei stride; GLsizei stride;
const BYTE *data; const BYTE *data;
UINT stream_idx; UINT stream_idx;
...@@ -1141,8 +1141,8 @@ struct blit_shader ...@@ -1141,8 +1141,8 @@ struct blit_shader
HRESULT (*set_shader)(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surface); HRESULT (*set_shader)(IWineD3DDevice *iface, IWineD3DSurfaceImpl *surface);
void (*unset_shader)(IWineD3DDevice *iface); void (*unset_shader)(IWineD3DDevice *iface);
BOOL (*blit_supported)(const struct wined3d_gl_info *gl_info, enum blit_operation blit_op, BOOL (*blit_supported)(const struct wined3d_gl_info *gl_info, enum blit_operation blit_op,
const RECT *src_rect, DWORD src_usage, WINED3DPOOL src_pool, const struct wined3d_format_desc *src_format_desc, const RECT *src_rect, DWORD src_usage, WINED3DPOOL src_pool, const struct wined3d_format *src_format,
const RECT *dst_rect, DWORD dst_usage, WINED3DPOOL dst_pool, const struct wined3d_format_desc *dst_format_desc); const RECT *dst_rect, DWORD dst_usage, WINED3DPOOL dst_pool, const struct wined3d_format *dst_format);
HRESULT (*color_fill)(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *dst_surface, HRESULT (*color_fill)(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *dst_surface,
const RECT *dst_rect, const WINED3DCOLORVALUE *color); const RECT *dst_rect, const WINED3DCOLORVALUE *color);
}; };
...@@ -1152,8 +1152,8 @@ extern const struct blit_shader arbfp_blit DECLSPEC_HIDDEN; ...@@ -1152,8 +1152,8 @@ extern const struct blit_shader arbfp_blit DECLSPEC_HIDDEN;
extern const struct blit_shader cpu_blit DECLSPEC_HIDDEN; extern const struct blit_shader cpu_blit DECLSPEC_HIDDEN;
const struct blit_shader *wined3d_select_blitter(const struct wined3d_gl_info *gl_info, enum blit_operation blit_op, const struct blit_shader *wined3d_select_blitter(const struct wined3d_gl_info *gl_info, enum blit_operation blit_op,
const RECT *src_rect, DWORD src_usage, WINED3DPOOL src_pool, const struct wined3d_format_desc *src_format, const RECT *src_rect, DWORD src_usage, WINED3DPOOL src_pool, const struct wined3d_format *src_format,
const RECT *dst_rect, DWORD dst_usage, WINED3DPOOL dst_pool, const struct wined3d_format_desc *dst_format) const RECT *dst_rect, DWORD dst_usage, WINED3DPOOL dst_pool, const struct wined3d_format *dst_format)
DECLSPEC_HIDDEN; DECLSPEC_HIDDEN;
/* Temporary blit_shader helper functions */ /* Temporary blit_shader helper functions */
...@@ -1176,7 +1176,7 @@ void context_attach_depth_stencil_fbo(struct wined3d_context *context, ...@@ -1176,7 +1176,7 @@ void context_attach_depth_stencil_fbo(struct wined3d_context *context,
GLenum fbo_target, IWineD3DSurfaceImpl *depth_stencil, BOOL use_render_buffer) DECLSPEC_HIDDEN; GLenum fbo_target, IWineD3DSurfaceImpl *depth_stencil, BOOL use_render_buffer) DECLSPEC_HIDDEN;
void context_bind_fbo(struct wined3d_context *context, GLenum target, GLuint *fbo) DECLSPEC_HIDDEN; void context_bind_fbo(struct wined3d_context *context, GLenum target, GLuint *fbo) DECLSPEC_HIDDEN;
struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3DSurfaceImpl *target, struct wined3d_context *context_create(IWineD3DSwapChainImpl *swapchain, IWineD3DSurfaceImpl *target,
const struct wined3d_format_desc *ds_format_desc) DECLSPEC_HIDDEN; const struct wined3d_format *ds_format) DECLSPEC_HIDDEN;
void context_destroy(IWineD3DDeviceImpl *This, struct wined3d_context *context) DECLSPEC_HIDDEN; void context_destroy(IWineD3DDeviceImpl *This, struct wined3d_context *context) DECLSPEC_HIDDEN;
void context_free_event_query(struct wined3d_event_query *query) DECLSPEC_HIDDEN; void context_free_event_query(struct wined3d_event_query *query) DECLSPEC_HIDDEN;
void context_free_occlusion_query(struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN; void context_free_occlusion_query(struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN;
...@@ -1417,7 +1417,7 @@ struct wined3d_gl_info ...@@ -1417,7 +1417,7 @@ struct wined3d_gl_info
WGL_EXT_FUNCS_GEN WGL_EXT_FUNCS_GEN
#undef USE_GL_FUNC #undef USE_GL_FUNC
struct wined3d_format_desc *gl_formats; struct wined3d_format *formats;
}; };
struct wined3d_driver_info struct wined3d_driver_info
...@@ -1755,7 +1755,7 @@ typedef struct IWineD3DResourceClass ...@@ -1755,7 +1755,7 @@ typedef struct IWineD3DResourceClass
WINED3DPOOL pool; WINED3DPOOL pool;
UINT size; UINT size;
DWORD usage; DWORD usage;
const struct wined3d_format_desc *format_desc; const struct wined3d_format *format;
DWORD priority; DWORD priority;
BYTE *allocatedMemory; /* Pointer to the real data location */ BYTE *allocatedMemory; /* Pointer to the real data location */
BYTE *heapMemory; /* Pointer to the HeapAlloced block of memory */ BYTE *heapMemory; /* Pointer to the HeapAlloced block of memory */
...@@ -1778,7 +1778,7 @@ DWORD resource_get_priority(IWineD3DResource *iface) DECLSPEC_HIDDEN; ...@@ -1778,7 +1778,7 @@ DWORD resource_get_priority(IWineD3DResource *iface) DECLSPEC_HIDDEN;
HRESULT resource_get_private_data(IWineD3DResource *iface, REFGUID guid, HRESULT resource_get_private_data(IWineD3DResource *iface, REFGUID guid,
void *data, DWORD *data_size) DECLSPEC_HIDDEN; void *data, DWORD *data_size) DECLSPEC_HIDDEN;
HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type, HRESULT resource_init(IWineD3DResource *iface, WINED3DRESOURCETYPE resource_type,
IWineD3DDeviceImpl *device, UINT size, DWORD usage, const struct wined3d_format_desc *format_desc, IWineD3DDeviceImpl *device, UINT size, DWORD usage, const struct wined3d_format *format,
WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; WINED3DPOOL pool, IUnknown *parent, const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
WINED3DRESOURCETYPE resource_get_type(IWineD3DResource *iface) DECLSPEC_HIDDEN; WINED3DRESOURCETYPE resource_get_type(IWineD3DResource *iface) DECLSPEC_HIDDEN;
DWORD resource_set_priority(IWineD3DResource *iface, DWORD new_priority) DECLSPEC_HIDDEN; DWORD resource_set_priority(IWineD3DResource *iface, DWORD new_priority) DECLSPEC_HIDDEN;
...@@ -1868,7 +1868,7 @@ IWineD3DResourceImpl *basetexture_get_sub_resource(IWineD3DBaseTextureImpl *text ...@@ -1868,7 +1868,7 @@ IWineD3DResourceImpl *basetexture_get_sub_resource(IWineD3DBaseTextureImpl *text
UINT layer, UINT level) DECLSPEC_HIDDEN; UINT layer, UINT level) DECLSPEC_HIDDEN;
HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT layer_count, UINT level_count, HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT layer_count, UINT level_count,
WINED3DRESOURCETYPE resource_type, IWineD3DDeviceImpl *device, UINT size, DWORD usage, WINED3DRESOURCETYPE resource_type, IWineD3DDeviceImpl *device, UINT size, DWORD usage,
const struct wined3d_format_desc *format_desc, WINED3DPOOL pool, IUnknown *parent, const struct wined3d_format *format, WINED3DPOOL pool, IUnknown *parent,
const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN; const struct wined3d_parent_ops *parent_ops) DECLSPEC_HIDDEN;
HRESULT basetexture_set_autogen_filter_type(IWineD3DBaseTexture *iface, HRESULT basetexture_set_autogen_filter_type(IWineD3DBaseTexture *iface,
WINED3DTEXTUREFILTERTYPE filter_type) DECLSPEC_HIDDEN; WINED3DTEXTUREFILTERTYPE filter_type) DECLSPEC_HIDDEN;
...@@ -2227,9 +2227,9 @@ typedef enum { ...@@ -2227,9 +2227,9 @@ typedef enum {
CONVERT_RGB32_888 CONVERT_RGB32_888
} CONVERT_TYPES; } CONVERT_TYPES;
HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, BOOL use_texturing, HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *surface, BOOL need_alpha_ck, BOOL use_texturing,
struct wined3d_format_desc *desc, CONVERT_TYPES *convert) DECLSPEC_HIDDEN; struct wined3d_format *format, CONVERT_TYPES *convert) DECLSPEC_HIDDEN;
void d3dfmt_p8_init_palette(IWineD3DSurfaceImpl *This, BYTE table[256][4], BOOL colorkey) DECLSPEC_HIDDEN; void d3dfmt_p8_init_palette(IWineD3DSurfaceImpl *surface, BYTE table[256][4], BOOL colorkey) DECLSPEC_HIDDEN;
BOOL palette9_changed(IWineD3DSurfaceImpl *This) DECLSPEC_HIDDEN; BOOL palette9_changed(IWineD3DSurfaceImpl *This) DECLSPEC_HIDDEN;
...@@ -2239,7 +2239,7 @@ BOOL palette9_changed(IWineD3DSurfaceImpl *This) DECLSPEC_HIDDEN; ...@@ -2239,7 +2239,7 @@ BOOL palette9_changed(IWineD3DSurfaceImpl *This) DECLSPEC_HIDDEN;
struct wined3d_vertex_declaration_element struct wined3d_vertex_declaration_element
{ {
const struct wined3d_format_desc *format_desc; const struct wined3d_format *format;
BOOL ffp_valid; BOOL ffp_valid;
WORD input_slot; WORD input_slot;
WORD offset; WORD offset;
...@@ -2553,7 +2553,7 @@ struct IWineD3DSwapChainImpl ...@@ -2553,7 +2553,7 @@ struct IWineD3DSwapChainImpl
enum wined3d_format_id orig_fmt; enum wined3d_format_id orig_fmt;
WINED3DGAMMARAMP orig_gamma; WINED3DGAMMARAMP orig_gamma;
BOOL render_to_fbo; BOOL render_to_fbo;
const struct wined3d_format_desc *ds_format; const struct wined3d_format *ds_format;
LONG prev_time, frames; /* Performance tracking */ LONG prev_time, frames; /* Performance tracking */
unsigned int vSyncCounter; unsigned int vSyncCounter;
...@@ -2652,9 +2652,9 @@ void state_fogstartend(DWORD state, IWineD3DStateBlockImpl *stateblock, ...@@ -2652,9 +2652,9 @@ void state_fogstartend(DWORD state, IWineD3DStateBlockImpl *stateblock,
void state_fog_fragpart(DWORD state, IWineD3DStateBlockImpl *stateblock, void state_fog_fragpart(DWORD state, IWineD3DStateBlockImpl *stateblock,
struct wined3d_context *context) DECLSPEC_HIDDEN; struct wined3d_context *context) DECLSPEC_HIDDEN;
BOOL getColorBits(const struct wined3d_format_desc *format_desc, BOOL getColorBits(const struct wined3d_format *format,
short *redSize, short *greenSize, short *blueSize, short *alphaSize, short *totalSize) DECLSPEC_HIDDEN; short *redSize, short *greenSize, short *blueSize, short *alphaSize, short *totalSize) DECLSPEC_HIDDEN;
BOOL getDepthStencilBits(const struct wined3d_format_desc *format_desc, BOOL getDepthStencilBits(const struct wined3d_format *format,
short *depthSize, short *stencilSize) DECLSPEC_HIDDEN; short *depthSize, short *stencilSize) DECLSPEC_HIDDEN;
/* Math utils */ /* Math utils */
...@@ -2963,7 +2963,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN ...@@ -2963,7 +2963,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN
#define WINED3DFMT_FLAG_COMPRESSED 0x00008000 #define WINED3DFMT_FLAG_COMPRESSED 0x00008000
#define WINED3DFMT_FLAG_BROKEN_PITCH 0x00010000 #define WINED3DFMT_FLAG_BROKEN_PITCH 0x00010000
struct wined3d_format_desc struct wined3d_format
{ {
enum wined3d_format_id id; enum wined3d_format_id id;
...@@ -2998,11 +2998,11 @@ struct wined3d_format_desc ...@@ -2998,11 +2998,11 @@ struct wined3d_format_desc
void (*convert)(const BYTE *src, BYTE *dst, UINT pitch, UINT width, UINT height); void (*convert)(const BYTE *src, BYTE *dst, UINT pitch, UINT width, UINT height);
}; };
const struct wined3d_format_desc *getFormatDescEntry(enum wined3d_format_id format_id, const struct wined3d_format *wined3d_get_format(const struct wined3d_gl_info *gl_info,
const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; enum wined3d_format_id format_id) DECLSPEC_HIDDEN;
UINT wined3d_format_calculate_size(const struct wined3d_format_desc *format, UINT wined3d_format_calculate_size(const struct wined3d_format *format,
UINT alignment, UINT width, UINT height) DECLSPEC_HIDDEN; UINT alignment, UINT width, UINT height) DECLSPEC_HIDDEN;
DWORD wined3d_format_convert_from_float(const struct wined3d_format_desc *format, DWORD wined3d_format_convert_from_float(const struct wined3d_format *format,
const WINED3DCOLORVALUE *color) DECLSPEC_HIDDEN; const WINED3DCOLORVALUE *color) DECLSPEC_HIDDEN;
static inline BOOL use_vs(IWineD3DStateBlockImpl *stateblock) static inline BOOL use_vs(IWineD3DStateBlockImpl *stateblock)
......
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