49 FIXME(
"Unhandled usage flags %#x.\n",
usage & ~handled);
51 WARN_(d3d_perf)(
"WINED3DUSAGE_DYNAMIC used with WINED3D_RESOURCE_ACCESS_MAP_R.\n");
85 ERR(
"Trying to create a scratch resource with access flags %s.\n",
94 WARN(
"Bind flags %s are incompatible with resource access %s.\n",
102 WARN(
"Bind flags %s are incompatible with resource usage %s.\n",
109 ERR(
"Attempting to create a zero-sized resource.\n");
117 gl_type = resource_types[
i].gl_type;
154 WARN(
"Did not find a suitable GL resource type for resource type %s.\n",
178 resource->multisample_type = multisample_type;
179 resource->multisample_quality = multisample_quality;
192 resource->resource_ops = resource_ops;
202 ERR(
"Out of adapter memory.\n");
244 ERR(
"Resource %p is being unloaded while mapped.\n",
resource);
253 WARN(
"Called on non-managed resource %p, ignoring.\n",
resource);
285 desc->multisample_quality =
resource->multisample_quality;
298 TRACE(
"resource %p, sub_resource_idx %u, map_desc %p, box %s, flags %#x.\n",
306 TRACE(
"resource %p, sub_resource_idx %u.\n",
resource, sub_resource_idx);
327 ERR(
"Failed to allocate system memory.\n");
433 else if (
resource->multisample_type)
472 unsigned int i,
count = 0;
476 if (
format->multisample_types & 1u <<
i)
493 unsigned int width_mask, height_mask;
511 width_mask =
format->block_width - 1;
512 height_mask =
format->block_height - 1;
514 if ((
box->left & width_mask) || (
box->top & height_mask)
515 || (
box->right & width_mask &&
box->right !=
desc.width)
516 || (
box->bottom & height_mask &&
box->bottom !=
desc.height))
578 unsigned int row_pitch, slice_pitch;
588 + (
box->front * slice_pitch)
589 + ((
box->top /
format->block_height) * row_pitch)
595 + (
box->front * slice_pitch)
596 + (
box->top * row_pitch)
613 if (full_subresource && !colour->
r && !colour->
g && !colour->
b && !colour->
a)
624 + (
box->front *
map->slice_pitch)
634 for (
x = 0;
x <
w; ++
x)
641 for (
x = 0;
x <
w; ++
x)
650 for (
x = 0;
x <
w; ++
x, dst2 += 3)
652 dst2[0] = (
c[0] ) & 0xff;
653 dst2[1] = (
c[0] >> 8) & 0xff;
654 dst2[2] = (
c[0] >> 16) & 0xff;
659 for (
x = 0;
x <
w; ++
x)
668 for (
x = 0;
x <
w; ++
x)
673 FIXME(
"Not implemented for bpp %u.\n",
bpp);
678 for (
y = 1;
y <
h; ++
y)
680 dst2 +=
map->row_pitch;
685 for (
z = 1;
z <
d; ++
z)
687 dst2 +=
map->slice_pitch;
COMPILER_DEPENDENT_INT64 INT64
#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)
HRESULT CDECL wined3d_device_context_unmap(struct wined3d_device_context *context, struct wined3d_resource *resource, unsigned int sub_resource_idx)
HRESULT CDECL wined3d_device_context_map(struct wined3d_device_context *context, struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, unsigned int flags)
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)
VkPipelineStageFlags vk_pipeline_stage_mask_from_bind_flags(uint32_t bind_flags)
unsigned int CDECL wined3d_resource_set_priority(struct wined3d_resource *resource, unsigned int priority)
GLbitfield wined3d_resource_gl_storage_flags(const struct wined3d_resource *resource)
const struct wined3d_format * wined3d_resource_get_decompress_format(const struct wined3d_resource *resource)
VkAccessFlags vk_access_mask_from_bind_flags(uint32_t bind_flags)
static void resource_check_usage(uint32_t usage, unsigned int access)
HRESULT wined3d_resource_check_box_dimensions(struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box)
unsigned int CDECL wined3d_resource_get_priority(const struct wined3d_resource *resource)
static BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource)
void wined3d_resource_memory_colour_fill(struct wined3d_resource *resource, const struct wined3d_map_desc *map, const struct wined3d_color *colour, const struct wined3d_box *box, bool full_subresource)
void CDECL wined3d_resource_preload(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)
unsigned int wined3d_resource_get_sample_count(const struct wined3d_resource *resource)
void * resource_offset_map_pointer(struct wined3d_resource *resource, unsigned int sub_resource_idx, uint8_t *base_memory, const struct wined3d_box *box)
void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc)
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, uint32_t usage, unsigned int bind_flags, 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)
GLbitfield wined3d_resource_gl_map_flags(const struct wined3d_bo_gl *bo, 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, uint32_t flags)
static void wined3d_resource_destroy_object(void *object)
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)
void resource_cleanup(struct wined3d_resource *resource)
void CDECL wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops)
BOOL wined3d_resource_prepare_sysmem(struct wined3d_resource *resource)
void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
void resource_unload(struct wined3d_resource *resource)
const char * debug_d3dusage(uint32_t usage)
const char * wined3d_debug_bind_flags(uint32_t bind_flags)
const char * debug_box(const struct wined3d_box *box)
const char * debug_d3dformat(enum wined3d_format_id format_id)
const char * wined3d_debug_resource_access(uint32_t access)
void wined3d_format_convert_from_float(const struct wined3d_format *format, const struct wined3d_color *color, void *ret)
const char * debug_d3dresourcetype(enum wined3d_resource_type resource_type)
const struct wined3d_format * wined3d_get_format(const struct wined3d_adapter *adapter, enum wined3d_format_id format_id, unsigned int bind_flags)
#define WINE_DECLARE_DEBUG_CHANNEL(x)
GLint GLint GLsizei GLsizei GLsizei depth
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLint GLint GLsizei GLsizei height
GLuint GLuint GLsizei GLenum type
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei width
#define GL_WRITE_ONLY_ARB
#define GL_MAP_FLUSH_EXPLICIT_BIT
#define GL_READ_WRITE_ARB
#define GL_MAP_UNSYNCHRONIZED_BIT
GLuint GLint GLboolean GLint GLenum access
GLubyte GLubyte GLubyte GLubyte w
GLsizeiptr const GLvoid GLenum usage
GLfloat GLfloat GLfloat GLfloat h
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
#define memcpy(s1, s2, n)
D3D11_SHADER_VARIABLE_DESC desc
DWORD multisample_draw_location
const struct wined3d_parent_ops * parent_ops
struct wined3d_texture * front_buffer
VkFlags VkPipelineStageFlags
@ VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT
@ VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT
@ VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT
@ VK_ACCESS_INDIRECT_COMMAND_READ_BIT
@ VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT
@ VK_ACCESS_SHADER_WRITE_BIT
@ VK_ACCESS_SHADER_READ_BIT
@ VK_ACCESS_UNIFORM_READ_BIT
@ VK_ACCESS_INDEX_READ_BIT
@ VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT
@ VK_ACCESS_COLOR_ATTACHMENT_READ_BIT
@ VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT
@ VK_PIPELINE_STAGE_VERTEX_INPUT_BIT
@ VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT
@ VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT
@ VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT
@ VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT
@ VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT
@ VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT
@ VK_PIPELINE_STAGE_VERTEX_SHADER_BIT
@ VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT
@ VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT
@ VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT
#define GL_CLIENT_STORAGE_BIT
UINT64 adapter_adjust_memory(struct wined3d_adapter *adapter, INT64 amount)
@ WINED3D_MULTISAMPLE_NON_MASKABLE
#define WINED3DUSAGE_LEGACY_CUBEMAP
#define WINED3D_BIND_VERTEX_BUFFER
#define WINED3D_RESOURCE_ACCESS_GPU
#define WINED3D_RESOURCE_ACCESS_CPU
@ WINED3D_RTYPE_TEXTURE_2D
@ WINED3D_RTYPE_TEXTURE_1D
@ WINED3D_RTYPE_TEXTURE_3D
#define WINED3D_BIND_UNORDERED_ACCESS
#define WINED3DUSAGE_OVERLAY
#define WINED3D_BIND_SHADER_RESOURCE
#define WINED3DUSAGE_VIDMEM_ACCOUNTING
@ WINED3DFMT_B8G8R8A8_UNORM
@ WINED3DFMT_B8G8R8A8_UNORM_SRGB
#define WINED3D_BIND_INDIRECT_BUFFER
#define WINED3D_BIND_DEPTH_STENCIL
#define WINED3D_RESOURCE_ACCESS_MAP_R
#define WINED3DUSAGE_MANAGED
#define WINED3D_MAP_WRITE
#define WINED3DUSAGE_SCRATCH
#define WINED3D_BIND_RENDER_TARGET
#define WINED3DUSAGE_DYNAMIC
#define WINEDDERR_INVALIDRECT
#define WINED3DERR_INVALIDCALL
#define WINED3DUSAGE_STATICDECL
#define WINED3D_BIND_CONSTANT_BUFFER
#define WINED3D_BIND_STREAM_OUTPUT
#define WINED3D_SRGB_READ_WRITE_CONTROL
#define WINED3DERR_OUTOFVIDEOMEMORY
#define WINED3D_BIND_INDEX_BUFFER
#define WINED3D_RESOURCE_ACCESS_MAP_W
#define WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY
static void wined3d_resource_get_sub_resource_map_pitch(struct wined3d_resource *resource, unsigned int sub_resource_idx, unsigned int *row_pitch, unsigned int *slice_pitch)
#define WINED3D_LOCATION_SYSMEM
#define WINED3D_FORMAT_CAP_TEXTURE
static HRESULT wined3d_resource_get_sub_resource_desc(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_sub_resource_desc *desc)
#define WINED3D_FORMAT_ATTR_BROKEN_PITCH
#define WINED3D_FORMAT_ATTR_MAPPABLE
#define WINED3D_LOCATION_RB_RESOLVED
#define RESOURCE_ALIGNMENT
#define WINED3D_FORMAT_CAP_SRGB_WRITE
@ 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_1D
@ WINED3D_GL_RES_TYPE_COUNT
#define WINED3D_LOCATION_TEXTURE_RGB
static size_t align(size_t addr, size_t alignment)
static void wined3d_resource_reference(struct wined3d_resource *resource)
#define WINED3D_FORMAT_CAP_DEPTH_STENCIL
#define WINED3D_LOCATION_DRAWABLE
#define WINED3D_FORMAT_CAP_RENDERTARGET
#define WINED3D_FORMAT_ATTR_BLOCKS
#define WINED3D_FORMAT_CAP_SRGB_READ
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)