52 FIXME(
"Unhandled usage flags %#x.\n",
usage & ~handled);
56 WARN_(d3d_perf)(
"WINED3DUSAGE_DYNAMIC used without WINED3DUSAGE_WRITEONLY.\n");
93 ERR(
"Trying to create a scratch resource with access flags %s.\n",
104 gl_type = resource_types[
i].gl_type;
123 WARN(
"Render target or depth stencil is not FBO attachable.\n");
136 TRACE(
"Skipping 2D texture type to try texture rectangle.\n");
158 WARN(
"Did not find a suitable GL resource type for resource type %s.\n",
181 resource->multisample_type = multisample_type;
182 resource->multisample_quality = multisample_quality;
192 resource->resource_ops = resource_ops;
199 ERR(
"Failed to allocate system memory.\n");
215 ERR(
"Out of adapter memory\n");
260 ERR(
"Resource %p is being unloaded while mapped.\n",
resource);
269 WARN(
"Called on non-managed resource %p, ignoring.\n",
resource);
300 desc->multisample_quality =
resource->multisample_quality;
317 WARN(
"WINED3D_MAP_READ combined with WINED3D_MAP_DISCARD, ignoring flags.\n");
322 WARN(
"WINED3D_MAP_READ combined with WINED3D_MAP_NOOVERWRITE, ignoring flags.\n");
330 WARN(
"DISCARD or NOOVERWRITE map on non-dynamic buffer, ignoring.\n");
336 WARN(
"WINED3D_MAP_NOOVERWRITE used with WINED3D_MAP_DISCARD, ignoring WINED3D_MAP_DISCARD.\n");
337 flags &= ~WINED3D_MAP_DISCARD;
347 TRACE(
"resource %p, sub_resource_idx %u, map_desc %p, box %s, flags %#x.\n",
352 WARN(
"No read/write flags specified.\n");
358 WARN(
"Resource does not have MAP_R access.\n");
364 WARN(
"Resource does not have MAP_W access.\n");
377 TRACE(
"resource %p, sub_resource_idx %u.\n",
resource, sub_resource_idx);
384 TRACE(
"resource %p, sub_resource_idx %u.\n",
resource, sub_resource_idx);
390 const struct wined3d_box *
box,
unsigned int row_pitch,
unsigned int depth_pitch)
396 TRACE(
"resource %p, sub_resource_idx %u, box %s, row_pitch %u, depth_pitch %u.\n",
401 if (sub_resource_idx > 0)
403 WARN(
"Invalid sub_resource_idx %u.\n", sub_resource_idx);
417 if (sub_resource_idx >=
texture->level_count *
texture->layer_count)
419 WARN(
"Invalid sub_resource_idx %u.\n", sub_resource_idx);
464 data_size += (
box->back -
box->front - 1) * depth_pitch;
470 data_size += (
box->right -
box->left) *
resource->format->byte_count;
473 data_size =
box->right -
box->left;
574 else if (
resource->multisample_type)
static BOOL heap_free(void *mem)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void wined3d_cs_emit_preload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource)
void wined3d_cs_destroy_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
void context_resource_released(const struct wined3d_device *device, struct wined3d_resource *resource, enum wined3d_resource_type type)
UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device *device)
void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource)
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource)
HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *device, enum wined3d_resource_type type, const struct wined3d_format *format, enum wined3d_multisample_type multisample_type, unsigned int multisample_quality, unsigned int usage, unsigned int access, unsigned int width, unsigned int height, unsigned int depth, unsigned int size, void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops)
void CDECL wined3d_resource_preload(struct wined3d_resource *resource)
DWORD CDECL wined3d_resource_set_priority(struct wined3d_resource *resource, DWORD priority)
DWORD CDECL wined3d_resource_get_priority(const struct wined3d_resource *resource)
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
void *CDECL wined3d_resource_get_parent(const struct wined3d_resource *resource)
void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc)
static void resource_check_usage(DWORD usage)
UINT CDECL wined3d_resource_update_info(struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, unsigned int row_pitch, unsigned int depth_pitch)
HRESULT CDECL wined3d_resource_map_info(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_info *info, DWORD flags)
static void wined3d_resource_destroy_object(void *object)
void CDECL wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent)
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource)
void wined3d_resource_free_sysmem(struct wined3d_resource *resource)
GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags)
HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags)
GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags)
BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource)
void resource_cleanup(struct wined3d_resource *resource)
static DWORD wined3d_resource_sanitise_map_flags(const struct wined3d_resource *resource, DWORD flags)
void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
void resource_unload(struct wined3d_resource *resource)
const char * debug_box(const struct wined3d_box *box)
const char * debug_d3dformat(enum wined3d_format_id format_id)
const char * debug_d3dresourcetype(enum wined3d_resource_type resource_type)
const char * wined3d_debug_resource_access(DWORD access)
#define WINE_DECLARE_DEBUG_CHANNEL(x)
int align(int length, int align)
GLint GLint GLsizei GLsizei GLsizei depth
GLuint GLuint GLsizei GLenum type
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
#define GL_WRITE_ONLY_ARB
#define GL_MAP_FLUSH_EXPLICIT_BIT
#define GL_READ_WRITE_ARB
GLboolean GLboolean GLboolean b
#define GL_MAP_UNSYNCHRONIZED_BIT
GLuint GLint GLboolean GLint GLenum access
#define GL_MAP_INVALIDATE_BUFFER_BIT
GLsizeiptr const GLvoid GLenum usage
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static const WCHAR desc[]
BOOL supported[WINED3D_GL_EXT_COUNT]
int offscreen_rendering_mode
struct wined3d_texture * front_buffer
UINT64 adapter_adjust_memory(struct wined3d_adapter *adapter, INT64 amount)
#define WINED3DUSAGE_WRITEONLY
#define WINED3DUSAGE_LEGACY_CUBEMAP
#define WINED3D_RESOURCE_ACCESS_GPU
#define WINED3D_VIDMEM_ACCOUNTING
#define WINED3D_RESOURCE_ACCESS_CPU
@ WINED3D_RTYPE_TEXTURE_2D
@ WINED3D_RTYPE_TEXTURE_1D
@ WINED3D_RTYPE_TEXTURE_3D
#define WINED3DUSAGE_OVERLAY
static void wined3d_box_set(struct wined3d_box *box, unsigned int left, unsigned int top, unsigned int right, unsigned int bottom, unsigned int front, unsigned int back)
#define WINED3D_RESOURCE_ACCESS_MAP_R
#define WINED3D_MAP_DISCARD
#define WINED3D_MAP_WRITE
#define WINED3DUSAGE_SCRATCH
#define WINED3DUSAGE_PRIVATE
#define WINED3DUSAGE_RENDERTARGET
#define WINED3D_MAP_NOOVERWRITE
#define WINED3DUSAGE_DYNAMIC
#define WINED3DERR_INVALIDCALL
#define WINED3DUSAGE_STATICDECL
#define WINED3DUSAGE_TEXTURE
#define WINED3DERR_OUTOFVIDEOMEMORY
#define WINED3D_RESOURCE_ACCESS_MAP_W
#define WINED3DUSAGE_DEPTHSTENCIL
@ ARB_TEXTURE_MULTISAMPLE
@ WINED3D_GL_NORMALIZED_TEXRECT
@ ARB_TEXTURE_NON_POWER_OF_TWO
static unsigned int wined3d_texture_get_level_height(const struct wined3d_texture *texture, unsigned int level)
#define WINED3D_LOCATION_SYSMEM
static void wined3d_resource_acquire(struct wined3d_resource *resource)
static unsigned int wined3d_texture_get_level_width(const struct wined3d_texture *texture, unsigned int level)
#define WINED3DFMT_FLAG_RENDERTARGET
#define WINED3D_LOCATION_RB_RESOLVED
#define RESOURCE_ALIGNMENT
#define WINED3DFMT_FLAG_FBO_ATTACHABLE
static void wined3d_resource_release(struct wined3d_resource *resource)
static BOOL wined3d_resource_access_is_managed(unsigned int access)
@ WINED3D_GL_RES_TYPE_TEX_3D
@ WINED3D_GL_RES_TYPE_TEX_CUBE
@ WINED3D_GL_RES_TYPE_BUFFER
@ WINED3D_GL_RES_TYPE_TEX_2D
@ WINED3D_GL_RES_TYPE_TEX_RECT
@ WINED3D_GL_RES_TYPE_TEX_1D
@ WINED3D_GL_RES_TYPE_COUNT
#define WINED3D_LOCATION_TEXTURE_RGB
#define WINED3DFMT_FLAG_TEXTURE
#define WINED3D_LOCATION_DRAWABLE
#define WINED3DFMT_FLAG_BLOCKS
#define WINED3DFMT_FLAG_STENCIL
#define WINED3D_LOCATION_RB_MULTISAMPLE
#define WINED3DFMT_FLAG_DEPTH
static void wined3d_resource_wait_idle(struct wined3d_resource *resource)
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
#define WINED3DFMT_FLAG_BLOCKS_NO_VERIFY
static unsigned int wined3d_texture_get_level_depth(const struct wined3d_texture *texture, unsigned int level)