ReactOS  0.4.13-dev-247-g0f29b3f
view.c File Reference
#include "config.h"
#include "wine/port.h"
#include "wined3d_private.h"
Include dependency graph for view.c:

Go to the source code of this file.

Macros

#define WINED3D_VIEW_CUBE_ARRAY   (WINED3D_VIEW_TEXTURE_CUBE | WINED3D_VIEW_TEXTURE_ARRAY)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3d)
 
static BOOL is_stencil_view_format (const struct wined3d_format *format)
 
static GLenum get_texture_view_target (const struct wined3d_gl_info *gl_info, const struct wined3d_view_desc *desc, const struct wined3d_texture *texture)
 
static const struct wined3d_formatvalidate_resource_view (const struct wined3d_view_desc *desc, struct wined3d_resource *resource, BOOL mip_slice, BOOL allow_srgb_toggle)
 
static void create_texture_view (struct wined3d_gl_view *view, GLenum view_target, const struct wined3d_view_desc *desc, struct wined3d_texture *texture, const struct wined3d_format *view_format)
 
static void create_buffer_texture (struct wined3d_gl_view *view, struct wined3d_context *context, struct wined3d_buffer *buffer, const struct wined3d_format *view_format, unsigned int offset, unsigned int size)
 
static void get_buffer_view_range (const struct wined3d_buffer *buffer, const struct wined3d_view_desc *desc, const struct wined3d_format *view_format, unsigned int *offset, unsigned int *size)
 
static void create_buffer_view (struct wined3d_gl_view *view, struct wined3d_context *context, const struct wined3d_view_desc *desc, struct wined3d_buffer *buffer, const struct wined3d_format *view_format)
 
static void wined3d_view_invalidate_location (struct wined3d_resource *resource, const struct wined3d_view_desc *desc, DWORD location)
 
ULONG CDECL wined3d_rendertarget_view_incref (struct wined3d_rendertarget_view *view)
 
static void wined3d_rendertarget_view_destroy_object (void *object)
 
ULONG CDECL wined3d_rendertarget_view_decref (struct wined3d_rendertarget_view *view)
 
void *CDECL wined3d_rendertarget_view_get_parent (const struct wined3d_rendertarget_view *view)
 
void *CDECL wined3d_rendertarget_view_get_sub_resource_parent (const struct wined3d_rendertarget_view *view)
 
void CDECL wined3d_rendertarget_view_set_parent (struct wined3d_rendertarget_view *view, void *parent)
 
struct wined3d_resource *CDECL wined3d_rendertarget_view_get_resource (const struct wined3d_rendertarget_view *view)
 
void wined3d_rendertarget_view_get_drawable_size (const struct wined3d_rendertarget_view *view, const struct wined3d_context *context, unsigned int *width, unsigned int *height)
 
void wined3d_rendertarget_view_prepare_location (struct wined3d_rendertarget_view *view, struct wined3d_context *context, DWORD location)
 
void wined3d_rendertarget_view_load_location (struct wined3d_rendertarget_view *view, struct wined3d_context *context, DWORD location)
 
void wined3d_rendertarget_view_validate_location (struct wined3d_rendertarget_view *view, DWORD location)
 
void wined3d_rendertarget_view_invalidate_location (struct wined3d_rendertarget_view *view, DWORD location)
 
static void wined3d_render_target_view_cs_init (void *object)
 
static HRESULT wined3d_rendertarget_view_init (struct wined3d_rendertarget_view *view, const struct wined3d_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops)
 
HRESULT CDECL wined3d_rendertarget_view_create (const struct wined3d_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_rendertarget_view **view)
 
HRESULT CDECL wined3d_rendertarget_view_create_from_sub_resource (struct wined3d_texture *texture, unsigned int sub_resource_idx, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_rendertarget_view **view)
 
ULONG CDECL wined3d_shader_resource_view_incref (struct wined3d_shader_resource_view *view)
 
static void wined3d_shader_resource_view_destroy_object (void *object)
 
ULONG CDECL wined3d_shader_resource_view_decref (struct wined3d_shader_resource_view *view)
 
void *CDECL wined3d_shader_resource_view_get_parent (const struct wined3d_shader_resource_view *view)
 
static void wined3d_shader_resource_view_cs_init (void *object)
 
static HRESULT wined3d_shader_resource_view_init (struct wined3d_shader_resource_view *view, const struct wined3d_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops)
 
HRESULT CDECL wined3d_shader_resource_view_create (const struct wined3d_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_shader_resource_view **view)
 
void wined3d_shader_resource_view_bind (struct wined3d_shader_resource_view *view, unsigned int unit, struct wined3d_sampler *sampler, struct wined3d_context *context)
 
static void shader_resource_view_bind_and_dirtify (struct wined3d_shader_resource_view *view, struct wined3d_context *context)
 
void shader_resource_view_generate_mipmaps (struct wined3d_shader_resource_view *view)
 
void CDECL wined3d_shader_resource_view_generate_mipmaps (struct wined3d_shader_resource_view *view)
 
ULONG CDECL wined3d_unordered_access_view_incref (struct wined3d_unordered_access_view *view)
 
static void wined3d_unordered_access_view_destroy_object (void *object)
 
ULONG CDECL wined3d_unordered_access_view_decref (struct wined3d_unordered_access_view *view)
 
void *CDECL wined3d_unordered_access_view_get_parent (const struct wined3d_unordered_access_view *view)
 
void wined3d_unordered_access_view_invalidate_location (struct wined3d_unordered_access_view *view, DWORD location)
 
void wined3d_unordered_access_view_clear_uint (struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value, struct wined3d_context *context)
 
void wined3d_unordered_access_view_set_counter (struct wined3d_unordered_access_view *view, unsigned int value)
 
void wined3d_unordered_access_view_copy_counter (struct wined3d_unordered_access_view *view, struct wined3d_buffer *buffer, unsigned int offset, struct wined3d_context *context)
 
static void wined3d_unordered_access_view_cs_init (void *object)
 
static HRESULT wined3d_unordered_access_view_init (struct wined3d_unordered_access_view *view, const struct wined3d_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops)
 
HRESULT CDECL wined3d_unordered_access_view_create (const struct wined3d_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_unordered_access_view **view)
 

Macro Definition Documentation

◆ WINED3D_VIEW_CUBE_ARRAY

#define WINED3D_VIEW_CUBE_ARRAY   (WINED3D_VIEW_TEXTURE_CUBE | WINED3D_VIEW_TEXTURE_ARRAY)

Definition at line 27 of file view.c.

Function Documentation

◆ create_buffer_texture()

static void create_buffer_texture ( struct wined3d_gl_view view,
struct wined3d_context context,
struct wined3d_buffer buffer,
const struct wined3d_format view_format,
unsigned int  offset,
unsigned int  size 
)
static

Definition at line 230 of file view.c.

233 {
234  const struct wined3d_gl_info *gl_info = context->gl_info;
235 
236  if (!gl_info->supported[ARB_TEXTURE_BUFFER_OBJECT])
237  {
238  FIXME("OpenGL implementation does not support buffer textures.\n");
239  return;
240  }
241 
242  if ((offset & (gl_info->limits.texture_buffer_offset_alignment - 1)))
243  {
244  FIXME("Buffer offset %u is not %u byte aligned.\n",
245  offset, gl_info->limits.texture_buffer_offset_alignment);
246  return;
247  }
248 
250 
251  view->target = GL_TEXTURE_BUFFER;
252  gl_info->gl_ops.gl.p_glGenTextures(1, &view->name);
253 
255  if (gl_info->supported[ARB_TEXTURE_BUFFER_RANGE])
256  {
257  GL_EXTCALL(glTexBufferRange(GL_TEXTURE_BUFFER, view_format->glInternal,
258  buffer->buffer_object, offset, size));
259  }
260  else
261  {
262  if (offset || size != buffer->resource.size)
263  FIXME("OpenGL implementation does not support ARB_texture_buffer_range.\n");
264  GL_EXTCALL(glTexBuffer(GL_TEXTURE_BUFFER, view_format->glInternal, buffer->buffer_object));
265  }
266  checkGLcall("Create buffer texture");
267 
270 }
struct opengl_funcs gl_ops
BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer, struct wined3d_context *context, DWORD location)
Definition: buffer.c:638
Definition: http.c:6587
#define GL_TEXTURE_BUFFER
Definition: glext.h:748
GLintptr offset
Definition: glext.h:5920
#define WINED3D_LOCATION_BUFFER
GLuint buffer
Definition: glext.h:5915
void context_invalidate_state(struct wined3d_context *context, DWORD state)
Definition: context.c:1638
void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint name)
Definition: context.c:2503
#define FIXME(fmt,...)
Definition: debug.h:110
BOOL supported[WINED3D_GL_EXT_COUNT]
#define STATE_GRAPHICS_SHADER_RESOURCE_BINDING
void context_invalidate_compute_state(struct wined3d_context *context, DWORD state_id)
Definition: context.c:1628
#define GL_EXTCALL(f)
GLsizeiptr size
Definition: glext.h:5919
#define STATE_COMPUTE_SHADER_RESOURCE_BINDING
#define checkGLcall(A)
struct wined3d_gl_limits limits

Referenced by create_buffer_view().

◆ create_buffer_view()

static void create_buffer_view ( struct wined3d_gl_view view,
struct wined3d_context context,
const struct wined3d_view_desc desc,
struct wined3d_buffer buffer,
const struct wined3d_format view_format 
)
static

Definition at line 288 of file view.c.

291 {
292  unsigned int offset, size;
293 
294  get_buffer_view_range(buffer, desc, view_format, &offset, &size);
296 }
static void create_buffer_texture(struct wined3d_gl_view *view, struct wined3d_context *context, struct wined3d_buffer *buffer, const struct wined3d_format *view_format, unsigned int offset, unsigned int size)
Definition: view.c:230
Definition: http.c:6587
GLintptr offset
Definition: glext.h:5920
GLuint buffer
Definition: glext.h:5915
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
GLsizeiptr size
Definition: glext.h:5919
static void get_buffer_view_range(const struct wined3d_buffer *buffer, const struct wined3d_view_desc *desc, const struct wined3d_format *view_format, unsigned int *offset, unsigned int *size)
Definition: view.c:272

Referenced by wined3d_shader_resource_view_cs_init(), and wined3d_unordered_access_view_cs_init().

◆ create_texture_view()

static void create_texture_view ( struct wined3d_gl_view view,
GLenum  view_target,
const struct wined3d_view_desc desc,
struct wined3d_texture texture,
const struct wined3d_format view_format 
)
static

Definition at line 168 of file view.c.

171 {
172  const struct wined3d_gl_info *gl_info;
173  unsigned int layer_idx, layer_count;
174  struct wined3d_context *context;
175  GLuint texture_name;
176 
177  view->target = view_target;
178 
179  context = context_acquire(texture->resource.device, NULL, 0);
180  gl_info = context->gl_info;
181 
182  if (!gl_info->supported[ARB_TEXTURE_VIEW])
183  {
185  FIXME("OpenGL implementation does not support texture views.\n");
186  return;
187  }
188 
191 
192  layer_idx = desc->u.texture.layer_idx;
193  layer_count = desc->u.texture.layer_count;
194  if (view_target == GL_TEXTURE_3D && (layer_idx || layer_count != 1))
195  {
196  FIXME("Depth slice (%u-%u) not supported.\n", layer_idx, layer_count);
197  layer_idx = 0;
198  layer_count = 1;
199  }
200 
201  gl_info->gl_ops.gl.p_glGenTextures(1, &view->name);
202  GL_EXTCALL(glTextureView(view->name, view->target, texture_name, view_format->glInternal,
203  desc->u.texture.level_idx, desc->u.texture.level_count,
204  layer_idx, layer_count));
205  checkGLcall("Create texture view");
206 
207  if (is_stencil_view_format(view_format))
208  {
209  static const GLint swizzle[] = {GL_ZERO, GL_RED, GL_ZERO, GL_ZERO};
210 
211  if (!gl_info->supported[ARB_STENCIL_TEXTURING])
212  {
214  FIXME("OpenGL implementation does not support stencil texturing.\n");
215  return;
216  }
217 
218  context_bind_texture(context, view->target, view->name);
219  gl_info->gl_ops.gl.p_glTexParameteriv(view->target, GL_TEXTURE_SWIZZLE_RGBA, swizzle);
220  gl_info->gl_ops.gl.p_glTexParameteri(view->target, GL_DEPTH_STENCIL_TEXTURE_MODE, GL_STENCIL_INDEX);
221  checkGLcall("Initialize stencil view");
222 
225  }
226 
228 }
#define GL_RED
Definition: gl.h:480
Definition: http.c:6587
static BOOL is_stencil_view_format(const struct wined3d_format *format)
Definition: view.c:29
void wined3d_texture_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
Definition: texture.c:1706
static GLuint wined3d_texture_get_texture_name(const struct wined3d_texture *texture, const struct wined3d_context *context, BOOL srgb)
#define GL_TEXTURE_SWIZZLE_RGBA
Definition: glext.h:2032
#define GL_DEPTH_STENCIL_TEXTURE_MODE
Definition: wgl.h:1005
void context_invalidate_state(struct wined3d_context *context, DWORD state)
Definition: context.c:1638
void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint name)
Definition: context.c:2503
#define GL_ZERO
Definition: gl.h:374
#define FIXME(fmt,...)
Definition: debug.h:110
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
#define GL_TEXTURE_3D
Definition: gl.h:1515
smooth NULL
Definition: ftsmooth.c:416
void context_release(struct wined3d_context *context)
Definition: context.c:1559
#define STATE_GRAPHICS_SHADER_RESOURCE_BINDING
void context_invalidate_compute_state(struct wined3d_context *context, DWORD state_id)
Definition: context.c:1628
#define GL_EXTCALL(f)
GLenum GLuint texture
Definition: glext.h:6295
#define GL_STENCIL_INDEX
Definition: gl.h:458
#define STATE_COMPUTE_SHADER_RESOURCE_BINDING
struct wined3d_context * context_acquire(const struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: context.c:4218
unsigned int GLuint
Definition: gl.h:159
#define checkGLcall(A)
GLuint GLenum swizzle
Definition: glext.h:9511
int GLint
Definition: gl.h:156
const struct wined3d_gl_info * gl_info

Referenced by wined3d_render_target_view_cs_init(), wined3d_shader_resource_view_cs_init(), and wined3d_unordered_access_view_cs_init().

◆ get_buffer_view_range()

static void get_buffer_view_range ( const struct wined3d_buffer buffer,
const struct wined3d_view_desc desc,
const struct wined3d_format view_format,
unsigned int offset,
unsigned int size 
)
static

Definition at line 272 of file view.c.

275 {
276  if (desc->format_id == WINED3DFMT_UNKNOWN)
277  {
278  *offset = desc->u.buffer.start_idx * buffer->desc.structure_byte_stride;
279  *size = desc->u.buffer.count * buffer->desc.structure_byte_stride;
280  }
281  else
282  {
283  *offset = desc->u.buffer.start_idx * view_format->byte_count;
284  *size = desc->u.buffer.count * view_format->byte_count;
285  }
286 }
GLintptr offset
Definition: glext.h:5920
GLuint buffer
Definition: glext.h:5915
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
GLsizeiptr size
Definition: glext.h:5919

Referenced by create_buffer_view(), and wined3d_unordered_access_view_clear_uint().

◆ get_texture_view_target()

static GLenum get_texture_view_target ( const struct wined3d_gl_info gl_info,
const struct wined3d_view_desc desc,
const struct wined3d_texture texture 
)
static

Definition at line 35 of file view.c.

37 {
38  static const struct
39  {
40  GLenum texture_target;
41  unsigned int view_flags;
42  GLenum view_target;
43  enum wined3d_gl_extension extension;
44  }
45  view_types[] =
46  {
50 
57 
62 
67  };
68  unsigned int i;
69 
70  for (i = 0; i < ARRAY_SIZE(view_types); ++i)
71  {
72  if (view_types[i].texture_target != texture->target || view_types[i].view_flags != desc->flags)
73  continue;
74  if (gl_info->supported[view_types[i].extension])
75  return view_types[i].view_target;
76 
77  FIXME("Extension %#x not supported.\n", view_types[i].extension);
78  }
79 
80  FIXME("Unhandled view flags %#x for texture target %#x.\n", desc->flags, texture->target);
81  return texture->target;
82 }
#define GL_TEXTURE_CUBE_MAP_ARRAY
Definition: glext.h:920
#define GL_TEXTURE_2D_MULTISAMPLE
Definition: glext.h:1939
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
Definition: glfuncs.h:248
#define GL_TEXTURE_1D
Definition: gl.h:644
#define FIXME(fmt,...)
Definition: debug.h:110
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
#define GL_TEXTURE_3D
Definition: gl.h:1515
#define WINED3D_VIEW_TEXTURE_ARRAY
Definition: wined3d.h:1577
#define WINED3D_VIEW_TEXTURE_CUBE
Definition: wined3d.h:1576
GLenum GLuint texture
Definition: glext.h:6295
wined3d_gl_extension
Definition: wined3d_gl.h:35
#define GL_TEXTURE_1D_ARRAY
Definition: glext.h:533
#define WINED3D_VIEW_CUBE_ARRAY
Definition: view.c:27
#define GL_TEXTURE_2D_ARRAY
Definition: glext.h:535
#define GL_TEXTURE_CUBE_MAP
Definition: gl.h:1788
unsigned int GLenum
Definition: gl.h:150
#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY
Definition: glext.h:1941
#define ARRAY_SIZE(a)
Definition: main.h:24
#define GL_TEXTURE_2D
Definition: gl.h:645
const struct wined3d_gl_info * gl_info
#define GL_TEXTURE_RECTANGLE
Definition: glext.h:753

Referenced by wined3d_shader_resource_view_cs_init(), and wined3d_unordered_access_view_cs_init().

◆ is_stencil_view_format()

static BOOL is_stencil_view_format ( const struct wined3d_format format)
static

Definition at line 29 of file view.c.

30 {
33 }
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546

Referenced by create_texture_view(), and wined3d_shader_resource_view_cs_init().

◆ shader_resource_view_bind_and_dirtify()

static void shader_resource_view_bind_and_dirtify ( struct wined3d_shader_resource_view view,
struct wined3d_context context 
)
static

Definition at line 830 of file view.c.

832 {
833  if (context->active_texture < ARRAY_SIZE(context->rev_tex_unit_map))
834  {
835  DWORD active_sampler = context->rev_tex_unit_map[context->active_texture];
836  if (active_sampler != WINED3D_UNMAPPED_STAGE)
838  }
839  /* FIXME: Ideally we'd only do this when touching a binding that's used by
840  * a shader. */
843 
844  context_bind_texture(context, view->gl_view.target, view->gl_view.name);
845 }
Definition: http.c:6587
void context_invalidate_state(struct wined3d_context *context, DWORD state)
Definition: context.c:1638
void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint name)
Definition: context.c:2503
#define STATE_GRAPHICS_SHADER_RESOURCE_BINDING
void context_invalidate_compute_state(struct wined3d_context *context, DWORD state_id)
Definition: context.c:1628
unsigned long DWORD
Definition: ntddk_ex.h:95
#define STATE_COMPUTE_SHADER_RESOURCE_BINDING
#define WINED3D_UNMAPPED_STAGE
#define STATE_SAMPLER(num)
#define ARRAY_SIZE(a)
Definition: main.h:24

Referenced by shader_resource_view_generate_mipmaps().

◆ shader_resource_view_generate_mipmaps()

void shader_resource_view_generate_mipmaps ( struct wined3d_shader_resource_view view)

Definition at line 847 of file view.c.

848 {
849  struct wined3d_texture *texture = texture_from_resource(view->resource);
850  unsigned int i, j, layer_count, level_count, base_level, max_level;
851  const struct wined3d_gl_info *gl_info;
852  struct wined3d_context *context;
853  struct gl_texture *gl_tex;
854  DWORD location;
855  BOOL srgb;
856 
857  TRACE("view %p.\n", view);
858 
859  context = context_acquire(view->resource->device, NULL, 0);
860  gl_info = context->gl_info;
861  layer_count = view->desc.u.texture.layer_count;
862  level_count = view->desc.u.texture.level_count;
863  base_level = view->desc.u.texture.level_idx;
864  max_level = base_level + level_count - 1;
865 
866  srgb = !!(texture->flags & WINED3D_TEXTURE_IS_SRGB);
868  for (i = 0; i < layer_count; ++i)
870 
871  if (view->gl_view.name)
872  {
874  }
875  else
876  {
878  gl_info->gl_ops.gl.p_glTexParameteri(texture->target, GL_TEXTURE_BASE_LEVEL, base_level);
879  gl_info->gl_ops.gl.p_glTexParameteri(texture->target, GL_TEXTURE_MAX_LEVEL, max_level);
880  }
881 
882  if (gl_info->supported[ARB_SAMPLER_OBJECTS])
883  GL_EXTCALL(glBindSampler(context->active_texture, 0));
884  gl_tex = wined3d_texture_get_gl_texture(texture, srgb);
885  if (context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL)
886  {
887  gl_info->gl_ops.gl.p_glTexParameteri(texture->target, GL_TEXTURE_SRGB_DECODE_EXT,
889  gl_tex->sampler_desc.srgb_decode = FALSE;
890  }
891 
892  gl_info->fbo_ops.glGenerateMipmap(texture->target);
893  checkGLcall("glGenerateMipMap()");
894 
895  for (i = 0; i < layer_count; ++i)
896  {
897  for (j = base_level + 1; j <= max_level; ++j)
898  {
901  }
902  }
903 
904  if (!view->gl_view.name)
905  {
906  gl_tex->base_level = base_level;
907  gl_info->gl_ops.gl.p_glTexParameteri(texture->target, GL_TEXTURE_MAX_LEVEL, texture->level_count - 1);
908  }
909 
911 }
struct opengl_funcs gl_ops
#define GL_TEXTURE_SRGB_DECODE_EXT
Definition: glext.h:5289
Definition: http.c:6587
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
Definition: glfuncs.h:248
#define WINED3D_TEXTURE_IS_SRGB
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL supported[WINED3D_GL_EXT_COUNT]
smooth NULL
Definition: ftsmooth.c:416
void context_release(struct wined3d_context *context)
Definition: context.c:1559
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 GLint GLint j
Definition: glfuncs.h:250
#define GL_EXTCALL(f)
#define TRACE(s)
Definition: solgame.cpp:4
void wined3d_texture_validate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD location)
Definition: texture.c:286
GLenum GLuint texture
Definition: glext.h:6295
unsigned long DWORD
Definition: ntddk_ex.h:95
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
struct wined3d_sampler_desc sampler_desc
static struct gl_texture * wined3d_texture_get_gl_texture(struct wined3d_texture *texture, BOOL srgb)
#define location(file, line)
Definition: kmtest.h:18
struct wined3d_context * context_acquire(const struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: context.c:4218
unsigned int base_level
void wined3d_texture_invalidate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD location)
Definition: texture.c:310
#define WINED3D_LOCATION_TEXTURE_RGB
#define checkGLcall(A)
BOOL wined3d_texture_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location)
Definition: texture.c:380
static void shader_resource_view_bind_and_dirtify(struct wined3d_shader_resource_view *view, struct wined3d_context *context)
Definition: view.c:830
struct wined3d_fbo_ops fbo_ops
#define WINED3D_SRGB_READ_WRITE_CONTROL
Definition: wined3d.h:1326
void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
Definition: texture.c:1064
#define WINED3D_LOCATION_TEXTURE_SRGB
#define GL_TEXTURE_MAX_LEVEL
Definition: gl.h:1504
#define GL_TEXTURE_BASE_LEVEL
Definition: gl.h:1503
#define GL_SKIP_DECODE_EXT
Definition: glext.h:5291

Referenced by wined3d_cs_exec_generate_mipmaps().

◆ validate_resource_view()

static const struct wined3d_format* validate_resource_view ( const struct wined3d_view_desc desc,
struct wined3d_resource resource,
BOOL  mip_slice,
BOOL  allow_srgb_toggle 
)
static

Definition at line 84 of file view.c.

86 {
87  const struct wined3d_gl_info *gl_info = &resource->device->adapter->gl_info;
88  const struct wined3d_format *format;
89 
90  format = wined3d_get_format(gl_info, desc->format_id, resource->usage);
91  if (resource->type == WINED3D_RTYPE_BUFFER && (desc->flags & WINED3D_VIEW_BUFFER_RAW))
92  {
94  {
95  WARN("Invalid format %s for raw buffer view.\n", debug_d3dformat(format->id));
96  return NULL;
97  }
98 
100  }
101 
103  {
104  WARN("Trying to create view for typeless format %s.\n", debug_d3dformat(format->id));
105  return NULL;
106  }
107 
108  if (resource->type == WINED3D_RTYPE_BUFFER)
109  {
111  unsigned int buffer_size, element_size;
112 
113  if (buffer->desc.structure_byte_stride)
114  {
115  if (desc->format_id != WINED3DFMT_UNKNOWN)
116  {
117  WARN("Invalid format %s for structured buffer view.\n", debug_d3dformat(desc->format_id));
118  return NULL;
119  }
120 
122  element_size = buffer->desc.structure_byte_stride;
123  }
124  else
125  {
126  element_size = format->byte_count;
127  }
128 
129  if (!element_size)
130  return NULL;
131 
132  buffer_size = buffer->resource.size / element_size;
133  if (desc->u.buffer.start_idx >= buffer_size
134  || desc->u.buffer.count > buffer_size - desc->u.buffer.start_idx)
135  return NULL;
136  }
137  else
138  {
140  unsigned int depth_or_layer_count;
141 
142  if (resource->format->id != format->id && !wined3d_format_is_typeless(resource->format)
143  && (!allow_srgb_toggle || !wined3d_formats_are_srgb_variants(resource->format->id, format->id)))
144  {
145  WARN("Trying to create incompatible view for non typeless format %s.\n",
146  debug_d3dformat(format->id));
147  return NULL;
148  }
149 
150  if (mip_slice && resource->type == WINED3D_RTYPE_TEXTURE_3D)
151  depth_or_layer_count = wined3d_texture_get_level_depth(texture, desc->u.texture.level_idx);
152  else
153  depth_or_layer_count = texture->layer_count;
154 
155  if (!desc->u.texture.level_count
156  || (mip_slice && desc->u.texture.level_count != 1)
157  || desc->u.texture.level_idx >= texture->level_count
158  || desc->u.texture.level_count > texture->level_count - desc->u.texture.level_idx
159  || !desc->u.texture.layer_count
160  || desc->u.texture.layer_idx >= depth_or_layer_count
161  || desc->u.texture.layer_count > depth_or_layer_count - desc->u.texture.layer_idx)
162  return NULL;
163  }
164 
165  return format;
166 }
#define WARN(fmt,...)
Definition: debug.h:111
static unsigned int wined3d_texture_get_level_depth(const struct wined3d_texture *texture, unsigned int level)
const struct wined3d_format * wined3d_get_format(const struct wined3d_gl_info *gl_info, enum wined3d_format_id format_id, unsigned int resource_usage)
Definition: utils.c:3773
GLuint buffer
Definition: glext.h:5915
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
static void buffer_size(GLcontext *ctx, GLuint *width, GLuint *height)
Definition: swimpl.c:927
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
smooth NULL
Definition: ftsmooth.c:416
GLenum GLuint texture
Definition: glext.h:6295
static BOOL wined3d_format_is_typeless(const struct wined3d_format *format)
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
static struct wined3d_buffer * buffer_from_resource(struct wined3d_resource *resource)
const char * debug_d3dformat(enum wined3d_format_id format_id)
Definition: utils.c:3922
BOOL wined3d_formats_are_srgb_variants(enum wined3d_format_id format1, enum wined3d_format_id format2)
Definition: utils.c:3864
#define WINED3D_VIEW_BUFFER_RAW
Definition: wined3d.h:1573

Referenced by wined3d_rendertarget_view_init(), wined3d_shader_resource_view_init(), and wined3d_unordered_access_view_init().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3d  )

◆ wined3d_render_target_view_cs_init()

static void wined3d_render_target_view_cs_init ( void object)
static

Definition at line 510 of file view.c.

511 {
513  struct wined3d_resource *resource = view->resource;
514  const struct wined3d_view_desc *desc = &view->desc;
515 
516  if (resource->type == WINED3D_RTYPE_BUFFER)
517  {
518  FIXME("Not implemented for resources %s.\n", debug_d3dresourcetype(resource->type));
519  }
520  else
521  {
523  unsigned int depth_or_layer_count;
524 
525  if (resource->type == WINED3D_RTYPE_TEXTURE_3D)
526  depth_or_layer_count = wined3d_texture_get_level_depth(texture, desc->u.texture.level_idx);
527  else
528  depth_or_layer_count = texture->layer_count;
529 
530  if (resource->format->id != view->format->id
531  || (view->layer_count != 1 && view->layer_count != depth_or_layer_count))
532  {
533  if (resource->format->gl_view_class != view->format->gl_view_class)
534  {
535  FIXME("Render target view not supported, resource format %s, view format %s.\n",
536  debug_d3dformat(resource->format->id), debug_d3dformat(view->format->id));
537  return;
538  }
539  if (texture->swapchain && texture->swapchain->desc.backbuffer_count > 1)
540  {
541  FIXME("Swapchain views not supported.\n");
542  return;
543  }
544 
545  create_texture_view(&view->gl_view, texture->target, desc, texture, view->format);
546  }
547  }
548 }
static unsigned int wined3d_texture_get_level_depth(const struct wined3d_texture *texture, unsigned int level)
static void create_texture_view(struct wined3d_gl_view *view, GLenum view_target, const struct wined3d_view_desc *desc, struct wined3d_texture *texture, const struct wined3d_format *view_format)
Definition: view.c:168
#define FIXME(fmt,...)
Definition: debug.h:110
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
GLenum GLuint texture
Definition: glext.h:6295
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
const char * debug_d3dresourcetype(enum wined3d_resource_type resource_type)
Definition: utils.c:4271
const char * debug_d3dformat(enum wined3d_format_id format_id)
Definition: utils.c:3922
void * object
Definition: jmemsys.h:48

Referenced by wined3d_rendertarget_view_init().

◆ wined3d_rendertarget_view_create()

HRESULT CDECL wined3d_rendertarget_view_create ( const struct wined3d_view_desc desc,
struct wined3d_resource resource,
void parent,
const struct wined3d_parent_ops parent_ops,
struct wined3d_rendertarget_view **  view 
)

Definition at line 598 of file view.c.

601 {
603  HRESULT hr;
604 
605  TRACE("desc %p, resource %p, parent %p, parent_ops %p, view %p.\n",
607 
608  if (!(object = heap_alloc_zero(sizeof(*object))))
609  return E_OUTOFMEMORY;
610 
612  {
613  heap_free(object);
614  WARN("Failed to initialise view, hr %#x.\n", hr);
615  return hr;
616  }
617 
618  TRACE("Created render target view %p.\n", object);
619  *view = object;
620 
621  return hr;
622 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
static HRESULT wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *view, const struct wined3d_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops)
Definition: view.c:550
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2677
LONG HRESULT
Definition: typedefs.h:77
const struct wined3d_parent_ops * parent_ops
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by swapchain_init(), wined3d_device_init_3d(), wined3d_device_reset(), and wined3d_rendertarget_view_create_from_sub_resource().

◆ wined3d_rendertarget_view_create_from_sub_resource()

HRESULT CDECL wined3d_rendertarget_view_create_from_sub_resource ( struct wined3d_texture texture,
unsigned int  sub_resource_idx,
void parent,
const struct wined3d_parent_ops parent_ops,
struct wined3d_rendertarget_view **  view 
)

Definition at line 624 of file view.c.

627 {
628  struct wined3d_view_desc desc;
629 
630  TRACE("texture %p, sub_resource_idx %u, parent %p, parent_ops %p, view %p.\n",
631  texture, sub_resource_idx, parent, parent_ops, view);
632 
633  desc.format_id = texture->resource.format->id;
634  desc.flags = 0;
635  desc.u.texture.level_idx = sub_resource_idx % texture->level_count;
636  desc.u.texture.level_count = 1;
637  desc.u.texture.layer_idx = sub_resource_idx / texture->level_count;
638  desc.u.texture.layer_count = 1;
639 
640  return wined3d_rendertarget_view_create(&desc, &texture->resource, parent, parent_ops, view);
641 }
HRESULT CDECL wined3d_rendertarget_view_create(const struct wined3d_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_rendertarget_view **view)
Definition: view.c:598
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2677
GLenum GLuint texture
Definition: glext.h:6295

Referenced by d3d8_surface_acquire_rendertarget_view(), d3d9_surface_acquire_rendertarget_view(), and ddraw_surface_get_rendertarget_view().

◆ wined3d_rendertarget_view_decref()

ULONG CDECL wined3d_rendertarget_view_decref ( struct wined3d_rendertarget_view view)

Definition at line 348 of file view.c.

349 {
350  ULONG refcount = InterlockedDecrement(&view->refcount);
351 
352  TRACE("%p decreasing refcount to %u.\n", view, refcount);
353 
354  if (!refcount)
355  {
356  struct wined3d_resource *resource = view->resource;
357  struct wined3d_device *device = resource->device;
358 
359  /* Call wined3d_object_destroyed() before releasing the resource,
360  * since releasing the resource may end up destroying the parent. */
361  view->parent_ops->wined3d_object_destroyed(view->parent);
364  }
365 
366  return refcount;
367 }
static ULONG wined3d_resource_decref(struct wined3d_resource *resource)
void wined3d_cs_destroy_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
Definition: cs.c:1907
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
static void wined3d_rendertarget_view_destroy_object(void *object)
Definition: view.c:327
unsigned int ULONG
Definition: retypes.h:1

Referenced by d3d8_surface_Release(), d3d8_texture_2d_Release(), d3d8_texture_cube_Release(), d3d9_surface_Release(), d3d9_texture_cleanup(), d3d9_texture_cube_AddRef(), ddraw_set_cooperative_level(), ddraw_surface_cleanup(), wined3d_device_init_3d(), wined3d_device_reset(), wined3d_device_set_depth_stencil_view(), wined3d_device_set_rendertarget_view(), and wined3d_device_uninit_3d().

◆ wined3d_rendertarget_view_destroy_object()

static void wined3d_rendertarget_view_destroy_object ( void object)
static

Definition at line 327 of file view.c.

328 {
330  struct wined3d_device *device = view->resource->device;
331 
332  if (view->gl_view.name)
333  {
334  const struct wined3d_gl_info *gl_info;
335  struct wined3d_context *context;
336 
338  gl_info = context->gl_info;
340  gl_info->gl_ops.gl.p_glDeleteTextures(1, &view->gl_view.name);
341  checkGLcall("glDeleteTextures");
343  }
344 
345  heap_free(view);
346 }
Definition: http.c:6587
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
void context_release(struct wined3d_context *context)
Definition: context.c:1559
struct wined3d_context * context_acquire(const struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: context.c:4218
#define checkGLcall(A)
const struct wined3d_gl_info * gl_info
void * object
Definition: jmemsys.h:48
void context_gl_resource_released(struct wined3d_device *device, GLuint name, BOOL rb_namespace)
Definition: context.c:1089
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by wined3d_rendertarget_view_decref().

◆ wined3d_rendertarget_view_get_drawable_size()

void wined3d_rendertarget_view_get_drawable_size ( const struct wined3d_rendertarget_view view,
const struct wined3d_context context,
unsigned int width,
unsigned int height 
)

Definition at line 404 of file view.c.

406 {
407  const struct wined3d_texture *texture;
408 
409  if (view->resource->type != WINED3D_RTYPE_TEXTURE_2D)
410  {
411  *width = view->width;
412  *height = view->height;
413  return;
414  }
415 
416  texture = texture_from_resource(view->resource);
417  if (texture->swapchain)
418  {
419  /* The drawable size of an onscreen drawable is the surface size.
420  * (Actually: The window size, but the surface is created in window
421  * size.) */
422  *width = texture->resource.width;
423  *height = texture->resource.height;
424  }
426  {
427  const struct wined3d_swapchain *swapchain = context->swapchain;
428 
429  /* The drawable size of a backbuffer / aux buffer offscreen target is
430  * the size of the current context's drawable, which is the size of
431  * the back buffer of the swapchain the active context belongs to. */
432  *width = swapchain->desc.backbuffer_width;
433  *height = swapchain->desc.backbuffer_height;
434  }
435  else
436  {
437  unsigned int level_idx = view->sub_resource_idx % texture->level_count;
438 
439  /* The drawable size of an FBO target is the OpenGL texture size,
440  * which is the power of two size. */
443  }
444 }
GLint GLint GLsizei width
Definition: gl.h:1546
Definition: http.c:6587
#define ORM_BACKBUFFER
struct wined3d_swapchain_desc desc
GLenum GLuint texture
Definition: glext.h:6295
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
static unsigned int wined3d_texture_get_level_pow2_height(const struct wined3d_texture *texture, unsigned int level)
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
static unsigned int wined3d_texture_get_level_pow2_width(const struct wined3d_texture *texture, unsigned int level)

Referenced by device_clear_render_targets(), get_viewports(), and scissorrect().

◆ wined3d_rendertarget_view_get_parent()

void* CDECL wined3d_rendertarget_view_get_parent ( const struct wined3d_rendertarget_view view)

Definition at line 369 of file view.c.

370 {
371  TRACE("view %p.\n", view);
372 
373  return view->parent;
374 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ wined3d_rendertarget_view_get_resource()

struct wined3d_resource* CDECL wined3d_rendertarget_view_get_resource ( const struct wined3d_rendertarget_view view)

Definition at line 397 of file view.c.

398 {
399  TRACE("view %p.\n", view);
400 
401  return view->resource;
402 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ wined3d_rendertarget_view_get_sub_resource_parent()

void* CDECL wined3d_rendertarget_view_get_sub_resource_parent ( const struct wined3d_rendertarget_view view)

Definition at line 376 of file view.c.

377 {
378  struct wined3d_texture *texture;
379 
380  TRACE("view %p.\n", view);
381 
382  if (view->resource->type == WINED3D_RTYPE_BUFFER)
384 
385  texture = texture_from_resource(view->resource);
386 
387  return texture->sub_resources[view->sub_resource_idx].parent;
388 }
void *CDECL wined3d_buffer_get_parent(const struct wined3d_buffer *buffer)
Definition: buffer.c:804
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
static struct wined3d_buffer * buffer_from_resource(struct wined3d_resource *resource)

Referenced by d3d8_device_GetDepthStencilSurface(), d3d8_device_GetRenderTarget(), d3d8_device_SetRenderTarget(), d3d8_device_SetViewport(), d3d9_device_GetDepthStencilSurface(), d3d9_device_GetRenderTarget(), d3d9_device_reset(), d3d_device7_SetViewport(), d3d_viewport_SetViewport(), d3d_viewport_SetViewport2(), ddraw_set_cooperative_level(), and device_init().

◆ wined3d_rendertarget_view_incref()

ULONG CDECL wined3d_rendertarget_view_incref ( struct wined3d_rendertarget_view view)

Definition at line 318 of file view.c.

319 {
320  ULONG refcount = InterlockedIncrement(&view->refcount);
321 
322  TRACE("%p increasing refcount to %u.\n", view, refcount);
323 
324  return refcount;
325 }
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

Referenced by d3d8_surface_AddRef(), d3d8_texture_2d_AddRef(), d3d8_texture_cube_AddRef(), d3d9_surface_AddRef(), d3d9_texture_2d_AddRef(), ddraw_set_cooperative_level(), ddraw_surface_add_iface(), wined3d_device_set_depth_stencil_view(), and wined3d_device_set_rendertarget_view().

◆ wined3d_rendertarget_view_init()

static HRESULT wined3d_rendertarget_view_init ( struct wined3d_rendertarget_view view,
const struct wined3d_view_desc desc,
struct wined3d_resource resource,
void parent,
const struct wined3d_parent_ops parent_ops 
)
static

Definition at line 550 of file view.c.

553 {
554  BOOL allow_srgb_toggle = FALSE;
555 
556  view->refcount = 1;
557  view->parent = parent;
558  view->parent_ops = parent_ops;
559 
560  if (resource->type != WINED3D_RTYPE_BUFFER)
561  {
563 
564  if (texture->swapchain)
565  allow_srgb_toggle = TRUE;
566  }
567  if (!(view->format = validate_resource_view(desc, resource, TRUE, allow_srgb_toggle)))
568  return E_INVALIDARG;
569  view->format_flags = view->format->flags[resource->gl_type];
570  view->desc = *desc;
571 
572  if (resource->type == WINED3D_RTYPE_BUFFER)
573  {
574  view->sub_resource_idx = 0;
575  view->layer_count = 1;
576  view->width = desc->u.buffer.count;
577  view->height = 1;
578  }
579  else
580  {
582 
583  view->sub_resource_idx = desc->u.texture.level_idx;
584  if (resource->type != WINED3D_RTYPE_TEXTURE_3D)
585  view->sub_resource_idx += desc->u.texture.layer_idx * texture->level_count;
586  view->layer_count = desc->u.texture.layer_count;
587  view->width = wined3d_texture_get_level_width(texture, desc->u.texture.level_idx);
588  view->height = wined3d_texture_get_level_height(texture, desc->u.texture.level_idx);
589  }
590 
592 
594 
595  return WINED3D_OK;
596 }
#define TRUE
Definition: types.h:120
static unsigned int wined3d_texture_get_level_height(const struct wined3d_texture *texture, unsigned int level)
static unsigned int wined3d_texture_get_level_width(const struct wined3d_texture *texture, unsigned int level)
void wined3d_cs_init_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
Definition: cs.c:1912
unsigned int BOOL
Definition: ntddk_ex.h:94
static const struct wined3d_format * validate_resource_view(const struct wined3d_view_desc *desc, struct wined3d_resource *resource, BOOL mip_slice, BOOL allow_srgb_toggle)
Definition: view.c:84
#define E_INVALIDARG
Definition: ddrawi.h:101
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
r parent
Definition: btrfs.c:2677
GLenum GLuint texture
Definition: glext.h:6295
#define WINED3D_OK
Definition: wined3d.h:37
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
static void wined3d_render_target_view_cs_init(void *object)
Definition: view.c:510
static ULONG wined3d_resource_incref(struct wined3d_resource *resource)

Referenced by wined3d_rendertarget_view_create().

◆ wined3d_rendertarget_view_invalidate_location()

void wined3d_rendertarget_view_invalidate_location ( struct wined3d_rendertarget_view view,
DWORD  location 
)

Definition at line 505 of file view.c.

506 {
508 }
static void wined3d_view_invalidate_location(struct wined3d_resource *resource, const struct wined3d_view_desc *desc, DWORD location)
Definition: view.c:298

Referenced by draw_primitive().

◆ wined3d_rendertarget_view_load_location()

void wined3d_rendertarget_view_load_location ( struct wined3d_rendertarget_view view,
struct wined3d_context context,
DWORD  location 
)

Definition at line 466 of file view.c.

468 {
469  struct wined3d_resource *resource = view->resource;
470  unsigned int i, sub_resource_idx, layer_count;
471  struct wined3d_texture *texture;
472 
473  if (resource->type == WINED3D_RTYPE_BUFFER)
474  {
476  return;
477  }
478 
480  sub_resource_idx = view->sub_resource_idx;
481  layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? view->layer_count : 1;
482  for (i = 0; i < layer_count; ++i, sub_resource_idx += texture->level_count)
484 }
BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer, struct wined3d_context *context, DWORD location)
Definition: buffer.c:638
Definition: http.c:6587
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
Definition: glfuncs.h:248
GLenum GLuint texture
Definition: glext.h:6295
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
static struct wined3d_buffer * buffer_from_resource(struct wined3d_resource *resource)
BOOL wined3d_texture_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location)
Definition: texture.c:380

Referenced by draw_primitive().

◆ wined3d_rendertarget_view_prepare_location()

void wined3d_rendertarget_view_prepare_location ( struct wined3d_rendertarget_view view,
struct wined3d_context context,
DWORD  location 
)

Definition at line 446 of file view.c.

448 {
449  struct wined3d_resource *resource = view->resource;
450  unsigned int i, sub_resource_idx, layer_count;
451  struct wined3d_texture *texture;
452 
453  if (resource->type == WINED3D_RTYPE_BUFFER)
454  {
455  FIXME("Not implemented for resources %s.\n", debug_d3dresourcetype(resource->type));
456  return;
457  }
458 
460  sub_resource_idx = view->sub_resource_idx;
461  layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? view->layer_count : 1;
462  for (i = 0; i < layer_count; ++i, sub_resource_idx += texture->level_count)
464 }
Definition: http.c:6587
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
Definition: glfuncs.h:248
#define FIXME(fmt,...)
Definition: debug.h:110
BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location)
Definition: texture.c:1800
GLenum GLuint texture
Definition: glext.h:6295
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
const char * debug_d3dresourcetype(enum wined3d_resource_type resource_type)
Definition: utils.c:4271

Referenced by draw_primitive().

◆ wined3d_rendertarget_view_set_parent()

void CDECL wined3d_rendertarget_view_set_parent ( struct wined3d_rendertarget_view view,
void parent 
)

Definition at line 390 of file view.c.

391 {
392  TRACE("view %p, parent %p.\n", view, parent);
393 
394  view->parent = parent;
395 }
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2677

Referenced by ddraw_surface7_Flip().

◆ wined3d_rendertarget_view_validate_location()

void wined3d_rendertarget_view_validate_location ( struct wined3d_rendertarget_view view,
DWORD  location 
)

Definition at line 486 of file view.c.

487 {
488  struct wined3d_resource *resource = view->resource;
489  unsigned int i, sub_resource_idx, layer_count;
490  struct wined3d_texture *texture;
491 
492  if (resource->type == WINED3D_RTYPE_BUFFER)
493  {
494  FIXME("Not implemented for resources %s.\n", debug_d3dresourcetype(resource->type));
495  return;
496  }
497 
499  sub_resource_idx = view->sub_resource_idx;
500  layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? view->layer_count : 1;
501  for (i = 0; i < layer_count; ++i, sub_resource_idx += texture->level_count)
503 }
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
Definition: glfuncs.h:248
#define FIXME(fmt,...)
Definition: debug.h:110
void wined3d_texture_validate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD location)
Definition: texture.c:286
GLenum GLuint texture
Definition: glext.h:6295
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
const char * debug_d3dresourcetype(enum wined3d_resource_type resource_type)
Definition: utils.c:4271

Referenced by draw_primitive().

◆ wined3d_shader_resource_view_bind()

void wined3d_shader_resource_view_bind ( struct wined3d_shader_resource_view view,
unsigned int  unit,
struct wined3d_sampler sampler,
struct wined3d_context context 
)

Definition at line 803 of file view.c.

805 {
806  const struct wined3d_gl_info *gl_info = context->gl_info;
807  struct wined3d_texture *texture;
808 
810 
811  if (view->gl_view.name)
812  {
813  context_bind_texture(context, view->gl_view.target, view->gl_view.name);
815  return;
816  }
817 
818  if (view->resource->type == WINED3D_RTYPE_BUFFER)
819  {
820  FIXME("Buffer shader resources not supported.\n");
821  return;
822  }
823 
827 }
Definition: http.c:6587
void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info, unsigned int unit)
Definition: context.c:2486
void wined3d_sampler_bind(struct wined3d_sampler *sampler, unsigned int unit, struct wined3d_texture *texture, const struct wined3d_context *context)
Definition: sampler.c:184
void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint name)
Definition: context.c:2503
struct wined3d_texture *__cdecl wined3d_texture_from_resource(struct wined3d_resource *resource)
Definition: texture.c:2140
#define FIXME(fmt,...)
Definition: debug.h:110
png_const_structrp png_const_inforp int * unit
Definition: png.h:2161
smooth NULL
Definition: ftsmooth.c:416
GLenum GLuint texture
Definition: glext.h:6295
void wined3d_texture_bind(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
Definition: texture.c:925
GLuint sampler
Definition: glext.h:7283

Referenced by context_bind_shader_resources().

◆ wined3d_shader_resource_view_create()

HRESULT CDECL wined3d_shader_resource_view_create ( const struct wined3d_view_desc desc,
struct wined3d_resource resource,
void parent,
const struct wined3d_parent_ops parent_ops,
struct wined3d_shader_resource_view **  view 
)

Definition at line 777 of file view.c.

780 {
782  HRESULT hr;
783 
784  TRACE("desc %p, resource %p, parent %p, parent_ops %p, view %p.\n",
786 
787  if (!(object = heap_alloc_zero(sizeof(*object))))
788  return E_OUTOFMEMORY;
789 
791  {
792  heap_free(object);
793  WARN("Failed to initialise view, hr %#x.\n", hr);
794  return hr;
795  }
796 
797  TRACE("Created shader resource view %p.\n", object);
798  *view = object;
799 
800  return WINED3D_OK;
801 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
static HRESULT wined3d_shader_resource_view_init(struct wined3d_shader_resource_view *view, const struct wined3d_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops)
Definition: view.c:757
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2677
LONG HRESULT
Definition: typedefs.h:77
#define WINED3D_OK
Definition: wined3d.h:37
const struct wined3d_parent_ops * parent_ops
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by d3d9_texture_acquire_shader_resource_view().

◆ wined3d_shader_resource_view_cs_init()

static void wined3d_shader_resource_view_cs_init ( void object)
static

Definition at line 699 of file view.c.

700 {
702  struct wined3d_resource *resource = view->resource;
703  const struct wined3d_format *view_format;
704  const struct wined3d_gl_info *gl_info;
705  const struct wined3d_view_desc *desc;
706  GLenum view_target;
707 
708  view_format = view->format;
709  gl_info = &resource->device->adapter->gl_info;
710  desc = &view->desc;
711 
712  if (resource->type == WINED3D_RTYPE_BUFFER)
713  {
715  struct wined3d_context *context;
716 
717  context = context_acquire(resource->device, NULL, 0);
718  create_buffer_view(&view->gl_view, context, desc, buffer, view_format);
720  }
721  else
722  {
724 
725  view_target = get_texture_view_target(gl_info, desc, texture);
726 
727  if (resource->format->id == view_format->id && texture->target == view_target
728  && !desc->u.texture.level_idx && desc->u.texture.level_count == texture->level_count
729  && !desc->u.texture.layer_idx && desc->u.texture.layer_count == texture->layer_count
730  && !is_stencil_view_format(view_format))
731  {
732  TRACE("Creating identity shader resource view.\n");
733  }
734  else if (texture->swapchain && texture->swapchain->desc.backbuffer_count > 1)
735  {
736  FIXME("Swapchain shader resource views not supported.\n");
737  }
738  else if (resource->format->typeless_id == view_format->typeless_id
739  && resource->format->gl_view_class == view_format->gl_view_class)
740  {
741  create_texture_view(&view->gl_view, view_target, desc, texture, view_format);
742  }
743  else if (wined3d_format_is_depth_view(resource->format->id, view_format->id))
744  {
745  create_texture_view(&view->gl_view, view_target, desc, texture, resource->format);
746  }
747  else
748  {
749  FIXME("Shader resource view not supported, resource format %s, view format %s.\n",
750  debug_d3dformat(resource->format->id), debug_d3dformat(view_format->id));
751  }
752  }
753 
755 }
Definition: http.c:6587
static BOOL is_stencil_view_format(const struct wined3d_format *format)
Definition: view.c:29
BOOL wined3d_format_is_depth_view(enum wined3d_format_id resource_format_id, enum wined3d_format_id view_format_id)
Definition: utils.c:3805
GLuint buffer
Definition: glext.h:5915
static void create_texture_view(struct wined3d_gl_view *view, GLenum view_target, const struct wined3d_view_desc *desc, struct wined3d_texture *texture, const struct wined3d_format *view_format)
Definition: view.c:168
enum wined3d_format_id typeless_id
static GLenum get_texture_view_target(const struct wined3d_gl_info *gl_info, const struct wined3d_view_desc *desc, const struct wined3d_texture *texture)
Definition: view.c:35
#define FIXME(fmt,...)
Definition: debug.h:110
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
smooth NULL
Definition: ftsmooth.c:416
void context_release(struct wined3d_context *context)
Definition: context.c:1559
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
enum wined3d_format_id id
static struct wined3d_buffer * buffer_from_resource(struct wined3d_resource *resource)
unsigned int GLenum
Definition: gl.h:150
struct wined3d_context * context_acquire(const struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: context.c:4218
static void wined3d_resource_release(struct wined3d_resource *resource)
static void create_buffer_view(struct wined3d_gl_view *view, struct wined3d_context *context, const struct wined3d_view_desc *desc, struct wined3d_buffer *buffer, const struct wined3d_format *view_format)
Definition: view.c:288
const char * debug_d3dformat(enum wined3d_format_id format_id)
Definition: utils.c:3922
void * object
Definition: jmemsys.h:48

Referenced by wined3d_shader_resource_view_init().

◆ wined3d_shader_resource_view_decref()

ULONG CDECL wined3d_shader_resource_view_decref ( struct wined3d_shader_resource_view view)

Definition at line 671 of file view.c.

672 {
673  ULONG refcount = InterlockedDecrement(&view->refcount);
674 
675  TRACE("%p decreasing refcount to %u.\n", view, refcount);
676 
677  if (!refcount)
678  {
679  struct wined3d_resource *resource = view->resource;
680  struct wined3d_device *device = resource->device;
681 
682  /* Call wined3d_object_destroyed() before releasing the resource,
683  * since releasing the resource may end up destroying the parent. */
684  view->parent_ops->wined3d_object_destroyed(view->parent);
687  }
688 
689  return refcount;
690 }
static void wined3d_shader_resource_view_destroy_object(void *object)
Definition: view.c:652
static ULONG wined3d_resource_decref(struct wined3d_resource *resource)
void wined3d_cs_destroy_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
Definition: cs.c:1907
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1

Referenced by d3d9_texture_cleanup(), state_unbind_resources(), and wined3d_device_set_shader_resource_view().

◆ wined3d_shader_resource_view_destroy_object()

static void wined3d_shader_resource_view_destroy_object ( void object)
static

Definition at line 652 of file view.c.

653 {
655 
656  if (view->gl_view.name)
657  {
658  const struct wined3d_gl_info *gl_info;
659  struct wined3d_context *context;
660 
661  context = context_acquire(view->resource->device, NULL, 0);
662  gl_info = context->gl_info;
663  gl_info->gl_ops.gl.p_glDeleteTextures(1, &view->gl_view.name);
664  checkGLcall("glDeleteTextures");
666  }
667 
668  heap_free(view);
669 }
Definition: http.c:6587
smooth NULL
Definition: ftsmooth.c:416
void context_release(struct wined3d_context *context)
Definition: context.c:1559
struct wined3d_context * context_acquire(const struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: context.c:4218
#define checkGLcall(A)
const struct wined3d_gl_info * gl_info
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by wined3d_shader_resource_view_decref().

◆ wined3d_shader_resource_view_generate_mipmaps()

void CDECL wined3d_shader_resource_view_generate_mipmaps ( struct wined3d_shader_resource_view view)

Definition at line 913 of file view.c.

914 {
915  struct wined3d_texture *texture;
916 
917  TRACE("view %p.\n", view);
918 
919  if (view->resource->type == WINED3D_RTYPE_BUFFER)
920  {
921  WARN("Called on buffer resource %p.\n", view->resource);
922  return;
923  }
924 
925  texture = texture_from_resource(view->resource);
927  {
928  WARN("Texture without the WINED3D_TEXTURE_GENERATE_MIPMAPS flag, ignoring.\n");
929  return;
930  }
931 
932  wined3d_cs_emit_generate_mipmaps(view->resource->device->cs, view);
933 }
#define WARN(fmt,...)
Definition: debug.h:111
void wined3d_cs_emit_generate_mipmaps(struct wined3d_cs *cs, struct wined3d_shader_resource_view *view)
Definition: cs.c:2434
#define WINED3D_TEXTURE_GENERATE_MIPMAPS
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)

Referenced by d3d9_texture_gen_auto_mipmap().

◆ wined3d_shader_resource_view_get_parent()

void* CDECL wined3d_shader_resource_view_get_parent ( const struct wined3d_shader_resource_view view)

Definition at line 692 of file view.c.

693 {
694  TRACE("view %p.\n", view);
695 
696  return view->parent;
697 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ wined3d_shader_resource_view_incref()

ULONG CDECL wined3d_shader_resource_view_incref ( struct wined3d_shader_resource_view view)

Definition at line 643 of file view.c.

644 {
645  ULONG refcount = InterlockedIncrement(&view->refcount);
646 
647  TRACE("%p increasing refcount to %u.\n", view, refcount);
648 
649  return refcount;
650 }
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

Referenced by wined3d_device_set_shader_resource_view().

◆ wined3d_shader_resource_view_init()

static HRESULT wined3d_shader_resource_view_init ( struct wined3d_shader_resource_view view,
const struct wined3d_view_desc desc,
struct wined3d_resource resource,
void parent,
const struct wined3d_parent_ops parent_ops 
)
static

Definition at line 757 of file view.c.

760 {
761  view->refcount = 1;
762  view->parent = parent;
763  view->parent_ops = parent_ops;
764 
765  if (!(view->format = validate_resource_view(desc, resource, FALSE, FALSE)))
766  return E_INVALIDARG;
767  view->desc = *desc;
768 
770 
773 
774  return WINED3D_OK;
775 }
static void wined3d_resource_acquire(struct wined3d_resource *resource)
void wined3d_cs_init_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
Definition: cs.c:1912
static void wined3d_shader_resource_view_cs_init(void *object)
Definition: view.c:699
static const struct wined3d_format * validate_resource_view(const struct wined3d_view_desc *desc, struct wined3d_resource *resource, BOOL mip_slice, BOOL allow_srgb_toggle)
Definition: view.c:84
#define E_INVALIDARG
Definition: ddrawi.h:101
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
r parent
Definition: btrfs.c:2677
#define WINED3D_OK
Definition: wined3d.h:37
static ULONG wined3d_resource_incref(struct wined3d_resource *resource)

Referenced by wined3d_shader_resource_view_create().

◆ wined3d_unordered_access_view_clear_uint()

void wined3d_unordered_access_view_clear_uint ( struct wined3d_unordered_access_view view,
const struct wined3d_uvec4 clear_value,
struct wined3d_context context 
)

Definition at line 1000 of file view.c.

1002 {
1003  const struct wined3d_gl_info *gl_info = context->gl_info;
1004  const struct wined3d_format *format;
1005  struct wined3d_resource *resource;
1006  struct wined3d_buffer *buffer;
1007  unsigned int offset, size;
1008 
1009  resource = view->resource;
1010  if (resource->type != WINED3D_RTYPE_BUFFER)
1011  {
1012  FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(resource->type));
1013  return;
1014  }
1015 
1016  if (!gl_info->supported[ARB_CLEAR_BUFFER_OBJECT])
1017  {
1018  FIXME("OpenGL implementation does not support ARB_clear_buffer_object.\n");
1019  return;
1020  }
1021 
1022  format = view->format;
1026  {
1027  FIXME("Not implemented for format %s.\n", debug_d3dformat(format->id));
1028  return;
1029  }
1030 
1034 
1036  context_bind_bo(context, buffer->buffer_type_hint, buffer->buffer_object);
1037  GL_EXTCALL(glClearBufferSubData(buffer->buffer_type_hint, format->glInternal,
1038  offset, size, format->glFormat, format->glType, clear_value));
1039  checkGLcall("clear unordered access view");
1040 }
BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer, struct wined3d_context *context, DWORD location)
Definition: buffer.c:638
Definition: http.c:6587
GLintptr offset
Definition: glext.h:5920
#define WINED3D_LOCATION_BUFFER
GLuint buffer
Definition: glext.h:5915
int resource
Definition: rdpsnd_sgi.c:44
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
#define FIXME(fmt,...)
Definition: debug.h:110
BOOL supported[WINED3D_GL_EXT_COUNT]
#define GL_EXTCALL(f)
GLsizeiptr size
Definition: glext.h:5919
static struct wined3d_buffer * buffer_from_resource(struct wined3d_resource *resource)
#define checkGLcall(A)
const char * debug_d3dresourcetype(enum wined3d_resource_type resource_type)
Definition: utils.c:4271
static void get_buffer_view_range(const struct wined3d_buffer *buffer, const struct wined3d_view_desc *desc, const struct wined3d_format *view_format, unsigned int *offset, unsigned int *size)
Definition: view.c:272
void context_bind_bo(struct wined3d_context *context, GLenum binding, GLuint name)
Definition: context.c:2493
const char * debug_d3dformat(enum wined3d_format_id format_id)
Definition: utils.c:3922
void wined3d_unordered_access_view_invalidate_location(struct wined3d_unordered_access_view *view, DWORD location)
Definition: view.c:994

Referenced by wined3d_cs_exec_clear_unordered_access_view().

◆ wined3d_unordered_access_view_copy_counter()

void wined3d_unordered_access_view_copy_counter ( struct wined3d_unordered_access_view view,
struct wined3d_buffer buffer,
unsigned int  offset,
struct wined3d_context context 
)

Definition at line 1059 of file view.c.

1061 {
1062  struct wined3d_bo_address dst, src;
1063  DWORD dst_location;
1064 
1065  if (!view->counter_bo)
1066  return;
1067 
1068  dst_location = wined3d_buffer_get_memory(buffer, &dst, buffer->locations);
1069  dst.addr += offset;
1070 
1071  src.buffer_object = view->counter_bo;
1072  src.addr = NULL;
1073 
1074  context_copy_bo_address(context, &dst, buffer->buffer_type_hint,
1075  &src, GL_ATOMIC_COUNTER_BUFFER, sizeof(GLuint));
1076 
1078 }
Definition: http.c:6587
GLintptr offset
Definition: glext.h:5920
GLuint buffer
Definition: glext.h:5915
DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_bo_address *data, DWORD locations)
Definition: buffer.c:710
smooth NULL
Definition: ftsmooth.c:416
void wined3d_buffer_invalidate_location(struct wined3d_buffer *buffer, DWORD location)
Definition: buffer.c:130
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum src
Definition: glext.h:6340
unsigned int GLuint
Definition: gl.h:159
void context_copy_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *dst, GLenum dst_binding, const struct wined3d_bo_address *src, GLenum src_binding, size_t size)
Definition: context.c:2613
GLenum GLenum dst
Definition: glext.h:6340
#define GL_ATOMIC_COUNTER_BUFFER
Definition: glext.h:2297

Referenced by wined3d_cs_exec_copy_uav_counter().

◆ wined3d_unordered_access_view_create()

HRESULT CDECL wined3d_unordered_access_view_create ( const struct wined3d_view_desc desc,
struct wined3d_resource resource,
void parent,
const struct wined3d_parent_ops parent_ops,
struct wined3d_unordered_access_view **  view 
)

Definition at line 1148 of file view.c.

1151 {
1153  HRESULT hr;
1154 
1155  TRACE("desc %p, resource %p, parent %p, parent_ops %p, view %p.\n",
1157 
1158  if (!(object = heap_alloc_zero(sizeof(*object))))
1159  return E_OUTOFMEMORY;
1160 
1162  {
1163  heap_free(object);
1164  WARN("Failed to initialise view, hr %#x.\n", hr);
1165  return hr;
1166  }
1167 
1168  TRACE("Created unordered access view %p.\n", object);
1169  *view = object;
1170 
1171  return WINED3D_OK;
1172 }
static HRESULT wined3d_unordered_access_view_init(struct wined3d_unordered_access_view *view, const struct wined3d_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops)
Definition: view.c:1128
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
#define TRACE(s)
Definition: solgame.cpp:4
r parent
Definition: btrfs.c:2677
LONG HRESULT
Definition: typedefs.h:77
#define WINED3D_OK
Definition: wined3d.h:37
const struct wined3d_parent_ops * parent_ops
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ wined3d_unordered_access_view_cs_init()

static void wined3d_unordered_access_view_cs_init ( void object)
static

Definition at line 1080 of file view.c.

1081 {
1083  struct wined3d_resource *resource = view->resource;
1084  struct wined3d_view_desc *desc = &view->desc;
1085  const struct wined3d_gl_info *gl_info;
1086 
1087  gl_info = &resource->device->adapter->gl_info;
1088 
1089  if (resource->type == WINED3D_RTYPE_BUFFER)
1090  {
1092  struct wined3d_context *context;
1093 
1094  context = context_acquire(resource->device, NULL, 0);
1095  gl_info = context->gl_info;
1096  create_buffer_view(&view->gl_view, context, desc, buffer, view->format);
1098  {
1099  static const GLuint initial_value = 0;
1100  GL_EXTCALL(glGenBuffers(1, &view->counter_bo));
1101  GL_EXTCALL(glBindBuffer(GL_ATOMIC_COUNTER_BUFFER, view->counter_bo));
1102  GL_EXTCALL(glBufferData(GL_ATOMIC_COUNTER_BUFFER,
1103  sizeof(initial_value), &initial_value, GL_STATIC_DRAW));
1104  checkGLcall("create atomic counter buffer");
1105  }
1107  }
1108  else
1109  {
1111  unsigned int depth_or_layer_count;
1112 
1113  if (resource->type == WINED3D_RTYPE_TEXTURE_3D)
1114  depth_or_layer_count = wined3d_texture_get_level_depth(texture, desc->u.texture.level_idx);
1115  else
1116  depth_or_layer_count = texture->layer_count;
1117 
1118  if (desc->u.texture.layer_idx || desc->u.texture.layer_count != depth_or_layer_count)
1119  {
1121  desc, texture, view->format);
1122  }
1123  }
1124 
1126 }
Definition: http.c:6587
static unsigned int wined3d_texture_get_level_depth(const struct wined3d_texture *texture, unsigned int level)
GLuint buffer
Definition: glext.h:5915
static void create_texture_view(struct wined3d_gl_view *view, GLenum view_target, const struct wined3d_view_desc *desc, struct wined3d_texture *texture, const struct wined3d_format *view_format)
Definition: view.c:168
static GLenum get_texture_view_target(const struct wined3d_gl_info *gl_info, const struct wined3d_view_desc *desc, const struct wined3d_texture *texture)
Definition: view.c:35
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
smooth NULL
Definition: ftsmooth.c:416
void context_release(struct wined3d_context *context)
Definition: context.c:1559
#define GL_EXTCALL(f)
GLenum GLuint texture
Definition: glext.h:6295
#define WINED3D_VIEW_BUFFER_APPEND
Definition: wined3d.h:1574
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
static struct wined3d_buffer * buffer_from_resource(struct wined3d_resource *resource)
struct wined3d_context * context_acquire(const struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: context.c:4218
static void wined3d_resource_release(struct wined3d_resource *resource)
unsigned int GLuint
Definition: gl.h:159
static void create_buffer_view(struct wined3d_gl_view *view, struct wined3d_context *context, const struct wined3d_view_desc *desc, struct wined3d_buffer *buffer, const struct wined3d_format *view_format)
Definition: view.c:288
#define WINED3D_VIEW_BUFFER_COUNTER
Definition: wined3d.h:1575
#define checkGLcall(A)
#define GL_ATOMIC_COUNTER_BUFFER
Definition: glext.h:2297
const struct wined3d_gl_info * gl_info
#define GL_STATIC_DRAW
Definition: glext.h:350
void * object
Definition: jmemsys.h:48

Referenced by wined3d_unordered_access_view_init().

◆ wined3d_unordered_access_view_decref()

ULONG CDECL wined3d_unordered_access_view_decref ( struct wined3d_unordered_access_view view)

Definition at line 966 of file view.c.

967 {
968  ULONG refcount = InterlockedDecrement(&view->refcount);
969 
970  TRACE("%p decreasing refcount to %u.\n", view, refcount);
971 
972  if (!refcount)
973  {
974  struct wined3d_resource *resource = view->resource;
975  struct wined3d_device *device = resource->device;
976 
977  /* Call wined3d_object_destroyed() before releasing the resource,
978  * since releasing the resource may end up destroying the parent. */
979  view->parent_ops->wined3d_object_destroyed(view->parent);
982  }
983 
984  return refcount;
985 }
static ULONG wined3d_resource_decref(struct wined3d_resource *resource)
void wined3d_cs_destroy_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
Definition: cs.c:1907
Definition: devices.h:37
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
static void wined3d_unordered_access_view_destroy_object(void *object)
Definition: view.c:944

Referenced by state_unbind_resources(), and wined3d_device_set_pipeline_unordered_access_view().

◆ wined3d_unordered_access_view_destroy_object()

static void wined3d_unordered_access_view_destroy_object ( void object)
static

Definition at line 944 of file view.c.

945 {
947 
948  if (view->gl_view.name || view->counter_bo)
949  {
950  const struct wined3d_gl_info *gl_info;
951  struct wined3d_context *context;
952 
953  context = context_acquire(view->resource->device, NULL, 0);
954  gl_info = context->gl_info;
955  if (view->gl_view.name)
956  gl_info->gl_ops.gl.p_glDeleteTextures(1, &view->gl_view.name);
957  if (view->counter_bo)
958  GL_EXTCALL(glDeleteBuffers(1, &view->counter_bo));
959  checkGLcall("delete resources");
961  }
962 
963  heap_free(view);
964 }
Definition: http.c:6587
smooth NULL
Definition: ftsmooth.c:416
void context_release(struct wined3d_context *context)
Definition: context.c:1559
#define GL_EXTCALL(f)
struct wined3d_context * context_acquire(const struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: context.c:4218
#define checkGLcall(A)
const struct wined3d_gl_info * gl_info
void * object
Definition: jmemsys.h:48
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by wined3d_unordered_access_view_decref().

◆ wined3d_unordered_access_view_get_parent()

void* CDECL wined3d_unordered_access_view_get_parent ( const struct wined3d_unordered_access_view view)

Definition at line 987 of file view.c.

988 {
989  TRACE("view %p.\n", view);
990 
991  return view->parent;
992 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ wined3d_unordered_access_view_incref()

ULONG CDECL wined3d_unordered_access_view_incref ( struct wined3d_unordered_access_view view)

Definition at line 935 of file view.c.

936 {
937  ULONG refcount = InterlockedIncrement(&view->refcount);
938 
939  TRACE("%p increasing refcount to %u.\n", view, refcount);
940 
941  return refcount;
942 }
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

Referenced by wined3d_device_set_pipeline_unordered_access_view().

◆ wined3d_unordered_access_view_init()

static HRESULT wined3d_unordered_access_view_init ( struct wined3d_unordered_access_view view,
const struct wined3d_view_desc desc,
struct wined3d_resource resource,
void parent,
const struct wined3d_parent_ops parent_ops 
)
static

Definition at line 1128 of file view.c.

1131 {
1132  view->refcount = 1;
1133  view->parent = parent;
1134  view->parent_ops = parent_ops;
1135 
1136  if (!(view->format = validate_resource_view(desc, resource, TRUE, FALSE)))
1137  return E_INVALIDARG;
1138  view->desc = *desc;
1139 
1140  wined3d_resource_incref(view->resource = resource);
1141 
1144 
1145  return WINED3D_OK;
1146 }
#define TRUE
Definition: types.h:120
static void wined3d_resource_acquire(struct wined3d_resource *resource)
void wined3d_cs_init_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
Definition: cs.c:1912
static const struct wined3d_format * validate_resource_view(const struct wined3d_view_desc *desc, struct wined3d_resource *resource, BOOL mip_slice, BOOL allow_srgb_toggle)
Definition: view.c:84
#define E_INVALIDARG
Definition: ddrawi.h:101
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
r parent
Definition: btrfs.c:2677
#define WINED3D_OK
Definition: wined3d.h:37
static ULONG wined3d_resource_incref(struct wined3d_resource *resource)
static void wined3d_unordered_access_view_cs_init(void *object)
Definition: view.c:1080

Referenced by wined3d_unordered_access_view_create().

◆ wined3d_unordered_access_view_invalidate_location()

void wined3d_unordered_access_view_invalidate_location ( struct wined3d_unordered_access_view view,
DWORD  location 
)

Definition at line 994 of file view.c.

996 {
998 }
static void wined3d_view_invalidate_location(struct wined3d_resource *resource, const struct wined3d_view_desc *desc, DWORD location)
Definition: view.c:298

Referenced by context_load_unordered_access_resources(), and wined3d_unordered_access_view_clear_uint().

◆ wined3d_unordered_access_view_set_counter()

void wined3d_unordered_access_view_set_counter ( struct wined3d_unordered_access_view view,
unsigned int  value 
)

Definition at line 1042 of file view.c.

1044 {
1045  const struct wined3d_gl_info *gl_info;
1046  struct wined3d_context *context;
1047 
1048  if (!view->counter_bo)
1049  return;
1050 
1051  context = context_acquire(view->resource->device, NULL, 0);
1052  gl_info = context->gl_info;
1053  GL_EXTCALL(glBindBuffer(GL_ATOMIC_COUNTER_BUFFER, view->counter_bo));
1054  GL_EXTCALL(glBufferSubData(GL_ATOMIC_COUNTER_BUFFER, 0, sizeof(value), &value));
1055  checkGLcall("set atomic counter");
1057 }
Definition: http.c:6587
smooth NULL
Definition: ftsmooth.c:416
void context_release(struct wined3d_context *context)
Definition: context.c:1559
#define GL_EXTCALL(f)
struct wined3d_context * context_acquire(const struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: context.c:4218
#define checkGLcall(A)
#define GL_ATOMIC_COUNTER_BUFFER
Definition: glext.h:2297
const struct wined3d_gl_info * gl_info

Referenced by wined3d_cs_exec_set_unordered_access_view().

◆ wined3d_view_invalidate_location()

static void wined3d_view_invalidate_location ( struct wined3d_resource resource,
const struct wined3d_view_desc desc,
DWORD  location 
)
static

Definition at line 298 of file view.c.

300 {
301  unsigned int i, sub_resource_idx, layer_count;
302  struct wined3d_texture *texture;
303 
304  if (resource->type == WINED3D_RTYPE_BUFFER)
305  {
307  return;
308  }
309 
311 
312  sub_resource_idx = desc->u.texture.layer_idx * texture->level_count + desc->u.texture.level_idx;
313  layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? desc->u.texture.layer_count : 1;
314  for (i = 0; i < layer_count; ++i, sub_resource_idx += texture->level_count)
316 }
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
Definition: glfuncs.h:248
const struct builtin_class_descr * desc
Definition: regcontrol.c:48
void wined3d_buffer_invalidate_location(struct wined3d_buffer *buffer, DWORD location)
Definition: buffer.c:130
GLenum GLuint texture
Definition: glext.h:6295
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)
static struct wined3d_buffer * buffer_from_resource(struct wined3d_resource *resource)
void wined3d_texture_invalidate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD location)
Definition: texture.c:310
unsigned int sub_resource_idx

Referenced by wined3d_rendertarget_view_invalidate_location(), and wined3d_unordered_access_view_invalidate_location().