ReactOS 0.4.17-dev-966-gf06eace
wined3d_private.h File Reference
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <sys/types.h>
#include <math.h>
#include <limits.h>
#include <float.h>
#include <vkd3d_shader.h>
#include "ntstatus.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "wingdi.h"
#include "winuser.h"
#include "winternl.h"
#include "ddk/d3dkmthk.h"
#include "wine/debug.h"
#include "objbase.h"
#include "wine/wined3d.h"
#include "wine/list.h"
#include "wine/rbtree.h"
#include <pshpack2.h>
#include <poppack.h>
Include dependency graph for wined3d_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  color_fixup_desc
 
struct  fragment_caps
 
struct  wined3d_d3d_limits
 
struct  wined3d_d3d_info
 
struct  wined3d_settings
 
struct  wined3d_shader_signature_element
 
struct  wined3d_shader_signature
 
struct  wined3d_string_buffer
 
struct  wined3d_shader_version
 
struct  wined3d_shader_resource_info
 
struct  wined3d_shader_sampler_map_entry
 
struct  wined3d_shader_sampler_map
 
struct  wined3d_shader_immediate_constant_buffer
 
struct  wined3d_shader_indexable_temp
 
struct  wined3d_shader_reg_maps
 
struct  wined3d_shader_tex_mx
 
struct  wined3d_shader_parser_state
 
struct  wined3d_shader_context
 
struct  wined3d_shader_register_index
 
struct  wined3d_shader_register
 
struct  wined3d_shader_dst_param
 
struct  wined3d_shader_src_param
 
struct  wined3d_shader_index_range
 
struct  wined3d_shader_semantic
 
struct  wined3d_shader_register_semantic
 
struct  wined3d_shader_structured_resource
 
struct  wined3d_shader_tgsm
 
struct  wined3d_shader_tgsm_raw
 
struct  wined3d_shader_tgsm_structured
 
struct  wined3d_shader_thread_group_size
 
struct  wined3d_shader_function_table_pointer
 
struct  wined3d_shader_texel_offset
 
struct  wined3d_shader_primitive_type
 
struct  wined3d_shader_instruction
 
struct  wined3d_shader_attribute
 
struct  wined3d_shader_loop_control
 
struct  wined3d_shader_frontend
 
struct  shader_caps
 
struct  ps_compile_args
 
struct  vs_compile_args
 
struct  ds_compile_args
 
struct  gs_compile_args
 
struct  wined3d_shader_backend_ops
 
struct  wined3d_bo
 
struct  wined3d_bo_user
 
struct  wined3d_bo_address
 
struct  wined3d_const_bo_address
 
struct  wined3d_stream_info_element
 
struct  wined3d_stream_info
 
struct  wined3d_direct_dispatch_parameters
 
struct  wined3d_indirect_dispatch_parameters
 
struct  wined3d_dispatch_parameters
 
struct  wined3d_direct_draw_parameters
 
struct  wined3d_indirect_draw_parameters
 
struct  wined3d_draw_parameters
 
struct  wined3d_query_ops
 
struct  wined3d_query
 
struct  wined3d_range
 
struct  wined3d_fb_state
 
struct  wined3d_context
 
struct  wined3d_state_entry
 
struct  wined3d_state_entry_template
 
struct  wined3d_fragment_pipe_ops
 
struct  wined3d_vertex_caps
 
struct  wined3d_vertex_pipe_ops
 
struct  wined3d_blitter
 
struct  wined3d_blitter_ops
 
struct  wined3d_light_constants
 
struct  wined3d_light_info
 
struct  wined3d_pixel_format
 
struct  wined3d_gpu_description
 
struct  wined3d_driver_info
 
struct  upload_bo
 
struct  wined3d_adapter_ops
 
struct  wined3d_output
 
struct  wined3d_adapter
 
struct  texture_stage_op
 
struct  ffp_frag_settings
 
struct  ffp_frag_desc
 
struct  wined3d_ffp_ps
 
struct  wined3d_ffp_vs_settings
 
struct  wined3d_ffp_vs_desc
 
struct  wined3d_ffp_vs
 
struct  wined3d
 
struct  wined3d_ffp_vs_constants
 
union  wined3d_ffp_vs_constants::wined3d_ffp_vs_modelview_matrices
 
struct  wined3d_ffp_vs_constants::wined3d_ffp_point_constants
 
struct  wined3d_ffp_vs_constants::wined3d_ffp_light_constants
 
struct  wined3d_ffp_ps_constants
 
struct  wined3d_ffp_ps_constants::wined3d_ffp_bumpenv_constants
 
struct  wined3d_blend_state
 
struct  wined3d_depth_stencil_state
 
struct  wined3d_rasterizer_state
 
struct  wined3d_light_state
 
struct  wined3d_state
 
struct  wined3d_so_desc_entry
 
struct  wined3d_device
 
struct  wined3d_device_no3d
 
struct  wined3d_allocator_chunk
 
struct  wined3d_allocator_block
 
struct  wined3d_allocator_pool
 
struct  wined3d_allocator_ops
 
struct  wined3d_allocator
 
struct  wined3d_client_resource
 
struct  wined3d_resource_ops
 
struct  wined3d_resource
 
struct  wined3d_texture_ops
 
struct  wined3d_texture
 
struct  wined3d_texture::wined3d_texture_async
 
struct  wined3d_texture::wined3d_dirty_regions
 
struct  wined3d_texture::wined3d_overlay_info
 
struct  wined3d_texture::wined3d_dc_info
 
struct  wined3d_texture::wined3d_texture_sub_resource
 
struct  wined3d_sampler
 
struct  wined3d_vertex_declaration_element
 
struct  wined3d_vertex_declaration
 
struct  wined3d_cs_queue
 
struct  wined3d_device_context_ops
 
struct  wined3d_device_context
 
struct  wined3d_cs
 
struct  wined3d_buffer
 
struct  wined3d_rendertarget_view
 
struct  wined3d_shader_resource_view
 
struct  wined3d_unordered_access_view
 
struct  wined3d_swapchain_state
 
struct  wined3d_swapchain_ops
 
struct  wined3d_swapchain
 
struct  wined3d_shader_lconst
 
struct  wined3d_shader_limits
 
struct  wined3d_string_buffer_list
 
struct  wined3d_shader_phase
 
struct  wined3d_vertex_shader
 
struct  wined3d_hull_shader
 
struct  wined3d_domain_shader
 
struct  wined3d_geometry_shader
 
struct  wined3d_pixel_shader
 
struct  wined3d_compute_shader
 
struct  wined3d_shader
 
struct  wined3d_palette
 
struct  wined3d_rational
 
struct  wined3d_color_key_conversion
 
struct  wined3d_format
 

Macros

#define LIBVKD3D_SHADER_SOURCE
 
#define WIN32_NO_STATUS
 
#define COBJMACROS
 
#define MAKEDWORD_VERSION(maj, min)   (((maj & 0xffffu) << 16) | (min & 0xffffu))
 
#define WINED3D_MAX_DIRTY_REGION_COUNT   7
 
#define WINED3D_ALPHA_TO_COVERAGE_ENABLE   MAKEFOURCC('A','2','M','1')
 
#define WINED3D_ALPHA_TO_COVERAGE_DISABLE   MAKEFOURCC('A','2','M','0')
 
#define WINED3D_BITMAP_SIZE(x)   (((x) + 31) >> 5)
 
#define WINED3D_MAX_ACTIVE_LIGHTS   8
 
#define WINED3D_MAX_SOFTWARE_ACTIVE_LIGHTS   32
 
#define MAX_CONSTANT_BUFFERS   15
 
#define MAX_SAMPLER_OBJECTS   16
 
#define MAX_SHADER_RESOURCE_VIEWS   128
 
#define MAX_UNORDERED_ACCESS_VIEWS   8
 
#define MAX_TGSM_REGISTERS   8192
 
#define MAX_VERTEX_BLENDS   4
 
#define PCI_VENDOR_NONE   0xffff /* e.g. 0x8086 for Intel and 0x10de for Nvidia */
 
#define PCI_DEVICE_NONE   0xffff /* e.g. 0x14f for a Geforce6200 */
 
#define WINED3D_CSMT_ENABLE   0x00000001
 
#define WINED3D_CSMT_SERIALIZE   0x00000002
 
#define WINED3D_SHADER_CONST_VS_F   0x00000001
 
#define WINED3D_SHADER_CONST_VS_I   0x00000002
 
#define WINED3D_SHADER_CONST_VS_B   0x00000004
 
#define WINED3D_SHADER_CONST_VS_CLIP_PLANES   0x00000008
 
#define WINED3D_SHADER_CONST_VS_POINTSIZE   0x00000010
 
#define WINED3D_SHADER_CONST_POS_FIXUP   0x00000020
 
#define WINED3D_SHADER_CONST_PS_F   0x00000040
 
#define WINED3D_SHADER_CONST_PS_I   0x00000080
 
#define WINED3D_SHADER_CONST_PS_B   0x00000100
 
#define WINED3D_SHADER_CONST_PS_BUMP_ENV   0x00000200
 
#define WINED3D_SHADER_CONST_PS_FOG   0x00000400
 
#define WINED3D_SHADER_CONST_PS_ALPHA_TEST   0x00000800
 
#define WINED3D_SHADER_CONST_FFP_MODELVIEW   0x00004000
 
#define WINED3D_SHADER_CONST_FFP_VERTEXBLEND   0x00008000
 
#define WINED3D_SHADER_CONST_FFP_PROJ   0x00010000
 
#define WINED3D_SHADER_CONST_FFP_TEXMATRIX   0x00020000
 
#define WINED3D_SHADER_CONST_FFP_MATERIAL   0x00040000
 
#define WINED3D_SHADER_CONST_FFP_LIGHTS   0x00080000
 
#define WINED3D_SHADER_CONST_FFP_PS   0x00100000
 
#define WINED3D_SHADER_CONST_FFP_COLOR_KEY   0x00200000
 
#define WINED3D_SHADER_CONST_BASE_VERTEX_ID   0x00400000
 
#define WINED3DSP_NOSWIZZLE   (0u | (1u << 2) | (2u << 4) | (3u << 6))
 
#define WINED3DSP_WRITEMASK_0   0x1u /* .x r */
 
#define WINED3DSP_WRITEMASK_1   0x2u /* .y g */
 
#define WINED3DSP_WRITEMASK_2   0x4u /* .z b */
 
#define WINED3DSP_WRITEMASK_3   0x8u /* .w a */
 
#define WINED3DSP_WRITEMASK_ALL   0xfu /* all */
 
#define WINED3D_PACKED_INTERPOLATION_SIZE   3
 
#define WINED3D_PACKED_INTERPOLATION_BIT_COUNT   3
 
#define WINED3DSI_TEXLD_PROJECT   0x1
 
#define WINED3DSI_TEXLD_BIAS   0x2
 
#define WINED3DSI_INDEXED_DYNAMIC   0x4
 
#define WINED3DSI_RESINFO_RCP_FLOAT   0x1
 
#define WINED3DSI_RESINFO_UINT   0x2
 
#define WINED3DSI_SAMPLE_INFO_UINT   0x1
 
#define WINED3DSI_SAMPLER_COMPARISON_MODE   0x1
 
#define WINED3DSI_PRECISE_X   0x100
 
#define WINED3DSI_PRECISE_Y   0x200
 
#define WINED3DSI_PRECISE_Z   0x400
 
#define WINED3DSI_PRECISE_W   0x800
 
#define WINED3DSI_PRECISE_XYZW
 
#define WINED3DSI_PRECISE_SHIFT   8
 
#define WINED3D_SM1_VS   0xfffeu
 
#define WINED3D_SM1_PS   0xffffu
 
#define WINED3D_SM4_PS   0x0000u
 
#define WINED3D_SM4_VS   0x0001u
 
#define WINED3D_SM4_GS   0x0002u
 
#define WINED3D_SM5_HS   0x0003u
 
#define WINED3D_SM5_DS   0x0004u
 
#define WINED3D_SM5_CS   0x0005u
 
#define WINED3DPS_VERSION(major, minor)   ((WINED3D_SM1_PS << 16) | ((major) << 8) | (minor))
 
#define WINED3DVS_VERSION(major, minor)   ((WINED3D_SM1_VS << 16) | ((major) << 8) | (minor))
 
#define MAX_ATTRIBS   32
 
#define MAX_REG_ADDR   1
 
#define MAX_REG_TEXCRD   8
 
#define MAX_REG_INPUT   32
 
#define MAX_REG_OUTPUT   32
 
#define WINED3D_MAX_CBS   15
 
#define MAX_LABELS   16
 
#define MAX_IMMEDIATE_CONSTANT_BUFFER_SIZE   4096
 
#define WINED3D_SAMPLER_DEFAULT   ~0x0u
 
#define WINED3D_SHADER_VERSION(major, minor)   (((major) << 8) | (minor))
 
#define WINED3D_SHADER_CAP_DOUBLE_PRECISION   0x00000004u
 
#define WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION   0x00000008u
 
#define WINED3D_SHADER_CAP_FULL_FFP_VARYINGS   0x00000010u
 
#define WINED3D_CONST_NUM_UNUSED   ~0U
 
#define WINED3D_PSARGS_PROJECTED   (1u << 3)
 
#define WINED3D_PSARGS_TEXTRANSFORM_SHIFT   4
 
#define WINED3D_PSARGS_TEXTRANSFORM_MASK   0xfu
 
#define WINED3D_PSARGS_TEXTYPE_SHIFT   2
 
#define WINED3D_PSARGS_TEXTYPE_MASK   0x3u
 
#define D3DCOLOR_B_R(dw)   (((dw) >> 16) & 0xff)
 
#define D3DCOLOR_B_G(dw)   (((dw) >> 8) & 0xff)
 
#define D3DCOLOR_B_B(dw)   (((dw) >> 0) & 0xff)
 
#define D3DCOLOR_B_A(dw)   (((dw) >> 24) & 0xff)
 
#define eps   1e-8f
 
#define GET_TEXCOORD_SIZE_FROM_FVF(d3dvtVertexType, tex_num)    (((((d3dvtVertexType) >> (16 + (2 * (tex_num)))) + 1) & 0x03) + 1)
 
#define STATE_RENDER(a)   (a)
 
#define STATE_IS_RENDER(a)   ((a) >= STATE_RENDER(1) && (a) <= STATE_RENDER(WINEHIGHEST_RENDER_STATE))
 
#define STATE_TEXTURESTAGE(stage, num)    (STATE_RENDER(WINEHIGHEST_RENDER_STATE) + 1 + (stage) * (WINED3D_HIGHEST_TEXTURE_STATE + 1) + (num))
 
#define STATE_IS_TEXTURESTAGE(a)    ((a) >= STATE_TEXTURESTAGE(0, 1) && (a) <= STATE_TEXTURESTAGE(WINED3D_MAX_FFP_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE))
 
#define STATE_GRAPHICS_SHADER(a)   (STATE_TEXTURESTAGE(WINED3D_MAX_FFP_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE) + 1 + (a))
 
#define STATE_IS_GRAPHICS_SHADER(a)    ((a) >= STATE_GRAPHICS_SHADER(0) && (a) < STATE_GRAPHICS_SHADER(WINED3D_SHADER_TYPE_GRAPHICS_COUNT))
 
#define STATE_GRAPHICS_CONSTANT_BUFFER(a)   (STATE_GRAPHICS_SHADER(WINED3D_SHADER_TYPE_GRAPHICS_COUNT) + (a))
 
#define STATE_IS_GRAPHICS_CONSTANT_BUFFER(a)
 
#define STATE_GRAPHICS_SHADER_RESOURCE_BINDING   (STATE_GRAPHICS_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_GRAPHICS_COUNT))
 
#define STATE_IS_GRAPHICS_SHADER_RESOURCE_BINDING(a)   ((a) == STATE_GRAPHICS_SHADER_RESOURCE_BINDING)
 
#define STATE_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING   (STATE_GRAPHICS_SHADER_RESOURCE_BINDING + 1)
 
#define STATE_IS_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING(a)   ((a) == STATE_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING)
 
#define STATE_STREAMSRC   (STATE_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING + 1)
 
#define STATE_IS_STREAMSRC(a)   ((a) == STATE_STREAMSRC)
 
#define STATE_INDEXBUFFER   (STATE_STREAMSRC + 1)
 
#define STATE_IS_INDEXBUFFER(a)   ((a) == STATE_INDEXBUFFER)
 
#define STATE_VDECL   (STATE_INDEXBUFFER + 1)
 
#define STATE_IS_VDECL(a)   ((a) == STATE_VDECL)
 
#define STATE_VIEWPORT   (STATE_VDECL + 1)
 
#define STATE_IS_VIEWPORT(a)   ((a) == STATE_VIEWPORT)
 
#define STATE_SCISSORRECT   (STATE_VIEWPORT + 1)
 
#define STATE_IS_SCISSORRECT(a)   ((a) == STATE_SCISSORRECT)
 
#define STATE_CLIPPLANE(a)   (STATE_SCISSORRECT + 1 + (a))
 
#define STATE_IS_CLIPPLANE(a)   ((a) >= STATE_CLIPPLANE(0) && (a) <= STATE_CLIPPLANE(WINED3D_MAX_CLIP_DISTANCES - 1))
 
#define STATE_RASTERIZER   (STATE_CLIPPLANE(WINED3D_MAX_CLIP_DISTANCES))
 
#define STATE_IS_RASTERIZER(a)   ((a) == STATE_RASTERIZER)
 
#define STATE_DEPTH_BOUNDS   (STATE_RASTERIZER + 1)
 
#define STATE_IS_DEPTH_BOUNDS(a)   ((a) == STATE_DEPTH_BOUNDS)
 
#define STATE_BASEVERTEXINDEX   (STATE_DEPTH_BOUNDS + 1)
 
#define STATE_IS_BASEVERTEXINDEX(a)   ((a) == STATE_BASEVERTEXINDEX)
 
#define STATE_FRAMEBUFFER   (STATE_BASEVERTEXINDEX + 1)
 
#define STATE_IS_FRAMEBUFFER(a)   ((a) == STATE_FRAMEBUFFER)
 
#define STATE_STREAM_OUTPUT   (STATE_FRAMEBUFFER + 1)
 
#define STATE_IS_STREAM_OUTPUT(a)   ((a) == STATE_STREAM_OUTPUT)
 
#define STATE_BLEND   (STATE_STREAM_OUTPUT + 1)
 
#define STATE_IS_BLEND(a)   ((a) == STATE_BLEND)
 
#define STATE_BLEND_FACTOR   (STATE_BLEND + 1)
 
#define STATE_IS_BLEND_FACTOR(a)   ((a) == STATE_BLEND_FACTOR)
 
#define STATE_SAMPLE_MASK   (STATE_BLEND_FACTOR + 1)
 
#define STATE_IS_SAMPLE_MASK(a)   ((a) == STATE_SAMPLE_MASK)
 
#define STATE_DEPTH_STENCIL   (STATE_SAMPLE_MASK + 1)
 
#define STATE_IS_DEPTH_STENCIL(a)   ((a) == STATE_DEPTH_STENCIL)
 
#define STATE_STENCIL_REF   (STATE_DEPTH_STENCIL + 1)
 
#define STATE_IS_STENCIL_REF(a)   ((a) == STATE_STENCIL_REF)
 
#define STATE_COMPUTE_OFFSET   (STATE_STENCIL_REF + 1)
 
#define STATE_COMPUTE_SHADER   (STATE_COMPUTE_OFFSET)
 
#define STATE_IS_COMPUTE_SHADER(a)   ((a) == STATE_COMPUTE_SHADER)
 
#define STATE_COMPUTE_CONSTANT_BUFFER   (STATE_COMPUTE_SHADER + 1)
 
#define STATE_IS_COMPUTE_CONSTANT_BUFFER(a)   ((a) == STATE_COMPUTE_CONSTANT_BUFFER)
 
#define STATE_COMPUTE_SHADER_RESOURCE_BINDING   (STATE_COMPUTE_CONSTANT_BUFFER + 1)
 
#define STATE_IS_COMPUTE_SHADER_RESOURCE_BINDING(a)   ((a) == STATE_COMPUTE_SHADER_RESOURCE_BINDING)
 
#define STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING   (STATE_COMPUTE_SHADER_RESOURCE_BINDING + 1)
 
#define STATE_IS_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING(a)   ((a) == STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING)
 
#define STATE_COMPUTE_HIGHEST   (STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING)
 
#define STATE_HIGHEST   (STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING)
 
#define STATE_IS_COMPUTE(a)   ((a) >= STATE_COMPUTE_OFFSET && (a) <= STATE_COMPUTE_HIGHEST)
 
#define STATE_COMPUTE_COUNT   (STATE_COMPUTE_HIGHEST - STATE_COMPUTE_OFFSET + 1)
 
#define STATE_SHADER(a)   ((a) != WINED3D_SHADER_TYPE_COMPUTE ? STATE_GRAPHICS_SHADER(a) : STATE_COMPUTE_SHADER)
 
#define STATE_CONSTANT_BUFFER(a)    ((a) != WINED3D_SHADER_TYPE_COMPUTE ? STATE_GRAPHICS_CONSTANT_BUFFER(a) : STATE_COMPUTE_CONSTANT_BUFFER)
 
#define STATE_UNORDERED_ACCESS_VIEW_BINDING(a)
 
#define WINED3D_QUERY_POOL_SIZE   256
 
#define GL_EXT_EMUL_ARB_MULTITEXTURE   0x00000001
 
#define GL_EXT_EMUL_EXT_FOG_COORD   0x00000002
 
#define WINED3D_MAX_DEVICE_IDENTIFIER_LENGTH   512
 
#define UPLOAD_BO_UPLOAD_ON_UNMAP   0x1
 
#define UPLOAD_BO_RENAME_ON_UNMAP   0x2
 
#define UPLOAD_BO_FREE_ON_UNMAP   0x4
 
#define MAX_PERSISTENT_MAPPED_BYTES   (128 * 1024 * 1024)
 
#define ARG_UNUSED   0xff
 
#define WINED3D_FFP_TCI_SHIFT   16
 
#define WINED3D_FFP_TCI_MASK   0xffu
 
#define WINED3D_FFP_LIGHT_TYPE_SHIFT(idx)   (3 * (idx))
 
#define WINED3D_FFP_LIGHT_TYPE_MASK   0x7u
 
#define WINED3D_FFP_CONSTANTS_EXTRA_REGISTER   3
 
#define WINED3D_STATE_NO_REF   0x00000001
 
#define WINED3D_STATE_INIT_DEFAULT   0x00000002
 
#define WINED3D_UNMAPPED_STAGE   ~0u
 
#define WINED3DCREATE_MULTITHREADED   0x00000004
 
#define WINED3D_ALLOCATOR_CHUNK_SIZE   (64 * 1024 * 1024)
 
#define WINED3D_ALLOCATOR_CHUNK_ORDER_COUNT   15
 
#define WINED3D_ALLOCATOR_MIN_BLOCK_SIZE   (WINED3D_ALLOCATOR_CHUNK_SIZE >> (WINED3D_ALLOCATOR_CHUNK_ORDER_COUNT - 1))
 
#define WINED3D_SLAB_BO_MIN_OBJECT_ALIGN   16
 
#define WINED3D_RETIRED_BO_SIZE_THRESHOLD   (64 * 1024 * 1024)
 
#define CLIENT_BO_DISCARDED   ((struct wined3d_bo *)~(UINT_PTR)0)
 
#define RESOURCE_ALIGNMENT   16
 
#define WINED3D_CONSTANT_BUFFER_ALIGNMENT   16
 
#define WINED3D_LOCATION_DISCARDED   0x00000001
 
#define WINED3D_LOCATION_SYSMEM   0x00000002
 
#define WINED3D_LOCATION_CLEARED   0x00000004
 
#define WINED3D_LOCATION_BUFFER   0x00000008
 
#define WINED3D_LOCATION_TEXTURE_RGB   0x00000010
 
#define WINED3D_LOCATION_TEXTURE_SRGB   0x00000020
 
#define WINED3D_LOCATION_DRAWABLE   0x00000040
 
#define WINED3D_LOCATION_RB_MULTISAMPLE   0x00000080
 
#define WINED3D_LOCATION_RB_RESOLVED   0x00000100
 
#define WINED3D_TEXTURE_COND_NP2   0x00000001
 
#define WINED3D_TEXTURE_IS_SRGB   0x00000008
 
#define WINED3D_TEXTURE_RGB_ALLOCATED   0x00000010
 
#define WINED3D_TEXTURE_RGB_VALID   0x00000020
 
#define WINED3D_TEXTURE_SRGB_ALLOCATED   0x00000040
 
#define WINED3D_TEXTURE_SRGB_VALID   0x00000080
 
#define WINED3D_TEXTURE_CONVERTED   0x00000100
 
#define WINED3D_TEXTURE_GET_DC_LENIENT   0x00000800
 
#define WINED3D_TEXTURE_DC_IN_USE   0x00001000
 
#define WINED3D_TEXTURE_DISCARD   0x00002000
 
#define WINED3D_TEXTURE_GET_DC   0x00004000
 
#define WINED3D_TEXTURE_GENERATE_MIPMAPS   0x00008000
 
#define WINED3D_TEXTURE_DOWNLOADABLE   0x00010000
 
#define WINED3D_TEXTURE_ASYNC_COLOR_KEY   0x00000001
 
#define WINED3D_CS_QUERY_POLL_INTERVAL   100u
 
#define WINED3D_CS_QUEUE_SIZE   0x400000u
 
#define WINED3D_CS_SPIN_COUNT   2000u
 
#define WINED3D_CS_COMMAND_WAIT_WITH_QUERIES_TIMEOUT   100
 
#define WINED3D_CS_CLIENT_WAIT_TIMEOUT   0
 
#define WINED3D_CS_QUEUE_MASK   (WINED3D_CS_QUEUE_SIZE - 1)
 
#define WINED3D_PAUSE_SPIN_COUNT   200u
 
#define wined3d_lock_init(lock, name)   wined3d_lock_init_(lock, __FILE__ ": " name)
 
#define PRINTF_ATTR(fmt, args)
 
#define WINED3D_FORMAT_ATTR_FLOAT   0x00000001
 
#define WINED3D_FORMAT_ATTR_INTEGER   0x00000002
 
#define WINED3D_FORMAT_ATTR_NORMALISED   0x00000004
 
#define WINED3D_FORMAT_ATTR_BUMPMAP   0x00000008
 
#define WINED3D_FORMAT_ATTR_EXTENSION   0x00000010
 
#define WINED3D_FORMAT_ATTR_BLOCKS   0x00000020
 
#define WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY   0x00000040
 
#define WINED3D_FORMAT_ATTR_COMPRESSED   0x00000080
 
#define WINED3D_FORMAT_ATTR_BROKEN_PITCH   0x00000100
 
#define WINED3D_FORMAT_ATTR_HEIGHT_SCALE   0x00000200
 
#define WINED3D_FORMAT_ATTR_MAPPABLE   0x00000400
 
#define WINED3D_FORMAT_ATTR_CAST_TO_BLOCK   0x00000800
 
#define WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING   0x00000001
 
#define WINED3D_FORMAT_CAP_FILTERING   0x00000002
 
#define WINED3D_FORMAT_CAP_UNORDERED_ACCESS   0x00000004
 
#define WINED3D_FORMAT_CAP_DEPTH_STENCIL   0x00000008
 
#define WINED3D_FORMAT_CAP_RENDERTARGET   0x00000010
 
#define WINED3D_FORMAT_CAP_FBO_ATTACHABLE   0x00000020
 
#define WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB   0x00000040
 
#define WINED3D_FORMAT_CAP_DECOMPRESS   0x00000080
 
#define WINED3D_FORMAT_CAP_SRGB_READ   0x00000100
 
#define WINED3D_FORMAT_CAP_SRGB_WRITE   0x00000200
 
#define WINED3D_FORMAT_CAP_VTF   0x00000400
 
#define WINED3D_FORMAT_CAP_SHADOW   0x00000800
 
#define WINED3D_FORMAT_CAP_TEXTURE   0x00001000
 
#define WINED3D_FORMAT_CAP_GEN_MIPMAP   0x00002000
 
#define WINED3D_FORMAT_CAP_VERTEX_ATTRIBUTE   0x00004000
 
#define WINED3D_FORMAT_CAP_BLIT   0x00008000
 
#define WINED3D_FORMAT_CAP_INDEX_BUFFER   0x00010000
 
#define WINED3D_OPENGL_WINDOW_CLASS_NAME   "WineD3D_OpenGL"
 

Typedefs

typedef void(* SHADER_HANDLER) (const struct wined3d_shader_instruction *)
 
typedef void(* APPLYSTATEFUNC) (struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id)
 

Enumerations

enum  wined3d_ffp_idx {
  WINED3D_FFP_POSITION = 0 , WINED3D_FFP_BLENDWEIGHT = 1 , WINED3D_FFP_BLENDINDICES = 2 , WINED3D_FFP_NORMAL = 3 ,
  WINED3D_FFP_PSIZE = 4 , WINED3D_FFP_DIFFUSE = 5 , WINED3D_FFP_SPECULAR = 6 , WINED3D_FFP_TEXCOORD0 = 7 ,
  WINED3D_FFP_TEXCOORD1 = 8 , WINED3D_FFP_TEXCOORD2 = 9 , WINED3D_FFP_TEXCOORD3 = 10 , WINED3D_FFP_TEXCOORD4 = 11 ,
  WINED3D_FFP_TEXCOORD5 = 12 , WINED3D_FFP_TEXCOORD6 = 13 , WINED3D_FFP_TEXCOORD7 = 14 , WINED3D_FFP_ATTRIBS_COUNT = 15
}
 
enum  wined3d_ffp_emit_idx {
  WINED3D_FFP_EMIT_FLOAT1 , WINED3D_FFP_EMIT_FLOAT2 , WINED3D_FFP_EMIT_FLOAT3 , WINED3D_FFP_EMIT_FLOAT4 ,
  WINED3D_FFP_EMIT_D3DCOLOR , WINED3D_FFP_EMIT_UBYTE4 , WINED3D_FFP_EMIT_SHORT2 , WINED3D_FFP_EMIT_SHORT4 ,
  WINED3D_FFP_EMIT_UBYTE4N , WINED3D_FFP_EMIT_SHORT2N , WINED3D_FFP_EMIT_SHORT4N , WINED3D_FFP_EMIT_USHORT2N ,
  WINED3D_FFP_EMIT_USHORT4N , WINED3D_FFP_EMIT_UDEC3 , WINED3D_FFP_EMIT_DEC3N , WINED3D_FFP_EMIT_FLOAT16_2 ,
  WINED3D_FFP_EMIT_FLOAT16_4 , WINED3D_FFP_EMIT_INVALID , WINED3D_FFP_EMIT_COUNT
}
 
enum  fixup_channel_source {
  CHANNEL_SOURCE_ZERO = 0 , CHANNEL_SOURCE_ONE = 1 , CHANNEL_SOURCE_X = 2 , CHANNEL_SOURCE_Y = 3 ,
  CHANNEL_SOURCE_Z = 4 , CHANNEL_SOURCE_W = 5 , CHANNEL_SOURCE_COMPLEX0 = 6 , CHANNEL_SOURCE_COMPLEX1 = 7
}
 
enum  complex_fixup {
  COMPLEX_FIXUP_NONE = 0 , COMPLEX_FIXUP_YUY2 = 1 , COMPLEX_FIXUP_UYVY = 2 , COMPLEX_FIXUP_YV12 = 3 ,
  COMPLEX_FIXUP_P8 = 4 , COMPLEX_FIXUP_NV12 = 5 , COMPLEX_FIXUP_YUV = 6
}
 
enum  wined3d_shader_backend { WINED3D_SHADER_BACKEND_AUTO , WINED3D_SHADER_BACKEND_GLSL , WINED3D_SHADER_BACKEND_GLSL_VKD3D }
 
enum  wined3d_shader_resource_type {
  WINED3D_SHADER_RESOURCE_NONE , WINED3D_SHADER_RESOURCE_BUFFER , WINED3D_SHADER_RESOURCE_TEXTURE_1D , WINED3D_SHADER_RESOURCE_TEXTURE_2D ,
  WINED3D_SHADER_RESOURCE_TEXTURE_2DMS , WINED3D_SHADER_RESOURCE_TEXTURE_3D , WINED3D_SHADER_RESOURCE_TEXTURE_CUBE , WINED3D_SHADER_RESOURCE_TEXTURE_1DARRAY ,
  WINED3D_SHADER_RESOURCE_TEXTURE_2DARRAY , WINED3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY , WINED3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY
}
 
enum  wined3d_shader_register_type {
  WINED3DSPR_TEMP = 0 , WINED3DSPR_INPUT = 1 , WINED3DSPR_CONST = 2 , WINED3DSPR_ADDR = 3 ,
  WINED3DSPR_TEXTURE = 3 , WINED3DSPR_RASTOUT = 4 , WINED3DSPR_ATTROUT = 5 , WINED3DSPR_TEXCRDOUT = 6 ,
  WINED3DSPR_OUTPUT = 6 , WINED3DSPR_CONSTINT = 7 , WINED3DSPR_COLOROUT = 8 , WINED3DSPR_DEPTHOUT = 9 ,
  WINED3DSPR_SAMPLER = 10 , WINED3DSPR_CONST2 = 11 , WINED3DSPR_CONST3 = 12 , WINED3DSPR_CONST4 = 13 ,
  WINED3DSPR_CONSTBOOL = 14 , WINED3DSPR_LOOP = 15 , WINED3DSPR_TEMPFLOAT16 = 16 , WINED3DSPR_MISCTYPE = 17 ,
  WINED3DSPR_LABEL = 18 , WINED3DSPR_PREDICATE = 19 , WINED3DSPR_IMMCONST , WINED3DSPR_CONSTBUFFER ,
  WINED3DSPR_IMMCONSTBUFFER , WINED3DSPR_PRIMID , WINED3DSPR_NULL , WINED3DSPR_RESOURCE ,
  WINED3DSPR_UAV , WINED3DSPR_OUTPOINTID , WINED3DSPR_FORKINSTID , WINED3DSPR_JOININSTID ,
  WINED3DSPR_INCONTROLPOINT , WINED3DSPR_OUTCONTROLPOINT , WINED3DSPR_PATCHCONST , WINED3DSPR_TESSCOORD ,
  WINED3DSPR_GROUPSHAREDMEM , WINED3DSPR_THREADID , WINED3DSPR_THREADGROUPID , WINED3DSPR_LOCALTHREADID ,
  WINED3DSPR_LOCALTHREADINDEX , WINED3DSPR_IDXTEMP , WINED3DSPR_STREAM , WINED3DSPR_FUNCTIONBODY ,
  WINED3DSPR_FUNCTIONPOINTER , WINED3DSPR_COVERAGE , WINED3DSPR_SAMPLEMASK , WINED3DSPR_GSINSTID ,
  WINED3DSPR_DEPTHOUTGE , WINED3DSPR_DEPTHOUTLE , WINED3DSPR_RASTERIZER , WINED3DSPR_STENCILREF
}
 
enum  wined3d_data_type {
  WINED3D_DATA_FLOAT , WINED3D_DATA_INT , WINED3D_DATA_RESOURCE , WINED3D_DATA_SAMPLER ,
  WINED3D_DATA_UAV , WINED3D_DATA_UINT , WINED3D_DATA_UNORM , WINED3D_DATA_SNORM ,
  WINED3D_DATA_OPAQUE
}
 
enum  wined3d_immconst_type { WINED3D_IMMCONST_SCALAR , WINED3D_IMMCONST_VEC4 }
 
enum  wined3d_shader_src_modifier {
  WINED3DSPSM_NONE = 0 , WINED3DSPSM_NEG = 1 , WINED3DSPSM_BIAS = 2 , WINED3DSPSM_BIASNEG = 3 ,
  WINED3DSPSM_SIGN = 4 , WINED3DSPSM_SIGNNEG = 5 , WINED3DSPSM_COMP = 6 , WINED3DSPSM_X2 = 7 ,
  WINED3DSPSM_X2NEG = 8 , WINED3DSPSM_DZ = 9 , WINED3DSPSM_DW = 10 , WINED3DSPSM_ABS = 11 ,
  WINED3DSPSM_ABSNEG = 12 , WINED3DSPSM_NOT = 13
}
 
enum  wined3d_shader_dst_modifier { WINED3DSPDM_NONE = 0 , WINED3DSPDM_SATURATE = 1 , WINED3DSPDM_PARTIALPRECISION = 2 , WINED3DSPDM_MSAMPCENTROID = 4 }
 
enum  wined3d_shader_interpolation_mode {
  WINED3DSIM_NONE = 0 , WINED3DSIM_CONSTANT = 1 , WINED3DSIM_LINEAR = 2 , WINED3DSIM_LINEAR_CENTROID = 3 ,
  WINED3DSIM_LINEAR_NOPERSPECTIVE = 4 , WINED3DSIM_LINEAR_NOPERSPECTIVE_CENTROID = 5 , WINED3DSIM_LINEAR_SAMPLE = 6 , WINED3DSIM_LINEAR_NOPERSPECTIVE_SAMPLE = 7
}
 
enum  wined3d_shader_global_flags { WINED3DSGF_REFACTORING_ALLOWED = 0x1 , WINED3DSGF_FORCE_EARLY_DEPTH_STENCIL = 0x4 , WINED3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS = 0x8 }
 
enum  wined3d_shader_sync_flags { WINED3DSSF_THREAD_GROUP = 0x1 , WINED3DSSF_GROUP_SHARED_MEMORY = 0x2 , WINED3DSSF_GLOBAL_UAV = 0x8 }
 
enum  wined3d_shader_uav_flags { WINED3DSUF_GLOBALLY_COHERENT = 0x2 , WINED3DSUF_ORDER_PRESERVING_COUNTER = 0x100 }
 
enum  wined3d_tessellator_domain { WINED3D_TESSELLATOR_DOMAIN_LINE = 1 , WINED3D_TESSELLATOR_DOMAIN_TRIANGLE = 2 , WINED3D_TESSELLATOR_DOMAIN_QUAD = 3 }
 
enum  wined3d_tessellator_output_primitive { WINED3D_TESSELLATOR_OUTPUT_POINT = 1 , WINED3D_TESSELLATOR_OUTPUT_LINE = 2 , WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CW = 3 , WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4 }
 
enum  wined3d_tessellator_partitioning { WINED3D_TESSELLATOR_PARTITIONING_INTEGER = 1 , WINED3D_TESSELLATOR_PARTITIONING_POW2 = 2 , WINED3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 3 , WINED3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 4 }
 
enum  wined3d_shader_rel_op {
  WINED3D_SHADER_REL_OP_GT = 1 , WINED3D_SHADER_REL_OP_EQ = 2 , WINED3D_SHADER_REL_OP_GE = 3 , WINED3D_SHADER_REL_OP_LT = 4 ,
  WINED3D_SHADER_REL_OP_NE = 5 , WINED3D_SHADER_REL_OP_LE = 6
}
 
enum  wined3d_shader_conditional_op { WINED3D_SHADER_CONDITIONAL_OP_NZ = 0 , WINED3D_SHADER_CONDITIONAL_OP_Z = 1 }
 
enum  wined3d_sysval_semantic {
  WINED3D_SV_POSITION = 0x01 , WINED3D_SV_CLIP_DISTANCE = 0x02 , WINED3D_SV_CULL_DISTANCE = 0x03 , WINED3D_SV_RENDER_TARGET_ARRAY_INDEX = 0x04 ,
  WINED3D_SV_VIEWPORT_ARRAY_INDEX = 0x05 , WINED3D_SV_VERTEX_ID = 0x06 , WINED3D_SV_PRIMITIVE_ID = 0x07 , WINED3D_SV_INSTANCE_ID = 0x08 ,
  WINED3D_SV_IS_FRONT_FACE = 0x09 , WINED3D_SV_SAMPLE_INDEX = 0x0a , WINED3D_SV_TESS_FACTOR_QUADEDGE = 0x0b , WINED3D_SV_TESS_FACTOR_QUADINT = 0x0c ,
  WINED3D_SV_TESS_FACTOR_TRIEDGE = 0x0d , WINED3D_SV_TESS_FACTOR_TRIINT = 0x0e , WINED3D_SV_TESS_FACTOR_LINEDET = 0x0f , WINED3D_SV_TESS_FACTOR_LINEDEN = 0x10
}
 
enum  wined3d_component_type { WINED3D_TYPE_UNKNOWN = 0x0 , WINED3D_TYPE_UINT = 0x1 , WINED3D_TYPE_INT = 0x2 , WINED3D_TYPE_FLOAT = 0x3 }
 
enum  WINED3D_SHADER_INSTRUCTION_HANDLER {
  WINED3DSIH_ABS , WINED3DSIH_ADD , WINED3DSIH_AND , WINED3DSIH_ATOMIC_AND ,
  WINED3DSIH_ATOMIC_CMP_STORE , WINED3DSIH_ATOMIC_IADD , WINED3DSIH_ATOMIC_IMAX , WINED3DSIH_ATOMIC_IMIN ,
  WINED3DSIH_ATOMIC_OR , WINED3DSIH_ATOMIC_UMAX , WINED3DSIH_ATOMIC_UMIN , WINED3DSIH_ATOMIC_XOR ,
  WINED3DSIH_BEM , WINED3DSIH_BFI , WINED3DSIH_BFREV , WINED3DSIH_BREAK ,
  WINED3DSIH_BREAKC , WINED3DSIH_BREAKP , WINED3DSIH_BUFINFO , WINED3DSIH_CALL ,
  WINED3DSIH_CALLNZ , WINED3DSIH_CASE , WINED3DSIH_CMP , WINED3DSIH_CND ,
  WINED3DSIH_CONTINUE , WINED3DSIH_CONTINUEP , WINED3DSIH_COUNTBITS , WINED3DSIH_CRS ,
  WINED3DSIH_CUT , WINED3DSIH_CUT_STREAM , WINED3DSIH_DCL , WINED3DSIH_DCL_CONSTANT_BUFFER ,
  WINED3DSIH_DCL_FUNCTION_BODY , WINED3DSIH_DCL_FUNCTION_TABLE , WINED3DSIH_DCL_GLOBAL_FLAGS , WINED3DSIH_DCL_GS_INSTANCES ,
  WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT , WINED3DSIH_DCL_HS_JOIN_PHASE_INSTANCE_COUNT , WINED3DSIH_DCL_HS_MAX_TESSFACTOR , WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER ,
  WINED3DSIH_DCL_INDEX_RANGE , WINED3DSIH_DCL_INDEXABLE_TEMP , WINED3DSIH_DCL_INPUT , WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT ,
  WINED3DSIH_DCL_INPUT_PRIMITIVE , WINED3DSIH_DCL_INPUT_PS , WINED3DSIH_DCL_INPUT_PS_SGV , WINED3DSIH_DCL_INPUT_PS_SIV ,
  WINED3DSIH_DCL_INPUT_SGV , WINED3DSIH_DCL_INPUT_SIV , WINED3DSIH_DCL_INTERFACE , WINED3DSIH_DCL_OUTPUT ,
  WINED3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT , WINED3DSIH_DCL_OUTPUT_SIV , WINED3DSIH_DCL_OUTPUT_TOPOLOGY , WINED3DSIH_DCL_RESOURCE_RAW ,
  WINED3DSIH_DCL_RESOURCE_STRUCTURED , WINED3DSIH_DCL_SAMPLER , WINED3DSIH_DCL_STREAM , WINED3DSIH_DCL_TEMPS ,
  WINED3DSIH_DCL_TESSELLATOR_DOMAIN , WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE , WINED3DSIH_DCL_TESSELLATOR_PARTITIONING , WINED3DSIH_DCL_TGSM_RAW ,
  WINED3DSIH_DCL_TGSM_STRUCTURED , WINED3DSIH_DCL_THREAD_GROUP , WINED3DSIH_DCL_UAV_RAW , WINED3DSIH_DCL_UAV_STRUCTURED ,
  WINED3DSIH_DCL_UAV_TYPED , WINED3DSIH_DCL_VERTICES_OUT , WINED3DSIH_DEF , WINED3DSIH_DEFAULT ,
  WINED3DSIH_DEFB , WINED3DSIH_DEFI , WINED3DSIH_DIV , WINED3DSIH_DP2 ,
  WINED3DSIH_DP2ADD , WINED3DSIH_DP3 , WINED3DSIH_DP4 , WINED3DSIH_DST ,
  WINED3DSIH_DSX , WINED3DSIH_DSX_COARSE , WINED3DSIH_DSX_FINE , WINED3DSIH_DSY ,
  WINED3DSIH_DSY_COARSE , WINED3DSIH_DSY_FINE , WINED3DSIH_ELSE , WINED3DSIH_EMIT ,
  WINED3DSIH_EMIT_STREAM , WINED3DSIH_ENDIF , WINED3DSIH_ENDLOOP , WINED3DSIH_ENDREP ,
  WINED3DSIH_ENDSWITCH , WINED3DSIH_EQ , WINED3DSIH_EVAL_CENTROID , WINED3DSIH_EVAL_SAMPLE_INDEX ,
  WINED3DSIH_EXP , WINED3DSIH_EXPP , WINED3DSIH_F16TOF32 , WINED3DSIH_F32TOF16 ,
  WINED3DSIH_FCALL , WINED3DSIH_FIRSTBIT_HI , WINED3DSIH_FIRSTBIT_LO , WINED3DSIH_FIRSTBIT_SHI ,
  WINED3DSIH_FRC , WINED3DSIH_FTOI , WINED3DSIH_FTOU , WINED3DSIH_GATHER4 ,
  WINED3DSIH_GATHER4_C , WINED3DSIH_GATHER4_PO , WINED3DSIH_GATHER4_PO_C , WINED3DSIH_GE ,
  WINED3DSIH_HS_CONTROL_POINT_PHASE , WINED3DSIH_HS_DECLS , WINED3DSIH_HS_FORK_PHASE , WINED3DSIH_HS_JOIN_PHASE ,
  WINED3DSIH_IADD , WINED3DSIH_IBFE , WINED3DSIH_IEQ , WINED3DSIH_IF ,
  WINED3DSIH_IFC , WINED3DSIH_IGE , WINED3DSIH_ILT , WINED3DSIH_IMAD ,
  WINED3DSIH_IMAX , WINED3DSIH_IMIN , WINED3DSIH_IMM_ATOMIC_ALLOC , WINED3DSIH_IMM_ATOMIC_AND ,
  WINED3DSIH_IMM_ATOMIC_CMP_EXCH , WINED3DSIH_IMM_ATOMIC_CONSUME , WINED3DSIH_IMM_ATOMIC_EXCH , WINED3DSIH_IMM_ATOMIC_IADD ,
  WINED3DSIH_IMM_ATOMIC_IMAX , WINED3DSIH_IMM_ATOMIC_IMIN , WINED3DSIH_IMM_ATOMIC_OR , WINED3DSIH_IMM_ATOMIC_UMAX ,
  WINED3DSIH_IMM_ATOMIC_UMIN , WINED3DSIH_IMM_ATOMIC_XOR , WINED3DSIH_IMUL , WINED3DSIH_INE ,
  WINED3DSIH_INEG , WINED3DSIH_ISHL , WINED3DSIH_ISHR , WINED3DSIH_ITOF ,
  WINED3DSIH_LABEL , WINED3DSIH_LD , WINED3DSIH_LD2DMS , WINED3DSIH_LD_RAW ,
  WINED3DSIH_LD_STRUCTURED , WINED3DSIH_LD_UAV_TYPED , WINED3DSIH_LIT , WINED3DSIH_LOD ,
  WINED3DSIH_LOG , WINED3DSIH_LOGP , WINED3DSIH_LOOP , WINED3DSIH_LRP ,
  WINED3DSIH_LT , WINED3DSIH_M3x2 , WINED3DSIH_M3x3 , WINED3DSIH_M3x4 ,
  WINED3DSIH_M4x3 , WINED3DSIH_M4x4 , WINED3DSIH_MAD , WINED3DSIH_MAX ,
  WINED3DSIH_MIN , WINED3DSIH_MOV , WINED3DSIH_MOVA , WINED3DSIH_MOVC ,
  WINED3DSIH_MUL , WINED3DSIH_NE , WINED3DSIH_NOP , WINED3DSIH_NOT ,
  WINED3DSIH_NRM , WINED3DSIH_OR , WINED3DSIH_PHASE , WINED3DSIH_POW ,
  WINED3DSIH_RCP , WINED3DSIH_REP , WINED3DSIH_RESINFO , WINED3DSIH_RET ,
  WINED3DSIH_RETP , WINED3DSIH_ROUND_NE , WINED3DSIH_ROUND_NI , WINED3DSIH_ROUND_PI ,
  WINED3DSIH_ROUND_Z , WINED3DSIH_RSQ , WINED3DSIH_SAMPLE , WINED3DSIH_SAMPLE_B ,
  WINED3DSIH_SAMPLE_C , WINED3DSIH_SAMPLE_C_LZ , WINED3DSIH_SAMPLE_GRAD , WINED3DSIH_SAMPLE_INFO ,
  WINED3DSIH_SAMPLE_LOD , WINED3DSIH_SAMPLE_POS , WINED3DSIH_SETP , WINED3DSIH_SGE ,
  WINED3DSIH_SGN , WINED3DSIH_SINCOS , WINED3DSIH_SLT , WINED3DSIH_SQRT ,
  WINED3DSIH_STORE_RAW , WINED3DSIH_STORE_STRUCTURED , WINED3DSIH_STORE_UAV_TYPED , WINED3DSIH_SUB ,
  WINED3DSIH_SWAPC , WINED3DSIH_SWITCH , WINED3DSIH_SYNC , WINED3DSIH_TEX ,
  WINED3DSIH_TEXBEM , WINED3DSIH_TEXBEML , WINED3DSIH_TEXCOORD , WINED3DSIH_TEXDEPTH ,
  WINED3DSIH_TEXDP3 , WINED3DSIH_TEXDP3TEX , WINED3DSIH_TEXKILL , WINED3DSIH_TEXLDD ,
  WINED3DSIH_TEXLDL , WINED3DSIH_TEXM3x2DEPTH , WINED3DSIH_TEXM3x2PAD , WINED3DSIH_TEXM3x2TEX ,
  WINED3DSIH_TEXM3x3 , WINED3DSIH_TEXM3x3DIFF , WINED3DSIH_TEXM3x3PAD , WINED3DSIH_TEXM3x3SPEC ,
  WINED3DSIH_TEXM3x3TEX , WINED3DSIH_TEXM3x3VSPEC , WINED3DSIH_TEXREG2AR , WINED3DSIH_TEXREG2GB ,
  WINED3DSIH_TEXREG2RGB , WINED3DSIH_UBFE , WINED3DSIH_UDIV , WINED3DSIH_UGE ,
  WINED3DSIH_ULT , WINED3DSIH_UMAX , WINED3DSIH_UMIN , WINED3DSIH_UMUL ,
  WINED3DSIH_USHR , WINED3DSIH_UTOF , WINED3DSIH_XOR , WINED3DSIH_TABLE_SIZE
}
 
enum  wined3d_shader_input_sysval_semantic {
  WINED3D_SIV_POSITION = 1 , WINED3D_SIV_CLIP_DISTANCE = 2 , WINED3D_SIV_CULL_DISTANCE = 3 , WINED3D_SIV_RENDER_TARGET_ARRAY_INDEX = 4 ,
  WINED3D_SIV_VIEWPORT_ARRAY_INDEX = 5 , WINED3D_SIV_VERTEX_ID = 6 , WINED3D_SIV_PRIMITIVE_ID = 7 , WINED3D_SIV_INSTANCE_ID = 8 ,
  WINED3D_SIV_IS_FRONT_FACE = 9 , WINED3D_SIV_SAMPLE_INDEX = 10 , WINED3D_SIV_QUAD_U0_TESS_FACTOR = 11 , WINED3D_SIV_QUAD_V0_TESS_FACTOR = 12 ,
  WINED3D_SIV_QUAD_U1_TESS_FACTOR = 13 , WINED3D_SIV_QUAD_V1_TESS_FACTOR = 14 , WINED3D_SIV_QUAD_U_INNER_TESS_FACTOR = 15 , WINED3D_SIV_QUAD_V_INNER_TESS_FACTOR = 16 ,
  WINED3D_SIV_TRIANGLE_U_TESS_FACTOR = 17 , WINED3D_SIV_TRIANGLE_V_TESS_FACTOR = 18 , WINED3D_SIV_TRIANGLE_W_TESS_FACTOR = 19 , WINED3D_SIV_TRIANGLE_INNER_TESS_FACTOR = 20 ,
  WINED3D_SIV_LINE_DETAIL_TESS_FACTOR = 21 , WINED3D_SIV_LINE_DENSITY_TESS_FACTOR = 22
}
 
enum  wined3d_gl_resource_type {
  WINED3D_GL_RES_TYPE_TEX_1D = 0 , WINED3D_GL_RES_TYPE_TEX_2D = 1 , WINED3D_GL_RES_TYPE_TEX_3D = 2 , WINED3D_GL_RES_TYPE_TEX_CUBE = 3 ,
  WINED3D_GL_RES_TYPE_BUFFER = 4 , WINED3D_GL_RES_TYPE_RB = 5 , WINED3D_GL_RES_TYPE_COUNT = 6
}
 
enum  wined3d_vertex_processing_mode { WINED3D_VP_MODE_FF , WINED3D_VP_MODE_SHADER , WINED3D_VP_MODE_NONE }
 
enum  wined3d_ffp_ps_fog_mode { WINED3D_FFP_PS_FOG_OFF , WINED3D_FFP_PS_FOG_LINEAR , WINED3D_FFP_PS_FOG_EXP , WINED3D_FFP_PS_FOG_EXP2 }
 
enum  wined3d_shader_tex_types { WINED3D_SHADER_TEX_2D = 0 , WINED3D_SHADER_TEX_3D = 1 , WINED3D_SHADER_TEX_CUBE = 2 , WINED3D_SHADER_TEX_ERR = 3 }
 
enum  fog_src_type { VS_FOG_Z , VS_FOG_COORD , VS_FOG_W }
 
enum  fogsource { FOGSOURCE_FFP , FOGSOURCE_VS }
 
enum  wined3d_query_state { QUERY_CREATED , QUERY_SIGNALLED , QUERY_BUILDING }
 
enum  wined3d_blit_op {
  WINED3D_BLIT_OP_COLOR_BLIT , WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST , WINED3D_BLIT_OP_COLOR_BLIT_CKEY , WINED3D_BLIT_OP_DEPTH_BLIT ,
  WINED3D_BLIT_OP_RAW_BLIT
}
 
enum  wined3d_pci_vendor {
  HW_VENDOR_SOFTWARE = 0x0000 , HW_VENDOR_AMD = 0x1002 , HW_VENDOR_NVIDIA = 0x10de , HW_VENDOR_VMWARE = 0x15ad ,
  HW_VENDOR_REDHAT = 0x1af4 , HW_VENDOR_INTEL = 0x8086
}
 
enum  wined3d_pci_device {
  CARD_WINE = 0x0000 , CARD_AMD_RAGE_128PRO = 0x5246 , CARD_AMD_RADEON_7200 = 0x5144 , CARD_AMD_RADEON_8500 = 0x514c ,
  CARD_AMD_RADEON_9500 = 0x4144 , CARD_AMD_RADEON_XPRESS_200M = 0x5955 , CARD_AMD_RADEON_X700 = 0x5e4c , CARD_AMD_RADEON_X1600 = 0x71c2 ,
  CARD_AMD_RADEON_HD2350 = 0x94c7 , CARD_AMD_RADEON_HD2600 = 0x9581 , CARD_AMD_RADEON_HD2900 = 0x9400 , CARD_AMD_RADEON_HD3200 = 0x9620 ,
  CARD_AMD_RADEON_HD3850 = 0x9515 , CARD_AMD_RADEON_HD4200M = 0x9712 , CARD_AMD_RADEON_HD4350 = 0x954f , CARD_AMD_RADEON_HD4600 = 0x9495 ,
  CARD_AMD_RADEON_HD4700 = 0x944e , CARD_AMD_RADEON_HD4800 = 0x944c , CARD_AMD_RADEON_HD5400 = 0x68f9 , CARD_AMD_RADEON_HD5600 = 0x68d8 ,
  CARD_AMD_RADEON_HD5700 = 0x68be , CARD_AMD_RADEON_HD5800 = 0x6898 , CARD_AMD_RADEON_HD5900 = 0x689c , CARD_AMD_RADEON_HD6300 = 0x9803 ,
  CARD_AMD_RADEON_HD6400 = 0x6770 , CARD_AMD_RADEON_HD6490M = 0x6760 , CARD_AMD_RADEON_HD6410D = 0x9644 , CARD_AMD_RADEON_HD6480G = 0x9648 ,
  CARD_AMD_RADEON_HD6550D = 0x9640 , CARD_AMD_RADEON_HD6600 = 0x6758 , CARD_AMD_RADEON_HD6600M = 0x6741 , CARD_AMD_RADEON_HD6700 = 0x68ba ,
  CARD_AMD_RADEON_HD6800 = 0x6739 , CARD_AMD_RADEON_HD6900 = 0x6719 , CARD_AMD_RADEON_HD7660D = 0x9901 , CARD_AMD_RADEON_HD7700 = 0x683d ,
  CARD_AMD_RADEON_HD7800 = 0x6819 , CARD_AMD_RADEON_HD7870 = 0x6818 , CARD_AMD_RADEON_HD7900 = 0x679a , CARD_AMD_RADEON_HD8600M = 0x6660 ,
  CARD_AMD_RADEON_HD8670 = 0x6610 , CARD_AMD_RADEON_HD8770 = 0x665c , CARD_AMD_RADEON_R3 = 0x9830 , CARD_AMD_RADEON_R7 = 0x130f ,
  CARD_AMD_RADEON_R9_285 = 0x6939 , CARD_AMD_RADEON_R9_290 = 0x67b1 , CARD_AMD_RADEON_R9_290X = 0x67b0 , CARD_AMD_RADEON_R9_FURY = 0x7300 ,
  CARD_AMD_RADEON_R9_M370X = 0x6821 , CARD_AMD_RADEON_R9_M380 = 0x6647 , CARD_AMD_RADEON_R9_M395X = 0x6920 , CARD_AMD_RADEON_RX_460 = 0x67ef ,
  CARD_AMD_RADEON_RX_480 = 0x67df , CARD_AMD_RADEON_RX_VEGA_10 = 0x687f , CARD_AMD_RADEON_RX_VEGA_12 = 0x69af , CARD_AMD_RADEON_RAVEN = 0x15dd ,
  CARD_AMD_RADEON_RX_VEGA_20 = 0x66af , CARD_AMD_RADEON_RX_NAVI_10 = 0x731f , CARD_AMD_RADEON_RX_NAVI_14 = 0x7340 , CARD_AMD_RADEON_RX_NAVI_21 = 0x73bf ,
  CARD_AMD_RADEON_PRO_V620 = 0x73a1 , CARD_AMD_RADEON_PRO_V620_VF = 0x73ae , CARD_AMD_VANGOGH = 0x163f , CARD_AMD_RAPHAEL = 0x164e ,
  CARD_NVIDIA_RIVA_128 = 0x0018 , CARD_NVIDIA_RIVA_TNT = 0x0020 , CARD_NVIDIA_RIVA_TNT2 = 0x0028 , CARD_NVIDIA_GEFORCE = 0x0100 ,
  CARD_NVIDIA_GEFORCE2_MX = 0x0110 , CARD_NVIDIA_GEFORCE2 = 0x0150 , CARD_NVIDIA_GEFORCE3 = 0x0200 , CARD_NVIDIA_GEFORCE4_MX = 0x0170 ,
  CARD_NVIDIA_GEFORCE4_TI4200 = 0x0253 , CARD_NVIDIA_GEFORCEFX_5200 = 0x0320 , CARD_NVIDIA_GEFORCEFX_5600 = 0x0312 , CARD_NVIDIA_GEFORCEFX_5800 = 0x0302 ,
  CARD_NVIDIA_GEFORCE_6200 = 0x014f , CARD_NVIDIA_GEFORCE_6600GT = 0x0140 , CARD_NVIDIA_GEFORCE_6800 = 0x0041 , CARD_NVIDIA_GEFORCE_7300 = 0x01d7 ,
  CARD_NVIDIA_GEFORCE_7400 = 0x01d8 , CARD_NVIDIA_GEFORCE_7600 = 0x0391 , CARD_NVIDIA_GEFORCE_7800GT = 0x0092 , CARD_NVIDIA_GEFORCE_8200 = 0x0849 ,
  CARD_NVIDIA_GEFORCE_8300GS = 0x0423 , CARD_NVIDIA_GEFORCE_8400GS = 0x0404 , CARD_NVIDIA_GEFORCE_8500GT = 0x0421 , CARD_NVIDIA_GEFORCE_8600GT = 0x0402 ,
  CARD_NVIDIA_GEFORCE_8600MGT = 0x0407 , CARD_NVIDIA_GEFORCE_8800GTS = 0x0193 , CARD_NVIDIA_GEFORCE_8800GTX = 0x0191 , CARD_NVIDIA_GEFORCE_9200 = 0x086d ,
  CARD_NVIDIA_GEFORCE_9300 = 0x086c , CARD_NVIDIA_GEFORCE_9400M = 0x0863 , CARD_NVIDIA_GEFORCE_9400GT = 0x042c , CARD_NVIDIA_GEFORCE_9500GT = 0x0640 ,
  CARD_NVIDIA_GEFORCE_9600GT = 0x0622 , CARD_NVIDIA_GEFORCE_9700MGT = 0x064a , CARD_NVIDIA_GEFORCE_9800GT = 0x0614 , CARD_NVIDIA_GEFORCE_210 = 0x0a23 ,
  CARD_NVIDIA_GEFORCE_GT220 = 0x0a20 , CARD_NVIDIA_GEFORCE_GT240 = 0x0ca3 , CARD_NVIDIA_GEFORCE_GTS250 = 0x0615 , CARD_NVIDIA_GEFORCE_GTX260 = 0x05e2 ,
  CARD_NVIDIA_GEFORCE_GTX275 = 0x05e6 , CARD_NVIDIA_GEFORCE_GTX280 = 0x05e1 , CARD_NVIDIA_GEFORCE_315M = 0x0a7a , CARD_NVIDIA_GEFORCE_320M = 0x08a3 ,
  CARD_NVIDIA_GEFORCE_GT320M = 0x0a2d , CARD_NVIDIA_GEFORCE_GT325M = 0x0a35 , CARD_NVIDIA_GEFORCE_GT330 = 0x0ca0 , CARD_NVIDIA_GEFORCE_GTS350M = 0x0cb0 ,
  CARD_NVIDIA_GEFORCE_410M = 0x1055 , CARD_NVIDIA_GEFORCE_GT420 = 0x0de2 , CARD_NVIDIA_GEFORCE_GT425M = 0x0df0 , CARD_NVIDIA_GEFORCE_GT430 = 0x0de1 ,
  CARD_NVIDIA_GEFORCE_GT440 = 0x0de0 , CARD_NVIDIA_GEFORCE_GTS450 = 0x0dc4 , CARD_NVIDIA_GEFORCE_GTX460 = 0x0e22 , CARD_NVIDIA_GEFORCE_GTX460M = 0x0dd1 ,
  CARD_NVIDIA_GEFORCE_GTX465 = 0x06c4 , CARD_NVIDIA_GEFORCE_GTX470 = 0x06cd , CARD_NVIDIA_GEFORCE_GTX480 = 0x06c0 , CARD_NVIDIA_GEFORCE_GT520 = 0x1040 ,
  CARD_NVIDIA_GEFORCE_GT525M = 0x0dec , CARD_NVIDIA_GEFORCE_GT540M = 0x0df4 , CARD_NVIDIA_GEFORCE_GTX550 = 0x1244 , CARD_NVIDIA_GEFORCE_GT555M = 0x04b8 ,
  CARD_NVIDIA_GEFORCE_GTX560TI = 0x1200 , CARD_NVIDIA_GEFORCE_GTX560M = 0x1251 , CARD_NVIDIA_GEFORCE_GTX560 = 0x1201 , CARD_NVIDIA_GEFORCE_GTX570 = 0x1081 ,
  CARD_NVIDIA_GEFORCE_GTX580 = 0x1080 , CARD_NVIDIA_GEFORCE_GT610 = 0x104a , CARD_NVIDIA_GEFORCE_GT630 = 0x0f00 , CARD_NVIDIA_GEFORCE_GT630M = 0x0de9 ,
  CARD_NVIDIA_GEFORCE_GT640 = 0x0fc1 , CARD_NVIDIA_GEFORCE_GT640M = 0x0fd2 , CARD_NVIDIA_GEFORCE_GT650M = 0x0fd1 , CARD_NVIDIA_GEFORCE_GTX650 = 0x0fc6 ,
  CARD_NVIDIA_GEFORCE_GTX650TI = 0x11c6 , CARD_NVIDIA_GEFORCE_GTX660 = 0x11c0 , CARD_NVIDIA_GEFORCE_GTX660M = 0x0fd4 , CARD_NVIDIA_GEFORCE_GTX660TI = 0x1183 ,
  CARD_NVIDIA_GEFORCE_GTX670 = 0x1189 , CARD_NVIDIA_GEFORCE_GTX670MX = 0x11a1 , CARD_NVIDIA_GEFORCE_GTX675MX_1 = 0x11a7 , CARD_NVIDIA_GEFORCE_GTX675MX_2 = 0x11a2 ,
  CARD_NVIDIA_GEFORCE_GTX680 = 0x1180 , CARD_NVIDIA_GEFORCE_GTX690 = 0x1188 , CARD_NVIDIA_GEFORCE_GT720 = 0x128b , CARD_NVIDIA_GEFORCE_GT730 = 0x1287 ,
  CARD_NVIDIA_GEFORCE_GT730M = 0x0fe1 , CARD_NVIDIA_GEFORCE_GT740M = 0x1292 , CARD_NVIDIA_GEFORCE_GT750M = 0x0fe9 , CARD_NVIDIA_GEFORCE_GT755M = 0x0fcd ,
  CARD_NVIDIA_GEFORCE_GTX750 = 0x1381 , CARD_NVIDIA_GEFORCE_GTX750TI = 0x1380 , CARD_NVIDIA_GEFORCE_GTX760 = 0x1187 , CARD_NVIDIA_GEFORCE_GTX760TI = 0x1193 ,
  CARD_NVIDIA_GEFORCE_GTX765M = 0x11e2 , CARD_NVIDIA_GEFORCE_GTX770M = 0x11e0 , CARD_NVIDIA_GEFORCE_GTX770 = 0x1184 , CARD_NVIDIA_GEFORCE_GTX775M = 0x119d ,
  CARD_NVIDIA_GEFORCE_GTX780 = 0x1004 , CARD_NVIDIA_GEFORCE_GTX780M = 0x119e , CARD_NVIDIA_GEFORCE_GTX780TI = 0x100a , CARD_NVIDIA_GEFORCE_GTXTITAN = 0x1005 ,
  CARD_NVIDIA_GEFORCE_GTXTITANB = 0x100c , CARD_NVIDIA_GEFORCE_GTXTITANX = 0x17c2 , CARD_NVIDIA_GEFORCE_GTXTITANZ = 0x1001 , CARD_NVIDIA_GEFORCE_820M = 0x0fed ,
  CARD_NVIDIA_GEFORCE_830M = 0x1340 , CARD_NVIDIA_GEFORCE_840M = 0x1341 , CARD_NVIDIA_GEFORCE_845M = 0x1344 , CARD_NVIDIA_GEFORCE_GTX850M = 0x1391 ,
  CARD_NVIDIA_GEFORCE_GTX860M = 0x1392 , CARD_NVIDIA_GEFORCE_GTX870M = 0x1199 , CARD_NVIDIA_GEFORCE_GTX880M = 0x1198 , CARD_NVIDIA_GEFORCE_940M = 0x1347 ,
  CARD_NVIDIA_GEFORCE_GTX950 = 0x1402 , CARD_NVIDIA_GEFORCE_GTX950M = 0x139a , CARD_NVIDIA_GEFORCE_GTX960 = 0x1401 , CARD_NVIDIA_GEFORCE_GTX960M = 0x139b ,
  CARD_NVIDIA_GEFORCE_GTX970 = 0x13c2 , CARD_NVIDIA_GEFORCE_GTX970M = 0x13d8 , CARD_NVIDIA_GEFORCE_GTX980 = 0x13c0 , CARD_NVIDIA_GEFORCE_GTX980TI = 0x17c8 ,
  CARD_NVIDIA_GEFORCE_GT1030 = 0x1d01 , CARD_NVIDIA_GEFORCE_GTX1050 = 0x1c81 , CARD_NVIDIA_GEFORCE_GTX1050TI = 0x1c82 , CARD_NVIDIA_GEFORCE_GTX1060_3GB = 0x1c02 ,
  CARD_NVIDIA_GEFORCE_GTX1060 = 0x1c03 , CARD_NVIDIA_GEFORCE_GTX1060M = 0x1c20 , CARD_NVIDIA_GEFORCE_GTX1070 = 0x1b81 , CARD_NVIDIA_GEFORCE_GTX1070M = 0x1be1 ,
  CARD_NVIDIA_GEFORCE_GTX1080 = 0x1b80 , CARD_NVIDIA_GEFORCE_GTX1080M = 0x1be0 , CARD_NVIDIA_GEFORCE_GTX1080TI = 0x1b06 , CARD_NVIDIA_TITANX_PASCAL = 0x1b00 ,
  CARD_NVIDIA_TITANV = 0x1d81 , CARD_NVIDIA_GEFORCE_GTX1650 = 0x1f82 , CARD_NVIDIA_GEFORCE_GTX1650SUPER = 0x2187 , CARD_NVIDIA_GEFORCE_GTX1660SUPER = 0x21c4 ,
  CARD_NVIDIA_GEFORCE_GTX1660TI = 0x2182 , CARD_NVIDIA_GEFORCE_RTX2060 = 0x1f08 , CARD_NVIDIA_GEFORCE_RTX2070 = 0x1f07 , CARD_NVIDIA_GEFORCE_RTX2080 = 0x1e87 ,
  CARD_NVIDIA_GEFORCE_RTX2080TI = 0x1e07 , CARD_NVIDIA_GEFORCE_RTX3050 = 0x2507 , CARD_NVIDIA_GEFORCE_RTX3060 = 0x2544 , CARD_NVIDIA_GEFORCE_RTX3060_LHR = 0x2504 ,
  CARD_NVIDIA_GEFORCE_RTX3060TI_GA103 = 0x2414 , CARD_NVIDIA_GEFORCE_RTX3060TI_GA104 = 0x2486 , CARD_NVIDIA_GEFORCE_RTX3060TI_GA104_LHR = 0x2489 , CARD_NVIDIA_GEFORCE_RTX3070 = 0x2484 ,
  CARD_NVIDIA_GEFORCE_RTX3070_LHR = 0x2488 , CARD_NVIDIA_GEFORCE_RTX3070_MOBILE = 0x249d , CARD_NVIDIA_GEFORCE_RTX3070TI = 0x2482 , CARD_NVIDIA_GEFORCE_RTX3080_10GB = 0x2206 ,
  CARD_NVIDIA_GEFORCE_RTX3080_10GB_LHR = 0x2216 , CARD_NVIDIA_GEFORCE_RTX3080_12GB = 0x220a , CARD_NVIDIA_GEFORCE_RTX3080TI = 0x2208 , CARD_NVIDIA_GEFORCE_RTX3090 = 0x2204 ,
  CARD_NVIDIA_GEFORCE_RTX3090TI = 0x2203 , CARD_NVIDIA_TESLA_T4 = 0x1eb8 , CARD_NVIDIA_AMPERE_A10 = 0x2236 , CARD_NVIDIA_GEFORCE_RTX4060 = 0x2882 ,
  CARD_NVIDIA_GEFORCE_RTX4060TI8G = 0x2803 , CARD_NVIDIA_GEFORCE_RTX4060TI16G = 0x2805 , CARD_NVIDIA_GEFORCE_RTX4070 = 0x2786 , CARD_NVIDIA_GEFORCE_RTX4070SUPER = 0x2783 ,
  CARD_NVIDIA_GEFORCE_RTX4070TI = 0x2782 , CARD_NVIDIA_GEFORCE_RTX4070TISUPER = 0x2705 , CARD_NVIDIA_GEFORCE_RTX4080 = 0x2704 , CARD_NVIDIA_GEFORCE_RTX4080SUPER = 0x2702 ,
  CARD_NVIDIA_GEFORCE_RTX4090 = 0x2684 , CARD_REDHAT_VIRGL = 0x1010 , CARD_VMWARE_SVGA3D = 0x0405 , CARD_INTEL_830M = 0x3577 ,
  CARD_INTEL_855GM = 0x3582 , CARD_INTEL_845G = 0x2562 , CARD_INTEL_865G = 0x2572 , CARD_INTEL_915G = 0x2582 ,
  CARD_INTEL_E7221G = 0x258a , CARD_INTEL_915GM = 0x2592 , CARD_INTEL_945G = 0x2772 , CARD_INTEL_945GM = 0x27a2 ,
  CARD_INTEL_945GME = 0x27ae , CARD_INTEL_Q35 = 0x29b2 , CARD_INTEL_G33 = 0x29c2 , CARD_INTEL_Q33 = 0x29d2 ,
  CARD_INTEL_PNVG = 0xa001 , CARD_INTEL_PNVM = 0xa011 , CARD_INTEL_965Q = 0x2992 , CARD_INTEL_965G = 0x2982 ,
  CARD_INTEL_946GZ = 0x2972 , CARD_INTEL_965GM = 0x2a02 , CARD_INTEL_965GME = 0x2a12 , CARD_INTEL_GM45 = 0x2a42 ,
  CARD_INTEL_IGD = 0x2e02 , CARD_INTEL_Q45 = 0x2e12 , CARD_INTEL_G45 = 0x2e22 , CARD_INTEL_G41 = 0x2e32 ,
  CARD_INTEL_B43 = 0x2e92 , CARD_INTEL_ILKD = 0x0042 , CARD_INTEL_ILKM = 0x0046 , CARD_INTEL_SNBD = 0x0122 ,
  CARD_INTEL_SNBM = 0x0126 , CARD_INTEL_SNBS = 0x010a , CARD_INTEL_IVBD = 0x0162 , CARD_INTEL_IVBM = 0x0166 ,
  CARD_INTEL_IVBS = 0x015a , CARD_INTEL_HWD = 0x0412 , CARD_INTEL_HWM = 0x0416 , CARD_INTEL_HD5000_1 = 0x0a26 ,
  CARD_INTEL_HD5000_2 = 0x0422 , CARD_INTEL_I5100_1 = 0x0a22 , CARD_INTEL_I5100_2 = 0x0a2a , CARD_INTEL_I5100_3 = 0x0a2b ,
  CARD_INTEL_I5100_4 = 0x0a2e , CARD_INTEL_IP5200_1 = 0x0d22 , CARD_INTEL_IP5200_2 = 0x0d26 , CARD_INTEL_IP5200_3 = 0x0d2a ,
  CARD_INTEL_IP5200_4 = 0x0d2b , CARD_INTEL_IP5200_5 = 0x0d2e , CARD_INTEL_IP5200_6 = 0x0c22 , CARD_INTEL_HD5300 = 0x161e ,
  CARD_INTEL_HD5500 = 0x1616 , CARD_INTEL_HD5600 = 0x1612 , CARD_INTEL_HD6000 = 0x1626 , CARD_INTEL_I6100 = 0x162b ,
  CARD_INTEL_IP6200 = 0x1622 , CARD_INTEL_IPP6300 = 0x162a , CARD_INTEL_HD510_1 = 0x1902 , CARD_INTEL_HD510_2 = 0x1906 ,
  CARD_INTEL_HD510_3 = 0x190b , CARD_INTEL_HD515 = 0x191e , CARD_INTEL_HD520_1 = 0x1916 , CARD_INTEL_HD520_2 = 0x1921 ,
  CARD_INTEL_HD530_1 = 0x1912 , CARD_INTEL_HD530_2 = 0x191b , CARD_INTEL_HDP530 = 0x191d , CARD_INTEL_I540 = 0x1926 ,
  CARD_INTEL_I550 = 0x1927 , CARD_INTEL_I555 = 0x192b , CARD_INTEL_IP555 = 0x192d , CARD_INTEL_IP580_1 = 0x1932 ,
  CARD_INTEL_IP580_2 = 0x193b , CARD_INTEL_IPP580_1 = 0x193a , CARD_INTEL_IPP580_2 = 0x193d , CARD_INTEL_UHD617 = 0x87c0 ,
  CARD_INTEL_UHD620 = 0x3ea0 , CARD_INTEL_HD615 = 0x591e , CARD_INTEL_HD620 = 0x5916 , CARD_INTEL_HD630_1 = 0x5912 ,
  CARD_INTEL_HD630_2 = 0x591b , CARD_INTEL_UHD630_1 = 0x3e9b , CARD_INTEL_UHD630_2 = 0x3e91
}
 
enum  wined3d_display_driver {
  DRIVER_AMD_RAGE_128PRO , DRIVER_AMD_R100 , DRIVER_AMD_R300 , DRIVER_AMD_R600 ,
  DRIVER_AMD_RX , DRIVER_INTEL_GMA800 , DRIVER_INTEL_GMA900 , DRIVER_INTEL_GMA950 ,
  DRIVER_INTEL_GMA3000 , DRIVER_INTEL_HD4000 , DRIVER_NVIDIA_TNT , DRIVER_NVIDIA_GEFORCE2MX ,
  DRIVER_NVIDIA_GEFORCEFX , DRIVER_NVIDIA_GEFORCE6 , DRIVER_NVIDIA_GEFORCE8 , DRIVER_NVIDIA_FERMI ,
  DRIVER_NVIDIA_KEPLER , DRIVER_REDHAT_VIRGL , DRIVER_VMWARE , DRIVER_WINE ,
  DRIVER_UNKNOWN
}
 
enum  wined3d_projection_type { WINED3D_PROJECTION_NONE = 0 , WINED3D_PROJECTION_COUNT3 = 1 , WINED3D_PROJECTION_COUNT4 = 2 }
 
enum  wined3d_ffp_vs_fog_mode { WINED3D_FFP_VS_FOG_OFF = 0 , WINED3D_FFP_VS_FOG_FOGCOORD = 1 , WINED3D_FFP_VS_FOG_DEPTH = 2 , WINED3D_FFP_VS_FOG_RANGE = 3 }
 
enum  wined3d_push_constants {
  WINED3D_PUSH_CONSTANTS_VS_F , WINED3D_PUSH_CONSTANTS_PS_F , WINED3D_PUSH_CONSTANTS_VS_I , WINED3D_PUSH_CONSTANTS_PS_I ,
  WINED3D_PUSH_CONSTANTS_VS_B , WINED3D_PUSH_CONSTANTS_PS_B , WINED3D_PUSH_CONSTANTS_VS_FFP , WINED3D_PUSH_CONSTANTS_PS_FFP ,
  WINED3D_PUSH_CONSTANTS_COUNT
}
 
enum  wined3d_cs_queue_id { WINED3D_CS_QUEUE_DEFAULT = 0 , WINED3D_CS_QUEUE_MAP , WINED3D_CS_QUEUE_COUNT }
 
enum  wined3d_channel_type {
  WINED3D_CHANNEL_TYPE_NONE , WINED3D_CHANNEL_TYPE_UNORM , WINED3D_CHANNEL_TYPE_SNORM , WINED3D_CHANNEL_TYPE_UINT ,
  WINED3D_CHANNEL_TYPE_SINT , WINED3D_CHANNEL_TYPE_FLOAT , WINED3D_CHANNEL_TYPE_DEPTH , WINED3D_CHANNEL_TYPE_STENCIL ,
  WINED3D_CHANNEL_TYPE_UNUSED
}
 

Functions

static size_t align (size_t addr, size_t alignment)
 
static uint32_t float_to_int (float f)
 
static float int_to_float (uint32_t i)
 
static const char * wined3d_get_line (const char **ptr, const char *end)
 
static struct color_fixup_desc create_complex_fixup_desc (enum complex_fixup complex_fixup)
 
static BOOL is_identity_fixup (struct color_fixup_desc fixup)
 
static BOOL is_complex_fixup (struct color_fixup_desc fixup)
 
static BOOL is_scaling_fixup (struct color_fixup_desc fixup)
 
static BOOL is_same_fixup (struct color_fixup_desc f1, struct color_fixup_desc f2)
 
static enum complex_fixup get_complex_fixup (struct color_fixup_desc fixup)
 
static enum wined3d_cmp_func wined3d_sanitize_cmp_func (enum wined3d_cmp_func func)
 
static float float_16_to_32 (const unsigned short *in)
 
static float float_24_to_32 (DWORD in)
 
static unsigned short float_32_to_16 (const float *in)
 
static unsigned int wined3d_popcount (unsigned int x)
 
static int wined3d_uint32_compare (uint32_t x, uint32_t y)
 
static int wined3d_uint64_compare (uint64_t x, uint64_t y)
 
static BOOL wined3d_shader_instruction_has_texel_offset (const struct wined3d_shader_instruction *ins)
 
HRESULT wined3d_shader_extract_from_dxbc (struct wined3d_shader *shader, unsigned int max_shader_version, enum vkd3d_shader_source_type *source_type)
 
BOOL shader_get_stream_output_register_info (const struct wined3d_shader *shader, const struct wined3d_stream_output_element *so_element, unsigned int *register_idx, unsigned int *component_idx)
 
const struct wined3d_shader_backend_ops * wined3d_spirv_shader_backend_init_vk (void)
 
static void wined3d_color_from_d3dcolor (struct wined3d_color *wined3d_color, DWORD d3d_color)
 
static float wined3d_srgb_from_linear (float colour)
 
static void wined3d_colour_srgb_from_linear (struct wined3d_color *colour_srgb, const struct wined3d_color *colour)
 
static struct wined3d_const_bo_address * wined3d_const_bo_address (const struct wined3d_bo_address *data)
 
void wined3d_stream_info_from_declaration (struct wined3d_stream_info *stream_info, const struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info)
 
void draw_primitive (struct wined3d_device *device, const struct wined3d_state *state, const struct wined3d_draw_parameters *draw_parameters)
 
void dispatch_compute (struct wined3d_device *device, const struct wined3d_state *state, const struct wined3d_dispatch_parameters *dispatch_parameters)
 
void wined3d_context_cleanup (struct wined3d_context *context)
 
void wined3d_context_init (struct wined3d_context *context, struct wined3d_swapchain *swapchain)
 
void context_update_stream_info (struct wined3d_context *context, const struct wined3d_state *state)
 
HRESULT wined3d_context_no3d_init (struct wined3d_context *context_no3d, struct wined3d_swapchain *swapchain)
 
const struct wined3d_fragment_pipe_ops * wined3d_spirv_fragment_pipe_init_vk (void)
 
const struct wined3d_vertex_pipe_ops * wined3d_spirv_vertex_pipe_init_vk (void)
 
HRESULT compile_state_table (struct wined3d_state_entry *state_table, APPLYSTATEFUNC **dev_multistate_funcs, const struct wined3d_d3d_info *d3d_info, const BOOL *supported_extensions, const struct wined3d_vertex_pipe_ops *vertex, const struct wined3d_fragment_pipe_ops *fragment, const struct wined3d_state_entry_template *misc)
 
struct wined3d_blitter * wined3d_cpu_blitter_create (void)
 
void wined3d_vk_blitter_create (struct wined3d_blitter **next)
 
void cpu_blitter_clear_texture (struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_box *box, const struct wined3d_color *colour)
 
BOOL wined3d_clip_blit (const RECT *clip_rect, RECT *clipped, RECT *other)
 
void context_invalidate_compute_state (struct wined3d_context *context, DWORD state_id)
 
void context_invalidate_state (struct wined3d_context *context, unsigned int state_id)
 
void context_resource_released (const struct wined3d_device *device, struct wined3d_resource *resource)
 
void context_restore (struct wined3d_context *context, struct wined3d_texture *texture, unsigned int sub_resource_idx)
 
void context_set_tls_idx (DWORD idx)
 
void context_state_drawbuf (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void context_state_fb (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
const struct wined3d_gpu_description * wined3d_get_gpu_description (enum wined3d_pci_vendor vendor, enum wined3d_pci_device device)
 
const struct wined3d_gpu_description * wined3d_get_user_override_gpu_description (enum wined3d_pci_vendor vendor, enum wined3d_pci_device device)
 
enum wined3d_pci_device wined3d_gpu_from_feature_level (enum wined3d_pci_vendor *vendor, enum wined3d_feature_level feature_level)
 
bool wined3d_driver_info_init (struct wined3d_driver_info *driver_info, const struct wined3d_gpu_description *gpu_description, enum wined3d_feature_level feature_level, UINT64 vram_bytes, UINT64 sysmem_bytes)
 
HRESULT wined3d_output_get_gamma_ramp (struct wined3d_output *output, struct wined3d_gamma_ramp *ramp)
 
BOOL wined3d_adapter_init (struct wined3d_adapter *adapter, unsigned int ordinal, const LUID *luid, const struct wined3d_adapter_ops *adapter_ops)
 
void wined3d_adapter_cleanup (struct wined3d_adapter *adapter)
 
BOOL wined3d_get_primary_adapter_luid (LUID *luid)
 
struct wined3d_adapter * wined3d_adapter_vk_create (unsigned int ordinal, unsigned int wined3d_creation_flags)
 
struct wined3d_adapter * wined3d_adapter_gl_create (unsigned int ordinal, unsigned int wined3d_creation_flags)
 
BOOL wined3d_adapter_no3d_init_format_info (struct wined3d_adapter *adapter)
 
ssize_t adapter_adjust_mapped_memory (struct wined3d_adapter *adapter, ssize_t size)
 
UINT64 adapter_adjust_memory (struct wined3d_adapter *adapter, INT64 amount)
 
int wined3d_ffp_frag_program_key_compare (const void *key, const struct wine_rb_entry *entry)
 
int wined3d_ffp_vertex_program_key_compare (const void *key, const struct wine_rb_entry *entry)
 
void wined3d_ffp_get_fs_settings (const struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info, struct ffp_frag_settings *settings)
 
const struct ffp_frag_desc * find_ffp_frag_shader (const struct wine_rb_tree *fragment_shaders, const struct ffp_frag_settings *settings)
 
void add_ffp_frag_shader (struct wine_rb_tree *shaders, struct ffp_frag_desc *desc)
 
void wined3d_ftoa (float value, char *s)
 
void wined3d_ffp_get_vs_settings (const struct wined3d_state *state, const struct wined3d_stream_info *si, const struct wined3d_d3d_info *d3d_info, struct wined3d_ffp_vs_settings *settings)
 
BOOL wined3d_filter_messages (HWND window, BOOL filter)
 
HRESULT wined3d_init (struct wined3d *wined3d, uint32_t flags)
 
void wined3d_unregister_window (HWND window)
 
BOOL wined3d_get_app_name (char *app_name, unsigned int app_name_size)
 
static unsigned int wined3d_blend_state_get_writemask (const struct wined3d_blend_state *state, unsigned int index)
 
void state_cleanup (struct wined3d_state *state)
 
void state_init (struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info, uint32_t flags, enum wined3d_feature_level feature_level)
 
void state_unbind_resources (struct wined3d_state *state)
 
static void wined3d_state_reset (struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info)
 
static bool wined3d_state_uses_depth_buffer (const struct wined3d_state *state)
 
void wined3d_device_cleanup (struct wined3d_device *device)
 
BOOL device_context_add (struct wined3d_device *device, struct wined3d_context *context)
 
void device_context_remove (struct wined3d_device *device, struct wined3d_context *context)
 
void wined3d_device_create_default_samplers (struct wined3d_device *device, struct wined3d_context *context)
 
void wined3d_device_destroy_default_samplers (struct wined3d_device *device)
 
HRESULT wined3d_device_init (struct wined3d_device *device, struct wined3d *wined3d, unsigned int adapter_idx, enum wined3d_device_type device_type, HWND focus_window, unsigned int flags, BYTE surface_alignment, const enum wined3d_feature_level *levels, unsigned int level_count, const BOOL *supported_extensions, struct wined3d_device_parent *device_parent)
 
LRESULT device_process_message (struct wined3d_device *device, HWND window, BOOL unicode, UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc)
 
void device_resource_add (struct wined3d_device *device, struct wined3d_resource *resource)
 
void device_resource_released (struct wined3d_device *device, struct wined3d_resource *resource)
 
void device_invalidate_state (const struct wined3d_device *device, unsigned int state)
 
HRESULT wined3d_device_set_implicit_swapchain (struct wined3d_device *device, struct wined3d_swapchain *swapchain)
 
void wined3d_device_uninit_3d (struct wined3d_device *device)
 
static void wined3d_device_bo_map_lock (struct wined3d_device *device)
 
static void wined3d_device_bo_map_unlock (struct wined3d_device *device)
 
static struct wined3d_device_no3d * wined3d_device_no3d (struct wined3d_device *device)
 
void wined3d_allocator_chunk_cleanup (struct wined3d_allocator_chunk *chunk)
 
bool wined3d_allocator_chunk_init (struct wined3d_allocator_chunk *chunk, struct wined3d_allocator *allocator)
 
void wined3d_allocator_block_free (struct wined3d_allocator_block *block)
 
struct wined3d_allocator_block * wined3d_allocator_allocate (struct wined3d_allocator *allocator, struct wined3d_context *context, unsigned int memory_type, size_t size)
 
void wined3d_allocator_cleanup (struct wined3d_allocator *allocator)
 
bool wined3d_allocator_init (struct wined3d_allocator *allocator, size_t pool_count, const struct wined3d_allocator_ops *allocator_ops)
 
const char * wined3d_debug_resource_access (uint32_t access)
 
const char * wined3d_debug_bind_flags (uint32_t bind_flags)
 
const char * wined3d_debug_view_desc (const struct wined3d_view_desc *d, const struct wined3d_resource *resource)
 
static ULONG wined3d_atomic_decrement_mutex_lock (volatile LONG *refcount)
 
static BOOL wined3d_resource_access_is_managed (unsigned int access)
 
static ULONG wined3d_resource_incref (struct wined3d_resource *resource)
 
static ULONG wined3d_resource_decref (struct wined3d_resource *resource)
 
static HRESULT wined3d_resource_get_sub_resource_desc (struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_sub_resource_desc *desc)
 
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)
 
void resource_cleanup (struct wined3d_resource *resource)
 
HRESULT resource_init (struct wined3d_resource *resource, struct wined3d_device *device, enum wined3d_resource_type type, const struct wined3d_format *format, enum wined3d_multisample_type multisample_type, unsigned int multisample_quality, unsigned int usage, unsigned int 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)
 
void * resource_offset_map_pointer (struct wined3d_resource *resource, unsigned int sub_resource_idx, uint8_t *base_memory, const struct wined3d_box *box)
 
void resource_unload (struct wined3d_resource *resource)
 
HRESULT wined3d_resource_check_box_dimensions (struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box)
 
void wined3d_resource_free_sysmem (struct wined3d_resource *resource)
 
const struct wined3d_format * wined3d_resource_get_decompress_format (const struct wined3d_resource *resource)
 
unsigned int wined3d_resource_get_sample_count (const struct wined3d_resource *resource)
 
BOOL wined3d_resource_is_offscreen (struct wined3d_resource *resource)
 
BOOL wined3d_resource_prepare_sysmem (struct wined3d_resource *resource)
 
void wined3d_resource_update_draw_binding (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)
 
const char * wined3d_debug_location (uint32_t location)
 
static void * wined3d_texture_allocate_object_memory (SIZE_T s, SIZE_T level_count, SIZE_T layer_count)
 
static struct wined3d_texture * texture_from_resource (struct wined3d_resource *resource)
 
static unsigned int wined3d_texture_get_level_width (const struct wined3d_texture *texture, unsigned int level)
 
static unsigned int wined3d_texture_get_level_height (const struct wined3d_texture *texture, unsigned int level)
 
static unsigned int wined3d_texture_get_level_depth (const struct wined3d_texture *texture, unsigned int level)
 
static void wined3d_texture_get_level_box (const struct wined3d_texture *texture, unsigned int level, struct wined3d_box *box)
 
static bool wined3d_texture_is_full_rect (const struct wined3d_texture *texture, unsigned int level, const RECT *r)
 
HRESULT texture2d_blt (struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const struct wined3d_box *dst_box, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, uint32_t flags, const struct wined3d_blt_fx *blt_fx, enum wined3d_texture_filter_type filter)
 
void wined3d_texture_cleanup (struct wined3d_texture *texture)
 
void wined3d_texture_download_from_texture (struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx)
 
void wined3d_texture_get_bo_address (const struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_bo_address *data, uint32_t location)
 
void wined3d_texture_invalidate_location (struct wined3d_texture *texture, unsigned int sub_resource_idx, uint32_t location)
 
void wined3d_texture_load (struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
 
BOOL wined3d_texture_load_location (struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, uint32_t location)
 
BOOL wined3d_texture_prepare_location (struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, uint32_t location)
 
void wined3d_texture_set_swapchain (struct wined3d_texture *texture, struct wined3d_swapchain *swapchain)
 
BOOL wined3d_texture_can_use_pbo (const struct wined3d_texture *texture, const struct wined3d_d3d_info *d3d_info)
 
void wined3d_texture_sub_resources_destroyed (struct wined3d_texture *texture)
 
void wined3d_texture_translate_drawable_coords (const struct wined3d_texture *texture, HWND window, RECT *rect)
 
void wined3d_texture_update_sub_resource (struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, const struct upload_bo *upload_bo, const struct wined3d_box *box, unsigned int row_pitch, unsigned int slice_pitch)
 
void wined3d_texture_upload_from_texture (struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box)
 
void wined3d_texture_validate_location (struct wined3d_texture *texture, unsigned int sub_resource_idx, uint32_t location)
 
bool wined3d_texture_validate_sub_resource_idx (const struct wined3d_texture *texture, unsigned int sub_resource_idx)
 
void wined3d_texture_clear_dirty_regions (struct wined3d_texture *texture)
 
HRESULT wined3d_texture_no3d_init (struct wined3d_texture *texture_no3d, struct wined3d_device *device, const struct wined3d_resource_desc *desc, unsigned int layer_count, unsigned int level_count, uint32_t flags, void *parent, const struct wined3d_parent_ops *parent_ops)
 
bool wined3d_light_state_enable_light (struct wined3d_light_state *state, const struct wined3d_d3d_info *d3d_info, struct wined3d_light_info *light_info, BOOL enable)
 
struct wined3d_light_info * wined3d_light_state_get_light (const struct wined3d_light_state *state, unsigned int idx)
 
 C_ASSERT (!(WINED3D_CS_QUEUE_SIZE &(WINED3D_CS_QUEUE_SIZE - 1)))
 
static void wined3d_device_context_lock (struct wined3d_device_context *context)
 
static void wined3d_device_context_unlock (struct wined3d_device_context *context)
 
struct wined3d_cs * wined3d_cs_create (struct wined3d_device *device, const enum wined3d_feature_level *levels, unsigned int level_count)
 
void wined3d_cs_destroy (struct wined3d_cs *cs)
 
void wined3d_cs_destroy_object (struct wined3d_cs *cs, void(*callback)(void *object), void *object)
 
void wined3d_cs_emit_add_dirty_texture_region (struct wined3d_cs *cs, struct wined3d_texture *texture, unsigned int layer)
 
void wined3d_cs_emit_clear (struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, uint32_t flags, const struct wined3d_color *color, float depth, DWORD stencil)
 
void wined3d_device_context_emit_clear_uav (struct wined3d_device_context *context, struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value, bool fp)
 
void wined3d_cs_emit_preload_resource (struct wined3d_cs *cs, struct wined3d_resource *resource)
 
void wined3d_cs_emit_present (struct wined3d_cs *cs, struct wined3d_swapchain *swapchain, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, unsigned int swap_interval, uint32_t flags)
 
void wined3d_cs_emit_set_color_key (struct wined3d_cs *cs, struct wined3d_texture *texture, WORD flags, const struct wined3d_color_key *color_key)
 
void wined3d_cs_emit_set_render_state (struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value)
 
void wined3d_cs_emit_unload_resource (struct wined3d_cs *cs, struct wined3d_resource *resource)
 
void wined3d_cs_init_object (struct wined3d_cs *cs, void(*callback)(void *object), void *object)
 
void wined3d_cs_map_bo_address (struct wined3d_cs *cs, struct wined3d_bo_address *addr, size_t size, unsigned int flags)
 
void wined3d_device_context_set_depth_bounds (struct wined3d_device_context *context, bool enable, float min_depth, float max_depth)
 
static void wined3d_cs_finish (struct wined3d_cs *cs, enum wined3d_cs_queue_id queue_id)
 
void wined3d_device_context_emit_blt_sub_resource (struct wined3d_device_context *context, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, const struct wined3d_box *dst_box, struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, unsigned int flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
 
void wined3d_device_context_emit_clear_rendertarget_view (struct wined3d_device_context *context, struct wined3d_rendertarget_view *view, const RECT *rect, unsigned int flags, const struct wined3d_color *color, float depth, unsigned int stencil)
 
void wined3d_device_context_emit_copy_uav_counter (struct wined3d_device_context *context, struct wined3d_buffer *dst_buffer, unsigned int offset, struct wined3d_unordered_access_view *uav)
 
void wined3d_device_context_emit_draw (struct wined3d_device_context *context, enum wined3d_primitive_type primitive_type, unsigned int patch_vertex_count, int base_vertex_idx, unsigned int start_idx, unsigned int index_count, unsigned int start_instance, unsigned int instance_count, bool indexed)
 
void wined3d_device_context_emit_execute_command_list (struct wined3d_device_context *context, struct wined3d_command_list *list, bool restore_state)
 
void wined3d_device_context_emit_generate_mipmaps (struct wined3d_device_context *context, struct wined3d_shader_resource_view *view)
 
HRESULT wined3d_device_context_emit_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)
 
void wined3d_device_context_emit_reset_state (struct wined3d_device_context *context, bool invalidate)
 
void wined3d_device_context_emit_set_blend_state (struct wined3d_device_context *context, struct wined3d_blend_state *state, const struct wined3d_color *blend_factor, unsigned int sample_mask)
 
void wined3d_device_context_emit_set_clip_plane (struct wined3d_device_context *context, unsigned int plane_idx, const struct wined3d_vec4 *plane)
 
void wined3d_device_context_emit_set_constant_buffers (struct wined3d_device_context *context, enum wined3d_shader_type type, unsigned int start_idx, unsigned int count, const struct wined3d_constant_buffer_state *buffers)
 
void wined3d_device_context_emit_set_depth_stencil_state (struct wined3d_device_context *context, struct wined3d_depth_stencil_state *state, unsigned int stencil_ref)
 
void wined3d_device_context_emit_set_depth_stencil_view (struct wined3d_device_context *context, struct wined3d_rendertarget_view *view)
 
void wined3d_device_context_emit_set_feature_level (struct wined3d_device_context *context, enum wined3d_feature_level level)
 
void wined3d_device_context_emit_set_index_buffer (struct wined3d_device_context *context, struct wined3d_buffer *buffer, enum wined3d_format_id format_id, unsigned int offset)
 
void wined3d_device_context_emit_set_light (struct wined3d_device_context *context, const struct wined3d_light_info *light)
 
void wined3d_device_context_emit_set_light_enable (struct wined3d_device_context *context, unsigned int idx, BOOL enable)
 
void wined3d_device_context_emit_set_predication (struct wined3d_device_context *context, struct wined3d_query *predicate, BOOL value)
 
void wined3d_device_context_emit_set_rasterizer_state (struct wined3d_device_context *context, struct wined3d_rasterizer_state *rasterizer_state)
 
void wined3d_device_context_emit_set_render_state (struct wined3d_device_context *context, enum wined3d_render_state state, unsigned int value)
 
void wined3d_device_context_emit_set_rendertarget_views (struct wined3d_device_context *context, unsigned int start_idx, unsigned int count, struct wined3d_rendertarget_view *const *views)
 
void wined3d_device_context_emit_set_samplers (struct wined3d_device_context *context, enum wined3d_shader_type type, unsigned int start_idx, unsigned int count, struct wined3d_sampler *const *samplers)
 
void wined3d_device_context_emit_set_scissor_rects (struct wined3d_device_context *context, unsigned int rect_count, const RECT *rects)
 
void wined3d_device_context_emit_set_shader (struct wined3d_device_context *context, enum wined3d_shader_type type, struct wined3d_shader *shader)
 
void wined3d_device_context_emit_set_shader_resource_views (struct wined3d_device_context *context, enum wined3d_shader_type type, unsigned int start_idx, unsigned int count, struct wined3d_shader_resource_view *const *views)
 
void wined3d_device_context_emit_set_stream_outputs (struct wined3d_device_context *context, const struct wined3d_stream_output outputs[WINED3D_MAX_STREAM_OUTPUT_BUFFERS])
 
void wined3d_device_context_emit_set_stream_sources (struct wined3d_device_context *context, unsigned int start_idx, unsigned int count, const struct wined3d_stream_state *streams)
 
void wined3d_device_context_emit_set_texture (struct wined3d_device_context *context, enum wined3d_shader_type shader_type, unsigned int bind_index, struct wined3d_shader_resource_view *view)
 
void wined3d_device_context_emit_set_texture_state (struct wined3d_device_context *context, unsigned int stage, enum wined3d_texture_stage_state state, unsigned int value)
 
void wined3d_device_context_emit_set_transform (struct wined3d_device_context *context, enum wined3d_transform_state state, const struct wined3d_matrix *matrix)
 
void wined3d_device_context_emit_set_unordered_access_views (struct wined3d_device_context *context, enum wined3d_pipeline pipeline, unsigned int start_idx, unsigned int count, struct wined3d_unordered_access_view *const *views, const unsigned int *initial_count)
 
void wined3d_device_context_emit_set_vertex_declaration (struct wined3d_device_context *context, struct wined3d_vertex_declaration *declaration)
 
void wined3d_device_context_emit_set_viewports (struct wined3d_device_context *context, unsigned int viewport_count, const struct wined3d_viewport *viewports)
 
void wined3d_device_context_emit_update_sub_resource (struct wined3d_device_context *context, struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, unsigned int slice_pitch)
 
HRESULT wined3d_device_context_emit_unmap (struct wined3d_device_context *context, struct wined3d_resource *resource, unsigned int sub_resource_idx)
 
void wined3d_device_context_push_constants (struct wined3d_device_context *context, enum wined3d_push_constants type, uint32_t update_mask, unsigned int start_idx, unsigned int count, const void *constants)
 
static void wined3d_resource_reference (struct wined3d_resource *resource)
 
static void wined3d_pause (unsigned int *spin_count)
 
static BOOL wined3d_ge_wrap (ULONG x, ULONG y)
 
 C_ASSERT (WINED3D_CS_QUEUE_SIZE< UINT_MAX/4)
 
static void wined3d_resource_wait_idle (const struct wined3d_resource *resource)
 
static struct wined3d_buffer * buffer_from_resource (struct wined3d_resource *resource)
 
static void wined3d_buffer_validate_user (struct wined3d_buffer *buffer)
 
void wined3d_buffer_acquire_bo_for_write (struct wined3d_buffer *buffer, struct wined3d_context *context)
 
void wined3d_buffer_cleanup (struct wined3d_buffer *buffer)
 
void wined3d_buffer_copy (struct wined3d_buffer *dst_buffer, unsigned int dst_offset, struct wined3d_buffer *src_buffer, unsigned int src_offset, unsigned int size)
 
void wined3d_buffer_copy_bo_address (struct wined3d_buffer *dst_buffer, struct wined3d_context *context, unsigned int dst_offset, const struct wined3d_const_bo_address *src_addr, unsigned int size)
 
DWORD wined3d_buffer_get_memory (struct wined3d_buffer *buffer, struct wined3d_context *context, struct wined3d_bo_address *data)
 
void wined3d_buffer_invalidate_location (struct wined3d_buffer *buffer, uint32_t location)
 
void wined3d_buffer_load (struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state)
 
BOOL wined3d_buffer_load_location (struct wined3d_buffer *buffer, struct wined3d_context *context, uint32_t location)
 
void * wined3d_buffer_load_sysmem (struct wined3d_buffer *buffer, struct wined3d_context *context)
 
BOOL wined3d_buffer_prepare_location (struct wined3d_buffer *buffer, struct wined3d_context *context, unsigned int location)
 
void wined3d_buffer_update_sub_resource (struct wined3d_buffer *buffer, struct wined3d_context *context, const struct upload_bo *upload_bo, unsigned int offset, unsigned int size)
 
void wined3d_buffer_validate_location (struct wined3d_buffer *buffer, uint32_t location)
 
HRESULT wined3d_buffer_no3d_init (struct wined3d_buffer *buffer_no3d, struct wined3d_device *device, const struct wined3d_buffer_desc *desc, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops)
 
void wined3d_rendertarget_view_cleanup (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_get_box (struct wined3d_rendertarget_view *view, struct wined3d_box *box)
 
void wined3d_rendertarget_view_invalidate_location (struct wined3d_rendertarget_view *view, uint32_t location)
 
void wined3d_rendertarget_view_load_location (struct wined3d_rendertarget_view *view, struct wined3d_context *context, uint32_t location)
 
void wined3d_rendertarget_view_prepare_location (struct wined3d_rendertarget_view *view, struct wined3d_context *context, uint32_t location)
 
void wined3d_rendertarget_view_validate_location (struct wined3d_rendertarget_view *view, uint32_t location)
 
DWORD wined3d_rendertarget_view_get_locations (const struct wined3d_rendertarget_view *view)
 
HRESULT wined3d_rendertarget_view_no3d_init (struct wined3d_rendertarget_view *view_no3d, const struct wined3d_view_desc *desc, struct wined3d_resource *resource, void *parent, const struct wined3d_parent_ops *parent_ops)
 
void wined3d_shader_resource_view_cleanup (struct wined3d_shader_resource_view *view)
 
void wined3d_shader_resource_view_destroy (struct wined3d_shader_resource_view *view)
 
static struct wined3d_texture * wined3d_state_get_ffp_texture (const struct wined3d_state *state, unsigned int idx)
 
void wined3d_unordered_access_view_cleanup (struct wined3d_unordered_access_view *view)
 
void wined3d_unordered_access_view_copy_counter (struct wined3d_unordered_access_view *view, struct wined3d_buffer *buffer, unsigned int offset, struct wined3d_context *context)
 
void wined3d_unordered_access_view_invalidate_location (struct wined3d_unordered_access_view *view, uint32_t location)
 
void wined3d_unordered_access_view_set_counter (struct wined3d_unordered_access_view *view, unsigned int value)
 
void wined3d_swapchain_state_cleanup (struct wined3d_swapchain_state *state)
 
void wined3d_swapchain_state_register (struct wined3d_swapchain_state *state)
 
void wined3d_swapchain_state_restore_from_fullscreen (struct wined3d_swapchain_state *state, HWND window, const RECT *window_rect)
 
HRESULT wined3d_swapchain_state_setup_fullscreen (struct wined3d_swapchain_state *state, HWND window, int x, int y, int width, int height)
 
void wined3d_swapchain_activate (struct wined3d_swapchain *swapchain, BOOL activate)
 
void wined3d_swapchain_cleanup (struct wined3d_swapchain *swapchain)
 
struct wined3d_output * wined3d_swapchain_get_output (const struct wined3d_swapchain *swapchain)
 
void swapchain_update_draw_bindings (struct wined3d_swapchain *swapchain)
 
void swapchain_set_max_frame_latency (struct wined3d_swapchain *swapchain, const struct wined3d_device *device)
 
HRESULT wined3d_swapchain_no3d_init (struct wined3d_swapchain *swapchain_no3d, struct wined3d_device *device, const struct wined3d_swapchain_desc *desc, struct wined3d_swapchain_state_parent *state_parent, void *parent, const struct wined3d_parent_ops *parent_ops)
 
const char * debug_bo_address (const struct wined3d_bo_address *address)
 
const char * debug_box (const struct wined3d_box *box)
 
const char * debug_color (const struct wined3d_color *color)
 
const char * debug_const_bo_address (const struct wined3d_const_bo_address *address)
 
const char * debug_d3dshaderinstructionhandler (enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx)
 
const char * debug_d3dformat (enum wined3d_format_id format_id)
 
const char * debug_d3ddevicetype (enum wined3d_device_type device_type)
 
const char * debug_d3dresourcetype (enum wined3d_resource_type resource_type)
 
const char * debug_d3dusage (uint32_t usage)
 
const char * debug_d3ddeclmethod (enum wined3d_decl_method method)
 
const char * debug_d3ddeclusage (enum wined3d_decl_usage usage)
 
const char * debug_d3dinput_classification (enum wined3d_input_classification classification)
 
const char * debug_d3dprimitivetype (enum wined3d_primitive_type primitive_type)
 
const char * debug_d3drenderstate (enum wined3d_render_state state)
 
const char * debug_d3dsamplerstate (enum wined3d_sampler_state state)
 
const char * debug_d3dstate (uint32_t state)
 
const char * debug_d3dtexturefiltertype (enum wined3d_texture_filter_type filter_type)
 
const char * debug_d3dtexturestate (enum wined3d_texture_stage_state state)
 
const char * debug_d3dtop (enum wined3d_texture_op d3dtop)
 
const char * debug_d3dtstype (enum wined3d_transform_state tstype)
 
const char * debug_ivec4 (const struct wined3d_ivec4 *v)
 
const char * debug_uvec4 (const struct wined3d_uvec4 *v)
 
const char * debug_shader_type (enum wined3d_shader_type shader_type)
 
const char * debug_vec4 (const struct wined3d_vec4 *v)
 
const char * wined3d_debug_feature_level (enum wined3d_feature_level level)
 
void dump_color_fixup_desc (struct color_fixup_desc fixup)
 
BOOL is_invalid_op (const struct wined3d_state *state, int stage, enum wined3d_texture_op op, DWORD arg1, DWORD arg2, DWORD arg3)
 
void state_nop (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void state_srgbwrite (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void state_clipping (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void clipplane (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void state_shademode (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
void multiply_matrix (struct wined3d_matrix *dest, const struct wined3d_matrix *src1, const struct wined3d_matrix *src2)
 
void wined3d_release_dc (HWND window, HDC dc)
 
static void wined3d_lock_init_ (CRITICAL_SECTION *lock, const char *name)
 
static void wined3d_lock_cleanup (CRITICAL_SECTION *lock)
 
struct wined3d_string_buffer * string_buffer_get (struct wined3d_string_buffer_list *list)
 
void string_buffer_sprintf (struct wined3d_string_buffer *buffer, const char *format,...) PRINTF_ATTR(2
 
void void string_buffer_release (struct wined3d_string_buffer_list *list, struct wined3d_string_buffer *buffer)
 
void string_buffer_list_init (struct wined3d_string_buffer_list *list)
 
void string_buffer_list_cleanup (struct wined3d_string_buffer_list *list)
 
int shader_addline (struct wined3d_string_buffer *buffer, const char *fmt,...) PRINTF_ATTR(2
 
int BOOL string_buffer_resize (struct wined3d_string_buffer *buffer, int rc)
 
int shader_vaddline (struct wined3d_string_buffer *buffer, const char *fmt, va_list args)
 
HRESULT wined3d_shader_create_ffp_vs (struct wined3d_device *device, const struct wined3d_ffp_vs_settings *settings, struct wined3d_shader **shader)
 
HRESULT wined3d_shader_create_ffp_ps (struct wined3d_device *device, const struct ffp_frag_settings *settings, struct wined3d_shader **shader)
 
enum wined3d_shader_resource_type pixelshader_get_resource_type (const struct wined3d_shader_reg_maps *reg_maps, unsigned int resource_idx, DWORD tex_types)
 
void find_ps_compile_args (const struct wined3d_state *state, const struct wined3d_shader *shader, BOOL position_transformed, struct ps_compile_args *args, const struct wined3d_context *context)
 
bool vshader_get_input (const struct wined3d_shader *shader, uint8_t usage_req, uint8_t usage_idx_req, unsigned int *regnum)
 
void find_vs_compile_args (const struct wined3d_state *state, const struct wined3d_shader *shader, struct vs_compile_args *args, const struct wined3d_context *context)
 
void find_ds_compile_args (const struct wined3d_state *state, const struct wined3d_shader *shader, struct ds_compile_args *args, const struct wined3d_context *context)
 
void find_gs_compile_args (const struct wined3d_state *state, const struct wined3d_shader *shader, struct gs_compile_args *args, const struct wined3d_context *context)
 
void string_buffer_clear (struct wined3d_string_buffer *buffer)
 
BOOL string_buffer_init (struct wined3d_string_buffer *buffer)
 
void string_buffer_free (struct wined3d_string_buffer *buffer)
 
unsigned int shader_find_free_input_register (const struct wined3d_shader_reg_maps *reg_maps, unsigned int max)
 
HRESULT shader_generate_code (const struct wined3d_shader *shader, struct wined3d_string_buffer *buffer, const struct wined3d_shader_reg_maps *reg_maps, void *backend_ctx, const DWORD *start, const DWORD *end)
 
BOOL shader_match_semantic (const char *semantic_name, enum wined3d_decl_usage usage)
 
enum vkd3d_shader_visibility vkd3d_shader_visibility_from_wined3d (enum wined3d_shader_type shader_type)
 
bool ffp_hlsl_compile_vs (const struct wined3d_ffp_vs_settings *settings, struct wined3d_shader_desc *shader_desc, struct wined3d_device *device)
 
bool ffp_hlsl_compile_ps (const struct ffp_frag_settings *settings, struct wined3d_shader_desc *shader_desc)
 
static BOOL shader_is_scalar (const struct wined3d_shader_register *reg)
 
static void shader_get_position_fixup (const struct wined3d_context *context, const struct wined3d_state *state, unsigned int fixup_count, float *position_fixup)
 
static BOOL shader_constant_is_local (const struct wined3d_shader *shader, DWORD reg)
 
static BOOL shader_sampler_is_shadow (const struct wined3d_shader *shader, const struct ps_compile_args *ps_args, unsigned int resource_idx, unsigned int sampler_idx)
 
void get_identity_matrix (struct wined3d_matrix *mat)
 
void get_modelview_matrix (const struct wined3d_stateblock_state *state, unsigned int index, struct wined3d_matrix *mat)
 
void get_texture_matrix (const struct wined3d_stateblock_state *state, const unsigned int tex, struct wined3d_matrix *mat)
 
void get_pointsize_minmax (const struct wined3d_context *context, const struct wined3d_state *state, float *out_min, float *out_max)
 
void get_fog_start_end (const struct wined3d_context *context, const struct wined3d_state *state, float *start, float *end)
 
enum wined3d_format_id pixelformat_for_depth (DWORD depth)
 
const struct wined3d_format * wined3d_get_format (const struct wined3d_adapter *adapter, enum wined3d_format_id format_id, unsigned int bind_flags)
 
enum wined3d_format_id wined3d_get_typed_format_id (const struct wined3d_adapter *adapter, const struct wined3d_format *format, enum wined3d_channel_type channel_type)
 
void wined3d_format_calculate_pitch (const struct wined3d_format *format, unsigned int alignment, unsigned int width, unsigned int height, unsigned int *row_pitch, unsigned int *slice_pitch)
 
UINT wined3d_format_calculate_size (const struct wined3d_format *format, UINT alignment, UINT width, UINT height, UINT depth)
 
void wined3d_format_convert_from_float (const struct wined3d_format *format, const struct wined3d_color *color, void *ret)
 
void wined3d_format_copy_data (const struct wined3d_format *format, const uint8_t *src, unsigned int src_row_pitch, unsigned int src_slice_pitch, uint8_t *dst, unsigned int dst_row_pitch, unsigned int dst_slice_pitch, unsigned int w, unsigned int h, unsigned int d)
 
void wined3d_format_get_float_color_key (const struct wined3d_format *format, const struct wined3d_color_key *key, struct wined3d_color *float_colors)
 
BOOL wined3d_format_is_depth_view (enum wined3d_format_id resource_format_id, enum wined3d_format_id view_format_id)
 
const struct wined3d_color_key_conversion * wined3d_format_get_color_key_conversion (const struct wined3d_texture *texture, BOOL need_alpha_ck)
 
uint32_t wined3d_format_pack (const struct wined3d_format *format, const struct wined3d_uvec4 *value)
 
BOOL wined3d_formats_are_srgb_variants (enum wined3d_format_id format1, enum wined3d_format_id format2)
 
void wined3d_stateblock_invalidate_texture_lod (struct wined3d_stateblock *stateblock, struct wined3d_texture *texture)
 
BOOL wined3d_array_reserve (void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T size)
 
static BOOL wined3d_format_is_typeless (const struct wined3d_format *format)
 
static BOOL use_vs (const struct wined3d_state *state)
 
static BOOL use_ps (const struct wined3d_state *state)
 
static BOOL use_transform_feedback (const struct wined3d_state *state)
 
static void context_apply_state (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 
static BOOL needs_separate_srgb_gl_texture (const struct wined3d_context *context, const struct wined3d_texture *texture)
 
static BOOL needs_srgb_write (const struct wined3d_d3d_info *d3d_info, const struct wined3d_state *state, const struct wined3d_fb_state *fb)
 
static BOOL can_use_texture_swizzle (const struct wined3d_d3d_info *d3d_info, const struct wined3d_format *format)
 
static BOOL is_rasterization_disabled (const struct wined3d_shader *geometry_shader)
 
static uint32_t wined3d_mask_from_size (unsigned int size)
 
static DWORD wined3d_extract_bits (const uint32_t *bitstream, unsigned int offset, unsigned int count)
 
static void wined3d_insert_bits (uint32_t *bitstream, unsigned int offset, unsigned int count, DWORD bits)
 
static void wined3d_from_cs (const struct wined3d_cs *cs)
 
static void wined3d_not_from_cs (const struct wined3d_cs *cs)
 
static enum wined3d_material_color_source validate_material_colour_source (const struct wined3d_vertex_declaration *vdecl, enum wined3d_material_color_source source)
 
static void wined3d_get_material_colour_source (enum wined3d_material_color_source *diffuse, enum wined3d_material_color_source *emissive, enum wined3d_material_color_source *ambient, enum wined3d_material_color_source *specular, const struct wined3d_state *state)
 
static void wined3d_vec4_transform (struct wined3d_vec4 *dst, const struct wined3d_vec4 *v, const struct wined3d_matrix *m)
 
BOOL invert_matrix (struct wined3d_matrix *out, const struct wined3d_matrix *m)
 
void compute_normal_matrix (struct wined3d_matrix *normal_matrix, BOOL legacy_lighting, const struct wined3d_matrix *modelview)
 
static struct wined3d_context * context_acquire (struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
 
static void context_release (struct wined3d_context *context)
 
static float wined3d_get_float_state (const struct wined3d_state *state, enum wined3d_render_state rs)
 
static void * wined3d_context_map_bo_address (struct wined3d_context *context, const struct wined3d_bo_address *data, size_t size, uint32_t map_flags)
 
static void wined3d_context_unmap_bo_address (struct wined3d_context *context, const struct wined3d_bo_address *data, unsigned int range_count, const struct wined3d_range *ranges)
 
static void wined3d_context_copy_bo_address (struct wined3d_context *context, const struct wined3d_bo_address *dst, const struct wined3d_bo_address *src, unsigned int range_count, const struct wined3d_range *ranges, uint32_t map_flags)
 
static void wined3d_context_flush_bo_address (struct wined3d_context *context, const struct wined3d_const_bo_address *data, size_t size)
 
static void wined3d_context_destroy_bo (struct wined3d_context *context, struct wined3d_bo *bo)
 
static BOOL wined3d_dsv_srv_conflict (const struct wined3d_rendertarget_view *dsv, const struct wined3d_format *srv_format)
 
static unsigned int wined3d_bind_layer_count (const struct wined3d_texture *texture)
 
static bool wined3d_srv_all_subresources (const struct wined3d_shader_resource_view *srv)
 
static bool wined3d_rtv_all_subresources (const struct wined3d_rendertarget_view *rtv)
 
static void wined3d_srv_bind_count_inc (struct wined3d_shader_resource_view *srv)
 
static void wined3d_srv_bind_count_dec (struct wined3d_shader_resource_view *srv)
 
static void wined3d_rtv_bind_count_inc (struct wined3d_rendertarget_view *rtv)
 
static void wined3d_rtv_bind_count_dec (struct wined3d_rendertarget_view *rtv)
 
static bool wined3d_rtv_overlaps_srv (const struct wined3d_rendertarget_view *rtv, const struct wined3d_shader_resource_view *srv)
 
static bool wined3d_is_srv_rtv_bound (const struct wined3d_state *state, const struct wined3d_shader_resource_view *srv)
 
static void wined3d_viewport_get_z_range (const struct wined3d_viewport *vp, float *min_z, float *max_z)
 
static BOOL wined3d_bitmap_clear (uint32_t *map, unsigned int idx)
 
static BOOL wined3d_bitmap_set (uint32_t *map, unsigned int idx)
 
static BOOL wined3d_bitmap_is_set (const uint32_t *map, unsigned int idx)
 
static unsigned int wined3d_bitmap_ffs_xor (const uint32_t *bitmap, unsigned int bit_count, unsigned int start, uint32_t xor_mask)
 
static unsigned int wined3d_bitmap_ffs (const uint32_t *bitmap, unsigned int bit_count, unsigned int start)
 
static unsigned int wined3d_bitmap_ffz (const uint32_t *bitmap, unsigned int bit_count, unsigned int start)
 
static BOOL wined3d_bitmap_get_range (const uint32_t *bitmap, unsigned int bit_count, unsigned int start, struct wined3d_range *range)
 
static bool wined3d_context_is_graphics_state_dirty (const struct wined3d_context *context, unsigned int state_id)
 
static bool wined3d_context_is_compute_state_dirty (const struct wined3d_context *context, unsigned int state_id)
 
static bool isStateDirty (const struct wined3d_context *context, unsigned int state_id)
 
static bool wined3d_primitive_type_is_list (enum wined3d_primitive_type t)
 
static bool wined3d_map_persistent (void)
 

Variables

static const struct color_fixup_desc COLOR_FIXUP_IDENTITY
 
static const uint32_t WINED3D_READ_ONLY_BIND_MASK
 
struct wined3d_settings wined3d_settings
 
const struct wined3d_shader_frontend sm1_shader_frontend
 
const struct wined3d_shader_frontend sm4_shader_frontend
 
const struct wined3d_shader_backend_ops glsl_shader_backend
 
const struct wined3d_shader_backend_ops none_shader_backend
 
const struct wined3d_vec4 wined3d_srgb_const []
 
const struct wined3d_state_entry_template misc_state_template_gl []
 
const struct wined3d_fragment_pipe_ops none_fragment_pipe
 
const struct wined3d_fragment_pipe_ops glsl_fragment_pipe
 
const struct wined3d_vertex_pipe_ops none_vertex_pipe
 
const struct wined3d_vertex_pipe_ops glsl_vertex_pipe
 
const struct wined3d_light WINED3D_default_light
 
const struct wined3d_parent_ops wined3d_null_parent_ops
 
CRITICAL_SECTION wined3d_command_cs
 

Macro Definition Documentation

◆ ARG_UNUSED

#define ARG_UNUSED   0xff

Definition at line 2652 of file wined3d_private.h.

◆ CLIENT_BO_DISCARDED

#define CLIENT_BO_DISCARDED   ((struct wined3d_bo *)~(UINT_PTR)0)

Definition at line 3204 of file wined3d_private.h.

◆ COBJMACROS

#define COBJMACROS

Definition at line 39 of file wined3d_private.h.

◆ D3DCOLOR_B_A

#define D3DCOLOR_B_A (   dw)    (((dw) >> 24) & 0xff)

Definition at line 1561 of file wined3d_private.h.

◆ D3DCOLOR_B_B

#define D3DCOLOR_B_B (   dw)    (((dw) >> 0) & 0xff)

Definition at line 1560 of file wined3d_private.h.

◆ D3DCOLOR_B_G

#define D3DCOLOR_B_G (   dw)    (((dw) >> 8) & 0xff)

Definition at line 1559 of file wined3d_private.h.

◆ D3DCOLOR_B_R

#define D3DCOLOR_B_R (   dw)    (((dw) >> 16) & 0xff)

Definition at line 1558 of file wined3d_private.h.

◆ eps

#define eps   1e-8f

Definition at line 1709 of file wined3d_private.h.

◆ GET_TEXCOORD_SIZE_FROM_FVF

#define GET_TEXCOORD_SIZE_FROM_FVF (   d3dvtVertexType,
  tex_num 
)     (((((d3dvtVertexType) >> (16 + (2 * (tex_num)))) + 1) & 0x03) + 1)

Definition at line 1711 of file wined3d_private.h.

◆ GL_EXT_EMUL_ARB_MULTITEXTURE

#define GL_EXT_EMUL_ARB_MULTITEXTURE   0x00000001

Definition at line 1949 of file wined3d_private.h.

◆ GL_EXT_EMUL_EXT_FOG_COORD

#define GL_EXT_EMUL_EXT_FOG_COORD   0x00000002

Definition at line 1950 of file wined3d_private.h.

◆ LIBVKD3D_SHADER_SOURCE

#define LIBVKD3D_SHADER_SOURCE

Definition at line 35 of file wined3d_private.h.

◆ MAKEDWORD_VERSION

#define MAKEDWORD_VERSION (   maj,
  min 
)    (((maj & 0xffffu) << 16) | (min & 0xffffu))

Definition at line 97 of file wined3d_private.h.

◆ MAX_ATTRIBS

#define MAX_ATTRIBS   32

Definition at line 793 of file wined3d_private.h.

◆ MAX_CONSTANT_BUFFERS

#define MAX_CONSTANT_BUFFERS   15

Definition at line 304 of file wined3d_private.h.

◆ MAX_IMMEDIATE_CONSTANT_BUFFER_SIZE

#define MAX_IMMEDIATE_CONSTANT_BUFFER_SIZE   4096

Definition at line 804 of file wined3d_private.h.

◆ MAX_LABELS

#define MAX_LABELS   16

Definition at line 802 of file wined3d_private.h.

◆ MAX_PERSISTENT_MAPPED_BYTES

#define MAX_PERSISTENT_MAPPED_BYTES   (128 * 1024 * 1024)

Definition at line 2597 of file wined3d_private.h.

◆ MAX_REG_ADDR

#define MAX_REG_ADDR   1

Definition at line 794 of file wined3d_private.h.

◆ MAX_REG_INPUT

#define MAX_REG_INPUT   32

Definition at line 796 of file wined3d_private.h.

◆ MAX_REG_OUTPUT

#define MAX_REG_OUTPUT   32

Definition at line 797 of file wined3d_private.h.

◆ MAX_REG_TEXCRD

#define MAX_REG_TEXCRD   8

Definition at line 795 of file wined3d_private.h.

◆ MAX_SAMPLER_OBJECTS

#define MAX_SAMPLER_OBJECTS   16

Definition at line 305 of file wined3d_private.h.

◆ MAX_SHADER_RESOURCE_VIEWS

#define MAX_SHADER_RESOURCE_VIEWS   128

Definition at line 306 of file wined3d_private.h.

◆ MAX_TGSM_REGISTERS

#define MAX_TGSM_REGISTERS   8192

Definition at line 308 of file wined3d_private.h.

◆ MAX_UNORDERED_ACCESS_VIEWS

#define MAX_UNORDERED_ACCESS_VIEWS   8

Definition at line 307 of file wined3d_private.h.

◆ MAX_VERTEX_BLENDS

#define MAX_VERTEX_BLENDS   4

Definition at line 309 of file wined3d_private.h.

◆ PCI_DEVICE_NONE

#define PCI_DEVICE_NONE   0xffff /* e.g. 0x14f for a Geforce6200 */

Definition at line 454 of file wined3d_private.h.

◆ PCI_VENDOR_NONE

#define PCI_VENDOR_NONE   0xffff /* e.g. 0x8086 for Intel and 0x10de for Nvidia */

Definition at line 453 of file wined3d_private.h.

◆ PRINTF_ATTR

#define PRINTF_ATTR (   fmt,
  args 
)

Definition at line 4171 of file wined3d_private.h.

◆ RESOURCE_ALIGNMENT

#define RESOURCE_ALIGNMENT   16

Definition at line 3324 of file wined3d_private.h.

◆ STATE_BASEVERTEXINDEX

#define STATE_BASEVERTEXINDEX   (STATE_DEPTH_BOUNDS + 1)

Definition at line 1762 of file wined3d_private.h.

◆ STATE_BLEND

#define STATE_BLEND   (STATE_STREAM_OUTPUT + 1)

Definition at line 1771 of file wined3d_private.h.

◆ STATE_BLEND_FACTOR

#define STATE_BLEND_FACTOR   (STATE_BLEND + 1)

Definition at line 1774 of file wined3d_private.h.

◆ STATE_CLIPPLANE

#define STATE_CLIPPLANE (   a)    (STATE_SCISSORRECT + 1 + (a))

Definition at line 1753 of file wined3d_private.h.

◆ STATE_COMPUTE_CONSTANT_BUFFER

#define STATE_COMPUTE_CONSTANT_BUFFER   (STATE_COMPUTE_SHADER + 1)

Definition at line 1791 of file wined3d_private.h.

◆ STATE_COMPUTE_COUNT

#define STATE_COMPUTE_COUNT   (STATE_COMPUTE_HIGHEST - STATE_COMPUTE_OFFSET + 1)

Definition at line 1804 of file wined3d_private.h.

◆ STATE_COMPUTE_HIGHEST

#define STATE_COMPUTE_HIGHEST   (STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING)

Definition at line 1800 of file wined3d_private.h.

◆ STATE_COMPUTE_OFFSET

#define STATE_COMPUTE_OFFSET   (STATE_STENCIL_REF + 1)

Definition at line 1786 of file wined3d_private.h.

◆ STATE_COMPUTE_SHADER

#define STATE_COMPUTE_SHADER   (STATE_COMPUTE_OFFSET)

Definition at line 1788 of file wined3d_private.h.

◆ STATE_COMPUTE_SHADER_RESOURCE_BINDING

#define STATE_COMPUTE_SHADER_RESOURCE_BINDING   (STATE_COMPUTE_CONSTANT_BUFFER + 1)

Definition at line 1794 of file wined3d_private.h.

◆ STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING

#define STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING   (STATE_COMPUTE_SHADER_RESOURCE_BINDING + 1)

Definition at line 1797 of file wined3d_private.h.

◆ STATE_CONSTANT_BUFFER

Definition at line 1807 of file wined3d_private.h.

◆ STATE_DEPTH_BOUNDS

#define STATE_DEPTH_BOUNDS   (STATE_RASTERIZER + 1)

Definition at line 1759 of file wined3d_private.h.

◆ STATE_DEPTH_STENCIL

#define STATE_DEPTH_STENCIL   (STATE_SAMPLE_MASK + 1)

Definition at line 1780 of file wined3d_private.h.

◆ STATE_FRAMEBUFFER

#define STATE_FRAMEBUFFER   (STATE_BASEVERTEXINDEX + 1)

Definition at line 1765 of file wined3d_private.h.

◆ STATE_GRAPHICS_CONSTANT_BUFFER

#define STATE_GRAPHICS_CONSTANT_BUFFER (   a)    (STATE_GRAPHICS_SHADER(WINED3D_SHADER_TYPE_GRAPHICS_COUNT) + (a))

Definition at line 1728 of file wined3d_private.h.

◆ STATE_GRAPHICS_SHADER

#define STATE_GRAPHICS_SHADER (   a)    (STATE_TEXTURESTAGE(WINED3D_MAX_FFP_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE) + 1 + (a))

Definition at line 1724 of file wined3d_private.h.

◆ STATE_GRAPHICS_SHADER_RESOURCE_BINDING

#define STATE_GRAPHICS_SHADER_RESOURCE_BINDING   (STATE_GRAPHICS_CONSTANT_BUFFER(WINED3D_SHADER_TYPE_GRAPHICS_COUNT))

Definition at line 1733 of file wined3d_private.h.

◆ STATE_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING

#define STATE_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING   (STATE_GRAPHICS_SHADER_RESOURCE_BINDING + 1)

Definition at line 1736 of file wined3d_private.h.

◆ STATE_HIGHEST

Definition at line 1801 of file wined3d_private.h.

◆ STATE_INDEXBUFFER

#define STATE_INDEXBUFFER   (STATE_STREAMSRC + 1)

Definition at line 1741 of file wined3d_private.h.

◆ STATE_IS_BASEVERTEXINDEX

#define STATE_IS_BASEVERTEXINDEX (   a)    ((a) == STATE_BASEVERTEXINDEX)

Definition at line 1763 of file wined3d_private.h.

◆ STATE_IS_BLEND

#define STATE_IS_BLEND (   a)    ((a) == STATE_BLEND)

Definition at line 1772 of file wined3d_private.h.

◆ STATE_IS_BLEND_FACTOR

#define STATE_IS_BLEND_FACTOR (   a)    ((a) == STATE_BLEND_FACTOR)

Definition at line 1775 of file wined3d_private.h.

◆ STATE_IS_CLIPPLANE

#define STATE_IS_CLIPPLANE (   a)    ((a) >= STATE_CLIPPLANE(0) && (a) <= STATE_CLIPPLANE(WINED3D_MAX_CLIP_DISTANCES - 1))

Definition at line 1754 of file wined3d_private.h.

◆ STATE_IS_COMPUTE

#define STATE_IS_COMPUTE (   a)    ((a) >= STATE_COMPUTE_OFFSET && (a) <= STATE_COMPUTE_HIGHEST)

Definition at line 1803 of file wined3d_private.h.

◆ STATE_IS_COMPUTE_CONSTANT_BUFFER

#define STATE_IS_COMPUTE_CONSTANT_BUFFER (   a)    ((a) == STATE_COMPUTE_CONSTANT_BUFFER)

Definition at line 1792 of file wined3d_private.h.

◆ STATE_IS_COMPUTE_SHADER

#define STATE_IS_COMPUTE_SHADER (   a)    ((a) == STATE_COMPUTE_SHADER)

Definition at line 1789 of file wined3d_private.h.

◆ STATE_IS_COMPUTE_SHADER_RESOURCE_BINDING

#define STATE_IS_COMPUTE_SHADER_RESOURCE_BINDING (   a)    ((a) == STATE_COMPUTE_SHADER_RESOURCE_BINDING)

Definition at line 1795 of file wined3d_private.h.

◆ STATE_IS_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING

#define STATE_IS_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING (   a)    ((a) == STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING)

Definition at line 1798 of file wined3d_private.h.

◆ STATE_IS_DEPTH_BOUNDS

#define STATE_IS_DEPTH_BOUNDS (   a)    ((a) == STATE_DEPTH_BOUNDS)

Definition at line 1760 of file wined3d_private.h.

◆ STATE_IS_DEPTH_STENCIL

#define STATE_IS_DEPTH_STENCIL (   a)    ((a) == STATE_DEPTH_STENCIL)

Definition at line 1781 of file wined3d_private.h.

◆ STATE_IS_FRAMEBUFFER

#define STATE_IS_FRAMEBUFFER (   a)    ((a) == STATE_FRAMEBUFFER)

Definition at line 1766 of file wined3d_private.h.

◆ STATE_IS_GRAPHICS_CONSTANT_BUFFER

#define STATE_IS_GRAPHICS_CONSTANT_BUFFER (   a)
Value:
#define a
Definition: ke_i.h:78
@ WINED3D_SHADER_TYPE_GRAPHICS_COUNT
Definition: wined3d.h:846
#define STATE_GRAPHICS_CONSTANT_BUFFER(a)

Definition at line 1729 of file wined3d_private.h.

◆ STATE_IS_GRAPHICS_SHADER

#define STATE_IS_GRAPHICS_SHADER (   a)     ((a) >= STATE_GRAPHICS_SHADER(0) && (a) < STATE_GRAPHICS_SHADER(WINED3D_SHADER_TYPE_GRAPHICS_COUNT))

Definition at line 1725 of file wined3d_private.h.

◆ STATE_IS_GRAPHICS_SHADER_RESOURCE_BINDING

#define STATE_IS_GRAPHICS_SHADER_RESOURCE_BINDING (   a)    ((a) == STATE_GRAPHICS_SHADER_RESOURCE_BINDING)

Definition at line 1734 of file wined3d_private.h.

◆ STATE_IS_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING

#define STATE_IS_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING (   a)    ((a) == STATE_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING)

Definition at line 1737 of file wined3d_private.h.

◆ STATE_IS_INDEXBUFFER

#define STATE_IS_INDEXBUFFER (   a)    ((a) == STATE_INDEXBUFFER)

Definition at line 1742 of file wined3d_private.h.

◆ STATE_IS_RASTERIZER

#define STATE_IS_RASTERIZER (   a)    ((a) == STATE_RASTERIZER)

Definition at line 1757 of file wined3d_private.h.

◆ STATE_IS_RENDER

#define STATE_IS_RENDER (   a)    ((a) >= STATE_RENDER(1) && (a) <= STATE_RENDER(WINEHIGHEST_RENDER_STATE))

Definition at line 1717 of file wined3d_private.h.

◆ STATE_IS_SAMPLE_MASK

#define STATE_IS_SAMPLE_MASK (   a)    ((a) == STATE_SAMPLE_MASK)

Definition at line 1778 of file wined3d_private.h.

◆ STATE_IS_SCISSORRECT

#define STATE_IS_SCISSORRECT (   a)    ((a) == STATE_SCISSORRECT)

Definition at line 1751 of file wined3d_private.h.

◆ STATE_IS_STENCIL_REF

#define STATE_IS_STENCIL_REF (   a)    ((a) == STATE_STENCIL_REF)

Definition at line 1784 of file wined3d_private.h.

◆ STATE_IS_STREAM_OUTPUT

#define STATE_IS_STREAM_OUTPUT (   a)    ((a) == STATE_STREAM_OUTPUT)

Definition at line 1769 of file wined3d_private.h.

◆ STATE_IS_STREAMSRC

#define STATE_IS_STREAMSRC (   a)    ((a) == STATE_STREAMSRC)

Definition at line 1740 of file wined3d_private.h.

◆ STATE_IS_TEXTURESTAGE

#define STATE_IS_TEXTURESTAGE (   a)     ((a) >= STATE_TEXTURESTAGE(0, 1) && (a) <= STATE_TEXTURESTAGE(WINED3D_MAX_FFP_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE))

Definition at line 1721 of file wined3d_private.h.

◆ STATE_IS_VDECL

#define STATE_IS_VDECL (   a)    ((a) == STATE_VDECL)

Definition at line 1745 of file wined3d_private.h.

◆ STATE_IS_VIEWPORT

#define STATE_IS_VIEWPORT (   a)    ((a) == STATE_VIEWPORT)

Definition at line 1748 of file wined3d_private.h.

◆ STATE_RASTERIZER

Definition at line 1756 of file wined3d_private.h.

◆ STATE_RENDER

#define STATE_RENDER (   a)    (a)

Definition at line 1716 of file wined3d_private.h.

◆ STATE_SAMPLE_MASK

#define STATE_SAMPLE_MASK   (STATE_BLEND_FACTOR + 1)

Definition at line 1777 of file wined3d_private.h.

◆ STATE_SCISSORRECT

#define STATE_SCISSORRECT   (STATE_VIEWPORT + 1)

Definition at line 1750 of file wined3d_private.h.

◆ STATE_SHADER

Definition at line 1806 of file wined3d_private.h.

◆ STATE_STENCIL_REF

#define STATE_STENCIL_REF   (STATE_DEPTH_STENCIL + 1)

Definition at line 1783 of file wined3d_private.h.

◆ STATE_STREAM_OUTPUT

#define STATE_STREAM_OUTPUT   (STATE_FRAMEBUFFER + 1)

Definition at line 1768 of file wined3d_private.h.

◆ STATE_STREAMSRC

Definition at line 1739 of file wined3d_private.h.

◆ STATE_TEXTURESTAGE

#define STATE_TEXTURESTAGE (   stage,
  num 
)     (STATE_RENDER(WINEHIGHEST_RENDER_STATE) + 1 + (stage) * (WINED3D_HIGHEST_TEXTURE_STATE + 1) + (num))

Definition at line 1719 of file wined3d_private.h.

◆ STATE_UNORDERED_ACCESS_VIEW_BINDING

#define STATE_UNORDERED_ACCESS_VIEW_BINDING (   a)
Value:

Definition at line 1809 of file wined3d_private.h.

◆ STATE_VDECL

#define STATE_VDECL   (STATE_INDEXBUFFER + 1)

Definition at line 1744 of file wined3d_private.h.

◆ STATE_VIEWPORT

#define STATE_VIEWPORT   (STATE_VDECL + 1)

Definition at line 1747 of file wined3d_private.h.

◆ UPLOAD_BO_FREE_ON_UNMAP

#define UPLOAD_BO_FREE_ON_UNMAP   0x4

Definition at line 2499 of file wined3d_private.h.

◆ UPLOAD_BO_RENAME_ON_UNMAP

#define UPLOAD_BO_RENAME_ON_UNMAP   0x2

Definition at line 2498 of file wined3d_private.h.

◆ UPLOAD_BO_UPLOAD_ON_UNMAP

#define UPLOAD_BO_UPLOAD_ON_UNMAP   0x1

Definition at line 2497 of file wined3d_private.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 38 of file wined3d_private.h.

◆ WINED3D_ALLOCATOR_CHUNK_ORDER_COUNT

#define WINED3D_ALLOCATOR_CHUNK_ORDER_COUNT   15

Definition at line 3123 of file wined3d_private.h.

◆ WINED3D_ALLOCATOR_CHUNK_SIZE

#define WINED3D_ALLOCATOR_CHUNK_SIZE   (64 * 1024 * 1024)

Definition at line 3122 of file wined3d_private.h.

◆ WINED3D_ALLOCATOR_MIN_BLOCK_SIZE

#define WINED3D_ALLOCATOR_MIN_BLOCK_SIZE   (WINED3D_ALLOCATOR_CHUNK_SIZE >> (WINED3D_ALLOCATOR_CHUNK_ORDER_COUNT - 1))

Definition at line 3124 of file wined3d_private.h.

◆ WINED3D_ALPHA_TO_COVERAGE_DISABLE

#define WINED3D_ALPHA_TO_COVERAGE_DISABLE   MAKEFOURCC('A','2','M','0')

Definition at line 102 of file wined3d_private.h.

◆ WINED3D_ALPHA_TO_COVERAGE_ENABLE

#define WINED3D_ALPHA_TO_COVERAGE_ENABLE   MAKEFOURCC('A','2','M','1')

Definition at line 101 of file wined3d_private.h.

◆ WINED3D_BITMAP_SIZE

#define WINED3D_BITMAP_SIZE (   x)    (((x) + 31) >> 5)

Definition at line 104 of file wined3d_private.h.

◆ WINED3D_CONST_NUM_UNUSED

#define WINED3D_CONST_NUM_UNUSED   ~0U

Definition at line 1445 of file wined3d_private.h.

◆ WINED3D_CONSTANT_BUFFER_ALIGNMENT

#define WINED3D_CONSTANT_BUFFER_ALIGNMENT   16

Definition at line 3325 of file wined3d_private.h.

◆ WINED3D_CS_CLIENT_WAIT_TIMEOUT

#define WINED3D_CS_CLIENT_WAIT_TIMEOUT   0

Definition at line 3620 of file wined3d_private.h.

◆ WINED3D_CS_COMMAND_WAIT_WITH_QUERIES_TIMEOUT

#define WINED3D_CS_COMMAND_WAIT_WITH_QUERIES_TIMEOUT   100

Definition at line 3618 of file wined3d_private.h.

◆ WINED3D_CS_QUERY_POLL_INTERVAL

#define WINED3D_CS_QUERY_POLL_INTERVAL   100u

Definition at line 3610 of file wined3d_private.h.

◆ WINED3D_CS_QUEUE_MASK

#define WINED3D_CS_QUEUE_MASK   (WINED3D_CS_QUEUE_SIZE - 1)

Definition at line 3621 of file wined3d_private.h.

◆ WINED3D_CS_QUEUE_SIZE

#define WINED3D_CS_QUEUE_SIZE   0x400000u

Definition at line 3614 of file wined3d_private.h.

◆ WINED3D_CS_SPIN_COUNT

#define WINED3D_CS_SPIN_COUNT   2000u

Definition at line 3616 of file wined3d_private.h.

◆ WINED3D_CSMT_ENABLE

#define WINED3D_CSMT_ENABLE   0x00000001

Definition at line 463 of file wined3d_private.h.

◆ WINED3D_CSMT_SERIALIZE

#define WINED3D_CSMT_SERIALIZE   0x00000002

Definition at line 464 of file wined3d_private.h.

◆ WINED3D_FFP_CONSTANTS_EXTRA_REGISTER

#define WINED3D_FFP_CONSTANTS_EXTRA_REGISTER   3

Definition at line 2851 of file wined3d_private.h.

◆ WINED3D_FFP_LIGHT_TYPE_MASK

#define WINED3D_FFP_LIGHT_TYPE_MASK   0x7u

Definition at line 2721 of file wined3d_private.h.

◆ WINED3D_FFP_LIGHT_TYPE_SHIFT

#define WINED3D_FFP_LIGHT_TYPE_SHIFT (   idx)    (3 * (idx))

Definition at line 2720 of file wined3d_private.h.

◆ WINED3D_FFP_TCI_MASK

#define WINED3D_FFP_TCI_MASK   0xffu

Definition at line 2718 of file wined3d_private.h.

◆ WINED3D_FFP_TCI_SHIFT

#define WINED3D_FFP_TCI_SHIFT   16

Definition at line 2717 of file wined3d_private.h.

◆ WINED3D_FORMAT_ATTR_BLOCKS

#define WINED3D_FORMAT_ATTR_BLOCKS   0x00000020

Definition at line 4474 of file wined3d_private.h.

◆ WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY

#define WINED3D_FORMAT_ATTR_BLOCKS_NO_VERIFY   0x00000040

Definition at line 4475 of file wined3d_private.h.

◆ WINED3D_FORMAT_ATTR_BROKEN_PITCH

#define WINED3D_FORMAT_ATTR_BROKEN_PITCH   0x00000100

Definition at line 4477 of file wined3d_private.h.

◆ WINED3D_FORMAT_ATTR_BUMPMAP

#define WINED3D_FORMAT_ATTR_BUMPMAP   0x00000008

Definition at line 4472 of file wined3d_private.h.

◆ WINED3D_FORMAT_ATTR_CAST_TO_BLOCK

#define WINED3D_FORMAT_ATTR_CAST_TO_BLOCK   0x00000800

Definition at line 4480 of file wined3d_private.h.

◆ WINED3D_FORMAT_ATTR_COMPRESSED

#define WINED3D_FORMAT_ATTR_COMPRESSED   0x00000080

Definition at line 4476 of file wined3d_private.h.

◆ WINED3D_FORMAT_ATTR_EXTENSION

#define WINED3D_FORMAT_ATTR_EXTENSION   0x00000010

Definition at line 4473 of file wined3d_private.h.

◆ WINED3D_FORMAT_ATTR_FLOAT

#define WINED3D_FORMAT_ATTR_FLOAT   0x00000001

Definition at line 4469 of file wined3d_private.h.

◆ WINED3D_FORMAT_ATTR_HEIGHT_SCALE

#define WINED3D_FORMAT_ATTR_HEIGHT_SCALE   0x00000200

Definition at line 4478 of file wined3d_private.h.

◆ WINED3D_FORMAT_ATTR_INTEGER

#define WINED3D_FORMAT_ATTR_INTEGER   0x00000002

Definition at line 4470 of file wined3d_private.h.

◆ WINED3D_FORMAT_ATTR_MAPPABLE

#define WINED3D_FORMAT_ATTR_MAPPABLE   0x00000400

Definition at line 4479 of file wined3d_private.h.

◆ WINED3D_FORMAT_ATTR_NORMALISED

#define WINED3D_FORMAT_ATTR_NORMALISED   0x00000004

Definition at line 4471 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_BLIT

#define WINED3D_FORMAT_CAP_BLIT   0x00008000

Definition at line 4498 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_DECOMPRESS

#define WINED3D_FORMAT_CAP_DECOMPRESS   0x00000080

Definition at line 4490 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_DEPTH_STENCIL

#define WINED3D_FORMAT_CAP_DEPTH_STENCIL   0x00000008

Definition at line 4486 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_FBO_ATTACHABLE

#define WINED3D_FORMAT_CAP_FBO_ATTACHABLE   0x00000020

Definition at line 4488 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB

#define WINED3D_FORMAT_CAP_FBO_ATTACHABLE_SRGB   0x00000040

Definition at line 4489 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_FILTERING

#define WINED3D_FORMAT_CAP_FILTERING   0x00000002

Definition at line 4484 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_GEN_MIPMAP

#define WINED3D_FORMAT_CAP_GEN_MIPMAP   0x00002000

Definition at line 4496 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_INDEX_BUFFER

#define WINED3D_FORMAT_CAP_INDEX_BUFFER   0x00010000

Definition at line 4499 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING

#define WINED3D_FORMAT_CAP_POSTPIXELSHADER_BLENDING   0x00000001

Definition at line 4483 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_RENDERTARGET

#define WINED3D_FORMAT_CAP_RENDERTARGET   0x00000010

Definition at line 4487 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_SHADOW

#define WINED3D_FORMAT_CAP_SHADOW   0x00000800

Definition at line 4494 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_SRGB_READ

#define WINED3D_FORMAT_CAP_SRGB_READ   0x00000100

Definition at line 4491 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_SRGB_WRITE

#define WINED3D_FORMAT_CAP_SRGB_WRITE   0x00000200

Definition at line 4492 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_TEXTURE

#define WINED3D_FORMAT_CAP_TEXTURE   0x00001000

Definition at line 4495 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_UNORDERED_ACCESS

#define WINED3D_FORMAT_CAP_UNORDERED_ACCESS   0x00000004

Definition at line 4485 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_VERTEX_ATTRIBUTE

#define WINED3D_FORMAT_CAP_VERTEX_ATTRIBUTE   0x00004000

Definition at line 4497 of file wined3d_private.h.

◆ WINED3D_FORMAT_CAP_VTF

#define WINED3D_FORMAT_CAP_VTF   0x00000400

Definition at line 4493 of file wined3d_private.h.

◆ WINED3D_LOCATION_BUFFER

#define WINED3D_LOCATION_BUFFER   0x00000008

Definition at line 3330 of file wined3d_private.h.

◆ WINED3D_LOCATION_CLEARED

#define WINED3D_LOCATION_CLEARED   0x00000004

Definition at line 3329 of file wined3d_private.h.

◆ WINED3D_LOCATION_DISCARDED

#define WINED3D_LOCATION_DISCARDED   0x00000001

Definition at line 3327 of file wined3d_private.h.

◆ WINED3D_LOCATION_DRAWABLE

#define WINED3D_LOCATION_DRAWABLE   0x00000040

Definition at line 3333 of file wined3d_private.h.

◆ WINED3D_LOCATION_RB_MULTISAMPLE

#define WINED3D_LOCATION_RB_MULTISAMPLE   0x00000080

Definition at line 3334 of file wined3d_private.h.

◆ WINED3D_LOCATION_RB_RESOLVED

#define WINED3D_LOCATION_RB_RESOLVED   0x00000100

Definition at line 3335 of file wined3d_private.h.

◆ WINED3D_LOCATION_SYSMEM

#define WINED3D_LOCATION_SYSMEM   0x00000002

Definition at line 3328 of file wined3d_private.h.

◆ WINED3D_LOCATION_TEXTURE_RGB

#define WINED3D_LOCATION_TEXTURE_RGB   0x00000010

Definition at line 3331 of file wined3d_private.h.

◆ WINED3D_LOCATION_TEXTURE_SRGB

#define WINED3D_LOCATION_TEXTURE_SRGB   0x00000020

Definition at line 3332 of file wined3d_private.h.

◆ wined3d_lock_init

#define wined3d_lock_init (   lock,
  name 
)    wined3d_lock_init_(lock, __FILE__ ": " name)

Definition at line 4153 of file wined3d_private.h.

◆ WINED3D_MAX_ACTIVE_LIGHTS

#define WINED3D_MAX_ACTIVE_LIGHTS   8

Definition at line 302 of file wined3d_private.h.

◆ WINED3D_MAX_CBS

#define WINED3D_MAX_CBS   15

Definition at line 798 of file wined3d_private.h.

◆ WINED3D_MAX_DEVICE_IDENTIFIER_LENGTH

#define WINED3D_MAX_DEVICE_IDENTIFIER_LENGTH   512

Definition at line 2479 of file wined3d_private.h.

◆ WINED3D_MAX_DIRTY_REGION_COUNT

#define WINED3D_MAX_DIRTY_REGION_COUNT   7

Definition at line 99 of file wined3d_private.h.

◆ WINED3D_MAX_SOFTWARE_ACTIVE_LIGHTS

#define WINED3D_MAX_SOFTWARE_ACTIVE_LIGHTS   32

Definition at line 303 of file wined3d_private.h.

◆ WINED3D_OPENGL_WINDOW_CLASS_NAME

#define WINED3D_OPENGL_WINDOW_CLASS_NAME   "WineD3D_OpenGL"

Definition at line 5040 of file wined3d_private.h.

◆ WINED3D_PACKED_INTERPOLATION_BIT_COUNT

#define WINED3D_PACKED_INTERPOLATION_BIT_COUNT   3

Definition at line 654 of file wined3d_private.h.

◆ WINED3D_PACKED_INTERPOLATION_SIZE

#define WINED3D_PACKED_INTERPOLATION_SIZE   3

Definition at line 653 of file wined3d_private.h.

◆ WINED3D_PAUSE_SPIN_COUNT

#define WINED3D_PAUSE_SPIN_COUNT   200u

Definition at line 3811 of file wined3d_private.h.

◆ WINED3D_PSARGS_PROJECTED

#define WINED3D_PSARGS_PROJECTED   (1u << 3)

Definition at line 1459 of file wined3d_private.h.

◆ WINED3D_PSARGS_TEXTRANSFORM_MASK

#define WINED3D_PSARGS_TEXTRANSFORM_MASK   0xfu

Definition at line 1461 of file wined3d_private.h.

◆ WINED3D_PSARGS_TEXTRANSFORM_SHIFT

#define WINED3D_PSARGS_TEXTRANSFORM_SHIFT   4

Definition at line 1460 of file wined3d_private.h.

◆ WINED3D_PSARGS_TEXTYPE_MASK

#define WINED3D_PSARGS_TEXTYPE_MASK   0x3u

Definition at line 1463 of file wined3d_private.h.

◆ WINED3D_PSARGS_TEXTYPE_SHIFT

#define WINED3D_PSARGS_TEXTYPE_SHIFT   2

Definition at line 1462 of file wined3d_private.h.

◆ WINED3D_QUERY_POOL_SIZE

#define WINED3D_QUERY_POOL_SIZE   256

Definition at line 1856 of file wined3d_private.h.

◆ WINED3D_RETIRED_BO_SIZE_THRESHOLD

#define WINED3D_RETIRED_BO_SIZE_THRESHOLD   (64 * 1024 * 1024)

Definition at line 3126 of file wined3d_private.h.

◆ WINED3D_SAMPLER_DEFAULT

#define WINED3D_SAMPLER_DEFAULT   ~0x0u

Definition at line 1073 of file wined3d_private.h.

◆ WINED3D_SHADER_CAP_DOUBLE_PRECISION

#define WINED3D_SHADER_CAP_DOUBLE_PRECISION   0x00000004u

Definition at line 1406 of file wined3d_private.h.

◆ WINED3D_SHADER_CAP_FULL_FFP_VARYINGS

#define WINED3D_SHADER_CAP_FULL_FFP_VARYINGS   0x00000010u

Definition at line 1408 of file wined3d_private.h.

◆ WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION

#define WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION   0x00000008u

Definition at line 1407 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_BASE_VERTEX_ID

#define WINED3D_SHADER_CONST_BASE_VERTEX_ID   0x00400000

Definition at line 530 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_COLOR_KEY

#define WINED3D_SHADER_CONST_FFP_COLOR_KEY   0x00200000

Definition at line 529 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_LIGHTS

#define WINED3D_SHADER_CONST_FFP_LIGHTS   0x00080000

Definition at line 527 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_MATERIAL

#define WINED3D_SHADER_CONST_FFP_MATERIAL   0x00040000

Definition at line 526 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_MODELVIEW

#define WINED3D_SHADER_CONST_FFP_MODELVIEW   0x00004000

Definition at line 522 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_PROJ

#define WINED3D_SHADER_CONST_FFP_PROJ   0x00010000

Definition at line 524 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_PS

#define WINED3D_SHADER_CONST_FFP_PS   0x00100000

Definition at line 528 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_TEXMATRIX

#define WINED3D_SHADER_CONST_FFP_TEXMATRIX   0x00020000

Definition at line 525 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_VERTEXBLEND

#define WINED3D_SHADER_CONST_FFP_VERTEXBLEND   0x00008000

Definition at line 523 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_POS_FIXUP

#define WINED3D_SHADER_CONST_POS_FIXUP   0x00000020

Definition at line 515 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_PS_ALPHA_TEST

#define WINED3D_SHADER_CONST_PS_ALPHA_TEST   0x00000800

Definition at line 521 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_PS_B

#define WINED3D_SHADER_CONST_PS_B   0x00000100

Definition at line 518 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_PS_BUMP_ENV

#define WINED3D_SHADER_CONST_PS_BUMP_ENV   0x00000200

Definition at line 519 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_PS_F

#define WINED3D_SHADER_CONST_PS_F   0x00000040

Definition at line 516 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_PS_FOG

#define WINED3D_SHADER_CONST_PS_FOG   0x00000400

Definition at line 520 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_PS_I

#define WINED3D_SHADER_CONST_PS_I   0x00000080

Definition at line 517 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_VS_B

#define WINED3D_SHADER_CONST_VS_B   0x00000004

Definition at line 512 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_VS_CLIP_PLANES

#define WINED3D_SHADER_CONST_VS_CLIP_PLANES   0x00000008

Definition at line 513 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_VS_F

#define WINED3D_SHADER_CONST_VS_F   0x00000001

Definition at line 510 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_VS_I

#define WINED3D_SHADER_CONST_VS_I   0x00000002

Definition at line 511 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_VS_POINTSIZE

#define WINED3D_SHADER_CONST_VS_POINTSIZE   0x00000010

Definition at line 514 of file wined3d_private.h.

◆ WINED3D_SHADER_VERSION

#define WINED3D_SHADER_VERSION (   major,
  minor 
)    (((major) << 8) | (minor))

Definition at line 1103 of file wined3d_private.h.

◆ WINED3D_SLAB_BO_MIN_OBJECT_ALIGN

#define WINED3D_SLAB_BO_MIN_OBJECT_ALIGN   16

Definition at line 3125 of file wined3d_private.h.

◆ WINED3D_SM1_PS

#define WINED3D_SM1_PS   0xffffu

Definition at line 779 of file wined3d_private.h.

◆ WINED3D_SM1_VS

#define WINED3D_SM1_VS   0xfffeu

Definition at line 778 of file wined3d_private.h.

◆ WINED3D_SM4_GS

#define WINED3D_SM4_GS   0x0002u

Definition at line 782 of file wined3d_private.h.

◆ WINED3D_SM4_PS

#define WINED3D_SM4_PS   0x0000u

Definition at line 780 of file wined3d_private.h.

◆ WINED3D_SM4_VS

#define WINED3D_SM4_VS   0x0001u

Definition at line 781 of file wined3d_private.h.

◆ WINED3D_SM5_CS

#define WINED3D_SM5_CS   0x0005u

Definition at line 785 of file wined3d_private.h.

◆ WINED3D_SM5_DS

#define WINED3D_SM5_DS   0x0004u

Definition at line 784 of file wined3d_private.h.

◆ WINED3D_SM5_HS

#define WINED3D_SM5_HS   0x0003u

Definition at line 783 of file wined3d_private.h.

◆ WINED3D_STATE_INIT_DEFAULT

#define WINED3D_STATE_INIT_DEFAULT   0x00000002

Definition at line 2922 of file wined3d_private.h.

◆ WINED3D_STATE_NO_REF

#define WINED3D_STATE_NO_REF   0x00000001

Definition at line 2921 of file wined3d_private.h.

◆ WINED3D_TEXTURE_ASYNC_COLOR_KEY

#define WINED3D_TEXTURE_ASYNC_COLOR_KEY   0x00000001

Definition at line 3372 of file wined3d_private.h.

◆ WINED3D_TEXTURE_COND_NP2

#define WINED3D_TEXTURE_COND_NP2   0x00000001

Definition at line 3358 of file wined3d_private.h.

◆ WINED3D_TEXTURE_CONVERTED

#define WINED3D_TEXTURE_CONVERTED   0x00000100

Definition at line 3364 of file wined3d_private.h.

◆ WINED3D_TEXTURE_DC_IN_USE

#define WINED3D_TEXTURE_DC_IN_USE   0x00001000

Definition at line 3366 of file wined3d_private.h.

◆ WINED3D_TEXTURE_DISCARD

#define WINED3D_TEXTURE_DISCARD   0x00002000

Definition at line 3367 of file wined3d_private.h.

◆ WINED3D_TEXTURE_DOWNLOADABLE

#define WINED3D_TEXTURE_DOWNLOADABLE   0x00010000

Definition at line 3370 of file wined3d_private.h.

◆ WINED3D_TEXTURE_GENERATE_MIPMAPS

#define WINED3D_TEXTURE_GENERATE_MIPMAPS   0x00008000

Definition at line 3369 of file wined3d_private.h.

◆ WINED3D_TEXTURE_GET_DC

#define WINED3D_TEXTURE_GET_DC   0x00004000

Definition at line 3368 of file wined3d_private.h.

◆ WINED3D_TEXTURE_GET_DC_LENIENT

#define WINED3D_TEXTURE_GET_DC_LENIENT   0x00000800

Definition at line 3365 of file wined3d_private.h.

◆ WINED3D_TEXTURE_IS_SRGB

#define WINED3D_TEXTURE_IS_SRGB   0x00000008

Definition at line 3359 of file wined3d_private.h.

◆ WINED3D_TEXTURE_RGB_ALLOCATED

#define WINED3D_TEXTURE_RGB_ALLOCATED   0x00000010

Definition at line 3360 of file wined3d_private.h.

◆ WINED3D_TEXTURE_RGB_VALID

#define WINED3D_TEXTURE_RGB_VALID   0x00000020

Definition at line 3361 of file wined3d_private.h.

◆ WINED3D_TEXTURE_SRGB_ALLOCATED

#define WINED3D_TEXTURE_SRGB_ALLOCATED   0x00000040

Definition at line 3362 of file wined3d_private.h.

◆ WINED3D_TEXTURE_SRGB_VALID

#define WINED3D_TEXTURE_SRGB_VALID   0x00000080

Definition at line 3363 of file wined3d_private.h.

◆ WINED3D_UNMAPPED_STAGE

#define WINED3D_UNMAPPED_STAGE   ~0u

Definition at line 2993 of file wined3d_private.h.

◆ WINED3DCREATE_MULTITHREADED

#define WINED3DCREATE_MULTITHREADED   0x00000004

Definition at line 2997 of file wined3d_private.h.

◆ WINED3DPS_VERSION

#define WINED3DPS_VERSION (   major,
  minor 
)    ((WINED3D_SM1_PS << 16) | ((major) << 8) | (minor))

Definition at line 788 of file wined3d_private.h.

◆ WINED3DSI_INDEXED_DYNAMIC

#define WINED3DSI_INDEXED_DYNAMIC   0x4

Definition at line 702 of file wined3d_private.h.

◆ WINED3DSI_PRECISE_SHIFT

#define WINED3DSI_PRECISE_SHIFT   8

Definition at line 714 of file wined3d_private.h.

◆ WINED3DSI_PRECISE_W

#define WINED3DSI_PRECISE_W   0x800

Definition at line 711 of file wined3d_private.h.

◆ WINED3DSI_PRECISE_X

#define WINED3DSI_PRECISE_X   0x100

Definition at line 708 of file wined3d_private.h.

◆ WINED3DSI_PRECISE_XYZW

#define WINED3DSI_PRECISE_XYZW
Value:
#define WINED3DSI_PRECISE_X
#define WINED3DSI_PRECISE_Y
#define WINED3DSI_PRECISE_Z
#define WINED3DSI_PRECISE_W

Definition at line 712 of file wined3d_private.h.

◆ WINED3DSI_PRECISE_Y

#define WINED3DSI_PRECISE_Y   0x200

Definition at line 709 of file wined3d_private.h.

◆ WINED3DSI_PRECISE_Z

#define WINED3DSI_PRECISE_Z   0x400

Definition at line 710 of file wined3d_private.h.

◆ WINED3DSI_RESINFO_RCP_FLOAT

#define WINED3DSI_RESINFO_RCP_FLOAT   0x1

Definition at line 703 of file wined3d_private.h.

◆ WINED3DSI_RESINFO_UINT

#define WINED3DSI_RESINFO_UINT   0x2

Definition at line 704 of file wined3d_private.h.

◆ WINED3DSI_SAMPLE_INFO_UINT

#define WINED3DSI_SAMPLE_INFO_UINT   0x1

Definition at line 705 of file wined3d_private.h.

◆ WINED3DSI_SAMPLER_COMPARISON_MODE

#define WINED3DSI_SAMPLER_COMPARISON_MODE   0x1

Definition at line 706 of file wined3d_private.h.

◆ WINED3DSI_TEXLD_BIAS

#define WINED3DSI_TEXLD_BIAS   0x2

Definition at line 701 of file wined3d_private.h.

◆ WINED3DSI_TEXLD_PROJECT

#define WINED3DSI_TEXLD_PROJECT   0x1

Definition at line 700 of file wined3d_private.h.

◆ WINED3DSP_NOSWIZZLE

#define WINED3DSP_NOSWIZZLE   (0u | (1u << 2) | (2u << 4) | (3u << 6))

Definition at line 607 of file wined3d_private.h.

◆ WINED3DSP_WRITEMASK_0

#define WINED3DSP_WRITEMASK_0   0x1u /* .x r */

Definition at line 627 of file wined3d_private.h.

◆ WINED3DSP_WRITEMASK_1

#define WINED3DSP_WRITEMASK_1   0x2u /* .y g */

Definition at line 628 of file wined3d_private.h.

◆ WINED3DSP_WRITEMASK_2

#define WINED3DSP_WRITEMASK_2   0x4u /* .z b */

Definition at line 629 of file wined3d_private.h.

◆ WINED3DSP_WRITEMASK_3

#define WINED3DSP_WRITEMASK_3   0x8u /* .w a */

Definition at line 630 of file wined3d_private.h.

◆ WINED3DSP_WRITEMASK_ALL

#define WINED3DSP_WRITEMASK_ALL   0xfu /* all */

Definition at line 631 of file wined3d_private.h.

◆ WINED3DVS_VERSION

#define WINED3DVS_VERSION (   major,
  minor 
)    ((WINED3D_SM1_VS << 16) | ((major) << 8) | (minor))

Definition at line 789 of file wined3d_private.h.

Typedef Documentation

◆ APPLYSTATEFUNC

typedef void(* APPLYSTATEFUNC) (struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id)

Definition at line 1934 of file wined3d_private.h.

◆ SHADER_HANDLER

typedef void(* SHADER_HANDLER) (const struct wined3d_shader_instruction *)

Definition at line 1404 of file wined3d_private.h.

Enumeration Type Documentation

◆ complex_fixup

Enumerator
COMPLEX_FIXUP_NONE 
COMPLEX_FIXUP_YUY2 
COMPLEX_FIXUP_UYVY 
COMPLEX_FIXUP_YV12 
COMPLEX_FIXUP_P8 
COMPLEX_FIXUP_NV12 
COMPLEX_FIXUP_YUV 

Definition at line 169 of file wined3d_private.h.

170{
178};
@ COMPLEX_FIXUP_P8
@ COMPLEX_FIXUP_YUY2
@ COMPLEX_FIXUP_UYVY
@ COMPLEX_FIXUP_NV12
@ COMPLEX_FIXUP_YV12
@ COMPLEX_FIXUP_YUV
@ COMPLEX_FIXUP_NONE

◆ fixup_channel_source

Enumerator
CHANNEL_SOURCE_ZERO 
CHANNEL_SOURCE_ONE 
CHANNEL_SOURCE_X 
CHANNEL_SOURCE_Y 
CHANNEL_SOURCE_Z 
CHANNEL_SOURCE_W 
CHANNEL_SOURCE_COMPLEX0 
CHANNEL_SOURCE_COMPLEX1 

Definition at line 157 of file wined3d_private.h.

158{
167};
@ CHANNEL_SOURCE_COMPLEX1
@ CHANNEL_SOURCE_ONE
@ CHANNEL_SOURCE_W
@ CHANNEL_SOURCE_X
@ CHANNEL_SOURCE_ZERO
@ CHANNEL_SOURCE_Z
@ CHANNEL_SOURCE_Y
@ CHANNEL_SOURCE_COMPLEX0

◆ fog_src_type

Enumerator
VS_FOG_Z 
VS_FOG_COORD 
VS_FOG_W 

Definition at line 1492 of file wined3d_private.h.

1493{
1494 VS_FOG_Z,
1496 VS_FOG_W,
1497};
@ VS_FOG_COORD
@ VS_FOG_W
@ VS_FOG_Z

◆ fogsource

Enumerator
FOGSOURCE_FFP 
FOGSOURCE_VS 

Definition at line 1812 of file wined3d_private.h.

1812 {
1815};
@ FOGSOURCE_VS
@ FOGSOURCE_FFP

◆ wined3d_blit_op

Enumerator
WINED3D_BLIT_OP_COLOR_BLIT 
WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST 
WINED3D_BLIT_OP_COLOR_BLIT_CKEY 
WINED3D_BLIT_OP_DEPTH_BLIT 
WINED3D_BLIT_OP_RAW_BLIT 

Definition at line 2006 of file wined3d_private.h.

2007{
2013};
@ WINED3D_BLIT_OP_COLOR_BLIT_CKEY
@ WINED3D_BLIT_OP_RAW_BLIT
@ WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST
@ WINED3D_BLIT_OP_DEPTH_BLIT
@ WINED3D_BLIT_OP_COLOR_BLIT

◆ wined3d_channel_type

Enumerator
WINED3D_CHANNEL_TYPE_NONE 
WINED3D_CHANNEL_TYPE_UNORM 
WINED3D_CHANNEL_TYPE_SNORM 
WINED3D_CHANNEL_TYPE_UINT 
WINED3D_CHANNEL_TYPE_SINT 
WINED3D_CHANNEL_TYPE_FLOAT 
WINED3D_CHANNEL_TYPE_DEPTH 
WINED3D_CHANNEL_TYPE_STENCIL 
WINED3D_CHANNEL_TYPE_UNUSED 

Definition at line 4514 of file wined3d_private.h.

4515{
4525};
@ WINED3D_CHANNEL_TYPE_UNUSED
@ WINED3D_CHANNEL_TYPE_UNORM
@ WINED3D_CHANNEL_TYPE_STENCIL
@ WINED3D_CHANNEL_TYPE_FLOAT
@ WINED3D_CHANNEL_TYPE_SNORM
@ WINED3D_CHANNEL_TYPE_NONE
@ WINED3D_CHANNEL_TYPE_UINT
@ WINED3D_CHANNEL_TYPE_SINT
@ WINED3D_CHANNEL_TYPE_DEPTH

◆ wined3d_component_type

Enumerator
WINED3D_TYPE_UNKNOWN 
WINED3D_TYPE_UINT 
WINED3D_TYPE_INT 
WINED3D_TYPE_FLOAT 

Definition at line 752 of file wined3d_private.h.

753{
755 WINED3D_TYPE_UINT = 0x1,
756 WINED3D_TYPE_INT = 0x2,
757 WINED3D_TYPE_FLOAT = 0x3,
758};
@ WINED3D_TYPE_UINT
@ WINED3D_TYPE_UNKNOWN
@ WINED3D_TYPE_FLOAT
@ WINED3D_TYPE_INT

◆ wined3d_cs_queue_id

Enumerator
WINED3D_CS_QUEUE_DEFAULT 
WINED3D_CS_QUEUE_MAP 
WINED3D_CS_QUEUE_COUNT 

Definition at line 3603 of file wined3d_private.h.

3604{
3608};
@ WINED3D_CS_QUEUE_MAP
@ WINED3D_CS_QUEUE_COUNT
@ WINED3D_CS_QUEUE_DEFAULT

◆ wined3d_data_type

Enumerator
WINED3D_DATA_FLOAT 
WINED3D_DATA_INT 
WINED3D_DATA_RESOURCE 
WINED3D_DATA_SAMPLER 
WINED3D_DATA_UAV 
WINED3D_DATA_UINT 
WINED3D_DATA_UNORM 
WINED3D_DATA_SNORM 
WINED3D_DATA_OPAQUE 

Definition at line 588 of file wined3d_private.h.

589{
599};
@ WINED3D_DATA_UINT
@ WINED3D_DATA_INT
@ WINED3D_DATA_UAV
@ WINED3D_DATA_SAMPLER
@ WINED3D_DATA_SNORM
@ WINED3D_DATA_UNORM
@ WINED3D_DATA_RESOURCE
@ WINED3D_DATA_FLOAT
@ WINED3D_DATA_OPAQUE

◆ wined3d_display_driver

Enumerator
DRIVER_AMD_RAGE_128PRO 
DRIVER_AMD_R100 
DRIVER_AMD_R300 
DRIVER_AMD_R600 
DRIVER_AMD_RX 
DRIVER_INTEL_GMA800 
DRIVER_INTEL_GMA900 
DRIVER_INTEL_GMA950 
DRIVER_INTEL_GMA3000 
DRIVER_INTEL_HD4000 
DRIVER_NVIDIA_TNT 
DRIVER_NVIDIA_GEFORCE2MX 
DRIVER_NVIDIA_GEFORCEFX 
DRIVER_NVIDIA_GEFORCE6 
DRIVER_NVIDIA_GEFORCE8 
DRIVER_NVIDIA_FERMI 
DRIVER_NVIDIA_KEPLER 
DRIVER_REDHAT_VIRGL 
DRIVER_VMWARE 
DRIVER_WINE 
DRIVER_UNKNOWN 

Definition at line 2437 of file wined3d_private.h.

2438{
2460};
@ DRIVER_UNKNOWN
@ DRIVER_NVIDIA_GEFORCE6
@ DRIVER_NVIDIA_GEFORCE2MX
@ DRIVER_INTEL_GMA950
@ DRIVER_AMD_R600
@ DRIVER_INTEL_HD4000
@ DRIVER_AMD_RAGE_128PRO
@ DRIVER_INTEL_GMA900
@ DRIVER_NVIDIA_TNT
@ DRIVER_VMWARE
@ DRIVER_INTEL_GMA3000
@ DRIVER_NVIDIA_GEFORCEFX
@ DRIVER_NVIDIA_KEPLER
@ DRIVER_NVIDIA_GEFORCE8
@ DRIVER_REDHAT_VIRGL
@ DRIVER_INTEL_GMA800
@ DRIVER_WINE
@ DRIVER_AMD_RX
@ DRIVER_NVIDIA_FERMI
@ DRIVER_AMD_R100
@ DRIVER_AMD_R300

◆ wined3d_ffp_emit_idx

Enumerator
WINED3D_FFP_EMIT_FLOAT1 
WINED3D_FFP_EMIT_FLOAT2 
WINED3D_FFP_EMIT_FLOAT3 
WINED3D_FFP_EMIT_FLOAT4 
WINED3D_FFP_EMIT_D3DCOLOR 
WINED3D_FFP_EMIT_UBYTE4 
WINED3D_FFP_EMIT_SHORT2 
WINED3D_FFP_EMIT_SHORT4 
WINED3D_FFP_EMIT_UBYTE4N 
WINED3D_FFP_EMIT_SHORT2N 
WINED3D_FFP_EMIT_SHORT4N 
WINED3D_FFP_EMIT_USHORT2N 
WINED3D_FFP_EMIT_USHORT4N 
WINED3D_FFP_EMIT_UDEC3 
WINED3D_FFP_EMIT_DEC3N 
WINED3D_FFP_EMIT_FLOAT16_2 
WINED3D_FFP_EMIT_FLOAT16_4 
WINED3D_FFP_EMIT_INVALID 
WINED3D_FFP_EMIT_COUNT 

Definition at line 132 of file wined3d_private.h.

133{
153};
@ WINED3D_FFP_EMIT_D3DCOLOR
@ WINED3D_FFP_EMIT_FLOAT16_2
@ WINED3D_FFP_EMIT_UBYTE4N
@ WINED3D_FFP_EMIT_COUNT
@ WINED3D_FFP_EMIT_FLOAT2
@ WINED3D_FFP_EMIT_SHORT4N
@ WINED3D_FFP_EMIT_USHORT2N
@ WINED3D_FFP_EMIT_SHORT2N
@ WINED3D_FFP_EMIT_UBYTE4
@ WINED3D_FFP_EMIT_FLOAT4
@ WINED3D_FFP_EMIT_INVALID
@ WINED3D_FFP_EMIT_UDEC3
@ WINED3D_FFP_EMIT_DEC3N
@ WINED3D_FFP_EMIT_FLOAT3
@ WINED3D_FFP_EMIT_FLOAT16_4
@ WINED3D_FFP_EMIT_USHORT4N
@ WINED3D_FFP_EMIT_SHORT2
@ WINED3D_FFP_EMIT_SHORT4
@ WINED3D_FFP_EMIT_FLOAT1

◆ wined3d_ffp_idx

Enumerator
WINED3D_FFP_POSITION 
WINED3D_FFP_BLENDWEIGHT 
WINED3D_FFP_BLENDINDICES 
WINED3D_FFP_NORMAL 
WINED3D_FFP_PSIZE 
WINED3D_FFP_DIFFUSE 
WINED3D_FFP_SPECULAR 
WINED3D_FFP_TEXCOORD0 
WINED3D_FFP_TEXCOORD1 
WINED3D_FFP_TEXCOORD2 
WINED3D_FFP_TEXCOORD3 
WINED3D_FFP_TEXCOORD4 
WINED3D_FFP_TEXCOORD5 
WINED3D_FFP_TEXCOORD6 
WINED3D_FFP_TEXCOORD7 
WINED3D_FFP_ATTRIBS_COUNT 

Definition at line 112 of file wined3d_private.h.

113{
130};
@ WINED3D_FFP_TEXCOORD4
@ WINED3D_FFP_PSIZE
@ WINED3D_FFP_TEXCOORD3
@ WINED3D_FFP_SPECULAR
@ WINED3D_FFP_TEXCOORD7
@ WINED3D_FFP_TEXCOORD1
@ WINED3D_FFP_POSITION
@ WINED3D_FFP_NORMAL
@ WINED3D_FFP_TEXCOORD5
@ WINED3D_FFP_BLENDWEIGHT
@ WINED3D_FFP_TEXCOORD2
@ WINED3D_FFP_DIFFUSE
@ WINED3D_FFP_TEXCOORD6
@ WINED3D_FFP_BLENDINDICES
@ WINED3D_FFP_TEXCOORD0
@ WINED3D_FFP_ATTRIBS_COUNT

◆ wined3d_ffp_ps_fog_mode

Enumerator
WINED3D_FFP_PS_FOG_OFF 
WINED3D_FFP_PS_FOG_LINEAR 
WINED3D_FFP_PS_FOG_EXP 
WINED3D_FFP_PS_FOG_EXP2 

Definition at line 1447 of file wined3d_private.h.

1448{
1453};
@ WINED3D_FFP_PS_FOG_EXP
@ WINED3D_FFP_PS_FOG_OFF
@ WINED3D_FFP_PS_FOG_EXP2
@ WINED3D_FFP_PS_FOG_LINEAR

◆ wined3d_ffp_vs_fog_mode

Enumerator
WINED3D_FFP_VS_FOG_OFF 
WINED3D_FFP_VS_FOG_FOGCOORD 
WINED3D_FFP_VS_FOG_DEPTH 
WINED3D_FFP_VS_FOG_RANGE 

Definition at line 2709 of file wined3d_private.h.

2710{
2715};
@ WINED3D_FFP_VS_FOG_FOGCOORD
@ WINED3D_FFP_VS_FOG_OFF
@ WINED3D_FFP_VS_FOG_DEPTH
@ WINED3D_FFP_VS_FOG_RANGE

◆ wined3d_gl_resource_type

Enumerator
WINED3D_GL_RES_TYPE_TEX_1D 
WINED3D_GL_RES_TYPE_TEX_2D 
WINED3D_GL_RES_TYPE_TEX_3D 
WINED3D_GL_RES_TYPE_TEX_CUBE 
WINED3D_GL_RES_TYPE_BUFFER 
WINED3D_GL_RES_TYPE_RB 
WINED3D_GL_RES_TYPE_COUNT 

Definition at line 1427 of file wined3d_private.h.

1428{
1436};
@ 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_RB
@ WINED3D_GL_RES_TYPE_TEX_1D
@ WINED3D_GL_RES_TYPE_COUNT

◆ wined3d_immconst_type

Enumerator
WINED3D_IMMCONST_SCALAR 
WINED3D_IMMCONST_VEC4 

Definition at line 601 of file wined3d_private.h.

602{
605};
@ WINED3D_IMMCONST_VEC4
@ WINED3D_IMMCONST_SCALAR

◆ wined3d_pci_device

Enumerator
CARD_WINE 
CARD_AMD_RAGE_128PRO 
CARD_AMD_RADEON_7200 
CARD_AMD_RADEON_8500 
CARD_AMD_RADEON_9500 
CARD_AMD_RADEON_XPRESS_200M 
CARD_AMD_RADEON_X700 
CARD_AMD_RADEON_X1600 
CARD_AMD_RADEON_HD2350 
CARD_AMD_RADEON_HD2600 
CARD_AMD_RADEON_HD2900 
CARD_AMD_RADEON_HD3200 
CARD_AMD_RADEON_HD3850 
CARD_AMD_RADEON_HD4200M 
CARD_AMD_RADEON_HD4350 
CARD_AMD_RADEON_HD4600 
CARD_AMD_RADEON_HD4700 
CARD_AMD_RADEON_HD4800 
CARD_AMD_RADEON_HD5400 
CARD_AMD_RADEON_HD5600 
CARD_AMD_RADEON_HD5700 
CARD_AMD_RADEON_HD5800 
CARD_AMD_RADEON_HD5900 
CARD_AMD_RADEON_HD6300 
CARD_AMD_RADEON_HD6400 
CARD_AMD_RADEON_HD6490M 
CARD_AMD_RADEON_HD6410D 
CARD_AMD_RADEON_HD6480G 
CARD_AMD_RADEON_HD6550D 
CARD_AMD_RADEON_HD6600 
CARD_AMD_RADEON_HD6600M 
CARD_AMD_RADEON_HD6700 
CARD_AMD_RADEON_HD6800 
CARD_AMD_RADEON_HD6900 
CARD_AMD_RADEON_HD7660D 
CARD_AMD_RADEON_HD7700 
CARD_AMD_RADEON_HD7800 
CARD_AMD_RADEON_HD7870 
CARD_AMD_RADEON_HD7900 
CARD_AMD_RADEON_HD8600M 
CARD_AMD_RADEON_HD8670 
CARD_AMD_RADEON_HD8770 
CARD_AMD_RADEON_R3 
CARD_AMD_RADEON_R7 
CARD_AMD_RADEON_R9_285 
CARD_AMD_RADEON_R9_290 
CARD_AMD_RADEON_R9_290X 
CARD_AMD_RADEON_R9_FURY 
CARD_AMD_RADEON_R9_M370X 
CARD_AMD_RADEON_R9_M380 
CARD_AMD_RADEON_R9_M395X 
CARD_AMD_RADEON_RX_460 
CARD_AMD_RADEON_RX_480 
CARD_AMD_RADEON_RX_VEGA_10 
CARD_AMD_RADEON_RX_VEGA_12 
CARD_AMD_RADEON_RAVEN 
CARD_AMD_RADEON_RX_VEGA_20 
CARD_AMD_RADEON_RX_NAVI_10 
CARD_AMD_RADEON_RX_NAVI_14 
CARD_AMD_RADEON_RX_NAVI_21 
CARD_AMD_RADEON_PRO_V620 
CARD_AMD_RADEON_PRO_V620_VF 
CARD_AMD_VANGOGH 
CARD_AMD_RAPHAEL 
CARD_NVIDIA_RIVA_128 
CARD_NVIDIA_RIVA_TNT 
CARD_NVIDIA_RIVA_TNT2 
CARD_NVIDIA_GEFORCE 
CARD_NVIDIA_GEFORCE2_MX 
CARD_NVIDIA_GEFORCE2 
CARD_NVIDIA_GEFORCE3 
CARD_NVIDIA_GEFORCE4_MX 
CARD_NVIDIA_GEFORCE4_TI4200 
CARD_NVIDIA_GEFORCEFX_5200 
CARD_NVIDIA_GEFORCEFX_5600 
CARD_NVIDIA_GEFORCEFX_5800 
CARD_NVIDIA_GEFORCE_6200 
CARD_NVIDIA_GEFORCE_6600GT 
CARD_NVIDIA_GEFORCE_6800 
CARD_NVIDIA_GEFORCE_7300 
CARD_NVIDIA_GEFORCE_7400 
CARD_NVIDIA_GEFORCE_7600 
CARD_NVIDIA_GEFORCE_7800GT 
CARD_NVIDIA_GEFORCE_8200 
CARD_NVIDIA_GEFORCE_8300GS 
CARD_NVIDIA_GEFORCE_8400GS 
CARD_NVIDIA_GEFORCE_8500GT 
CARD_NVIDIA_GEFORCE_8600GT 
CARD_NVIDIA_GEFORCE_8600MGT 
CARD_NVIDIA_GEFORCE_8800GTS 
CARD_NVIDIA_GEFORCE_8800GTX 
CARD_NVIDIA_GEFORCE_9200 
CARD_NVIDIA_GEFORCE_9300 
CARD_NVIDIA_GEFORCE_9400M 
CARD_NVIDIA_GEFORCE_9400GT 
CARD_NVIDIA_GEFORCE_9500GT 
CARD_NVIDIA_GEFORCE_9600GT 
CARD_NVIDIA_GEFORCE_9700MGT 
CARD_NVIDIA_GEFORCE_9800GT 
CARD_NVIDIA_GEFORCE_210 
CARD_NVIDIA_GEFORCE_GT220 
CARD_NVIDIA_GEFORCE_GT240 
CARD_NVIDIA_GEFORCE_GTS250 
CARD_NVIDIA_GEFORCE_GTX260 
CARD_NVIDIA_GEFORCE_GTX275 
CARD_NVIDIA_GEFORCE_GTX280 
CARD_NVIDIA_GEFORCE_315M 
CARD_NVIDIA_GEFORCE_320M 
CARD_NVIDIA_GEFORCE_GT320M 
CARD_NVIDIA_GEFORCE_GT325M 
CARD_NVIDIA_GEFORCE_GT330 
CARD_NVIDIA_GEFORCE_GTS350M 
CARD_NVIDIA_GEFORCE_410M 
CARD_NVIDIA_GEFORCE_GT420 
CARD_NVIDIA_GEFORCE_GT425M 
CARD_NVIDIA_GEFORCE_GT430 
CARD_NVIDIA_GEFORCE_GT440 
CARD_NVIDIA_GEFORCE_GTS450 
CARD_NVIDIA_GEFORCE_GTX460 
CARD_NVIDIA_GEFORCE_GTX460M 
CARD_NVIDIA_GEFORCE_GTX465 
CARD_NVIDIA_GEFORCE_GTX470 
CARD_NVIDIA_GEFORCE_GTX480 
CARD_NVIDIA_GEFORCE_GT520 
CARD_NVIDIA_GEFORCE_GT525M 
CARD_NVIDIA_GEFORCE_GT540M 
CARD_NVIDIA_GEFORCE_GTX550 
CARD_NVIDIA_GEFORCE_GT555M 
CARD_NVIDIA_GEFORCE_GTX560TI 
CARD_NVIDIA_GEFORCE_GTX560M 
CARD_NVIDIA_GEFORCE_GTX560 
CARD_NVIDIA_GEFORCE_GTX570 
CARD_NVIDIA_GEFORCE_GTX580 
CARD_NVIDIA_GEFORCE_GT610 
CARD_NVIDIA_GEFORCE_GT630 
CARD_NVIDIA_GEFORCE_GT630M 
CARD_NVIDIA_GEFORCE_GT640 
CARD_NVIDIA_GEFORCE_GT640M 
CARD_NVIDIA_GEFORCE_GT650M 
CARD_NVIDIA_GEFORCE_GTX650 
CARD_NVIDIA_GEFORCE_GTX650TI 
CARD_NVIDIA_GEFORCE_GTX660 
CARD_NVIDIA_GEFORCE_GTX660M 
CARD_NVIDIA_GEFORCE_GTX660TI 
CARD_NVIDIA_GEFORCE_GTX670 
CARD_NVIDIA_GEFORCE_GTX670MX 
CARD_NVIDIA_GEFORCE_GTX675MX_1 
CARD_NVIDIA_GEFORCE_GTX675MX_2 
CARD_NVIDIA_GEFORCE_GTX680 
CARD_NVIDIA_GEFORCE_GTX690 
CARD_NVIDIA_GEFORCE_GT720 
CARD_NVIDIA_GEFORCE_GT730 
CARD_NVIDIA_GEFORCE_GT730M 
CARD_NVIDIA_GEFORCE_GT740M 
CARD_NVIDIA_GEFORCE_GT750M 
CARD_NVIDIA_GEFORCE_GT755M 
CARD_NVIDIA_GEFORCE_GTX750 
CARD_NVIDIA_GEFORCE_GTX750TI 
CARD_NVIDIA_GEFORCE_GTX760 
CARD_NVIDIA_GEFORCE_GTX760TI 
CARD_NVIDIA_GEFORCE_GTX765M 
CARD_NVIDIA_GEFORCE_GTX770M 
CARD_NVIDIA_GEFORCE_GTX770 
CARD_NVIDIA_GEFORCE_GTX775M 
CARD_NVIDIA_GEFORCE_GTX780 
CARD_NVIDIA_GEFORCE_GTX780M 
CARD_NVIDIA_GEFORCE_GTX780TI 
CARD_NVIDIA_GEFORCE_GTXTITAN 
CARD_NVIDIA_GEFORCE_GTXTITANB 
CARD_NVIDIA_GEFORCE_GTXTITANX 
CARD_NVIDIA_GEFORCE_GTXTITANZ 
CARD_NVIDIA_GEFORCE_820M 
CARD_NVIDIA_GEFORCE_830M 
CARD_NVIDIA_GEFORCE_840M 
CARD_NVIDIA_GEFORCE_845M 
CARD_NVIDIA_GEFORCE_GTX850M 
CARD_NVIDIA_GEFORCE_GTX860M 
CARD_NVIDIA_GEFORCE_GTX870M 
CARD_NVIDIA_GEFORCE_GTX880M 
CARD_NVIDIA_GEFORCE_940M 
CARD_NVIDIA_GEFORCE_GTX950 
CARD_NVIDIA_GEFORCE_GTX950M 
CARD_NVIDIA_GEFORCE_GTX960 
CARD_NVIDIA_GEFORCE_GTX960M 
CARD_NVIDIA_GEFORCE_GTX970 
CARD_NVIDIA_GEFORCE_GTX970M 
CARD_NVIDIA_GEFORCE_GTX980 
CARD_NVIDIA_GEFORCE_GTX980TI 
CARD_NVIDIA_GEFORCE_GT1030 
CARD_NVIDIA_GEFORCE_GTX1050 
CARD_NVIDIA_GEFORCE_GTX1050TI 
CARD_NVIDIA_GEFORCE_GTX1060_3GB 
CARD_NVIDIA_GEFORCE_GTX1060 
CARD_NVIDIA_GEFORCE_GTX1060M 
CARD_NVIDIA_GEFORCE_GTX1070 
CARD_NVIDIA_GEFORCE_GTX1070M 
CARD_NVIDIA_GEFORCE_GTX1080 
CARD_NVIDIA_GEFORCE_GTX1080M 
CARD_NVIDIA_GEFORCE_GTX1080TI 
CARD_NVIDIA_TITANX_PASCAL 
CARD_NVIDIA_TITANV 
CARD_NVIDIA_GEFORCE_GTX1650 
CARD_NVIDIA_GEFORCE_GTX1650SUPER 
CARD_NVIDIA_GEFORCE_GTX1660SUPER 
CARD_NVIDIA_GEFORCE_GTX1660TI 
CARD_NVIDIA_GEFORCE_RTX2060 
CARD_NVIDIA_GEFORCE_RTX2070 
CARD_NVIDIA_GEFORCE_RTX2080 
CARD_NVIDIA_GEFORCE_RTX2080TI 
CARD_NVIDIA_GEFORCE_RTX3050 
CARD_NVIDIA_GEFORCE_RTX3060 
CARD_NVIDIA_GEFORCE_RTX3060_LHR 
CARD_NVIDIA_GEFORCE_RTX3060TI_GA103 
CARD_NVIDIA_GEFORCE_RTX3060TI_GA104 
CARD_NVIDIA_GEFORCE_RTX3060TI_GA104_LHR 
CARD_NVIDIA_GEFORCE_RTX3070 
CARD_NVIDIA_GEFORCE_RTX3070_LHR 
CARD_NVIDIA_GEFORCE_RTX3070_MOBILE 
CARD_NVIDIA_GEFORCE_RTX3070TI 
CARD_NVIDIA_GEFORCE_RTX3080_10GB 
CARD_NVIDIA_GEFORCE_RTX3080_10GB_LHR 
CARD_NVIDIA_GEFORCE_RTX3080_12GB 
CARD_NVIDIA_GEFORCE_RTX3080TI 
CARD_NVIDIA_GEFORCE_RTX3090 
CARD_NVIDIA_GEFORCE_RTX3090TI 
CARD_NVIDIA_TESLA_T4 
CARD_NVIDIA_AMPERE_A10 
CARD_NVIDIA_GEFORCE_RTX4060 
CARD_NVIDIA_GEFORCE_RTX4060TI8G 
CARD_NVIDIA_GEFORCE_RTX4060TI16G 
CARD_NVIDIA_GEFORCE_RTX4070 
CARD_NVIDIA_GEFORCE_RTX4070SUPER 
CARD_NVIDIA_GEFORCE_RTX4070TI 
CARD_NVIDIA_GEFORCE_RTX4070TISUPER 
CARD_NVIDIA_GEFORCE_RTX4080 
CARD_NVIDIA_GEFORCE_RTX4080SUPER 
CARD_NVIDIA_GEFORCE_RTX4090 
CARD_REDHAT_VIRGL 
CARD_VMWARE_SVGA3D 
CARD_INTEL_830M 
CARD_INTEL_855GM 
CARD_INTEL_845G 
CARD_INTEL_865G 
CARD_INTEL_915G 
CARD_INTEL_E7221G 
CARD_INTEL_915GM 
CARD_INTEL_945G 
CARD_INTEL_945GM 
CARD_INTEL_945GME 
CARD_INTEL_Q35 
CARD_INTEL_G33 
CARD_INTEL_Q33 
CARD_INTEL_PNVG 
CARD_INTEL_PNVM 
CARD_INTEL_965Q 
CARD_INTEL_965G 
CARD_INTEL_946GZ 
CARD_INTEL_965GM 
CARD_INTEL_965GME 
CARD_INTEL_GM45 
CARD_INTEL_IGD 
CARD_INTEL_Q45 
CARD_INTEL_G45 
CARD_INTEL_G41 
CARD_INTEL_B43 
CARD_INTEL_ILKD 
CARD_INTEL_ILKM 
CARD_INTEL_SNBD 
CARD_INTEL_SNBM 
CARD_INTEL_SNBS 
CARD_INTEL_IVBD 
CARD_INTEL_IVBM 
CARD_INTEL_IVBS 
CARD_INTEL_HWD 
CARD_INTEL_HWM 
CARD_INTEL_HD5000_1 
CARD_INTEL_HD5000_2 
CARD_INTEL_I5100_1 
CARD_INTEL_I5100_2 
CARD_INTEL_I5100_3 
CARD_INTEL_I5100_4 
CARD_INTEL_IP5200_1 
CARD_INTEL_IP5200_2 
CARD_INTEL_IP5200_3 
CARD_INTEL_IP5200_4 
CARD_INTEL_IP5200_5 
CARD_INTEL_IP5200_6 
CARD_INTEL_HD5300 
CARD_INTEL_HD5500 
CARD_INTEL_HD5600 
CARD_INTEL_HD6000 
CARD_INTEL_I6100 
CARD_INTEL_IP6200 
CARD_INTEL_IPP6300 
CARD_INTEL_HD510_1 
CARD_INTEL_HD510_2 
CARD_INTEL_HD510_3 
CARD_INTEL_HD515 
CARD_INTEL_HD520_1 
CARD_INTEL_HD520_2 
CARD_INTEL_HD530_1 
CARD_INTEL_HD530_2 
CARD_INTEL_HDP530 
CARD_INTEL_I540 
CARD_INTEL_I550 
CARD_INTEL_I555 
CARD_INTEL_IP555 
CARD_INTEL_IP580_1 
CARD_INTEL_IP580_2 
CARD_INTEL_IPP580_1 
CARD_INTEL_IPP580_2 
CARD_INTEL_UHD617 
CARD_INTEL_UHD620 
CARD_INTEL_HD615 
CARD_INTEL_HD620 
CARD_INTEL_HD630_1 
CARD_INTEL_HD630_2 
CARD_INTEL_UHD630_1 
CARD_INTEL_UHD630_2 

Definition at line 2106 of file wined3d_private.h.

2107{
2108 CARD_WINE = 0x0000,
2109
2110 CARD_AMD_RAGE_128PRO = 0x5246,
2111 CARD_AMD_RADEON_7200 = 0x5144,
2112 CARD_AMD_RADEON_8500 = 0x514c,
2113 CARD_AMD_RADEON_9500 = 0x4144,
2115 CARD_AMD_RADEON_X700 = 0x5e4c,
2116 CARD_AMD_RADEON_X1600 = 0x71c2,
2117 CARD_AMD_RADEON_HD2350 = 0x94c7,
2118 CARD_AMD_RADEON_HD2600 = 0x9581,
2119 CARD_AMD_RADEON_HD2900 = 0x9400,
2120 CARD_AMD_RADEON_HD3200 = 0x9620,
2121 CARD_AMD_RADEON_HD3850 = 0x9515,
2122 CARD_AMD_RADEON_HD4200M = 0x9712,
2123 CARD_AMD_RADEON_HD4350 = 0x954f,
2124 CARD_AMD_RADEON_HD4600 = 0x9495,
2125 CARD_AMD_RADEON_HD4700 = 0x944e,
2126 CARD_AMD_RADEON_HD4800 = 0x944c,
2127 CARD_AMD_RADEON_HD5400 = 0x68f9,
2128 CARD_AMD_RADEON_HD5600 = 0x68d8,
2129 CARD_AMD_RADEON_HD5700 = 0x68be,
2130 CARD_AMD_RADEON_HD5800 = 0x6898,
2131 CARD_AMD_RADEON_HD5900 = 0x689c,
2132 CARD_AMD_RADEON_HD6300 = 0x9803,
2133 CARD_AMD_RADEON_HD6400 = 0x6770,
2134 CARD_AMD_RADEON_HD6490M = 0x6760,
2135 CARD_AMD_RADEON_HD6410D = 0x9644,
2136 CARD_AMD_RADEON_HD6480G = 0x9648,
2137 CARD_AMD_RADEON_HD6550D = 0x9640,
2138 CARD_AMD_RADEON_HD6600 = 0x6758,
2139 CARD_AMD_RADEON_HD6600M = 0x6741,
2140 CARD_AMD_RADEON_HD6700 = 0x68ba,
2141 CARD_AMD_RADEON_HD6800 = 0x6739,
2142 CARD_AMD_RADEON_HD6900 = 0x6719,
2143 CARD_AMD_RADEON_HD7660D = 0x9901,
2144 CARD_AMD_RADEON_HD7700 = 0x683d,
2145 CARD_AMD_RADEON_HD7800 = 0x6819,
2146 CARD_AMD_RADEON_HD7870 = 0x6818,
2147 CARD_AMD_RADEON_HD7900 = 0x679a,
2148 CARD_AMD_RADEON_HD8600M = 0x6660,
2149 CARD_AMD_RADEON_HD8670 = 0x6610,
2150 CARD_AMD_RADEON_HD8770 = 0x665c,
2151 CARD_AMD_RADEON_R3 = 0x9830,
2152 CARD_AMD_RADEON_R7 = 0x130f,
2153 CARD_AMD_RADEON_R9_285 = 0x6939,
2154 CARD_AMD_RADEON_R9_290 = 0x67b1,
2155 CARD_AMD_RADEON_R9_290X = 0x67b0,
2156 CARD_AMD_RADEON_R9_FURY = 0x7300,
2157 CARD_AMD_RADEON_R9_M370X = 0x6821,
2158 CARD_AMD_RADEON_R9_M380 = 0x6647,
2159 CARD_AMD_RADEON_R9_M395X = 0x6920,
2160 CARD_AMD_RADEON_RX_460 = 0x67ef,
2161 CARD_AMD_RADEON_RX_480 = 0x67df,
2164 CARD_AMD_RADEON_RAVEN = 0x15dd,
2169 CARD_AMD_RADEON_PRO_V620 = 0x73a1,
2171 CARD_AMD_VANGOGH = 0x163f,
2172 CARD_AMD_RAPHAEL = 0x164e,
2173
2174 CARD_NVIDIA_RIVA_128 = 0x0018,
2175 CARD_NVIDIA_RIVA_TNT = 0x0020,
2176 CARD_NVIDIA_RIVA_TNT2 = 0x0028,
2177 CARD_NVIDIA_GEFORCE = 0x0100,
2178 CARD_NVIDIA_GEFORCE2_MX = 0x0110,
2179 CARD_NVIDIA_GEFORCE2 = 0x0150,
2180 CARD_NVIDIA_GEFORCE3 = 0x0200,
2181 CARD_NVIDIA_GEFORCE4_MX = 0x0170,
2186 CARD_NVIDIA_GEFORCE_6200 = 0x014f,
2188 CARD_NVIDIA_GEFORCE_6800 = 0x0041,
2189 CARD_NVIDIA_GEFORCE_7300 = 0x01d7, /* GeForce Go 7300 */
2190 CARD_NVIDIA_GEFORCE_7400 = 0x01d8,
2191 CARD_NVIDIA_GEFORCE_7600 = 0x0391,
2193 CARD_NVIDIA_GEFORCE_8200 = 0x0849, /* Other PCI ID 0x084b */
2201 CARD_NVIDIA_GEFORCE_9200 = 0x086d,
2202 CARD_NVIDIA_GEFORCE_9300 = 0x086c,
2209 CARD_NVIDIA_GEFORCE_210 = 0x0a23,
2216 CARD_NVIDIA_GEFORCE_315M = 0x0a7a,
2217 CARD_NVIDIA_GEFORCE_320M = 0x08a3,
2222 CARD_NVIDIA_GEFORCE_410M = 0x1055,
2281 CARD_NVIDIA_GEFORCE_820M = 0x0fed,
2282 CARD_NVIDIA_GEFORCE_830M = 0x1340,
2283 CARD_NVIDIA_GEFORCE_840M = 0x1341,
2284 CARD_NVIDIA_GEFORCE_845M = 0x1344,
2286 CARD_NVIDIA_GEFORCE_GTX860M = 0x1392, /* Other PCI ID 0x119a */
2289 CARD_NVIDIA_GEFORCE_940M = 0x1347,
2310 CARD_NVIDIA_TITANV = 0x1d81,
2335 CARD_NVIDIA_TESLA_T4 = 0x1eb8,
2336 CARD_NVIDIA_AMPERE_A10 = 0x2236,
2347
2348 CARD_REDHAT_VIRGL = 0x1010,
2349
2350 CARD_VMWARE_SVGA3D = 0x0405,
2351
2352 CARD_INTEL_830M = 0x3577,
2353 CARD_INTEL_855GM = 0x3582,
2354 CARD_INTEL_845G = 0x2562,
2355 CARD_INTEL_865G = 0x2572,
2356 CARD_INTEL_915G = 0x2582,
2357 CARD_INTEL_E7221G = 0x258a,
2358 CARD_INTEL_915GM = 0x2592,
2359 CARD_INTEL_945G = 0x2772,
2360 CARD_INTEL_945GM = 0x27a2,
2361 CARD_INTEL_945GME = 0x27ae,
2362 CARD_INTEL_Q35 = 0x29b2,
2363 CARD_INTEL_G33 = 0x29c2,
2364 CARD_INTEL_Q33 = 0x29d2,
2365 CARD_INTEL_PNVG = 0xa001,
2366 CARD_INTEL_PNVM = 0xa011,
2367 CARD_INTEL_965Q = 0x2992,
2368 CARD_INTEL_965G = 0x2982,
2369 CARD_INTEL_946GZ = 0x2972,
2370 CARD_INTEL_965GM = 0x2a02,
2371 CARD_INTEL_965GME = 0x2a12,
2372 CARD_INTEL_GM45 = 0x2a42,
2373 CARD_INTEL_IGD = 0x2e02,
2374 CARD_INTEL_Q45 = 0x2e12,
2375 CARD_INTEL_G45 = 0x2e22,
2376 CARD_INTEL_G41 = 0x2e32,
2377 CARD_INTEL_B43 = 0x2e92,
2378 CARD_INTEL_ILKD = 0x0042,
2379 CARD_INTEL_ILKM = 0x0046,
2380 CARD_INTEL_SNBD = 0x0122,
2381 CARD_INTEL_SNBM = 0x0126,
2382 CARD_INTEL_SNBS = 0x010a,
2383 CARD_INTEL_IVBD = 0x0162,
2384 CARD_INTEL_IVBM = 0x0166,
2385 CARD_INTEL_IVBS = 0x015a,
2386 CARD_INTEL_HWD = 0x0412,
2387 CARD_INTEL_HWM = 0x0416,
2388 CARD_INTEL_HD5000_1 = 0x0a26,
2389 CARD_INTEL_HD5000_2 = 0x0422,
2390 CARD_INTEL_I5100_1 = 0x0a22,
2391 CARD_INTEL_I5100_2 = 0x0a2a,
2392 CARD_INTEL_I5100_3 = 0x0a2b,
2393 CARD_INTEL_I5100_4 = 0x0a2e,
2394 CARD_INTEL_IP5200_1 = 0x0d22,
2395 CARD_INTEL_IP5200_2 = 0x0d26,
2396 CARD_INTEL_IP5200_3 = 0x0d2a,
2397 CARD_INTEL_IP5200_4 = 0x0d2b,
2398 CARD_INTEL_IP5200_5 = 0x0d2e,
2399 CARD_INTEL_IP5200_6 = 0x0c22,
2400 CARD_INTEL_HD5300 = 0x161e,
2401 CARD_INTEL_HD5500 = 0x1616,
2402 CARD_INTEL_HD5600 = 0x1612,
2403 CARD_INTEL_HD6000 = 0x1626,
2404 CARD_INTEL_I6100 = 0x162b,
2405 CARD_INTEL_IP6200 = 0x1622,
2406 CARD_INTEL_IPP6300 = 0x162a,
2407 CARD_INTEL_HD510_1 = 0x1902,
2408 CARD_INTEL_HD510_2 = 0x1906,
2409 CARD_INTEL_HD510_3 = 0x190b,
2410 CARD_INTEL_HD515 = 0x191e,
2411 CARD_INTEL_HD520_1 = 0x1916,
2412 CARD_INTEL_HD520_2 = 0x1921,
2413 CARD_INTEL_HD530_1 = 0x1912,
2414 CARD_INTEL_HD530_2 = 0x191b,
2415 CARD_INTEL_HDP530 = 0x191d,
2416 CARD_INTEL_I540 = 0x1926,
2417 CARD_INTEL_I550 = 0x1927,
2418 CARD_INTEL_I555 = 0x192b,
2419 CARD_INTEL_IP555 = 0x192d,
2420 CARD_INTEL_IP580_1 = 0x1932,
2421 CARD_INTEL_IP580_2 = 0x193b,
2422 CARD_INTEL_IPP580_1 = 0x193a,
2423 CARD_INTEL_IPP580_2 = 0x193d,
2424 CARD_INTEL_UHD617 = 0x87c0,
2425 CARD_INTEL_UHD620 = 0x3ea0,
2426 CARD_INTEL_HD615 = 0x591e,
2427 CARD_INTEL_HD620 = 0x5916,
2428 CARD_INTEL_HD630_1 = 0x5912,
2429 CARD_INTEL_HD630_2 = 0x591b,
2430 CARD_INTEL_UHD630_1 = 0x3e9b,
2431 CARD_INTEL_UHD630_2 = 0x3e91,
2432};
@ CARD_NVIDIA_GEFORCE_GTX780
@ CARD_INTEL_I5100_4
@ CARD_INTEL_I5100_3
@ CARD_NVIDIA_GEFORCE_GTX950M
@ CARD_INTEL_946GZ
@ CARD_NVIDIA_GEFORCE_RTX4060
@ CARD_NVIDIA_GEFORCE_GTX1060_3GB
@ CARD_NVIDIA_GEFORCE_GT325M
@ CARD_NVIDIA_GEFORCE_GTXTITANZ
@ CARD_INTEL_HD5500
@ CARD_AMD_RADEON_HD4800
@ CARD_NVIDIA_GEFORCE_GTX775M
@ CARD_NVIDIA_GEFORCE_GTX570
@ CARD_NVIDIA_GEFORCE_GTXTITAN
@ CARD_NVIDIA_GEFORCE_RTX3080_10GB_LHR
@ CARD_NVIDIA_GEFORCE_GTX560TI
@ CARD_NVIDIA_GEFORCE_GTX1080TI
@ CARD_INTEL_855GM
@ CARD_NVIDIA_GEFORCE_GTS250
@ CARD_AMD_RADEON_HD6400
@ CARD_AMD_RADEON_HD4700
@ CARD_INTEL_IP5200_2
@ CARD_NVIDIA_GEFORCE_6800
@ CARD_AMD_RADEON_HD5700
@ CARD_NVIDIA_GEFORCE_GT610
@ CARD_NVIDIA_GEFORCE_GT420
@ CARD_NVIDIA_GEFORCEFX_5600
@ CARD_AMD_RADEON_R9_M370X
@ CARD_INTEL_945G
@ CARD_INTEL_HWD
@ CARD_NVIDIA_GEFORCE_GTX1080
@ CARD_INTEL_945GME
@ CARD_AMD_RADEON_RX_460
@ CARD_NVIDIA_GEFORCE_9600GT
@ CARD_NVIDIA_GEFORCE_GT640M
@ CARD_AMD_RADEON_HD7800
@ CARD_NVIDIA_GEFORCE_GTX1650SUPER
@ CARD_AMD_RADEON_RX_VEGA_20
@ CARD_INTEL_HD615
@ CARD_NVIDIA_GEFORCE_GT1030
@ CARD_NVIDIA_GEFORCE_940M
@ CARD_INTEL_915G
@ CARD_NVIDIA_GEFORCE_320M
@ CARD_AMD_RADEON_R9_290X
@ CARD_INTEL_G41
@ CARD_NVIDIA_GEFORCE_GT650M
@ CARD_NVIDIA_GEFORCE_GTX460
@ CARD_AMD_RADEON_RX_NAVI_21
@ CARD_INTEL_IP555
@ CARD_NVIDIA_GEFORCE_830M
@ CARD_AMD_RADEON_RX_VEGA_10
@ CARD_AMD_RADEON_HD2900
@ CARD_NVIDIA_RIVA_128
@ CARD_INTEL_I555
@ CARD_NVIDIA_GEFORCE_7300
@ CARD_NVIDIA_GEFORCEFX_5200
@ CARD_NVIDIA_GEFORCE_GTX1650
@ CARD_NVIDIA_GEFORCE_GT330
@ CARD_NVIDIA_GEFORCE_7600
@ CARD_INTEL_IPP6300
@ CARD_NVIDIA_GEFORCE_GT320M
@ CARD_INTEL_PNVG
@ CARD_WINE
@ CARD_NVIDIA_GEFORCE_820M
@ CARD_NVIDIA_GEFORCE_GTX280
@ CARD_NVIDIA_GEFORCE_6600GT
@ CARD_NVIDIA_GEFORCE_GT425M
@ CARD_NVIDIA_GEFORCE_GTX275
@ CARD_AMD_RADEON_XPRESS_200M
@ CARD_NVIDIA_GEFORCE_GT440
@ CARD_NVIDIA_GEFORCE_7400
@ CARD_AMD_RADEON_HD5600
@ CARD_NVIDIA_GEFORCE_GTX560
@ CARD_INTEL_IVBD
@ CARD_NVIDIA_GEFORCE_GTX650TI
@ CARD_INTEL_SNBS
@ CARD_NVIDIA_GEFORCE_845M
@ CARD_AMD_RADEON_HD5400
@ CARD_NVIDIA_GEFORCE_RTX3080_10GB
@ CARD_NVIDIA_GEFORCE_840M
@ CARD_INTEL_915GM
@ CARD_AMD_RADEON_X1600
@ CARD_INTEL_945GM
@ CARD_NVIDIA_GEFORCE_8800GTX
@ CARD_NVIDIA_GEFORCE_9700MGT
@ CARD_INTEL_965Q
@ CARD_INTEL_965G
@ CARD_NVIDIA_GEFORCE_GT730
@ CARD_INTEL_PNVM
@ CARD_NVIDIA_GEFORCE_GTX580
@ CARD_NVIDIA_GEFORCE_GTX1060
@ CARD_INTEL_IVBM
@ CARD_NVIDIA_GEFORCE_GTX1070
@ CARD_NVIDIA_GEFORCE_GTX950
@ CARD_INTEL_HD5000_2
@ CARD_NVIDIA_GEFORCE_RTX3090
@ CARD_NVIDIA_GEFORCE_RTX3060TI_GA104_LHR
@ CARD_INTEL_UHD630_1
@ CARD_NVIDIA_GEFORCE_GTX690
@ CARD_NVIDIA_GEFORCE_GTX780TI
@ CARD_NVIDIA_GEFORCE_RTX3050
@ CARD_AMD_RADEON_RX_VEGA_12
@ CARD_NVIDIA_GEFORCE_RTX3060TI_GA104
@ CARD_NVIDIA_GEFORCE_GTX770
@ CARD_NVIDIA_GEFORCE_RTX3090TI
@ CARD_NVIDIA_GEFORCE_GTX760
@ CARD_NVIDIA_GEFORCE_GTX880M
@ CARD_NVIDIA_GEFORCE4_TI4200
@ CARD_INTEL_UHD617
@ CARD_AMD_RADEON_HD4200M
@ CARD_INTEL_HD6000
@ CARD_INTEL_UHD620
@ CARD_NVIDIA_GEFORCE_GT430
@ CARD_NVIDIA_RIVA_TNT
@ CARD_NVIDIA_GEFORCE_GTX750TI
@ CARD_INTEL_I5100_2
@ CARD_INTEL_I540
@ CARD_NVIDIA_GEFORCE_8300GS
@ CARD_NVIDIA_GEFORCE_RTX4090
@ CARD_NVIDIA_GEFORCE_GTX465
@ CARD_INTEL_E7221G
@ CARD_INTEL_965GME
@ CARD_INTEL_IP580_2
@ CARD_AMD_RADEON_HD2600
@ CARD_INTEL_IP6200
@ CARD_NVIDIA_GEFORCE_RTX4070TI
@ CARD_NVIDIA_GEFORCE_GT240
@ CARD_NVIDIA_TITANX_PASCAL
@ CARD_AMD_RAPHAEL
@ CARD_AMD_RADEON_R9_M380
@ CARD_AMD_RADEON_HD6550D
@ CARD_AMD_RADEON_HD4600
@ CARD_INTEL_HD520_1
@ CARD_NVIDIA_GEFORCE_GT520
@ CARD_AMD_RADEON_RAVEN
@ CARD_INTEL_G33
@ CARD_NVIDIA_GEFORCE_RTX2080
@ CARD_AMD_RADEON_PRO_V620_VF
@ CARD_INTEL_HD5600
@ CARD_NVIDIA_GEFORCE_GTX675MX_1
@ CARD_NVIDIA_GEFORCE_GT730M
@ CARD_AMD_RADEON_RX_NAVI_14
@ CARD_NVIDIA_GEFORCE_8800GTS
@ CARD_NVIDIA_GEFORCE_RTX4070TISUPER
@ CARD_NVIDIA_GEFORCE_GT640
@ CARD_AMD_RADEON_HD6800
@ CARD_AMD_RADEON_HD3200
@ CARD_NVIDIA_GEFORCE_8400GS
@ CARD_INTEL_IP5200_6
@ CARD_NVIDIA_GEFORCE_RTX3070TI
@ CARD_AMD_RAGE_128PRO
@ CARD_NVIDIA_GEFORCE_8200
@ CARD_VMWARE_SVGA3D
@ CARD_AMD_RADEON_HD6600M
@ CARD_AMD_RADEON_HD7900
@ CARD_INTEL_845G
@ CARD_INTEL_HD510_2
@ CARD_NVIDIA_GEFORCE_RTX3080TI
@ CARD_NVIDIA_GEFORCE_GTX1660TI
@ CARD_NVIDIA_GEFORCE_RTX3070_MOBILE
@ CARD_AMD_RADEON_HD3850
@ CARD_AMD_RADEON_HD6600
@ CARD_INTEL_I5100_1
@ CARD_INTEL_ILKD
@ CARD_NVIDIA_GEFORCE_GTX480
@ CARD_INTEL_HD515
@ CARD_NVIDIA_GEFORCE_RTX4070SUPER
@ CARD_NVIDIA_GEFORCE_GT720
@ CARD_NVIDIA_GEFORCE_GTX550
@ CARD_NVIDIA_GEFORCE_9400M
@ CARD_NVIDIA_GEFORCE_GTX960
@ CARD_NVIDIA_GEFORCE_GT755M
@ CARD_REDHAT_VIRGL
@ CARD_AMD_RADEON_9500
@ CARD_NVIDIA_GEFORCE_GTX680
@ CARD_INTEL_Q45
@ CARD_AMD_RADEON_HD8670
@ CARD_NVIDIA_GEFORCE2
@ CARD_AMD_RADEON_HD7870
@ CARD_NVIDIA_GEFORCE_8600MGT
@ CARD_INTEL_Q33
@ CARD_NVIDIA_GEFORCE_GTX650
@ CARD_NVIDIA_GEFORCE_GT555M
@ CARD_NVIDIA_GEFORCE_GTS350M
@ CARD_NVIDIA_GEFORCE_RTX3080_12GB
@ CARD_AMD_RADEON_HD7660D
@ CARD_NVIDIA_GEFORCE_GTX870M
@ CARD_NVIDIA_GEFORCE_9400GT
@ CARD_NVIDIA_GEFORCE_GTX850M
@ CARD_NVIDIA_GEFORCE_RTX3060
@ CARD_NVIDIA_GEFORCE_7800GT
@ CARD_INTEL_Q35
@ CARD_AMD_RADEON_R9_M395X
@ CARD_NVIDIA_GEFORCE
@ CARD_NVIDIA_GEFORCE_RTX3060TI_GA103
@ CARD_NVIDIA_GEFORCE_GTX670
@ CARD_AMD_RADEON_R9_290
@ CARD_NVIDIA_GEFORCE_GTX765M
@ CARD_AMD_RADEON_HD5900
@ CARD_NVIDIA_TITANV
@ CARD_NVIDIA_GEFORCE_RTX4080SUPER
@ CARD_NVIDIA_GEFORCE_GTX1080M
@ CARD_INTEL_G45
@ CARD_AMD_RADEON_R9_FURY
@ CARD_INTEL_IVBS
@ CARD_NVIDIA_GEFORCE_RTX4060TI16G
@ CARD_INTEL_865G
@ CARD_INTEL_IP5200_5
@ CARD_NVIDIA_GEFORCE_RTX4070
@ CARD_NVIDIA_GEFORCE_RTX3060_LHR
@ CARD_NVIDIA_GEFORCE_210
@ CARD_INTEL_IPP580_1
@ CARD_NVIDIA_GEFORCE_GTX660M
@ CARD_INTEL_HD510_3
@ CARD_NVIDIA_GEFORCE_GTX460M
@ CARD_AMD_RADEON_HD6700
@ CARD_NVIDIA_GEFORCE_9800GT
@ CARD_INTEL_IGD
@ CARD_INTEL_965GM
@ CARD_AMD_RADEON_X700
@ CARD_AMD_RADEON_7200
@ CARD_AMD_RADEON_HD6900
@ CARD_INTEL_I6100
@ CARD_NVIDIA_GEFORCE_6200
@ CARD_INTEL_I550
@ CARD_INTEL_IP580_1
@ CARD_INTEL_SNBD
@ CARD_AMD_RADEON_R7
@ CARD_AMD_RADEON_8500
@ CARD_INTEL_IP5200_1
@ CARD_NVIDIA_GEFORCE_9300
@ CARD_NVIDIA_GEFORCE_GT525M
@ CARD_NVIDIA_GEFORCE_GTX760TI
@ CARD_NVIDIA_AMPERE_A10
@ CARD_INTEL_GM45
@ CARD_NVIDIA_GEFORCE_GTX1060M
@ CARD_INTEL_UHD630_2
@ CARD_NVIDIA_GEFORCE_GTX260
@ CARD_NVIDIA_GEFORCE_GTX980
@ CARD_NVIDIA_GEFORCE_8600GT
@ CARD_NVIDIA_GEFORCE_GTX970M
@ CARD_NVIDIA_GEFORCE_GTX560M
@ CARD_NVIDIA_GEFORCE_GTX1070M
@ CARD_NVIDIA_GEFORCE_315M
@ CARD_NVIDIA_GEFORCE_RTX2070
@ CARD_NVIDIA_GEFORCE_GT630
@ CARD_NVIDIA_GEFORCE_GT220
@ CARD_AMD_RADEON_HD7700
@ CARD_NVIDIA_GEFORCE_GTX750
@ CARD_INTEL_HDP530
@ CARD_NVIDIA_RIVA_TNT2
@ CARD_NVIDIA_GEFORCE_GTX770M
@ CARD_NVIDIA_GEFORCE_GTXTITANX
@ CARD_NVIDIA_GEFORCE_GTX1660SUPER
@ CARD_AMD_RADEON_RX_NAVI_10
@ CARD_NVIDIA_GEFORCE_GTX675MX_2
@ CARD_AMD_RADEON_HD5800
@ CARD_AMD_RADEON_PRO_V620
@ CARD_INTEL_HD530_2
@ CARD_NVIDIA_GEFORCEFX_5800
@ CARD_AMD_RADEON_HD2350
@ CARD_AMD_RADEON_R9_285
@ CARD_NVIDIA_GEFORCE_GTX1050
@ CARD_AMD_RADEON_HD8600M
@ CARD_NVIDIA_GEFORCE3
@ CARD_INTEL_HD630_2
@ CARD_NVIDIA_GEFORCE_RTX4060TI8G
@ CARD_INTEL_HD520_2
@ CARD_NVIDIA_GEFORCE_GTXTITANB
@ CARD_INTEL_HD630_1
@ CARD_NVIDIA_GEFORCE4_MX
@ CARD_NVIDIA_TESLA_T4
@ CARD_NVIDIA_GEFORCE_GTX780M
@ CARD_NVIDIA_GEFORCE_GTX960M
@ CARD_AMD_RADEON_R3
@ CARD_NVIDIA_GEFORCE_GTX1050TI
@ CARD_NVIDIA_GEFORCE_GTX970
@ CARD_AMD_RADEON_HD6300
@ CARD_NVIDIA_GEFORCE_GT630M
@ CARD_INTEL_SNBM
@ CARD_NVIDIA_GEFORCE_GT740M
@ CARD_AMD_RADEON_HD8770
@ CARD_INTEL_HD510_1
@ CARD_INTEL_830M
@ CARD_NVIDIA_GEFORCE_GT540M
@ CARD_NVIDIA_GEFORCE_GTX660
@ CARD_NVIDIA_GEFORCE_RTX4080
@ CARD_AMD_RADEON_HD6490M
@ CARD_INTEL_IPP580_2
@ CARD_INTEL_IP5200_4
@ CARD_AMD_RADEON_RX_480
@ CARD_NVIDIA_GEFORCE_RTX3070
@ CARD_INTEL_HD530_1
@ CARD_INTEL_IP5200_3
@ CARD_INTEL_HD5300
@ CARD_INTEL_HD620
@ CARD_NVIDIA_GEFORCE2_MX
@ CARD_INTEL_ILKM
@ CARD_NVIDIA_GEFORCE_RTX2060
@ CARD_NVIDIA_GEFORCE_GTX470
@ CARD_NVIDIA_GEFORCE_RTX2080TI
@ CARD_NVIDIA_GEFORCE_8500GT
@ CARD_NVIDIA_GEFORCE_GTX980TI
@ CARD_NVIDIA_GEFORCE_410M
@ CARD_AMD_VANGOGH
@ CARD_NVIDIA_GEFORCE_GTS450
@ CARD_NVIDIA_GEFORCE_GT750M
@ CARD_AMD_RADEON_HD6480G
@ CARD_NVIDIA_GEFORCE_RTX3070_LHR
@ CARD_NVIDIA_GEFORCE_GTX660TI
@ CARD_INTEL_HWM
@ CARD_NVIDIA_GEFORCE_9500GT
@ CARD_NVIDIA_GEFORCE_GTX670MX
@ CARD_NVIDIA_GEFORCE_GTX860M
@ CARD_AMD_RADEON_HD4350
@ CARD_INTEL_B43
@ CARD_NVIDIA_GEFORCE_9200
@ CARD_INTEL_HD5000_1
@ CARD_AMD_RADEON_HD6410D

◆ wined3d_pci_vendor

Enumerator
HW_VENDOR_SOFTWARE 
HW_VENDOR_AMD 
HW_VENDOR_NVIDIA 
HW_VENDOR_VMWARE 
HW_VENDOR_REDHAT 
HW_VENDOR_INTEL 

Definition at line 2096 of file wined3d_private.h.

2097{
2098 HW_VENDOR_SOFTWARE = 0x0000,
2099 HW_VENDOR_AMD = 0x1002,
2100 HW_VENDOR_NVIDIA = 0x10de,
2101 HW_VENDOR_VMWARE = 0x15ad,
2102 HW_VENDOR_REDHAT = 0x1af4,
2103 HW_VENDOR_INTEL = 0x8086,
2104};
@ HW_VENDOR_INTEL
@ HW_VENDOR_NVIDIA
@ HW_VENDOR_REDHAT
@ HW_VENDOR_AMD
@ HW_VENDOR_SOFTWARE
@ HW_VENDOR_VMWARE

◆ wined3d_projection_type

Enumerator
WINED3D_PROJECTION_NONE 
WINED3D_PROJECTION_COUNT3 
WINED3D_PROJECTION_COUNT4 

Definition at line 2642 of file wined3d_private.h.

2643{
2647};
@ WINED3D_PROJECTION_COUNT3
@ WINED3D_PROJECTION_NONE
@ WINED3D_PROJECTION_COUNT4

◆ wined3d_push_constants

Enumerator
WINED3D_PUSH_CONSTANTS_VS_F 
WINED3D_PUSH_CONSTANTS_PS_F 
WINED3D_PUSH_CONSTANTS_VS_I 
WINED3D_PUSH_CONSTANTS_PS_I 
WINED3D_PUSH_CONSTANTS_VS_B 
WINED3D_PUSH_CONSTANTS_PS_B 
WINED3D_PUSH_CONSTANTS_VS_FFP 
WINED3D_PUSH_CONSTANTS_PS_FFP 
WINED3D_PUSH_CONSTANTS_COUNT 

Definition at line 2853 of file wined3d_private.h.

◆ wined3d_query_state

Enumerator
QUERY_CREATED 
QUERY_SIGNALLED 
QUERY_BUILDING 

Definition at line 1820 of file wined3d_private.h.

1821{
1825};
@ QUERY_BUILDING
@ QUERY_SIGNALLED
@ QUERY_CREATED

◆ wined3d_shader_backend

Enumerator
WINED3D_SHADER_BACKEND_AUTO 
WINED3D_SHADER_BACKEND_GLSL 
WINED3D_SHADER_BACKEND_GLSL_VKD3D 

Definition at line 456 of file wined3d_private.h.

457{
461};
@ WINED3D_SHADER_BACKEND_AUTO
@ WINED3D_SHADER_BACKEND_GLSL
@ WINED3D_SHADER_BACKEND_GLSL_VKD3D

◆ wined3d_shader_conditional_op

Enumerator
WINED3D_SHADER_CONDITIONAL_OP_NZ 
WINED3D_SHADER_CONDITIONAL_OP_Z 

Definition at line 726 of file wined3d_private.h.

727{
730};
@ WINED3D_SHADER_CONDITIONAL_OP_NZ
@ WINED3D_SHADER_CONDITIONAL_OP_Z

◆ wined3d_shader_dst_modifier

Enumerator
WINED3DSPDM_NONE 
WINED3DSPDM_SATURATE 
WINED3DSPDM_PARTIALPRECISION 
WINED3DSPDM_MSAMPCENTROID 

Definition at line 633 of file wined3d_private.h.

634{
639};
@ WINED3DSPDM_MSAMPCENTROID
@ WINED3DSPDM_PARTIALPRECISION
@ WINED3DSPDM_SATURATE
@ WINED3DSPDM_NONE

◆ wined3d_shader_global_flags

Enumerator
WINED3DSGF_REFACTORING_ALLOWED 
WINED3DSGF_FORCE_EARLY_DEPTH_STENCIL 
WINED3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS 

Definition at line 656 of file wined3d_private.h.

657{
661};
@ WINED3DSGF_REFACTORING_ALLOWED
@ WINED3DSGF_FORCE_EARLY_DEPTH_STENCIL
@ WINED3DSGF_ENABLE_RAW_AND_STRUCTURED_BUFFERS

◆ wined3d_shader_input_sysval_semantic

Enumerator
WINED3D_SIV_POSITION 
WINED3D_SIV_CLIP_DISTANCE 
WINED3D_SIV_CULL_DISTANCE 
WINED3D_SIV_RENDER_TARGET_ARRAY_INDEX 
WINED3D_SIV_VIEWPORT_ARRAY_INDEX 
WINED3D_SIV_VERTEX_ID 
WINED3D_SIV_PRIMITIVE_ID 
WINED3D_SIV_INSTANCE_ID 
WINED3D_SIV_IS_FRONT_FACE 
WINED3D_SIV_SAMPLE_INDEX 
WINED3D_SIV_QUAD_U0_TESS_FACTOR 
WINED3D_SIV_QUAD_V0_TESS_FACTOR 
WINED3D_SIV_QUAD_U1_TESS_FACTOR 
WINED3D_SIV_QUAD_V1_TESS_FACTOR 
WINED3D_SIV_QUAD_U_INNER_TESS_FACTOR 
WINED3D_SIV_QUAD_V_INNER_TESS_FACTOR 
WINED3D_SIV_TRIANGLE_U_TESS_FACTOR 
WINED3D_SIV_TRIANGLE_V_TESS_FACTOR 
WINED3D_SIV_TRIANGLE_W_TESS_FACTOR 
WINED3D_SIV_TRIANGLE_INNER_TESS_FACTOR 
WINED3D_SIV_LINE_DETAIL_TESS_FACTOR 
WINED3D_SIV_LINE_DENSITY_TESS_FACTOR 

Definition at line 1248 of file wined3d_private.h.

1249{
1272};
@ WINED3D_SIV_VIEWPORT_ARRAY_INDEX
@ WINED3D_SIV_TRIANGLE_INNER_TESS_FACTOR
@ WINED3D_SIV_CULL_DISTANCE
@ WINED3D_SIV_QUAD_V0_TESS_FACTOR
@ WINED3D_SIV_POSITION
@ WINED3D_SIV_IS_FRONT_FACE
@ WINED3D_SIV_QUAD_V_INNER_TESS_FACTOR
@ WINED3D_SIV_TRIANGLE_U_TESS_FACTOR
@ WINED3D_SIV_INSTANCE_ID
@ WINED3D_SIV_TRIANGLE_W_TESS_FACTOR
@ WINED3D_SIV_RENDER_TARGET_ARRAY_INDEX
@ WINED3D_SIV_QUAD_U0_TESS_FACTOR
@ WINED3D_SIV_CLIP_DISTANCE
@ WINED3D_SIV_QUAD_U1_TESS_FACTOR
@ WINED3D_SIV_SAMPLE_INDEX
@ WINED3D_SIV_TRIANGLE_V_TESS_FACTOR
@ WINED3D_SIV_LINE_DETAIL_TESS_FACTOR
@ WINED3D_SIV_LINE_DENSITY_TESS_FACTOR
@ WINED3D_SIV_VERTEX_ID
@ WINED3D_SIV_QUAD_V1_TESS_FACTOR
@ WINED3D_SIV_PRIMITIVE_ID
@ WINED3D_SIV_QUAD_U_INNER_TESS_FACTOR

◆ WINED3D_SHADER_INSTRUCTION_HANDLER

Enumerator
WINED3DSIH_ABS 
WINED3DSIH_ADD 
WINED3DSIH_AND 
WINED3DSIH_ATOMIC_AND 
WINED3DSIH_ATOMIC_CMP_STORE 
WINED3DSIH_ATOMIC_IADD 
WINED3DSIH_ATOMIC_IMAX 
WINED3DSIH_ATOMIC_IMIN 
WINED3DSIH_ATOMIC_OR 
WINED3DSIH_ATOMIC_UMAX 
WINED3DSIH_ATOMIC_UMIN 
WINED3DSIH_ATOMIC_XOR 
WINED3DSIH_BEM 
WINED3DSIH_BFI 
WINED3DSIH_BFREV 
WINED3DSIH_BREAK 
WINED3DSIH_BREAKC 
WINED3DSIH_BREAKP 
WINED3DSIH_BUFINFO 
WINED3DSIH_CALL 
WINED3DSIH_CALLNZ 
WINED3DSIH_CASE 
WINED3DSIH_CMP 
WINED3DSIH_CND 
WINED3DSIH_CONTINUE 
WINED3DSIH_CONTINUEP 
WINED3DSIH_COUNTBITS 
WINED3DSIH_CRS 
WINED3DSIH_CUT 
WINED3DSIH_CUT_STREAM 
WINED3DSIH_DCL 
WINED3DSIH_DCL_CONSTANT_BUFFER 
WINED3DSIH_DCL_FUNCTION_BODY 
WINED3DSIH_DCL_FUNCTION_TABLE 
WINED3DSIH_DCL_GLOBAL_FLAGS 
WINED3DSIH_DCL_GS_INSTANCES 
WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT 
WINED3DSIH_DCL_HS_JOIN_PHASE_INSTANCE_COUNT 
WINED3DSIH_DCL_HS_MAX_TESSFACTOR 
WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER 
WINED3DSIH_DCL_INDEX_RANGE 
WINED3DSIH_DCL_INDEXABLE_TEMP 
WINED3DSIH_DCL_INPUT 
WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT 
WINED3DSIH_DCL_INPUT_PRIMITIVE 
WINED3DSIH_DCL_INPUT_PS 
WINED3DSIH_DCL_INPUT_PS_SGV 
WINED3DSIH_DCL_INPUT_PS_SIV 
WINED3DSIH_DCL_INPUT_SGV 
WINED3DSIH_DCL_INPUT_SIV 
WINED3DSIH_DCL_INTERFACE 
WINED3DSIH_DCL_OUTPUT 
WINED3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT 
WINED3DSIH_DCL_OUTPUT_SIV 
WINED3DSIH_DCL_OUTPUT_TOPOLOGY 
WINED3DSIH_DCL_RESOURCE_RAW 
WINED3DSIH_DCL_RESOURCE_STRUCTURED 
WINED3DSIH_DCL_SAMPLER 
WINED3DSIH_DCL_STREAM 
WINED3DSIH_DCL_TEMPS 
WINED3DSIH_DCL_TESSELLATOR_DOMAIN 
WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE 
WINED3DSIH_DCL_TESSELLATOR_PARTITIONING 
WINED3DSIH_DCL_TGSM_RAW 
WINED3DSIH_DCL_TGSM_STRUCTURED 
WINED3DSIH_DCL_THREAD_GROUP 
WINED3DSIH_DCL_UAV_RAW 
WINED3DSIH_DCL_UAV_STRUCTURED 
WINED3DSIH_DCL_UAV_TYPED 
WINED3DSIH_DCL_VERTICES_OUT 
WINED3DSIH_DEF 
WINED3DSIH_DEFAULT 
WINED3DSIH_DEFB 
WINED3DSIH_DEFI 
WINED3DSIH_DIV 
WINED3DSIH_DP2 
WINED3DSIH_DP2ADD 
WINED3DSIH_DP3 
WINED3DSIH_DP4 
WINED3DSIH_DST 
WINED3DSIH_DSX 
WINED3DSIH_DSX_COARSE 
WINED3DSIH_DSX_FINE 
WINED3DSIH_DSY 
WINED3DSIH_DSY_COARSE 
WINED3DSIH_DSY_FINE 
WINED3DSIH_ELSE 
WINED3DSIH_EMIT 
WINED3DSIH_EMIT_STREAM 
WINED3DSIH_ENDIF 
WINED3DSIH_ENDLOOP 
WINED3DSIH_ENDREP 
WINED3DSIH_ENDSWITCH 
WINED3DSIH_EQ 
WINED3DSIH_EVAL_CENTROID 
WINED3DSIH_EVAL_SAMPLE_INDEX 
WINED3DSIH_EXP 
WINED3DSIH_EXPP 
WINED3DSIH_F16TOF32 
WINED3DSIH_F32TOF16 
WINED3DSIH_FCALL 
WINED3DSIH_FIRSTBIT_HI 
WINED3DSIH_FIRSTBIT_LO 
WINED3DSIH_FIRSTBIT_SHI 
WINED3DSIH_FRC 
WINED3DSIH_FTOI 
WINED3DSIH_FTOU 
WINED3DSIH_GATHER4 
WINED3DSIH_GATHER4_C 
WINED3DSIH_GATHER4_PO 
WINED3DSIH_GATHER4_PO_C 
WINED3DSIH_GE 
WINED3DSIH_HS_CONTROL_POINT_PHASE 
WINED3DSIH_HS_DECLS 
WINED3DSIH_HS_FORK_PHASE 
WINED3DSIH_HS_JOIN_PHASE 
WINED3DSIH_IADD 
WINED3DSIH_IBFE 
WINED3DSIH_IEQ 
WINED3DSIH_IF 
WINED3DSIH_IFC 
WINED3DSIH_IGE 
WINED3DSIH_ILT 
WINED3DSIH_IMAD 
WINED3DSIH_IMAX 
WINED3DSIH_IMIN 
WINED3DSIH_IMM_ATOMIC_ALLOC 
WINED3DSIH_IMM_ATOMIC_AND 
WINED3DSIH_IMM_ATOMIC_CMP_EXCH 
WINED3DSIH_IMM_ATOMIC_CONSUME 
WINED3DSIH_IMM_ATOMIC_EXCH 
WINED3DSIH_IMM_ATOMIC_IADD 
WINED3DSIH_IMM_ATOMIC_IMAX 
WINED3DSIH_IMM_ATOMIC_IMIN 
WINED3DSIH_IMM_ATOMIC_OR 
WINED3DSIH_IMM_ATOMIC_UMAX 
WINED3DSIH_IMM_ATOMIC_UMIN 
WINED3DSIH_IMM_ATOMIC_XOR 
WINED3DSIH_IMUL 
WINED3DSIH_INE 
WINED3DSIH_INEG 
WINED3DSIH_ISHL 
WINED3DSIH_ISHR 
WINED3DSIH_ITOF 
WINED3DSIH_LABEL 
WINED3DSIH_LD 
WINED3DSIH_LD2DMS 
WINED3DSIH_LD_RAW 
WINED3DSIH_LD_STRUCTURED 
WINED3DSIH_LD_UAV_TYPED 
WINED3DSIH_LIT 
WINED3DSIH_LOD 
WINED3DSIH_LOG 
WINED3DSIH_LOGP 
WINED3DSIH_LOOP 
WINED3DSIH_LRP 
WINED3DSIH_LT 
WINED3DSIH_M3x2 
WINED3DSIH_M3x3 
WINED3DSIH_M3x4 
WINED3DSIH_M4x3 
WINED3DSIH_M4x4 
WINED3DSIH_MAD 
WINED3DSIH_MAX 
WINED3DSIH_MIN 
WINED3DSIH_MOV 
WINED3DSIH_MOVA 
WINED3DSIH_MOVC 
WINED3DSIH_MUL 
WINED3DSIH_NE 
WINED3DSIH_NOP 
WINED3DSIH_NOT 
WINED3DSIH_NRM 
WINED3DSIH_OR 
WINED3DSIH_PHASE 
WINED3DSIH_POW 
WINED3DSIH_RCP 
WINED3DSIH_REP 
WINED3DSIH_RESINFO 
WINED3DSIH_RET 
WINED3DSIH_RETP 
WINED3DSIH_ROUND_NE 
WINED3DSIH_ROUND_NI 
WINED3DSIH_ROUND_PI 
WINED3DSIH_ROUND_Z 
WINED3DSIH_RSQ 
WINED3DSIH_SAMPLE 
WINED3DSIH_SAMPLE_B 
WINED3DSIH_SAMPLE_C 
WINED3DSIH_SAMPLE_C_LZ 
WINED3DSIH_SAMPLE_GRAD 
WINED3DSIH_SAMPLE_INFO 
WINED3DSIH_SAMPLE_LOD 
WINED3DSIH_SAMPLE_POS 
WINED3DSIH_SETP 
WINED3DSIH_SGE 
WINED3DSIH_SGN 
WINED3DSIH_SINCOS 
WINED3DSIH_SLT 
WINED3DSIH_SQRT 
WINED3DSIH_STORE_RAW 
WINED3DSIH_STORE_STRUCTURED 
WINED3DSIH_STORE_UAV_TYPED 
WINED3DSIH_SUB 
WINED3DSIH_SWAPC 
WINED3DSIH_SWITCH 
WINED3DSIH_SYNC 
WINED3DSIH_TEX 
WINED3DSIH_TEXBEM 
WINED3DSIH_TEXBEML 
WINED3DSIH_TEXCOORD 
WINED3DSIH_TEXDEPTH 
WINED3DSIH_TEXDP3 
WINED3DSIH_TEXDP3TEX 
WINED3DSIH_TEXKILL 
WINED3DSIH_TEXLDD 
WINED3DSIH_TEXLDL 
WINED3DSIH_TEXM3x2DEPTH 
WINED3DSIH_TEXM3x2PAD 
WINED3DSIH_TEXM3x2TEX 
WINED3DSIH_TEXM3x3 
WINED3DSIH_TEXM3x3DIFF 
WINED3DSIH_TEXM3x3PAD 
WINED3DSIH_TEXM3x3SPEC 
WINED3DSIH_TEXM3x3TEX 
WINED3DSIH_TEXM3x3VSPEC 
WINED3DSIH_TEXREG2AR 
WINED3DSIH_TEXREG2GB 
WINED3DSIH_TEXREG2RGB 
WINED3DSIH_UBFE 
WINED3DSIH_UDIV 
WINED3DSIH_UGE 
WINED3DSIH_ULT 
WINED3DSIH_UMAX 
WINED3DSIH_UMIN 
WINED3DSIH_UMUL 
WINED3DSIH_USHR 
WINED3DSIH_UTOF 
WINED3DSIH_XOR 
WINED3DSIH_TABLE_SIZE 

Definition at line 814 of file wined3d_private.h.

815{
1056};
@ WINED3DSIH_DSX_COARSE
@ WINED3DSIH_DCL_TESSELLATOR_PARTITIONING
@ WINED3DSIH_MOVC
@ WINED3DSIH_ULT
@ WINED3DSIH_SINCOS
@ WINED3DSIH_DCL_TEMPS
@ WINED3DSIH_LIT
@ WINED3DSIH_DP4
@ WINED3DSIH_GATHER4_PO_C
@ WINED3DSIH_ATOMIC_XOR
@ WINED3DSIH_TEXDEPTH
@ WINED3DSIH_MUL
@ WINED3DSIH_DSX_FINE
@ WINED3DSIH_DCL_OUTPUT
@ WINED3DSIH_DCL_FUNCTION_TABLE
@ WINED3DSIH_DCL_INPUT_SIV
@ WINED3DSIH_M3x3
@ WINED3DSIH_CALLNZ
@ WINED3DSIH_IMM_ATOMIC_XOR
@ WINED3DSIH_TEXREG2RGB
@ WINED3DSIH_IEQ
@ WINED3DSIH_DCL_INPUT
@ WINED3DSIH_TEXLDL
@ WINED3DSIH_CONTINUE
@ WINED3DSIH_CONTINUEP
@ WINED3DSIH_DEFI
@ WINED3DSIH_FIRSTBIT_HI
@ WINED3DSIH_IADD
@ WINED3DSIH_ABS
@ WINED3DSIH_SAMPLE_B
@ WINED3DSIH_LRP
@ WINED3DSIH_DCL_CONSTANT_BUFFER
@ WINED3DSIH_ROUND_Z
@ WINED3DSIH_DST
@ WINED3DSIH_DCL_INTERFACE
@ WINED3DSIH_TEXREG2AR
@ WINED3DSIH_TEXM3x3PAD
@ WINED3DSIH_IMM_ATOMIC_IADD
@ WINED3DSIH_TEXREG2GB
@ WINED3DSIH_LOOP
@ WINED3DSIH_DSY_COARSE
@ WINED3DSIH_M3x4
@ WINED3DSIH_SAMPLE_LOD
@ WINED3DSIH_SYNC
@ WINED3DSIH_ISHL
@ WINED3DSIH_SWITCH
@ WINED3DSIH_SWAPC
@ WINED3DSIH_SUB
@ WINED3DSIH_RCP
@ WINED3DSIH_F16TOF32
@ WINED3DSIH_IMIN
@ WINED3DSIH_STORE_STRUCTURED
@ WINED3DSIH_NOP
@ WINED3DSIH_ENDIF
@ WINED3DSIH_IMM_ATOMIC_UMAX
@ WINED3DSIH_STORE_UAV_TYPED
@ WINED3DSIH_FTOI
@ WINED3DSIH_LD
@ WINED3DSIH_TEXM3x3TEX
@ WINED3DSIH_EXP
@ WINED3DSIH_ATOMIC_IMAX
@ WINED3DSIH_DEFAULT
@ WINED3DSIH_UMAX
@ WINED3DSIH_OR
@ WINED3DSIH_ROUND_PI
@ WINED3DSIH_SAMPLE_GRAD
@ WINED3DSIH_ATOMIC_AND
@ WINED3DSIH_TEXM3x3VSPEC
@ WINED3DSIH_DCL_INPUT_SGV
@ WINED3DSIH_IF
@ WINED3DSIH_ATOMIC_UMIN
@ WINED3DSIH_UMIN
@ WINED3DSIH_ATOMIC_OR
@ WINED3DSIH_DCL_INPUT_PS_SGV
@ WINED3DSIH_LD2DMS
@ WINED3DSIH_LOG
@ WINED3DSIH_TEXM3x2DEPTH
@ WINED3DSIH_SAMPLE
@ WINED3DSIH_MOV
@ WINED3DSIH_DCL_IMMEDIATE_CONSTANT_BUFFER
@ WINED3DSIH_HS_DECLS
@ WINED3DSIH_AND
@ WINED3DSIH_NRM
@ WINED3DSIH_DCL_THREAD_GROUP
@ WINED3DSIH_CRS
@ WINED3DSIH_UMUL
@ WINED3DSIH_DCL_OUTPUT_SIV
@ WINED3DSIH_DCL_INDEX_RANGE
@ WINED3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE
@ WINED3DSIH_ATOMIC_CMP_STORE
@ WINED3DSIH_LD_RAW
@ WINED3DSIH_GATHER4
@ WINED3DSIH_TEXM3x3
@ WINED3DSIH_UTOF
@ WINED3DSIH_ELSE
@ WINED3DSIH_HS_CONTROL_POINT_PHASE
@ WINED3DSIH_DEFB
@ WINED3DSIH_LD_STRUCTURED
@ WINED3DSIH_ENDSWITCH
@ WINED3DSIH_ATOMIC_IADD
@ WINED3DSIH_RSQ
@ WINED3DSIH_SQRT
@ WINED3DSIH_IMM_ATOMIC_AND
@ WINED3DSIH_DP2ADD
@ WINED3DSIH_TEXM3x2TEX
@ WINED3DSIH_IMM_ATOMIC_CONSUME
@ WINED3DSIH_EQ
@ WINED3DSIH_IMM_ATOMIC_UMIN
@ WINED3DSIH_ADD
@ WINED3DSIH_HS_FORK_PHASE
@ WINED3DSIH_BREAK
@ WINED3DSIH_NOT
@ WINED3DSIH_XOR
@ WINED3DSIH_BFREV
@ WINED3DSIH_FRC
@ WINED3DSIH_SAMPLE_INFO
@ WINED3DSIH_EVAL_CENTROID
@ WINED3DSIH_DSX
@ WINED3DSIH_DCL
@ WINED3DSIH_COUNTBITS
@ WINED3DSIH_IMM_ATOMIC_CMP_EXCH
@ WINED3DSIH_DCL_VERTICES_OUT
@ WINED3DSIH_CALL
@ WINED3DSIH_HS_JOIN_PHASE
@ WINED3DSIH_USHR
@ WINED3DSIH_ENDREP
@ WINED3DSIH_F32TOF16
@ WINED3DSIH_EMIT
@ WINED3DSIH_BEM
@ WINED3DSIH_TEXDP3TEX
@ WINED3DSIH_TEXBEML
@ WINED3DSIH_ILT
@ WINED3DSIH_DCL_OUTPUT_TOPOLOGY
@ WINED3DSIH_DCL_HS_MAX_TESSFACTOR
@ WINED3DSIH_TEXM3x3SPEC
@ WINED3DSIH_BREAKC
@ WINED3DSIH_UBFE
@ WINED3DSIH_ATOMIC_IMIN
@ WINED3DSIH_SETP
@ WINED3DSIH_BREAKP
@ WINED3DSIH_BFI
@ WINED3DSIH_DCL_SAMPLER
@ WINED3DSIH_TEXBEM
@ WINED3DSIH_DCL_GS_INSTANCES
@ WINED3DSIH_DCL_TGSM_RAW
@ WINED3DSIH_M3x2
@ WINED3DSIH_DCL_UAV_TYPED
@ WINED3DSIH_MIN
@ WINED3DSIH_TEXLDD
@ WINED3DSIH_TABLE_SIZE
@ WINED3DSIH_GE
@ WINED3DSIH_SLT
@ WINED3DSIH_DP3
@ WINED3DSIH_CUT
@ WINED3DSIH_REP
@ WINED3DSIH_EMIT_STREAM
@ WINED3DSIH_SAMPLE_POS
@ WINED3DSIH_FTOU
@ WINED3DSIH_RET
@ WINED3DSIH_IMAX
@ WINED3DSIH_ITOF
@ WINED3DSIH_IGE
@ WINED3DSIH_IMM_ATOMIC_IMAX
@ WINED3DSIH_IFC
@ WINED3DSIH_SAMPLE_C_LZ
@ WINED3DSIH_LOD
@ WINED3DSIH_ENDLOOP
@ WINED3DSIH_DSY
@ WINED3DSIH_TEXDP3
@ WINED3DSIH_MOVA
@ WINED3DSIH_DCL_INPUT_PS
@ WINED3DSIH_GATHER4_C
@ WINED3DSIH_LD_UAV_TYPED
@ WINED3DSIH_INEG
@ WINED3DSIH_DEF
@ WINED3DSIH_GATHER4_PO
@ WINED3DSIH_DCL_UAV_STRUCTURED
@ WINED3DSIH_CMP
@ WINED3DSIH_LT
@ WINED3DSIH_DCL_HS_FORK_PHASE_INSTANCE_COUNT
@ WINED3DSIH_DCL_INPUT_CONTROL_POINT_COUNT
@ WINED3DSIH_DCL_GLOBAL_FLAGS
@ WINED3DSIH_TEXKILL
@ WINED3DSIH_POW
@ WINED3DSIH_CND
@ WINED3DSIH_UDIV
@ WINED3DSIH_EVAL_SAMPLE_INDEX
@ WINED3DSIH_ROUND_NI
@ WINED3DSIH_M4x3
@ WINED3DSIH_TEXM3x2PAD
@ WINED3DSIH_INE
@ WINED3DSIH_IBFE
@ WINED3DSIH_BUFINFO
@ WINED3DSIH_STORE_RAW
@ WINED3DSIH_IMM_ATOMIC_ALLOC
@ WINED3DSIH_IMM_ATOMIC_IMIN
@ WINED3DSIH_UGE
@ WINED3DSIH_MAD
@ WINED3DSIH_CUT_STREAM
@ WINED3DSIH_TEX
@ WINED3DSIH_DCL_TESSELLATOR_DOMAIN
@ WINED3DSIH_EXPP
@ WINED3DSIH_LABEL
@ WINED3DSIH_IMM_ATOMIC_EXCH
@ WINED3DSIH_FCALL
@ WINED3DSIH_CASE
@ WINED3DSIH_IMUL
@ WINED3DSIH_IMAD
@ WINED3DSIH_NE
@ WINED3DSIH_SGE
@ WINED3DSIH_FIRSTBIT_SHI
@ WINED3DSIH_RESINFO
@ WINED3DSIH_DCL_INPUT_PS_SIV
@ WINED3DSIH_DCL_TGSM_STRUCTURED
@ WINED3DSIH_FIRSTBIT_LO
@ WINED3DSIH_M4x4
@ WINED3DSIH_SAMPLE_C
@ WINED3DSIH_ROUND_NE
@ WINED3DSIH_DCL_UAV_RAW
@ WINED3DSIH_TEXM3x3DIFF
@ WINED3DSIH_DCL_FUNCTION_BODY
@ WINED3DSIH_SGN
@ WINED3DSIH_DCL_OUTPUT_CONTROL_POINT_COUNT
@ WINED3DSIH_LOGP
@ WINED3DSIH_IMM_ATOMIC_OR
@ WINED3DSIH_DCL_STREAM
@ WINED3DSIH_DIV
@ WINED3DSIH_TEXCOORD
@ WINED3DSIH_ATOMIC_UMAX
@ WINED3DSIH_DCL_INDEXABLE_TEMP
@ WINED3DSIH_DCL_RESOURCE_RAW
@ WINED3DSIH_MAX
@ WINED3DSIH_DCL_INPUT_PRIMITIVE
@ WINED3DSIH_RETP
@ WINED3DSIH_ISHR
@ WINED3DSIH_DCL_HS_JOIN_PHASE_INSTANCE_COUNT
@ WINED3DSIH_DP2
@ WINED3DSIH_PHASE
@ WINED3DSIH_DSY_FINE
@ WINED3DSIH_DCL_RESOURCE_STRUCTURED

◆ wined3d_shader_interpolation_mode

Enumerator
WINED3DSIM_NONE 
WINED3DSIM_CONSTANT 
WINED3DSIM_LINEAR 
WINED3DSIM_LINEAR_CENTROID 
WINED3DSIM_LINEAR_NOPERSPECTIVE 
WINED3DSIM_LINEAR_NOPERSPECTIVE_CENTROID 
WINED3DSIM_LINEAR_SAMPLE 
WINED3DSIM_LINEAR_NOPERSPECTIVE_SAMPLE 

Definition at line 641 of file wined3d_private.h.

642{
643 WINED3DSIM_NONE = 0,
651};
@ WINED3DSIM_LINEAR_CENTROID
@ WINED3DSIM_LINEAR_NOPERSPECTIVE_SAMPLE
@ WINED3DSIM_LINEAR
@ WINED3DSIM_NONE
@ WINED3DSIM_LINEAR_NOPERSPECTIVE
@ WINED3DSIM_LINEAR_NOPERSPECTIVE_CENTROID
@ WINED3DSIM_LINEAR_SAMPLE
@ WINED3DSIM_CONSTANT

◆ wined3d_shader_register_type

Enumerator
WINED3DSPR_TEMP 
WINED3DSPR_INPUT 
WINED3DSPR_CONST 
WINED3DSPR_ADDR 
WINED3DSPR_TEXTURE 
WINED3DSPR_RASTOUT 
WINED3DSPR_ATTROUT 
WINED3DSPR_TEXCRDOUT 
WINED3DSPR_OUTPUT 
WINED3DSPR_CONSTINT 
WINED3DSPR_COLOROUT 
WINED3DSPR_DEPTHOUT 
WINED3DSPR_SAMPLER 
WINED3DSPR_CONST2 
WINED3DSPR_CONST3 
WINED3DSPR_CONST4 
WINED3DSPR_CONSTBOOL 
WINED3DSPR_LOOP 
WINED3DSPR_TEMPFLOAT16 
WINED3DSPR_MISCTYPE 
WINED3DSPR_LABEL 
WINED3DSPR_PREDICATE 
WINED3DSPR_IMMCONST 
WINED3DSPR_CONSTBUFFER 
WINED3DSPR_IMMCONSTBUFFER 
WINED3DSPR_PRIMID 
WINED3DSPR_NULL 
WINED3DSPR_RESOURCE 
WINED3DSPR_UAV 
WINED3DSPR_OUTPOINTID 
WINED3DSPR_FORKINSTID 
WINED3DSPR_JOININSTID 
WINED3DSPR_INCONTROLPOINT 
WINED3DSPR_OUTCONTROLPOINT 
WINED3DSPR_PATCHCONST 
WINED3DSPR_TESSCOORD 
WINED3DSPR_GROUPSHAREDMEM 
WINED3DSPR_THREADID 
WINED3DSPR_THREADGROUPID 
WINED3DSPR_LOCALTHREADID 
WINED3DSPR_LOCALTHREADINDEX 
WINED3DSPR_IDXTEMP 
WINED3DSPR_STREAM 
WINED3DSPR_FUNCTIONBODY 
WINED3DSPR_FUNCTIONPOINTER 
WINED3DSPR_COVERAGE 
WINED3DSPR_SAMPLEMASK 
WINED3DSPR_GSINSTID 
WINED3DSPR_DEPTHOUTGE 
WINED3DSPR_DEPTHOUTLE 
WINED3DSPR_RASTERIZER 
WINED3DSPR_STENCILREF 

Definition at line 532 of file wined3d_private.h.

533{
534 WINED3DSPR_TEMP = 0,
537 WINED3DSPR_ADDR = 3,
551 WINED3DSPR_LOOP = 15,
554 WINED3DSPR_LABEL = 18,
586};
@ WINED3DSPR_CONSTBOOL
@ WINED3DSPR_RESOURCE
@ WINED3DSPR_COLOROUT
@ WINED3DSPR_RASTERIZER
@ WINED3DSPR_LOOP
@ WINED3DSPR_CONST
@ WINED3DSPR_PRIMID
@ WINED3DSPR_LOCALTHREADID
@ WINED3DSPR_FUNCTIONPOINTER
@ WINED3DSPR_CONST3
@ WINED3DSPR_IMMCONST
@ WINED3DSPR_OUTPOINTID
@ WINED3DSPR_OUTCONTROLPOINT
@ WINED3DSPR_INCONTROLPOINT
@ WINED3DSPR_TESSCOORD
@ WINED3DSPR_NULL
@ WINED3DSPR_CONSTINT
@ WINED3DSPR_GSINSTID
@ WINED3DSPR_ATTROUT
@ WINED3DSPR_CONST4
@ WINED3DSPR_THREADGROUPID
@ WINED3DSPR_STENCILREF
@ WINED3DSPR_ADDR
@ WINED3DSPR_LABEL
@ WINED3DSPR_JOININSTID
@ WINED3DSPR_DEPTHOUTGE
@ WINED3DSPR_UAV
@ WINED3DSPR_SAMPLER
@ WINED3DSPR_CONSTBUFFER
@ WINED3DSPR_FUNCTIONBODY
@ WINED3DSPR_IDXTEMP
@ WINED3DSPR_RASTOUT
@ WINED3DSPR_CONST2
@ WINED3DSPR_STREAM
@ WINED3DSPR_PATCHCONST
@ WINED3DSPR_OUTPUT
@ WINED3DSPR_PREDICATE
@ WINED3DSPR_INPUT
@ WINED3DSPR_GROUPSHAREDMEM
@ WINED3DSPR_SAMPLEMASK
@ WINED3DSPR_TEMP
@ WINED3DSPR_DEPTHOUT
@ WINED3DSPR_TEXCRDOUT
@ WINED3DSPR_THREADID
@ WINED3DSPR_COVERAGE
@ WINED3DSPR_TEXTURE
@ WINED3DSPR_LOCALTHREADINDEX
@ WINED3DSPR_FORKINSTID
@ WINED3DSPR_TEMPFLOAT16
@ WINED3DSPR_DEPTHOUTLE
@ WINED3DSPR_MISCTYPE
@ WINED3DSPR_IMMCONSTBUFFER

◆ wined3d_shader_rel_op

Enumerator
WINED3D_SHADER_REL_OP_GT 
WINED3D_SHADER_REL_OP_EQ 
WINED3D_SHADER_REL_OP_GE 
WINED3D_SHADER_REL_OP_LT 
WINED3D_SHADER_REL_OP_NE 
WINED3D_SHADER_REL_OP_LE 

Definition at line 716 of file wined3d_private.h.

717{
724};
@ WINED3D_SHADER_REL_OP_GT
@ WINED3D_SHADER_REL_OP_LE
@ WINED3D_SHADER_REL_OP_GE
@ WINED3D_SHADER_REL_OP_EQ
@ WINED3D_SHADER_REL_OP_LT
@ WINED3D_SHADER_REL_OP_NE

◆ wined3d_shader_resource_type

Enumerator
WINED3D_SHADER_RESOURCE_NONE 
WINED3D_SHADER_RESOURCE_BUFFER 
WINED3D_SHADER_RESOURCE_TEXTURE_1D 
WINED3D_SHADER_RESOURCE_TEXTURE_2D 
WINED3D_SHADER_RESOURCE_TEXTURE_2DMS 
WINED3D_SHADER_RESOURCE_TEXTURE_3D 
WINED3D_SHADER_RESOURCE_TEXTURE_CUBE 
WINED3D_SHADER_RESOURCE_TEXTURE_1DARRAY 
WINED3D_SHADER_RESOURCE_TEXTURE_2DARRAY 
WINED3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY 
WINED3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY 

Definition at line 495 of file wined3d_private.h.

496{
508};
@ WINED3D_SHADER_RESOURCE_BUFFER
@ WINED3D_SHADER_RESOURCE_TEXTURE_3D
@ WINED3D_SHADER_RESOURCE_TEXTURE_2D
@ WINED3D_SHADER_RESOURCE_TEXTURE_1DARRAY
@ WINED3D_SHADER_RESOURCE_TEXTURE_2DARRAY
@ WINED3D_SHADER_RESOURCE_NONE
@ WINED3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY
@ WINED3D_SHADER_RESOURCE_TEXTURE_2DMS
@ WINED3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY
@ WINED3D_SHADER_RESOURCE_TEXTURE_CUBE
@ WINED3D_SHADER_RESOURCE_TEXTURE_1D

◆ wined3d_shader_src_modifier

Enumerator
WINED3DSPSM_NONE 
WINED3DSPSM_NEG 
WINED3DSPSM_BIAS 
WINED3DSPSM_BIASNEG 
WINED3DSPSM_SIGN 
WINED3DSPSM_SIGNNEG 
WINED3DSPSM_COMP 
WINED3DSPSM_X2 
WINED3DSPSM_X2NEG 
WINED3DSPSM_DZ 
WINED3DSPSM_DW 
WINED3DSPSM_ABS 
WINED3DSPSM_ABSNEG 
WINED3DSPSM_NOT 

Definition at line 609 of file wined3d_private.h.

610{
612 WINED3DSPSM_NEG = 1,
618 WINED3DSPSM_X2 = 7,
620 WINED3DSPSM_DZ = 9,
621 WINED3DSPSM_DW = 10,
622 WINED3DSPSM_ABS = 11,
624 WINED3DSPSM_NOT = 13,
625};
@ WINED3DSPSM_ABSNEG
@ WINED3DSPSM_X2NEG
@ WINED3DSPSM_BIAS
@ WINED3DSPSM_BIASNEG
@ WINED3DSPSM_COMP
@ WINED3DSPSM_ABS
@ WINED3DSPSM_NOT
@ WINED3DSPSM_SIGNNEG
@ WINED3DSPSM_DW
@ WINED3DSPSM_X2
@ WINED3DSPSM_SIGN
@ WINED3DSPSM_NONE
@ WINED3DSPSM_NEG
@ WINED3DSPSM_DZ

◆ wined3d_shader_sync_flags

Enumerator
WINED3DSSF_THREAD_GROUP 
WINED3DSSF_GROUP_SHARED_MEMORY 
WINED3DSSF_GLOBAL_UAV 

Definition at line 663 of file wined3d_private.h.

664{
668};
@ WINED3DSSF_THREAD_GROUP
@ WINED3DSSF_GROUP_SHARED_MEMORY
@ WINED3DSSF_GLOBAL_UAV

◆ wined3d_shader_tex_types

Enumerator
WINED3D_SHADER_TEX_2D 
WINED3D_SHADER_TEX_3D 
WINED3D_SHADER_TEX_CUBE 
WINED3D_SHADER_TEX_ERR 

Definition at line 1466 of file wined3d_private.h.

1467{
1472};
@ WINED3D_SHADER_TEX_3D
@ WINED3D_SHADER_TEX_2D
@ WINED3D_SHADER_TEX_ERR
@ WINED3D_SHADER_TEX_CUBE

◆ wined3d_shader_uav_flags

Enumerator
WINED3DSUF_GLOBALLY_COHERENT 
WINED3DSUF_ORDER_PRESERVING_COUNTER 

Definition at line 670 of file wined3d_private.h.

671{
674};
@ WINED3DSUF_ORDER_PRESERVING_COUNTER
@ WINED3DSUF_GLOBALLY_COHERENT

◆ wined3d_sysval_semantic

Enumerator
WINED3D_SV_POSITION 
WINED3D_SV_CLIP_DISTANCE 
WINED3D_SV_CULL_DISTANCE 
WINED3D_SV_RENDER_TARGET_ARRAY_INDEX 
WINED3D_SV_VIEWPORT_ARRAY_INDEX 
WINED3D_SV_VERTEX_ID 
WINED3D_SV_PRIMITIVE_ID 
WINED3D_SV_INSTANCE_ID 
WINED3D_SV_IS_FRONT_FACE 
WINED3D_SV_SAMPLE_INDEX 
WINED3D_SV_TESS_FACTOR_QUADEDGE 
WINED3D_SV_TESS_FACTOR_QUADINT 
WINED3D_SV_TESS_FACTOR_TRIEDGE 
WINED3D_SV_TESS_FACTOR_TRIINT 
WINED3D_SV_TESS_FACTOR_LINEDET 
WINED3D_SV_TESS_FACTOR_LINEDEN 

Definition at line 732 of file wined3d_private.h.

733{
734 WINED3D_SV_POSITION = 0x01,
750};
@ WINED3D_SV_INSTANCE_ID
@ WINED3D_SV_CULL_DISTANCE
@ WINED3D_SV_CLIP_DISTANCE
@ WINED3D_SV_VIEWPORT_ARRAY_INDEX
@ WINED3D_SV_TESS_FACTOR_QUADINT
@ WINED3D_SV_SAMPLE_INDEX
@ WINED3D_SV_IS_FRONT_FACE
@ WINED3D_SV_TESS_FACTOR_QUADEDGE
@ WINED3D_SV_TESS_FACTOR_LINEDET
@ WINED3D_SV_POSITION
@ WINED3D_SV_PRIMITIVE_ID
@ WINED3D_SV_RENDER_TARGET_ARRAY_INDEX
@ WINED3D_SV_TESS_FACTOR_TRIINT
@ WINED3D_SV_TESS_FACTOR_TRIEDGE
@ WINED3D_SV_TESS_FACTOR_LINEDEN
@ WINED3D_SV_VERTEX_ID

◆ wined3d_tessellator_domain

Enumerator
WINED3D_TESSELLATOR_DOMAIN_LINE 
WINED3D_TESSELLATOR_DOMAIN_TRIANGLE 
WINED3D_TESSELLATOR_DOMAIN_QUAD 

Definition at line 676 of file wined3d_private.h.

677{
681};
@ WINED3D_TESSELLATOR_DOMAIN_TRIANGLE
@ WINED3D_TESSELLATOR_DOMAIN_QUAD
@ WINED3D_TESSELLATOR_DOMAIN_LINE

◆ wined3d_tessellator_output_primitive

Enumerator
WINED3D_TESSELLATOR_OUTPUT_POINT 
WINED3D_TESSELLATOR_OUTPUT_LINE 
WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CW 
WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW 

Definition at line 683 of file wined3d_private.h.

684{
689};
@ WINED3D_TESSELLATOR_OUTPUT_POINT
@ WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CW
@ WINED3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW
@ WINED3D_TESSELLATOR_OUTPUT_LINE

◆ wined3d_tessellator_partitioning

Enumerator
WINED3D_TESSELLATOR_PARTITIONING_INTEGER 
WINED3D_TESSELLATOR_PARTITIONING_POW2 
WINED3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD 
WINED3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN 

Definition at line 691 of file wined3d_private.h.

◆ wined3d_vertex_processing_mode

Enumerator
WINED3D_VP_MODE_FF 
WINED3D_VP_MODE_SHADER 
WINED3D_VP_MODE_NONE 

Definition at line 1438 of file wined3d_private.h.

1439{
1443};
@ WINED3D_VP_MODE_NONE
@ WINED3D_VP_MODE_FF
@ WINED3D_VP_MODE_SHADER

Function Documentation

◆ adapter_adjust_mapped_memory()

ssize_t adapter_adjust_mapped_memory ( struct wined3d_adapter *  adapter,
ssize_t  size 
)

Definition at line 167 of file directx.c.

168{
169 /* Note that this needs to be thread-safe; the Vulkan adapter may map from
170 * client threads. */
172 TRACE("Adjusted mapped adapter memory by %Id to %Id.\n", size, ret);
173 return ret;
174}
return ret
Definition: mutex.c:147
return adapter
GLsizeiptr size
Definition: glext.h:5919
#define InterlockedExchangeAddSizeT(a, b)
Definition: interlocked.h:211
int ssize_t
Definition: rosdhcp.h:52
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by wined3d_allocator_chunk_gl_map(), wined3d_allocator_chunk_gl_unmap(), wined3d_allocator_chunk_vk_map(), wined3d_allocator_chunk_vk_unmap(), wined3d_allocator_vk_destroy_chunk(), wined3d_bo_gl_map(), wined3d_bo_gl_unmap(), wined3d_bo_vk_map(), wined3d_bo_vk_unmap(), wined3d_context_gl_destroy_bo(), and wined3d_context_vk_destroy_bo().

◆ adapter_adjust_memory()

UINT64 adapter_adjust_memory ( struct wined3d_adapter *  adapter,
INT64  amount 
)

Definition at line 158 of file directx.c.

159{
160 adapter->vram_bytes_used += amount;
161 TRACE("Adjusted used adapter memory by 0x%s to 0x%s.\n",
162 wine_dbgstr_longlong(amount),
163 wine_dbgstr_longlong(adapter->vram_bytes_used));
164 return adapter->vram_bytes_used;
165}
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49

Referenced by resource_cleanup(), resource_init(), and wined3d_texture_update_desc().

◆ add_ffp_frag_shader()

void add_ffp_frag_shader ( struct wine_rb_tree *  shaders,
struct ffp_frag_desc *  desc 
)

Definition at line 6426 of file utils.c.

6427{
6428 /* Note that the key is the implementation independent part of the ffp_frag_desc structure,
6429 * whereas desc points to an extended structure with implementation specific parts. */
6430 if (wine_rb_put(shaders, &desc->settings, &desc->entry) == -1)
6431 {
6432 ERR("Failed to insert ffp frag shader.\n");
6433 }
6434}
#define ERR(fmt,...)
Definition: precomp.h:57
const GLuint * shaders
Definition: glext.h:7538
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
#define wine_rb_put
Definition: rbtree.h:410

Referenced by get_ffp_pixel_shader(), and shader_glsl_find_ffp_fragment_shader().

◆ align()

static size_t align ( size_t  addr,
size_t  alignment 
)
inlinestatic

Definition at line 54 of file wined3d_private.h.

55{
56 return (addr + (alignment - 1)) & ~(alignment - 1);
57}
_Check_return_ _Ret_maybenull_ _In_ size_t alignment
Definition: align.cpp:48
GLenum const GLvoid * addr
Definition: glext.h:9621

Referenced by _aligned_msize_base(), _aligned_offset_malloc_base(), _aligned_offset_realloc_base(), _aligned_offset_recalloc_base(), _test_img_align(), Align(), align_length(), align_output(), align_pointer(), align_pointer_clear(), align_pointer_offset(), align_pointer_offset_clear(), align_ptr(), AlignAndAlloca(), AlignAndAllocaAndBigLocals(), AlignAndAllocaAndEbpAdj(), AlignAndBigLocals(), AlignAndEbpAdj(), anonymous_namespace{activex.cpp}::aligndown(), anonymous_namespace{activex.cpp}::alignup(), allocate_range(), bytecode_align(), clamp_align(), compute_input_layout_offsets(), d3d12_device_get_copyable_footprints(), d3d12_device_get_resource1_allocation_info(), d3d12_resource_init_tiles(), d3d12_root_signature_init_descriptor_table_push_constants(), d3d12_root_signature_init_push_constants(), draw_paragraph(), DrawStatusTextW(), dxil_parse(), EMFDC_SetTextAlign(), EMFDRV_SetTextAlign(), field_memsize(), fields_memsize(), fill_params_array(), GdipGetStringFormatAlign(), GdipGetStringFormatLineAlign(), GdipSetStringFormatAlign(), GdipSetStringFormatLineAlign(), get_padding(), get_required_buffer_size_type(), get_stack_size(), GSCookieAndAlign(), GSCookieAndAlignAndAlloca(), GSCookieAndAlignAndAllocaAndBigLocals(), GSCookieAndAlignAndAllocaAndEbpAdj(), GSCookieAndAlignAndBigLocals(), GSCookieAndAlignAndEbpAdj(), hlsl_fx_2_write(), hlsl_type_calculate_reg_size(), hlsl_type_get_array_element_reg_size(), hlsl_type_get_component_offset(), hlsl_type_get_sm4_offset(), macho_map_file(), ME_DebugWrite(), ME_InsertRowStart(), memcmp(), METADC_SetTextAlign(), MFDRV_SetTextAlign(), msl_generate_cbv_declaration(), pipeline_state_desc_from_d3d12_stream_desc(), psh_hint_align(), query_align_status(), register_deref_usage(), StringFormat::SetAlignment(), StringFormat::SetLineAlignment(), shader_glsl_generate_cbv_declaration(), shader_parse_signature(), sm4_generate_vsir_add_function(), spirv_compiler_emit_cbv_declaration(), taskdialog_layout(), test_block_layout(), test_constructor(), test_dsound(), test_frequency(), test_getgenericdefault(), test_getgenerictypographic(), test_HeapCreate(), test_primary_secondary(), test_secondary(), test_secondary8(), test_SysAllocString(), test_TabbedText(), ThemeDrawCaptionText(), TLB_get_size_from_hreftype(), TLB_size_instance(), TREEVIEW_DrawItem(), TryAndAlign(), TryAndAlignAndAlloca(), TryAndAlignAndAllocaAndBigLocals(), TryAndAlignAndAllocaAndEbpAdj(), TryAndAlignAndBigLocals(), TryAndAlignAndEbpAdj(), TryAndGSCookieAndAlign(), TryAndGSCookieAndAlignAndAlloca(), TryAndGSCookieAndAlignAndAllocaAndBigLocals(), TryAndGSCookieAndAlignAndAllocaAndEbpAdj(), TryAndGSCookieAndAlignAndBigLocals(), TryAndGSCookieAndAlignAndEbpAdj(), type_buffer_alignment(), type_memsize(), type_memsize_and_alignment(), UDFFindMinSuitableExtent(), union_memsize(), VARIANT_UserMarshal(), VARIANT_UserSize(), VARIANT_UserUnmarshal(), vkd3d_bind_heap_memory(), vkd3d_gpu_va_allocator_allocate(), vkd3d_spirv_string_word_count(), vring_init(), vring_size(), vring_size_split(), wined3d_deferred_context_map_upload_bo(), wined3d_resource_allocate_sysmem(), wined3d_streaming_buffer_map(), write_array_tfs(), write_conf_or_var_desc(), write_fixed_array_pointer_descriptions(), write_func_param_struct(), write_fx_4_buffer(), write_fx_4_type(), write_no_repeat_pointer_descriptions(), write_param_fs(), write_pointer_description_offsets(), write_proc_func_header(), write_sm4_rdef(), write_struct_members(), write_struct_tfs(), write_union_tfs(), write_varying_array_pointer_descriptions(), XXH_readLE32_align(), XXH_readLE64_align(), and ZSTD_cwksp_align().

◆ buffer_from_resource()

static struct wined3d_buffer * buffer_from_resource ( struct wined3d_resource *  resource)
inlinestatic

◆ C_ASSERT() [1/2]

C_ASSERT ( !  WINED3D_CS_QUEUE_SIZE &(WINED3D_CS_QUEUE_SIZE - 1))

◆ C_ASSERT() [2/2]

C_ASSERT ( )

◆ can_use_texture_swizzle()

static BOOL can_use_texture_swizzle ( const struct wined3d_d3d_info *  d3d_info,
const struct wined3d_format *  format 
)
inlinestatic

Definition at line 4661 of file wined3d_private.h.

4662{
4663 return d3d_info->texture_swizzle && !is_complex_fixup(format->color_fixup) && !is_scaling_fixup(format->color_fixup);
4664}
uint32_t texture_swizzle
static BOOL is_scaling_fixup(struct color_fixup_desc fixup)
static BOOL is_complex_fixup(struct color_fixup_desc fixup)

Referenced by create_texture_view(), find_ps_compile_args(), texture_binding_might_invalidate_fs_settings(), texture_binding_might_invalidate_ps(), wined3d_ffp_get_fs_settings(), wined3d_texture_gl_bind(), wined3d_texture_vk_get_default_image_info(), and wined3d_view_vk_create_vk_image_view().

◆ clipplane()

void clipplane ( struct wined3d_context *  context,
const struct wined3d_state *  state,
DWORD  state_id 
)

Definition at line 1002 of file ffp_gl.c.

1003{
1004 context->constant_update_mask |= WINED3D_SHADER_CONST_VS_CLIP_PLANES;
1005}
Definition: http.c:7252
#define WINED3D_SHADER_CONST_VS_CLIP_PLANES

◆ compile_state_table()

HRESULT compile_state_table ( struct wined3d_state_entry *  state_table,
APPLYSTATEFUNC **  dev_multistate_funcs,
const struct wined3d_d3d_info *  d3d_info,
const BOOL *  supported_extensions,
const struct wined3d_vertex_pipe_ops *  vertex,
const struct wined3d_fragment_pipe_ops *  fragment,
const struct wined3d_state_entry_template *  misc 
)

Definition at line 1666 of file ffp_gl.c.

1670{
1671 APPLYSTATEFUNC multistate_funcs[STATE_HIGHEST + 1][3];
1672 const struct wined3d_state_entry_template *cur;
1673 unsigned int i, type, handlers;
1674 BOOL set[STATE_HIGHEST + 1];
1675
1676 memset(multistate_funcs, 0, sizeof(multistate_funcs));
1677
1678 for (i = 0; i < STATE_HIGHEST + 1; ++i)
1679 {
1680 state_table[i].representative = 0;
1681 state_table[i].apply = state_undefined;
1682 }
1683
1684 for (type = 0; type < 3; ++type)
1685 {
1686 /* This switch decides the order in which the states are applied */
1687 switch (type)
1688 {
1689 case 0: cur = misc; break;
1690 case 1: cur = fragment->states; break;
1691 case 2: cur = vertex->vp_states; break;
1692 default: cur = NULL; /* Stupid compiler */
1693 }
1694 if (!cur) continue;
1695
1696 /* GL extension filtering should not prevent multiple handlers being applied from different
1697 * pipeline parts
1698 */
1699 memset(set, 0, sizeof(set));
1700
1701 for (i = 0; cur[i].state; ++i)
1702 {
1703 APPLYSTATEFUNC *funcs_array;
1704
1705 /* Only use the first matching state with the available extension from one template.
1706 * e.g.
1707 * {D3DRS_FOOBAR, {D3DRS_FOOBAR, func1}, XYZ_FANCY},
1708 * {D3DRS_FOOBAR, {D3DRS_FOOBAR, func2}, 0 }
1709 *
1710 * if GL_XYZ_fancy is supported, ignore the 2nd line
1711 */
1712 if (set[cur[i].state]) continue;
1713 /* Skip state lines depending on unsupported extensions */
1714 if (!supported_extensions[cur[i].extension]) continue;
1715 set[cur[i].state] = TRUE;
1716 /* In some cases having an extension means that nothing has to be
1717 * done for a state, e.g. if GL_ARB_texture_non_power_of_two is
1718 * supported, the texture coordinate fixup can be ignored. If the
1719 * apply function is used, mark the state set(done above) to prevent
1720 * applying later lines, but do not record anything in the state
1721 * table
1722 */
1723 if (!cur[i].content.representative) continue;
1724
1725 handlers = num_handlers(multistate_funcs[cur[i].state]);
1726 multistate_funcs[cur[i].state][handlers] = cur[i].content.apply;
1727 switch (handlers)
1728 {
1729 case 0:
1730 state_table[cur[i].state].apply = cur[i].content.apply;
1731 break;
1732 case 1:
1733 state_table[cur[i].state].apply = multistate_apply_2;
1734 if (!(dev_multistate_funcs[cur[i].state] = calloc(2, sizeof(**dev_multistate_funcs))))
1735 goto out_of_mem;
1736
1737 dev_multistate_funcs[cur[i].state][0] = multistate_funcs[cur[i].state][0];
1738 dev_multistate_funcs[cur[i].state][1] = multistate_funcs[cur[i].state][1];
1739 break;
1740 case 2:
1741 state_table[cur[i].state].apply = multistate_apply_3;
1742 if (!(funcs_array = realloc(dev_multistate_funcs[cur[i].state],
1743 sizeof(**dev_multistate_funcs) * 3)))
1744 goto out_of_mem;
1745
1746 dev_multistate_funcs[cur[i].state] = funcs_array;
1747 dev_multistate_funcs[cur[i].state][2] = multistate_funcs[cur[i].state][2];
1748 break;
1749 default:
1750 ERR("Unexpected amount of state handlers for state %u: %u.\n",
1751 cur[i].state, handlers + 1);
1752 }
1753
1754 if (state_table[cur[i].state].representative
1755 && state_table[cur[i].state].representative != cur[i].content.representative)
1756 {
1757 FIXME("State %s (%#x) has different representatives in different pipeline parts.\n",
1759 }
1760 state_table[cur[i].state].representative = cur[i].content.representative;
1761 }
1762 }
1763
1766
1767 return WINED3D_OK;
1768
1769out_of_mem:
1770 for (i = 0; i <= STATE_HIGHEST; ++i)
1771 {
1772 free(dev_multistate_funcs[i]);
1773 }
1774
1775 memset(dev_multistate_funcs, 0, (STATE_HIGHEST + 1) * sizeof(*dev_multistate_funcs));
1776
1777 return E_OUTOFMEMORY;
1778}
static int state
Definition: maze.c:121
#define FIXME(fmt,...)
Definition: precomp.h:53
Definition: _set.h:50
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define realloc
Definition: debug_ros.c:6
#define free
Definition: debug_ros.c:5
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
static const struct @282 state_table[]
const char * debug_d3dstate(uint32_t state)
Definition: utils.c:5331
content
Definition: atl_ax.c:990
static xmlCharEncodingHandlerPtr * handlers
Definition: encoding.c:1380
static void prune_invalid_states(struct wined3d_state_entry *state_table, const struct wined3d_d3d_info *d3d_info)
Definition: ffp_gl.c:1547
static void multistate_apply_2(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: ffp_gl.c:1534
static void state_undefined(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: ffp_gl.c:37
static void multistate_apply_3(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: ffp_gl.c:1540
static void validate_state_table(struct wined3d_state_entry *state_table)
Definition: ffp_gl.c:1560
static unsigned int num_handlers(const APPLYSTATEFUNC *funcs)
Definition: ffp_gl.c:1527
unsigned int BOOL
Definition: ntddk_ex.h:94
FxCollectionEntry * cur
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
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 calloc
Definition: rosglue.h:14
#define memset(x, y, z)
Definition: compat.h:39
Definition: mesh.c:4665
const struct wined3d_state_entry_template * states
unsigned int extension
#define WINED3D_OK
Definition: wined3d.h:33
#define STATE_HIGHEST
void(* APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id)

Referenced by wined3d_device_init().

◆ compute_normal_matrix()

void compute_normal_matrix ( struct wined3d_matrix *  normal_matrix,
BOOL  legacy_lighting,
const struct wined3d_matrix *  modelview 
)

Definition at line 7042 of file utils.c.

7044{
7045 struct wined3d_matrix mv;
7046
7047 mv = *modelview;
7048 if (legacy_lighting)
7049 invert_matrix_3d(&mv, &mv);
7050 else
7051 invert_matrix(&mv, &mv);
7052 /* Tests show that singular modelview matrices are used unchanged as normal
7053 * matrices on D3D3 and older. There seems to be no clearly consistent
7054 * behavior on newer D3D versions so always follow older ddraw behavior. */
7055
7056 normal_matrix->_11 = mv._11;
7057 normal_matrix->_12 = mv._21;
7058 normal_matrix->_13 = mv._31;
7059 normal_matrix->_21 = mv._12;
7060 normal_matrix->_22 = mv._22;
7061 normal_matrix->_23 = mv._32;
7062 normal_matrix->_31 = mv._13;
7063 normal_matrix->_32 = mv._23;
7064 normal_matrix->_33 = mv._33;
7065}
BOOL invert_matrix(struct wined3d_matrix *out, const struct wined3d_matrix *m)
Definition: utils.c:6775
static BOOL invert_matrix_3d(struct wined3d_matrix *out, const struct wined3d_matrix *in)
Definition: utils.c:6980

Referenced by init_transformed_lights(), and wined3d_device_apply_stateblock().

◆ context_acquire()

static struct wined3d_context * context_acquire ( struct wined3d_device *  device,
struct wined3d_texture *  texture,
unsigned int  sub_resource_idx 
)
inlinestatic

Definition at line 4782 of file wined3d_private.h.

4784{
4786
4787 return device->adapter->adapter_ops->adapter_acquire_context(device, texture, sub_resource_idx);
4788}
GLenum GLuint texture
Definition: glext.h:6295
Definition: devices.h:37
static void wined3d_from_cs(const struct wined3d_cs *cs)

Referenced by adapter_vk_dispatch_compute(), adapter_vk_draw_primitive(), buffer_resource_preload(), buffer_resource_sub_resource_map(), buffer_resource_sub_resource_unmap(), buffer_resource_unload(), context_restore(), cpu_blitter_clear_texture(), create_texture_view(), dispatch_compute(), draw_primitive(), ffp_blitter_clear_rendertargets(), shader_glsl_destroy(), shader_glsl_precompile(), surface_convert_format(), surface_cpu_blt(), swapchain_frontbuffer_updated(), swapchain_gl_present(), swapchain_vk_present(), texture2d_blt(), texture2d_blt_fbo(), texture2d_read_from_framebuffer(), texture_resource_preload(), texture_resource_sub_resource_map(), texture_resource_sub_resource_unmap(), texture_resource_unload(), vk_blitter_clear(), wined3d_allocator_gl_destroy_chunk(), wined3d_buffer_copy(), wined3d_buffer_destroy_object(), wined3d_command_list_destroy_object(), wined3d_context_gl_reacquire(), wined3d_cs_exec_add_dirty_texture_region(), wined3d_cs_exec_blt_sub_resource(), wined3d_cs_exec_clear_unordered_access_view(), wined3d_cs_exec_copy_uav_counter(), wined3d_cs_exec_flush(), wined3d_cs_exec_generate_mipmaps(), wined3d_cs_exec_map_bo_address(), wined3d_cs_exec_update_sub_resource(), wined3d_device_gl_create_primary_opengl_context_cs(), wined3d_device_gl_delete_opengl_contexts_cs(), wined3d_fence_issue(), wined3d_fence_test(), wined3d_fence_wait(), wined3d_occlusion_query_ops_issue(), wined3d_pipeline_query_ops_issue(), wined3d_query_event_vk_issue(), wined3d_query_gl_destroy_object(), wined3d_query_timestamp_vk_issue(), wined3d_query_vk_destroy(), wined3d_query_vk_issue(), wined3d_render_target_view_vk_cs_init(), wined3d_sampler_gl_cs_init(), wined3d_sampler_gl_destroy_object(), wined3d_sampler_vk_cs_init(), wined3d_sampler_vk_destroy_object(), wined3d_shader_resource_view_gl_cs_init(), wined3d_shader_resource_view_vk_cs_init(), wined3d_so_statistics_query_ops_issue(), wined3d_texture_create_dc(), wined3d_texture_destroy_dc(), wined3d_texture_download_from_texture(), wined3d_texture_update_map_binding(), wined3d_texture_upload_from_texture(), wined3d_timestamp_query_ops_issue(), wined3d_unordered_access_view_gl_cs_init(), wined3d_unordered_access_view_set_counter(), wined3d_unordered_access_view_vk_cs_init(), wined3d_view_gl_destroy_object(), and wined3d_view_vk_destroy_object().

◆ context_apply_state()

static void context_apply_state ( struct wined3d_context *  context,
const struct wined3d_state *  state,
DWORD  state_id 
)
inlinestatic

Definition at line 4626 of file wined3d_private.h.

4628{
4629 const struct wined3d_state_entry *state_table = context->state_table;
4630 unsigned int rep = state_table[state_id].representative;
4631 state_table[rep].apply(context, state, rep);
4632}

Referenced by glsl_vertex_pipe_vs().

◆ context_invalidate_compute_state()

void context_invalidate_compute_state ( struct wined3d_context *  context,
DWORD  state_id 
)

Definition at line 66 of file context.c.

67{
68 DWORD representative = context->state_table[state_id].representative - STATE_COMPUTE_OFFSET;
69 unsigned int index, shift;
70
71 index = representative / (sizeof(*context->dirty_compute_states) * CHAR_BIT);
72 shift = representative & (sizeof(*context->dirty_compute_states) * CHAR_BIT - 1);
73 context->dirty_compute_states[index] |= (1u << shift);
74}
#define index(s, c)
Definition: various.h:29
#define CHAR_BIT
Definition: cabinet.h:45
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint index
Definition: glext.h:6031
#define shift
Definition: input.c:3280
#define STATE_COMPUTE_OFFSET

Referenced by create_buffer_texture(), create_texture_view(), device_invalidate_state(), shader_resource_view_gl_bind_and_dirtify(), wined3d_context_gl_apply_blit_state(), wined3d_context_vk_load_shader_resources(), wined3d_texture_gl_bind_and_dirtify(), and wined3d_unordered_access_view_vk_clear().

◆ context_invalidate_state()

◆ context_release()

static void context_release ( struct wined3d_context *  context)
inlinestatic

Definition at line 4790 of file wined3d_private.h.

4791{
4792 context->device->adapter->adapter_ops->adapter_release_context(context);
4793}

Referenced by adapter_vk_dispatch_compute(), adapter_vk_draw_primitive(), buffer_resource_preload(), buffer_resource_sub_resource_map(), buffer_resource_sub_resource_unmap(), buffer_resource_unload(), context_restore(), cpu_blitter_clear_texture(), create_texture_view(), dispatch_compute(), draw_primitive(), ffp_blitter_clear_rendertargets(), shader_glsl_destroy(), shader_glsl_precompile(), surface_convert_format(), surface_cpu_blt(), swapchain_frontbuffer_updated(), swapchain_gl_present(), swapchain_vk_present(), texture2d_blt(), texture2d_blt_fbo(), texture_resource_preload(), texture_resource_sub_resource_map(), texture_resource_sub_resource_unmap(), texture_resource_unload(), vk_blitter_clear(), wined3d_allocator_gl_destroy_chunk(), wined3d_buffer_copy(), wined3d_buffer_destroy_object(), wined3d_command_list_destroy_object(), wined3d_context_gl_create_wgl_ctx(), wined3d_context_gl_init(), wined3d_cs_exec_add_dirty_texture_region(), wined3d_cs_exec_blt_sub_resource(), wined3d_cs_exec_clear_unordered_access_view(), wined3d_cs_exec_copy_uav_counter(), wined3d_cs_exec_flush(), wined3d_cs_exec_generate_mipmaps(), wined3d_cs_exec_map_bo_address(), wined3d_cs_exec_update_sub_resource(), wined3d_device_gl_create_primary_opengl_context_cs(), wined3d_device_gl_delete_opengl_contexts_cs(), wined3d_fence_issue(), wined3d_fence_test(), wined3d_fence_wait(), wined3d_occlusion_query_ops_issue(), wined3d_occlusion_query_ops_poll(), wined3d_pipeline_query_ops_issue(), wined3d_pipeline_query_ops_poll(), wined3d_query_event_vk_issue(), wined3d_query_gl_destroy_object(), wined3d_query_timestamp_vk_issue(), wined3d_query_vk_destroy(), wined3d_query_vk_issue(), wined3d_render_target_view_vk_cs_init(), wined3d_sampler_gl_cs_init(), wined3d_sampler_gl_destroy_object(), wined3d_sampler_vk_cs_init(), wined3d_sampler_vk_destroy_object(), wined3d_shader_resource_view_gl_cs_init(), wined3d_shader_resource_view_vk_cs_init(), wined3d_so_statistics_query_ops_issue(), wined3d_so_statistics_query_ops_poll(), wined3d_swapchain_gl_create_context(), wined3d_texture_create_dc(), wined3d_texture_destroy_dc(), wined3d_texture_download_from_texture(), wined3d_texture_update_map_binding(), wined3d_texture_upload_from_texture(), wined3d_timestamp_query_ops_issue(), wined3d_timestamp_query_ops_poll(), wined3d_unordered_access_view_gl_cs_init(), wined3d_unordered_access_view_set_counter(), wined3d_unordered_access_view_vk_cs_init(), wined3d_view_gl_destroy_object(), and wined3d_view_vk_destroy_object().

◆ context_resource_released()

void context_resource_released ( const struct wined3d_device *  device,
struct wined3d_resource *  resource 
)

Definition at line 32 of file context.c.

33{
34 unsigned int i;
35
36 for (i = 0; i < device->context_count; ++i)
37 {
38 struct wined3d_context *context = device->contexts[i];
39
40 if (&context->current_rt.texture->resource == resource)
41 {
42 context->current_rt.texture = NULL;
43 context->current_rt.sub_resource_idx = 0;
44 }
45 }
46}

Referenced by wined3d_resource_destroy_object().

◆ context_restore()

void context_restore ( struct wined3d_context *  context,
struct wined3d_texture *  texture,
unsigned int  sub_resource_idx 
)

Definition at line 55 of file context.c.

56{
57 if (texture && (context->current_rt.texture != texture || context->current_rt.sub_resource_idx != sub_resource_idx))
58 {
60 context = context_acquire(texture->resource.device, texture, sub_resource_idx);
61 }
62
64}
static void context_release(struct wined3d_context *context)
static struct wined3d_context * context_acquire(struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)

Referenced by texture2d_blt_fbo(), and texture2d_read_from_framebuffer().

◆ context_set_tls_idx()

void context_set_tls_idx ( DWORD  idx)

Definition at line 1561 of file context_gl.c.

1562{
1564}
static DWORD wined3d_context_tls_idx
Definition: context_gl.c:37
unsigned int idx
Definition: utils.c:40

Referenced by wined3d_dll_init().

◆ context_state_drawbuf()

void context_state_drawbuf ( struct wined3d_context *  context,
const struct wined3d_state *  state,
DWORD  state_id 
)

Definition at line 3722 of file context_gl.c.

3723{
3724 struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
3725 uint32_t rt_mask, *cur_mask;
3726
3728
3729 cur_mask = context_gl->current_fbo ? &context_gl->current_fbo->rt_mask : &context_gl->draw_buffers_mask;
3730 rt_mask = find_draw_buffers_mask(context_gl, state);
3731 if (rt_mask != *cur_mask)
3732 {
3733 wined3d_context_gl_apply_draw_buffers(context_gl, rt_mask);
3734 *cur_mask = rt_mask;
3735 }
3736}
static void wined3d_context_gl_apply_draw_buffers(struct wined3d_context_gl *context_gl, uint32_t rt_mask)
Definition: context_gl.c:2447
static uint32_t find_draw_buffers_mask(const struct wined3d_context_gl *context_gl, const struct wined3d_state *state)
Definition: context_gl.c:3360
UINT32 uint32_t
Definition: types.h:75
struct fbo_entry * current_fbo
Definition: wined3d_gl.h:641
uint32_t draw_buffers_mask
Definition: wined3d_gl.h:645
static bool isStateDirty(const struct wined3d_context *context, unsigned int state_id)
#define STATE_FRAMEBUFFER

◆ context_state_fb()

void context_state_fb ( struct wined3d_context *  context,
const struct wined3d_state *  state,
DWORD  state_id 
)

Definition at line 3426 of file context_gl.c.

3427{
3428 struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
3429 uint32_t rt_mask = find_draw_buffers_mask(context_gl, state);
3430 const struct wined3d_rendertarget_view_gl *view_gl;
3431 struct wined3d_rendertarget_info ds_info = {{0}};
3432 const struct wined3d_fb_state *fb = &state->fb;
3433 DWORD color_location = 0;
3434 uint32_t *cur_mask;
3435
3436 memset(context_gl->blit_targets, 0, sizeof(context_gl->blit_targets));
3437 for (unsigned int i = 0; i < context_gl->gl_info->limits.buffers; ++i)
3438 {
3439 if (!fb->render_targets[i])
3440 continue;
3441
3443 context_gl->blit_targets[i].gl_view = view_gl->gl_view;
3444 context_gl->blit_targets[i].resource = view_gl->v.resource;
3445 context_gl->blit_targets[i].sub_resource_idx = view_gl->v.sub_resource_idx;
3446 context_gl->blit_targets[i].layer_count = view_gl->v.layer_count;
3447
3448 if (!color_location)
3449 color_location = view_gl->v.resource->draw_binding;
3450 }
3451
3452 if (fb->depth_stencil)
3453 {
3455 ds_info.gl_view = view_gl->gl_view;
3456 ds_info.resource = view_gl->v.resource;
3457 ds_info.sub_resource_idx = view_gl->v.sub_resource_idx;
3458 ds_info.layer_count = view_gl->v.layer_count;
3459 }
3460
3461 wined3d_context_gl_apply_fbo_state(context_gl, GL_FRAMEBUFFER, context_gl->blit_targets, &ds_info,
3462 color_location, fb->depth_stencil ? fb->depth_stencil->resource->draw_binding : 0);
3463
3464 cur_mask = context_gl->current_fbo ? &context_gl->current_fbo->rt_mask : &context_gl->draw_buffers_mask;
3465 if (rt_mask != *cur_mask)
3466 {
3467 wined3d_context_gl_apply_draw_buffers(context_gl, rt_mask);
3468 *cur_mask = rt_mask;
3469 }
3470}
static void wined3d_context_gl_apply_fbo_state(struct wined3d_context_gl *context_gl, GLenum target, const struct wined3d_rendertarget_info *render_targets, const struct wined3d_rendertarget_info *depth_stencil, DWORD color_location, DWORD ds_location)
Definition: context_gl.c:821
#define GL_FRAMEBUFFER
Definition: glext.h:1732
const struct wined3d_gl_info * gl_info
Definition: wined3d_gl.h:603
struct wined3d_rendertarget_info blit_targets[WINED3D_MAX_RENDER_TARGETS]
Definition: wined3d_gl.h:644
struct wined3d_rendertarget_view * depth_stencil
struct wined3d_rendertarget_view * render_targets[WINED3D_MAX_RENDER_TARGETS]
unsigned int layer_count
Definition: wined3d_gl.h:564
struct wined3d_gl_view gl_view
Definition: wined3d_gl.h:561
unsigned int sub_resource_idx
Definition: wined3d_gl.h:563
struct wined3d_resource * resource
Definition: wined3d_gl.h:562
struct wined3d_rendertarget_view v
Definition: wined3d_gl.h:1065
struct wined3d_gl_view gl_view
Definition: wined3d_gl.h:1066

◆ context_update_stream_info()

void context_update_stream_info ( struct wined3d_context *  context,
const struct wined3d_state *  state 
)

Definition at line 258 of file context.c.

259{
260 struct wined3d_stream_info *stream_info = &context->stream_info;
261 const struct wined3d_d3d_info *d3d_info = context->d3d_info;
262 DWORD prev_all_vbo = stream_info->all_vbo;
263 unsigned int i;
265
267
268 stream_info->all_vbo = 1;
269 map = stream_info->use_map;
270 while (map)
271 {
274 struct wined3d_buffer *buffer;
275
277 element = &stream_info->elements[i];
278 buffer = state->streams[element->stream_idx].buffer;
279
280 /* We can't use VBOs if the base vertex index is negative. OpenGL
281 * doesn't accept negative offsets (or rather offsets bigger than the
282 * VBO, because the pointer is unsigned), so use system memory
283 * sources. In most sane cases the pointer - offset will still be > 0,
284 * otherwise it will wrap around to some big value. Hope that with the
285 * indices the driver wraps it back internally. If not,
286 * draw_primitive_immediate_mode() is needed, including a vertex buffer
287 * path. */
288 if (state->load_base_vertex_index < 0)
289 {
290 WARN_(d3d_perf)("load_base_vertex_index is < 0 (%d), not using VBOs.\n",
291 state->load_base_vertex_index);
292 element->data.buffer_object = 0;
294 if ((UINT_PTR)element->data.addr < -state->load_base_vertex_index * element->stride)
295 FIXME("System memory vertex data load offset is negative!\n");
296 }
297 else
298 {
301 element->data.buffer_object = data.buffer_object;
302 element->data.addr += (ULONG_PTR)data.addr;
303 }
304
305 if (!element->data.buffer_object)
306 stream_info->all_vbo = 0;
307
308 TRACE("Load array %u %s.\n", i, debug_bo_address(&element->data));
309 }
310
311 if (prev_all_vbo != stream_info->all_vbo)
313}
Definition: _map.h:48
void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state)
Definition: buffer.c:484
DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *context, struct wined3d_bo_address *data)
Definition: buffer.c:369
void * wined3d_buffer_load_sysmem(struct wined3d_buffer *buffer, struct wined3d_context *context)
Definition: buffer.c:362
void context_invalidate_state(struct wined3d_context *context, unsigned int state_id)
Definition: context.c:76
void wined3d_stream_info_from_declaration(struct wined3d_stream_info *stream_info, const struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info)
Definition: context.c:160
const char * debug_bo_address(const struct wined3d_bo_address *address)
Definition: utils.c:4600
#define ULONG_PTR
Definition: config.h:101
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint buffer
Definition: glext.h:5915
static void stream_info(IStream *stream, HGLOBAL *hmem, int *size, int *pos)
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define WARN_(ch,...)
Definition: debug.h:157
static int wined3d_bit_scan(unsigned int *x)
Definition: wined3d.h:2982
#define STATE_INDEXBUFFER

Referenced by context_apply_draw_state().

◆ cpu_blitter_clear_texture()

void cpu_blitter_clear_texture ( struct wined3d_texture *  texture,
unsigned int  sub_resource_idx,
const struct wined3d_box *  box,
const struct wined3d_color *  colour 
)

Definition at line 1128 of file surface.c.

1130{
1131 struct wined3d_device *device = texture->resource.device;
1132 struct wined3d_context *context;
1133 struct wined3d_bo_address data;
1134 struct wined3d_box level_box;
1135 struct wined3d_map_desc map;
1136 struct wined3d_range range;
1137 bool full_subresource;
1138 unsigned int level;
1139 DWORD map_binding;
1140
1141 TRACE("texture %p, sub_resource_idx %u, box %s, colour %s.\n",
1142 texture, sub_resource_idx, debug_box(box), debug_color(colour));
1143
1144 if (texture->resource.format_attrs & WINED3D_FORMAT_ATTR_BLOCKS)
1145 {
1146 FIXME("Not implemented for format %s.\n", debug_d3dformat(texture->resource.format->id));
1147 return;
1148 }
1149
1151
1152 level = sub_resource_idx % texture->level_count;
1154 full_subresource = !memcmp(box, &level_box, sizeof(*box));
1155
1156 map_binding = texture->resource.map_binding;
1157 if (!wined3d_texture_load_location(texture, sub_resource_idx, context, map_binding))
1158 ERR("Failed to load the sub-resource into %s.\n", wined3d_debug_location(map_binding));
1159 wined3d_texture_invalidate_location(texture, sub_resource_idx, ~map_binding);
1160 wined3d_texture_get_pitch(texture, level, &map.row_pitch, &map.slice_pitch);
1161 wined3d_texture_get_bo_address(texture, sub_resource_idx, &data, map_binding);
1163 texture->sub_resources[sub_resource_idx].size, WINED3D_MAP_WRITE);
1164 range.offset = 0;
1165 range.size = texture->sub_resources[sub_resource_idx].size;
1166
1167 wined3d_resource_memory_colour_fill(&texture->resource, &map, colour, box, full_subresource);
1168
1171}
range
Definition: d3dx9_private.h:58
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)
Definition: resource.c:601
void wined3d_texture_invalidate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, uint32_t location)
Definition: texture.c:702
BOOL wined3d_texture_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, uint32_t location)
Definition: texture.c:770
void wined3d_texture_get_bo_address(const struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_bo_address *data, uint32_t location)
Definition: texture.c:727
void CDECL wined3d_texture_get_pitch(const struct wined3d_texture *texture, unsigned int level, unsigned int *row_pitch, unsigned int *slice_pitch)
Definition: texture.c:1697
const char * debug_box(const struct wined3d_box *box)
Definition: utils.c:4552
const char * debug_d3dformat(enum wined3d_format_id format_id)
Definition: utils.c:4605
const char * wined3d_debug_location(uint32_t location)
Definition: utils.c:6588
const char * debug_color(const struct wined3d_color *color)
Definition: utils.c:4561
_ACRTIMP int __cdecl memcmp(const void *, const void *, size_t)
Definition: string.c:2807
GLint level
Definition: gl.h:1546
Definition: palette.c:466
#define WINED3D_MAP_WRITE
Definition: wined3d.h:956
static void wined3d_context_unmap_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *data, unsigned int range_count, const struct wined3d_range *ranges)
static void wined3d_texture_get_level_box(const struct wined3d_texture *texture, unsigned int level, struct wined3d_box *box)
static void * wined3d_context_map_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *data, size_t size, uint32_t map_flags)
#define WINED3D_FORMAT_ATTR_BLOCKS

Referenced by cpu_blitter_clear_rtv(), and wined3d_cs_exec_clear_sysmem_texture().

◆ create_complex_fixup_desc()

static struct color_fixup_desc create_complex_fixup_desc ( enum complex_fixup  complex_fixup)
inlinestatic

Definition at line 256 of file wined3d_private.h.

257{
258 struct color_fixup_desc fixup =
259 {
264 };
265 return fixup;
266}
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 * u
Definition: glfuncs.h:240
complex_fixup

Referenced by apply_format_fixups().

◆ debug_bo_address()

const char * debug_bo_address ( const struct wined3d_bo_address *  address)

Definition at line 4600 of file utils.c.

4601{
4603}
const char * debug_const_bo_address(const struct wined3d_const_bo_address *address)
Definition: utils.c:4593
GLuint address
Definition: glext.h:9393

Referenced by context_update_stream_info(), wined3d_context_gl_load_numbered_arrays(), wined3d_deferred_context_map_upload_bo(), wined3d_texture_gl_download_data(), and wined3d_texture_vk_download_data().

◆ debug_box()

◆ debug_color()

◆ debug_const_bo_address()

◆ debug_d3ddeclmethod()

const char * debug_d3ddeclmethod ( enum wined3d_decl_method  method)

Definition at line 4933 of file utils.c.

4934{
4935 switch (method)
4936 {
4937#define WINED3DDECLMETHOD_TO_STR(u) case u: return #u
4945#undef WINED3DDECLMETHOD_TO_STR
4946 default:
4947 FIXME("Unrecognized declaration method %#x.\n", method);
4948 return "unrecognized";
4949 }
4950}
#define WINED3DDECLMETHOD_TO_STR(u)
method
Definition: dragdrop.c:54
@ WINED3D_DECL_METHOD_LOOKUP
Definition: wined3d.h:801
@ WINED3D_DECL_METHOD_LOOKUP_PRESAMPLED
Definition: wined3d.h:802
@ WINED3D_DECL_METHOD_PARTIAL_V
Definition: wined3d.h:798
@ WINED3D_DECL_METHOD_CROSS_UV
Definition: wined3d.h:799
@ WINED3D_DECL_METHOD_UV
Definition: wined3d.h:800
@ WINED3D_DECL_METHOD_PARTIAL_U
Definition: wined3d.h:797
@ WINED3D_DECL_METHOD_DEFAULT
Definition: wined3d.h:796

Referenced by dump_wined3d_vertex_element().

◆ debug_d3ddeclusage()

const char * debug_d3ddeclusage ( enum wined3d_decl_usage  usage)

Definition at line 4952 of file utils.c.

4953{
4954 switch (usage)
4955 {
4956#define WINED3DDECLUSAGE_TO_STR(u) case u: return #u
4971#undef WINED3DDECLUSAGE_TO_STR
4972 default:
4973 FIXME("Unrecognized %u declaration usage!\n", usage);
4974 return "unrecognized";
4975 }
4976}
#define WINED3DDECLUSAGE_TO_STR(u)
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
@ WINED3D_DECL_USAGE_DEPTH
Definition: wined3d.h:819
@ WINED3D_DECL_USAGE_BLEND_INDICES
Definition: wined3d.h:809
@ WINED3D_DECL_USAGE_TESS_FACTOR
Definition: wined3d.h:815
@ WINED3D_DECL_USAGE_NORMAL
Definition: wined3d.h:810
@ WINED3D_DECL_USAGE_PSIZE
Definition: wined3d.h:811
@ WINED3D_DECL_USAGE_BLEND_WEIGHT
Definition: wined3d.h:808
@ WINED3D_DECL_USAGE_SAMPLE
Definition: wined3d.h:820
@ WINED3D_DECL_USAGE_POSITION
Definition: wined3d.h:807
@ WINED3D_DECL_USAGE_BINORMAL
Definition: wined3d.h:814
@ WINED3D_DECL_USAGE_COLOR
Definition: wined3d.h:817
@ WINED3D_DECL_USAGE_POSITIONT
Definition: wined3d.h:816
@ WINED3D_DECL_USAGE_TEXCOORD
Definition: wined3d.h:812
@ WINED3D_DECL_USAGE_TANGENT
Definition: wined3d.h:813
@ WINED3D_DECL_USAGE_FOG
Definition: wined3d.h:818

Referenced by dump_wined3d_vertex_element(), fixed_get_input(), and wined3d_stream_info_from_declaration().

◆ debug_d3ddevicetype()

const char * debug_d3ddevicetype ( enum wined3d_device_type  device_type)

Definition at line 4781 of file utils.c.

4782{
4783 switch (device_type)
4784 {
4785#define DEVTYPE_TO_STR(dev) case dev: return #dev
4789#undef DEVTYPE_TO_STR
4790 default:
4791 FIXME("Unrecognized device type %#x.\n", device_type);
4792 return "unrecognized";
4793 }
4794}
device_type
#define DEVTYPE_TO_STR(dev)
@ WINED3D_DEVICE_TYPE_SW
Definition: wined3d.h:93
@ WINED3D_DEVICE_TYPE_HAL
Definition: wined3d.h:91
@ WINED3D_DEVICE_TYPE_REF
Definition: wined3d.h:92

Referenced by wined3d_check_depth_stencil_match(), wined3d_check_device_format(), wined3d_check_device_format_conversion(), wined3d_check_device_multisample_type(), wined3d_check_device_type(), and wined3d_get_device_caps().

◆ debug_d3dformat()

const char * debug_d3dformat ( enum wined3d_format_id  format_id)

Definition at line 4605 of file utils.c.

4606{
4607 switch (format_id)
4608 {
4609#define FMT_TO_STR(format_id) case format_id: return #format_id
4763#undef FMT_TO_STR
4764 default:
4765 {
4766 char fourcc[5];
4767 fourcc[0] = (char)(format_id);
4768 fourcc[1] = (char)(format_id >> 8);
4769 fourcc[2] = (char)(format_id >> 16);
4770 fourcc[3] = (char)(format_id >> 24);
4771 fourcc[4] = 0;
4772 if (isprint(fourcc[0]) && isprint(fourcc[1]) && isprint(fourcc[2]) && isprint(fourcc[3]))
4773 FIXME("Unrecognized %#x (as fourcc: %s) WINED3DFORMAT!\n", format_id, fourcc);
4774 else
4775 FIXME("Unrecognized %#x WINED3DFORMAT!\n", format_id);
4776 }
4777 return "unrecognized";
4778 }
4779}
#define isprint(c)
Definition: acclib.h:73
#define FMT_TO_STR(format_id)
unsigned char
Definition: typeof.h:29
static UINT format_id
Definition: clipboard.c:1455
@ WINED3DFMT_R32G32B32_TYPELESS
Definition: wined3d.h:160
@ WINED3DFMT_RESZ
Definition: wined3d.h:275
@ WINED3DFMT_R8_TYPELESS
Definition: wined3d.h:217
@ WINED3DFMT_B2G3R3_UNORM
Definition: wined3d.h:131
@ WINED3DFMT_BC5_UNORM
Definition: wined3d.h:240
@ WINED3DFMT_R32G32B32_SINT
Definition: wined3d.h:163
@ WINED3DFMT_R8G8_UNORM
Definition: wined3d.h:206
@ WINED3DFMT_BC7_TYPELESS
Definition: wined3d.h:253
@ WINED3DFMT_BC7_UNORM_SRGB
Definition: wined3d.h:255
@ WINED3DFMT_R32G32_SINT
Definition: wined3d.h:173
@ WINED3DFMT_X24_TYPELESS_G8_UINT
Definition: wined3d.h:204
@ WINED3DFMT_BC2_UNORM_SRGB
Definition: wined3d.h:232
@ WINED3DFMT_INTZ
Definition: wined3d.h:274
@ WINED3DFMT_B4G4R4A4_UNORM
Definition: wined3d.h:130
@ WINED3DFMT_R16G16_UINT
Definition: wined3d.h:193
@ WINED3DFMT_R16G16_UNORM
Definition: wined3d.h:192
@ WINED3DFMT_R8G8_TYPELESS
Definition: wined3d.h:205
@ WINED3DFMT_R10G10B10X2_UINT
Definition: wined3d.h:145
@ WINED3DFMT_X8D24_UNORM
Definition: wined3d.h:151
@ WINED3DFMT_BC5_SNORM
Definition: wined3d.h:241
@ WINED3DFMT_R32_SINT
Definition: wined3d.h:200
@ WINED3DFMT_DXT2
Definition: wined3d.h:261
@ WINED3DFMT_D32_FLOAT
Definition: wined3d.h:197
@ WINED3DFMT_R10G10B10A2_UNORM
Definition: wined3d.h:179
@ WINED3DFMT_R8_UINT
Definition: wined3d.h:219
@ WINED3DFMT_R8G8_SNORM_Cx
Definition: wined3d.h:155
@ WINED3DFMT_R32G32_FLOAT
Definition: wined3d.h:171
@ WINED3DFMT_R16G16_SNORM
Definition: wined3d.h:194
@ WINED3DFMT_B8G8R8A8_UNORM
Definition: wined3d.h:244
@ WINED3DFMT_R16_UNORM
Definition: wined3d.h:213
@ WINED3DFMT_R24G8_TYPELESS
Definition: wined3d.h:201
@ WINED3DFMT_R10G10B10A2_TYPELESS
Definition: wined3d.h:178
@ WINED3DFMT_R32G32_UINT
Definition: wined3d.h:172
@ WINED3DFMT_R32G32B32_UINT
Definition: wined3d.h:162
@ WINED3DFMT_BC4_TYPELESS
Definition: wined3d.h:236
@ WINED3DFMT_ATI1N
Definition: wined3d.h:268
@ WINED3DFMT_BC2_UNORM
Definition: wined3d.h:231
@ WINED3DFMT_R8_UNORM
Definition: wined3d.h:218
@ WINED3DFMT_R8G8B8A8_SNORM
Definition: wined3d.h:188
@ WINED3DFMT_NV12
Definition: wined3d.h:279
@ WINED3DFMT_S8_UINT_D24_FLOAT
Definition: wined3d.h:154
@ WINED3DFMT_R10G10B10_XR_BIAS_A2_UNORM
Definition: wined3d.h:182
@ WINED3DFMT_NULL
Definition: wined3d.h:276
@ WINED3DFMT_R16_TYPELESS
Definition: wined3d.h:210
@ WINED3DFMT_R16G16B16A16_SINT
Definition: wined3d.h:169
@ WINED3DFMT_D16_LOCKABLE
Definition: wined3d.h:148
@ WINED3DFMT_R10G11B11_SNORM
Definition: wined3d.h:143
@ WINED3DFMT_S1_UINT_D15_UNORM
Definition: wined3d.h:150
@ WINED3DFMT_R16_SINT
Definition: wined3d.h:216
@ WINED3DFMT_B2G3R3A8_UNORM
Definition: wined3d.h:132
@ WINED3DFMT_R8G8_B8G8_UNORM
Definition: wined3d.h:225
@ WINED3DFMT_L8A8_UNORM
Definition: wined3d.h:139
@ WINED3DFMT_R32G32B32_FLOAT
Definition: wined3d.h:161
@ WINED3DFMT_L4A4_UNORM
Definition: wined3d.h:140
@ WINED3DFMT_B8G8R8X8_UNORM
Definition: wined3d.h:245
@ WINED3DFMT_R32_FLOAT_X8X24_TYPELESS
Definition: wined3d.h:176
@ WINED3DFMT_R8G8B8X8_UNORM
Definition: wined3d.h:134
@ WINED3DFMT_BC1_UNORM_SRGB
Definition: wined3d.h:229
@ WINED3DFMT_B5G5R5X1_UNORM
Definition: wined3d.h:129
@ WINED3DFMT_B10G10R10A2_UNORM
Definition: wined3d.h:135
@ WINED3DFMT_R16G16B16A16_FLOAT
Definition: wined3d.h:165
@ WINED3DFMT_D16_UNORM
Definition: wined3d.h:212
@ WINED3DFMT_L8_UNORM
Definition: wined3d.h:138
@ WINED3DFMT_NVHS
Definition: wined3d.h:273
@ WINED3DFMT_R8G8_SNORM
Definition: wined3d.h:208
@ WINED3DFMT_UNKNOWN
Definition: wined3d.h:127
@ WINED3DFMT_R5G5_SNORM_L6_UNORM
Definition: wined3d.h:141
@ WINED3DFMT_R8G8B8A8_TYPELESS
Definition: wined3d.h:184
@ WINED3DFMT_R8G8_UINT
Definition: wined3d.h:207
@ WINED3DFMT_BC7_UNORM
Definition: wined3d.h:254
@ WINED3DFMT_B8G8R8_UNORM
Definition: wined3d.h:128
@ WINED3DFMT_INST
Definition: wined3d.h:270
@ WINED3DFMT_DXT1
Definition: wined3d.h:260
@ WINED3DFMT_R8G8B8A8_UNORM_SRGB
Definition: wined3d.h:186
@ WINED3DFMT_R9G9B9E5_SHAREDEXP
Definition: wined3d.h:224
@ WINED3DFMT_NVDB
Definition: wined3d.h:271
@ WINED3DFMT_B8G8R8X8_TYPELESS
Definition: wined3d.h:248
@ WINED3DFMT_R32_UINT
Definition: wined3d.h:199
@ WINED3DFMT_B5G5R5A1_UNORM
Definition: wined3d.h:243
@ WINED3DFMT_R10G10B10_SNORM_A2_UNORM
Definition: wined3d.h:147
@ WINED3DFMT_R16_FLOAT
Definition: wined3d.h:211
@ WINED3DFMT_DXT3
Definition: wined3d.h:262
@ WINED3DFMT_DXT4
Definition: wined3d.h:263
@ WINED3DFMT_D32_UNORM
Definition: wined3d.h:149
@ WINED3DFMT_R8G8B8A8_UNORM
Definition: wined3d.h:185
@ WINED3DFMT_R10G10B10A2_UINT
Definition: wined3d.h:180
@ WINED3DFMT_G8R8_G8B8_UNORM
Definition: wined3d.h:226
@ WINED3DFMT_R10G10B10X2_TYPELESS
Definition: wined3d.h:144
@ WINED3DFMT_R32G32B32A32_UINT
Definition: wined3d.h:158
@ WINED3DFMT_R16G16B16A16_UNORM
Definition: wined3d.h:166
@ WINED3DFMT_BC3_UNORM
Definition: wined3d.h:234
@ WINED3DFMT_BC6H_UF16
Definition: wined3d.h:251
@ WINED3DFMT_R16G16B16A16_TYPELESS
Definition: wined3d.h:164
@ WINED3DFMT_R10G10B10A2_SNORM
Definition: wined3d.h:181
@ WINED3DFMT_R24_UNORM_X8_TYPELESS
Definition: wined3d.h:203
@ WINED3DFMT_R16
Definition: wined3d.h:277
@ WINED3DFMT_D32_FLOAT_S8X24_UINT
Definition: wined3d.h:175
@ WINED3DFMT_NVHU
Definition: wined3d.h:272
@ WINED3DFMT_R32_FLOAT
Definition: wined3d.h:198
@ WINED3DFMT_R8G8_SNORM_L8X8_UNORM
Definition: wined3d.h:142
@ WINED3DFMT_X32_TYPELESS_G8X24_UINT
Definition: wined3d.h:177
@ WINED3DFMT_YV12
Definition: wined3d.h:259
@ WINED3DFMT_B5G6R5_UNORM
Definition: wined3d.h:242
@ WINED3DFMT_R16G16B16A16_UINT
Definition: wined3d.h:167
@ WINED3DFMT_S4X4_UINT_D24_UNORM
Definition: wined3d.h:152
@ WINED3DFMT_BC1_TYPELESS
Definition: wined3d.h:227
@ WINED3DFMT_B8G8R8X8_UNORM_SRGB
Definition: wined3d.h:249
@ WINED3DFMT_DXT5
Definition: wined3d.h:264
@ WINED3DFMT_BC4_UNORM
Definition: wined3d.h:237
@ WINED3DFMT_B8G8R8A8_TYPELESS
Definition: wined3d.h:246
@ WINED3DFMT_BC3_TYPELESS
Definition: wined3d.h:233
@ WINED3DFMT_R16G16_TYPELESS
Definition: wined3d.h:190
@ WINED3DFMT_R8_SNORM
Definition: wined3d.h:220
@ WINED3DFMT_YUY2
Definition: wined3d.h:258
@ WINED3DFMT_R16G16_FLOAT
Definition: wined3d.h:191
@ WINED3DFMT_G8R8_G8B8
Definition: wined3d.h:266
@ WINED3DFMT_P8_UINT
Definition: wined3d.h:137
@ WINED3DFMT_R8G8B8A8_UINT
Definition: wined3d.h:187
@ WINED3DFMT_L16_UNORM
Definition: wined3d.h:153
@ WINED3DFMT_R16_SNORM
Definition: wined3d.h:215
@ WINED3DFMT_BC6H_TYPELESS
Definition: wined3d.h:250
@ WINED3DFMT_BC1_UNORM
Definition: wined3d.h:228
@ WINED3DFMT_R32G32B32A32_TYPELESS
Definition: wined3d.h:156
@ WINED3DFMT_R32_TYPELESS
Definition: wined3d.h:196
@ WINED3DFMT_R32G8X24_TYPELESS
Definition: wined3d.h:174
@ WINED3DFMT_R16_UINT
Definition: wined3d.h:214
@ WINED3DFMT_R8_SINT
Definition: wined3d.h:221
@ WINED3DFMT_UYVY
Definition: wined3d.h:257
@ WINED3DFMT_BC5_TYPELESS
Definition: wined3d.h:239
@ WINED3DFMT_R8G8_SINT
Definition: wined3d.h:209
@ WINED3DFMT_R32G32B32A32_SINT
Definition: wined3d.h:159
@ WINED3DFMT_R8G8B8A8_SINT
Definition: wined3d.h:189
@ WINED3DFMT_R10G10B10X2_SNORM
Definition: wined3d.h:146
@ WINED3DFMT_R1_UNORM
Definition: wined3d.h:223
@ WINED3DFMT_ATOC
Definition: wined3d.h:282
@ WINED3DFMT_R11G11B10_FLOAT
Definition: wined3d.h:183
@ WINED3DFMT_B8G8R8A8_UNORM_SRGB
Definition: wined3d.h:247
@ WINED3DFMT_BC3_UNORM_SRGB
Definition: wined3d.h:235
@ WINED3DFMT_A8_UNORM
Definition: wined3d.h:222
@ WINED3DFMT_R32G32B32A32_FLOAT
Definition: wined3d.h:157
@ WINED3DFMT_BC2_TYPELESS
Definition: wined3d.h:230
@ WINED3DFMT_R8G8_B8G8
Definition: wined3d.h:267
@ WINED3DFMT_BC6H_SF16
Definition: wined3d.h:252
@ WINED3DFMT_ATI2N
Definition: wined3d.h:269
@ WINED3DFMT_B4G4R4X4_UNORM
Definition: wined3d.h:133
@ WINED3DFMT_MULTI2_ARGB8
Definition: wined3d.h:265
@ WINED3DFMT_AL16
Definition: wined3d.h:278
@ WINED3DFMT_D24_UNORM_S8_UINT
Definition: wined3d.h:202
@ WINED3DFMT_P8_UINT_A8_UNORM
Definition: wined3d.h:136
@ WINED3DFMT_R16G16B16A16_SNORM
Definition: wined3d.h:168
@ WINED3DFMT_BC4_SNORM
Definition: wined3d.h:238
@ WINED3DFMT_R16G16_SINT
Definition: wined3d.h:195
@ WINED3DFMT_R32G32_TYPELESS
Definition: wined3d.h:170

Referenced by check_fbo_compat(), context_choose_pixel_format(), cpu_blitter_clear(), cpu_blitter_clear_rtv(), cpu_blitter_clear_texture(), depthbias(), dump_wined3d_vertex_element(), get_format_internal(), init_format_depth_bias_scale(), init_format_fbo_compat_info(), init_format_filter_info(), init_vulkan_format_info(), query_format_cap(), query_internal_format(), query_view_class(), resource_init(), surface_convert_format(), surface_cpu_blt(), surface_cpu_blt_compressed(), swapchain_blit_gdi(), texture2d_blt(), texture2d_depth_blt_fbo(), validate_resource_view(), vertexdeclaration_init(), wined3d_calculate_format_pitch(), wined3d_check_depth_stencil_match(), wined3d_check_device_format(), wined3d_check_device_format_conversion(), wined3d_check_device_multisample_type(), wined3d_check_device_type(), wined3d_context_gl_find_fbo_entry(), wined3d_debug_view_desc(), wined3d_device_context_clear_uav_float(), wined3d_device_context_copy_resource(), wined3d_device_context_copy_sub_resource_region(), wined3d_device_context_resolve_sub_resource(), wined3d_device_context_set_index_buffer(), wined3d_device_reset(), wined3d_device_set_cursor_properties(), wined3d_format_convert_from_float(), wined3d_format_get_color_key_conversion(), wined3d_format_get_colour(), wined3d_format_get_float_color_key(), wined3d_get_format(), wined3d_output_find_closest_matching_mode(), wined3d_output_get_display_mode(), wined3d_output_get_mode(), wined3d_output_get_mode_count(), wined3d_output_set_display_mode(), wined3d_render_target_view_gl_cs_init(), wined3d_shader_resource_view_gl_cs_init(), wined3d_shader_resource_view_vk_generate_mipmap(), wined3d_stateblock_set_index_buffer(), wined3d_stream_info_from_declaration(), wined3d_swapchain_get_display_mode(), wined3d_swapchain_resize_buffers(), wined3d_swapchain_state_init(), wined3d_swapchain_vk_select_vk_format(), wined3d_texture_create_dc(), wined3d_texture_gl_download_data(), wined3d_texture_gl_download_data_slow_path(), wined3d_texture_gl_prepare_texture(), wined3d_texture_gl_upload_data(), wined3d_texture_init(), wined3d_texture_vk_download_data(), wined3d_texture_vk_upload_data(), wined3d_unordered_access_view_gl_clear(), and wined3d_unordered_access_view_vk_clear().

◆ debug_d3dinput_classification()

const char * debug_d3dinput_classification ( enum wined3d_input_classification  classification)

Definition at line 4978 of file utils.c.

4979{
4980 switch (classification)
4981 {
4982#define WINED3D_TO_STR(x) case x: return #x
4985#undef WINED3D_TO_STR
4986 default:
4987 FIXME("Unrecognized input classification %#x.\n", classification);
4988 return "unrecognized";
4989 }
4990}
#define WINED3D_TO_STR(x)
@ WINED3D_INPUT_PER_INSTANCE_DATA
Definition: wined3d.h:1827
@ WINED3D_INPUT_PER_VERTEX_DATA
Definition: wined3d.h:1826

Referenced by dump_wined3d_vertex_element(), and wined3d_stream_info_from_declaration().

◆ debug_d3dprimitivetype()

const char * debug_d3dprimitivetype ( enum wined3d_primitive_type  primitive_type)

Definition at line 5009 of file utils.c.

5010{
5011 switch (primitive_type)
5012 {
5013#define PRIM_TO_STR(prim) case prim: return #prim
5026#undef PRIM_TO_STR
5027 default:
5028 FIXME("Unrecognized primitive type %#x.\n", primitive_type);
5029 return "unrecognized";
5030 }
5031}
#define PRIM_TO_STR(prim)
@ WINED3D_PT_LINESTRIP_ADJ
Definition: wined3d.h:83
@ WINED3D_PT_LINELIST
Definition: wined3d.h:77
@ WINED3D_PT_UNDEFINED
Definition: wined3d.h:75
@ WINED3D_PT_PATCH
Definition: wined3d.h:86
@ WINED3D_PT_POINTLIST
Definition: wined3d.h:76
@ WINED3D_PT_TRIANGLELIST_ADJ
Definition: wined3d.h:84
@ WINED3D_PT_LINELIST_ADJ
Definition: wined3d.h:82
@ WINED3D_PT_TRIANGLESTRIP_ADJ
Definition: wined3d.h:85
@ WINED3D_PT_TRIANGLESTRIP
Definition: wined3d.h:80
@ WINED3D_PT_LINESTRIP
Definition: wined3d.h:78
@ WINED3D_PT_TRIANGLELIST
Definition: wined3d.h:79
@ WINED3D_PT_TRIANGLEFAN
Definition: wined3d.h:81

Referenced by gl_primitive_type_from_d3d(), glsl_primitive_type_from_d3d(), shader_glsl_generate_geometry_shader(), vk_topology_class_from_wined3d(), vk_topology_from_wined3d(), wined3d_device_context_get_primitive_type(), and wined3d_device_context_set_primitive_type().

◆ debug_d3drenderstate()

const char * debug_d3drenderstate ( enum wined3d_render_state  state)

Definition at line 5033 of file utils.c.

5034{
5035 switch (state)
5036 {
5037#define D3DSTATE_TO_STR(u) case u: return #u
5162#undef D3DSTATE_TO_STR
5163 default:
5164 FIXME("Unrecognized %u render state!\n", state);
5165 return "unrecognized";
5166 }
5167}
#define D3DSTATE_TO_STR(u)
@ WINED3D_RS_TEXTUREFACTOR
Definition: wined3d.h:337
@ WINED3D_RS_COLORKEYENABLE
Definition: wined3d.h:323
@ WINED3D_RS_STENCILFAIL
Definition: wined3d.h:330
@ WINED3D_RS_NORMALDEGREE
Definition: wined3d.h:380
@ WINED3D_RS_WRAP8
Definition: wined3d.h:402
@ WINED3D_RS_LIGHTING
Definition: wined3d.h:347
@ WINED3D_RS_SOFTWAREVERTEXPROCESSING
Definition: wined3d.h:361
@ WINED3D_RS_STIPPLEDALPHA
Definition: wined3d.h:316
@ WINED3D_RS_COLORWRITEENABLE1
Definition: wined3d.h:396
@ WINED3D_RS_STENCILENABLE
Definition: wined3d.h:329
@ WINED3D_RS_COLORVERTEX
Definition: wined3d.h:351
@ WINED3D_RS_TWEENFACTOR
Definition: wined3d.h:377
@ WINED3D_RS_FOGCOLOR
Definition: wined3d.h:317
@ WINED3D_RS_WRAP4
Definition: wined3d.h:342
@ WINED3D_RS_WRAP15
Definition: wined3d.h:409
@ WINED3D_RS_ZENABLE
Definition: wined3d.h:293
@ WINED3D_RS_ANTIALIASEDLINEENABLE
Definition: wined3d.h:383
@ WINED3D_RS_SPECULARMATERIALSOURCE
Definition: wined3d.h:356
@ WINED3D_RS_STENCILPASS
Definition: wined3d.h:332
@ WINED3D_RS_WRAP13
Definition: wined3d.h:407
@ WINED3D_RS_DEBUGMONITORTOKEN
Definition: wined3d.h:373
@ WINED3D_RS_WRAP1
Definition: wined3d.h:339
@ WINED3D_RS_WRAP3
Definition: wined3d.h:341
@ WINED3D_RS_DEPTHBIAS
Definition: wined3d.h:401
@ WINED3D_RS_MAXTESSELLATIONLEVEL
Definition: wined3d.h:385
@ WINED3D_RS_DITHERENABLE
Definition: wined3d.h:309
@ WINED3D_RS_SHADEMODE
Definition: wined3d.h:295
@ WINED3D_RS_CULLMODE
Definition: wined3d.h:305
@ WINED3D_RS_BACK_STENCILPASS
Definition: wined3d.h:394
@ WINED3D_RS_WRAPV
Definition: wined3d.h:292
@ WINED3D_RS_PATCHEDGESTYLE
Definition: wined3d.h:371
@ WINED3D_RS_SCISSORTESTENABLE
Definition: wined3d.h:381
@ WINED3D_RS_LASTPIXEL
Definition: wined3d.h:302
@ WINED3D_RS_VERTEXBLEND
Definition: wined3d.h:359
@ WINED3D_RS_FOGEND
Definition: wined3d.h:320
@ WINED3D_RS_MINTESSELLATIONLEVEL
Definition: wined3d.h:384
@ WINED3D_RS_POINTSCALE_A
Definition: wined3d.h:366
@ WINED3D_RS_MULTISAMPLEMASK
Definition: wined3d.h:370
@ WINED3D_RS_BACK_STENCILFUNC
Definition: wined3d.h:395
@ WINED3D_RS_SRCBLEND
Definition: wined3d.h:303
@ WINED3D_RS_SRGBWRITEENABLE
Definition: wined3d.h:400
@ WINED3D_RS_RANGEFOGENABLE
Definition: wined3d.h:325
@ WINED3D_RS_POINTSIZE_MIN
Definition: wined3d.h:363
@ WINED3D_RS_TEXTUREPERSPECTIVE
Definition: wined3d.h:290
@ WINED3D_RS_ENABLEADAPTIVETESSELLATION
Definition: wined3d.h:390
@ WINED3D_RS_COLORWRITEENABLE3
Definition: wined3d.h:398
@ WINED3D_RS_ALPHABLENDENABLE
Definition: wined3d.h:310
@ WINED3D_RS_WRAPU
Definition: wined3d.h:291
@ WINED3D_RS_ADAPTIVETESS_X
Definition: wined3d.h:386
@ WINED3D_RS_MONOENABLE
Definition: wined3d.h:297
@ WINED3D_RS_LOCALVIEWER
Definition: wined3d.h:352
@ WINED3D_RS_ADAPTIVETESS_Z
Definition: wined3d.h:388
@ WINED3D_RS_WRAP0
Definition: wined3d.h:338
@ WINED3D_RS_STENCILMASK
Definition: wined3d.h:335
@ WINED3D_RS_BLENDOP
Definition: wined3d.h:378
@ WINED3D_RS_POINTSCALE_C
Definition: wined3d.h:368
@ WINED3D_RS_FOGSTART
Definition: wined3d.h:319
@ WINED3D_RS_STENCILFUNC
Definition: wined3d.h:333
@ WINED3D_RS_WRAP7
Definition: wined3d.h:345
@ WINED3D_RS_FOGTABLEMODE
Definition: wined3d.h:318
@ WINED3D_RS_POINTSIZE
Definition: wined3d.h:362
@ WINED3D_RS_POINTSIZE_MAX
Definition: wined3d.h:374
@ WINED3D_RS_ZWRITEENABLE
Definition: wined3d.h:300
@ WINED3D_RS_PLANEMASK
Definition: wined3d.h:299
@ WINED3D_RS_SUBPIXELX
Definition: wined3d.h:315
@ WINED3D_RS_CLIPPLANEENABLE
Definition: wined3d.h:360
@ WINED3D_RS_DESTBLEND
Definition: wined3d.h:304
@ WINED3D_RS_AMBIENTMATERIALSOURCE
Definition: wined3d.h:357
@ WINED3D_RS_WRAP6
Definition: wined3d.h:344
@ WINED3D_RS_STENCILREF
Definition: wined3d.h:334
@ WINED3D_RS_FOGENABLE
Definition: wined3d.h:311
@ WINED3D_RS_POINTSPRITEENABLE
Definition: wined3d.h:364
@ WINED3D_RS_FLUSHBATCH
Definition: wined3d.h:327
@ WINED3D_RS_BACK_STENCILZFAIL
Definition: wined3d.h:393
@ WINED3D_RS_ZFUNC
Definition: wined3d.h:306
@ WINED3D_RS_ROP2
Definition: wined3d.h:298
@ WINED3D_RS_POSITIONDEGREE
Definition: wined3d.h:379
@ WINED3D_RS_MULTISAMPLEANTIALIAS
Definition: wined3d.h:369
@ WINED3D_RS_ANTIALIAS
Definition: wined3d.h:289
@ WINED3D_RS_BACK_STENCILFAIL
Definition: wined3d.h:392
@ WINED3D_RS_COLORWRITEENABLE
Definition: wined3d.h:376
@ WINED3D_RS_SLOPESCALEDEPTHBIAS
Definition: wined3d.h:382
@ WINED3D_RS_DIFFUSEMATERIALSOURCE
Definition: wined3d.h:355
@ WINED3D_RS_ALPHAREF
Definition: wined3d.h:307
@ WINED3D_RS_NORMALIZENORMALS
Definition: wined3d.h:353
@ WINED3D_RS_ANISOTROPY
Definition: wined3d.h:326
@ WINED3D_RS_TWOSIDEDSTENCILMODE
Definition: wined3d.h:391
@ WINED3D_RS_TRANSLUCENTSORTINDEPENDENT
Definition: wined3d.h:328
@ WINED3D_RS_EMISSIVEMATERIALSOURCE
Definition: wined3d.h:358
@ WINED3D_RS_PATCHSEGMENTS
Definition: wined3d.h:372
@ WINED3D_RS_SPECULARENABLE
Definition: wined3d.h:312
@ WINED3D_RS_WRAP2
Definition: wined3d.h:340
@ WINED3D_RS_ADAPTIVETESS_W
Definition: wined3d.h:389
@ WINED3D_RS_FILLMODE
Definition: wined3d.h:294
@ WINED3D_RS_CLIPPING
Definition: wined3d.h:346
@ WINED3D_RS_WRAP10
Definition: wined3d.h:404
@ WINED3D_RS_SRCBLENDALPHA
Definition: wined3d.h:411
@ WINED3D_RS_COLORKEYBLENDENABLE
Definition: wined3d.h:354
@ WINED3D_RS_COLORWRITEENABLE2
Definition: wined3d.h:397
@ WINED3D_RS_POINTSCALEENABLE
Definition: wined3d.h:365
@ WINED3D_RS_WRAP14
Definition: wined3d.h:408
@ WINED3D_RS_FOGVERTEXMODE
Definition: wined3d.h:350
@ WINED3D_RS_STENCILWRITEMASK
Definition: wined3d.h:336
@ WINED3D_RS_AMBIENT
Definition: wined3d.h:349
@ WINED3D_RS_WRAP11
Definition: wined3d.h:405
@ WINED3D_RS_LINEPATTERN
Definition: wined3d.h:296
@ WINED3D_RS_ZVISIBLE
Definition: wined3d.h:313
@ WINED3D_RS_EXTENTS
Definition: wined3d.h:348
@ WINED3D_RS_BLENDOPALPHA
Definition: wined3d.h:413
@ WINED3D_RS_DESTBLENDALPHA
Definition: wined3d.h:412
@ WINED3D_RS_FOGDENSITY
Definition: wined3d.h:321
@ WINED3D_RS_STENCILZFAIL
Definition: wined3d.h:331
@ WINED3D_RS_SUBPIXEL
Definition: wined3d.h:314
@ WINED3D_RS_POINTSCALE_B
Definition: wined3d.h:367
@ WINED3D_RS_INDEXEDVERTEXBLENDENABLE
Definition: wined3d.h:375
@ WINED3D_RS_MIPMAPLODBIAS
Definition: wined3d.h:324
@ WINED3D_RS_WRAP9
Definition: wined3d.h:403
@ WINED3D_RS_SEPARATEALPHABLENDENABLE
Definition: wined3d.h:410
@ WINED3D_RS_STIPPLEENABLE
Definition: wined3d.h:322
@ WINED3D_RS_WRAP5
Definition: wined3d.h:343
@ WINED3D_RS_ADAPTIVETESS_Y
Definition: wined3d.h:387
@ WINED3D_RS_ALPHATESTENABLE
Definition: wined3d.h:301
@ WINED3D_RS_ALPHAFUNC
Definition: wined3d.h:308
@ WINED3D_RS_WRAP12
Definition: wined3d.h:406

Referenced by debug_d3dstate(), and wined3d_stateblock_set_render_state().

◆ debug_d3dresourcetype()

const char * debug_d3dresourcetype ( enum wined3d_resource_type  resource_type)

Definition at line 4992 of file utils.c.

4993{
4994 switch (resource_type)
4995 {
4996#define WINED3D_TO_STR(x) case x: return #x
5002#undef WINED3D_TO_STR
5003 default:
5004 FIXME("Unrecognized resource type %#x.\n", resource_type);
5005 return "unrecognized";
5006 }
5007}
@ WINED3D_RTYPE_TEXTURE_2D
Definition: wined3d.h:720
@ WINED3D_RTYPE_TEXTURE_1D
Definition: wined3d.h:719
@ WINED3D_RTYPE_NONE
Definition: wined3d.h:717
@ WINED3D_RTYPE_BUFFER
Definition: wined3d.h:718
@ WINED3D_RTYPE_TEXTURE_3D
Definition: wined3d.h:721

Referenced by context_generate_rt_mask_from_resource(), device_resource_released(), resource_init(), texture_resource_unload(), vk_blitter_blit(), vk_image_view_type_from_wined3d(), wined3d_check_device_format(), wined3d_context_gl_set_fbo_key_for_render_target(), wined3d_cs_exec_blt_sub_resource(), wined3d_device_cleanup(), wined3d_device_context_clear_rendertarget_view(), wined3d_device_context_copy_resource(), wined3d_device_context_copy_sub_resource_region(), wined3d_device_context_resolve_sub_resource(), wined3d_render_target_view_gl_cs_init(), wined3d_rendertarget_view_prepare_location(), wined3d_rendertarget_view_validate_location(), wined3d_texture_get_dc(), wined3d_texture_gl_download_data(), wined3d_texture_gl_init(), wined3d_texture_gl_set_compatible_renderbuffer(), wined3d_texture_init(), wined3d_texture_release_dc(), wined3d_texture_update_desc(), wined3d_texture_vk_prepare_texture(), and wined3d_unordered_access_view_vk_clear().

◆ debug_d3dsamplerstate()

const char * debug_d3dsamplerstate ( enum wined3d_sampler_state  state)

Definition at line 5169 of file utils.c.

5170{
5171 switch (state)
5172 {
5173#define D3DSTATE_TO_STR(u) case u: return #u
5187#undef D3DSTATE_TO_STR
5188 default:
5189 FIXME("Unrecognized %u sampler state!\n", state);
5190 return "unrecognized";
5191 }
5192}
@ WINED3D_SAMP_ELEMENT_INDEX
Definition: wined3d.h:566
@ WINED3D_SAMP_MAX_ANISOTROPY
Definition: wined3d.h:564
@ WINED3D_SAMP_MIPMAP_LOD_BIAS
Definition: wined3d.h:562
@ WINED3D_SAMP_MIN_FILTER
Definition: wined3d.h:560
@ WINED3D_SAMP_SRGB_TEXTURE
Definition: wined3d.h:565
@ WINED3D_SAMP_DMAP_OFFSET
Definition: wined3d.h:567
@ WINED3D_SAMP_MIP_FILTER
Definition: wined3d.h:561
@ WINED3D_SAMP_MAG_FILTER
Definition: wined3d.h:559
@ WINED3D_SAMP_BORDER_COLOR
Definition: wined3d.h:558
@ WINED3D_SAMP_ADDRESS_V
Definition: wined3d.h:556
@ WINED3D_SAMP_ADDRESS_U
Definition: wined3d.h:555
@ WINED3D_SAMP_ADDRESS_W
Definition: wined3d.h:557
@ WINED3D_SAMP_MAX_MIP_LEVEL
Definition: wined3d.h:563

Referenced by wined3d_stateblock_set_sampler_state().

◆ debug_d3dshaderinstructionhandler()

const char * debug_d3dshaderinstructionhandler ( enum WINED3D_SHADER_INSTRUCTION_HANDLER  handler_idx)

Definition at line 301 of file shader.c.

302{
303 if (handler_idx >= ARRAY_SIZE(shader_opcode_names))
304 return wine_dbg_sprintf("UNRECOGNIZED(%#x)", handler_idx);
305
306 return shader_opcode_names[handler_idx];
307}
#define ARRAY_SIZE(A)
Definition: main.h:20
static const char *const shader_opcode_names[]
Definition: shader.c:40

Referenced by shader_get_registers_used(), shader_glsl_binop(), shader_glsl_compare(), shader_glsl_handle_instruction(), shader_glsl_map2gl(), shader_glsl_sample(), shader_glsl_unary_op(), shader_record_shader_phase(), and shader_sm1_validate_instruction().

◆ debug_d3dstate()

const char * debug_d3dstate ( uint32_t  state)

Definition at line 5331 of file utils.c.

5332{
5334 return wine_dbg_sprintf("STATE_RENDER(%s)", debug_d3drenderstate(state - STATE_RENDER(0)));
5336 {
5337 unsigned int texture_stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
5338 uint32_t texture_state = state - STATE_TEXTURESTAGE(texture_stage, 0);
5339 return wine_dbg_sprintf("STATE_TEXTURESTAGE(%#x, %s)",
5340 texture_stage, debug_d3dtexturestate(texture_state));
5341 }
5345 return wine_dbg_sprintf("STATE_SHADER(%s)", debug_shader_type(state - STATE_SHADER(0)));
5347 return wine_dbg_sprintf("STATE_CONSTANT_BUFFER(%s)", debug_shader_type(WINED3D_SHADER_TYPE_COMPUTE));
5349 return wine_dbg_sprintf("STATE_CONSTANT_BUFFER(%s)", debug_shader_type(state - STATE_CONSTANT_BUFFER(0)));
5351 return "STATE_COMPUTE_SHADER_RESOURCE_BINDING";
5353 return "STATE_GRAPHICS_SHADER_RESOURCE_BINDING";
5355 return "STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING";
5357 return "STATE_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING";
5359 return "STATE_STREAMSRC";
5361 return "STATE_INDEXBUFFER";
5362 if (STATE_IS_VDECL(state))
5363 return "STATE_VDECL";
5365 return "STATE_VIEWPORT";
5367 return "STATE_SCISSORRECT";
5369 return wine_dbg_sprintf("STATE_CLIPPLANE(%#x)", state - STATE_CLIPPLANE(0));
5371 return "STATE_RASTERIZER";
5373 return "STATE_DEPTH_BOUNDS";
5375 return "STATE_BASEVERTEXINDEX";
5377 return "STATE_FRAMEBUFFER";
5379 return "STATE_STREAM_OUTPUT";
5380 if (STATE_IS_BLEND(state))
5381 return "STATE_BLEND";
5383 return "STATE_BLEND_FACTOR";
5385 return "STATE_SAMPLE_MASK";
5387 return "STATE_DEPTH_STENCIL";
5389 return "STATE_STENCIL_REF";
5390
5391 return wine_dbg_sprintf("UNKNOWN_STATE(%#x)", state);
5392}
const char * debug_d3dtexturestate(enum wined3d_texture_stage_state state)
Definition: utils.c:5214
const char * debug_shader_type(enum wined3d_shader_type type)
Definition: utils.c:5313
const char * debug_d3drenderstate(enum wined3d_render_state state)
Definition: utils.c:5033
@ WINED3D_SHADER_TYPE_COMPUTE
Definition: wined3d.h:848
#define WINED3D_HIGHEST_TEXTURE_STATE
Definition: wined3d.h:614
#define STATE_IS_GRAPHICS_CONSTANT_BUFFER(a)
#define STATE_CLIPPLANE(a)
#define STATE_CONSTANT_BUFFER(a)
#define STATE_IS_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING(a)
#define STATE_IS_STREAM_OUTPUT(a)
#define STATE_IS_VDECL(a)
#define STATE_IS_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING(a)
#define STATE_IS_BLEND_FACTOR(a)
#define STATE_IS_STREAMSRC(a)
#define STATE_IS_BLEND(a)
#define STATE_SHADER(a)
#define STATE_IS_TEXTURESTAGE(a)
#define STATE_IS_CLIPPLANE(a)
#define STATE_IS_VIEWPORT(a)
#define STATE_IS_STENCIL_REF(a)
#define STATE_IS_RENDER(a)
#define STATE_IS_COMPUTE_SHADER_RESOURCE_BINDING(a)
#define STATE_IS_COMPUTE_SHADER(a)
#define STATE_TEXTURESTAGE(stage, num)
#define STATE_IS_DEPTH_STENCIL(a)
#define STATE_IS_COMPUTE_CONSTANT_BUFFER(a)
#define STATE_IS_SCISSORRECT(a)
#define STATE_IS_RASTERIZER(a)
#define STATE_IS_FRAMEBUFFER(a)
#define STATE_IS_GRAPHICS_SHADER_RESOURCE_BINDING(a)
#define STATE_IS_INDEXBUFFER(a)
#define STATE_IS_DEPTH_BOUNDS(a)
#define STATE_RENDER(a)
#define STATE_IS_GRAPHICS_SHADER(a)
#define STATE_IS_SAMPLE_MASK(a)
#define STATE_IS_BASEVERTEXINDEX(a)

Referenced by compile_state_table(), state_cb_warn(), state_nop(), state_undefined(), and validate_state_table().

◆ debug_d3dtexturefiltertype()

const char * debug_d3dtexturefiltertype ( enum wined3d_texture_filter_type  filter_type)

Definition at line 5194 of file utils.c.

5195{
5196 switch (filter_type)
5197 {
5198#define D3DTEXTUREFILTERTYPE_TO_STR(u) case u: return #u
5207#undef D3DTEXTUREFILTERTYPE_TO_STR
5208 default:
5209 FIXME("Unrecognized texture filter type 0x%08x.\n", filter_type);
5210 return "unrecognized";
5211 }
5212}
#define D3DTEXTUREFILTERTYPE_TO_STR(u)
@ WINED3D_TEXF_GAUSSIAN_CUBIC
Definition: wined3d.h:710
@ WINED3D_TEXF_NONE
Definition: wined3d.h:705
@ WINED3D_TEXF_PYRAMIDAL_QUAD
Definition: wined3d.h:711
@ WINED3D_TEXF_FLAT_CUBIC
Definition: wined3d.h:709
@ WINED3D_TEXF_GAUSSIAN_QUAD
Definition: wined3d.h:712
@ WINED3D_TEXF_POINT
Definition: wined3d.h:706
@ WINED3D_TEXF_ANISOTROPIC
Definition: wined3d.h:708
@ WINED3D_TEXF_LINEAR
Definition: wined3d.h:707

Referenced by fbo_blitter_blit(), glsl_blitter_blit(), surface_cpu_blt(), texture2d_blt(), texture2d_blt_fbo(), vk_blitter_blit(), and wined3d_device_context_blt().

◆ debug_d3dtexturestate()

const char * debug_d3dtexturestate ( enum wined3d_texture_stage_state  state)

Definition at line 5214 of file utils.c.

5215{
5216 switch (state)
5217 {
5218#define D3DSTATE_TO_STR(u) case u: return #u
5237#undef D3DSTATE_TO_STR
5238 default:
5239 FIXME("Unrecognized %u texture state!\n", state);
5240 return "unrecognized";
5241 }
5242}
@ WINED3D_TSS_COLOR_ARG2
Definition: wined3d.h:596
@ WINED3D_TSS_BUMPENV_LOFFSET
Definition: wined3d.h:606
@ WINED3D_TSS_ALPHA_OP
Definition: wined3d.h:597
@ WINED3D_TSS_BUMPENV_MAT11
Definition: wined3d.h:603
@ WINED3D_TSS_COLOR_OP
Definition: wined3d.h:594
@ WINED3D_TSS_BUMPENV_MAT10
Definition: wined3d.h:602
@ WINED3D_TSS_TEXCOORD_INDEX
Definition: wined3d.h:604
@ WINED3D_TSS_ALPHA_ARG2
Definition: wined3d.h:599
@ WINED3D_TSS_CONSTANT
Definition: wined3d.h:611
@ WINED3D_TSS_BUMPENV_MAT01
Definition: wined3d.h:601
@ WINED3D_TSS_ALPHA_ARG0
Definition: wined3d.h:609
@ WINED3D_TSS_BUMPENV_LSCALE
Definition: wined3d.h:605
@ WINED3D_TSS_COLOR_ARG0
Definition: wined3d.h:608
@ WINED3D_TSS_COLOR_ARG1
Definition: wined3d.h:595
@ WINED3D_TSS_ALPHA_ARG1
Definition: wined3d.h:598
@ WINED3D_TSS_RESULT_ARG
Definition: wined3d.h:610
@ WINED3D_TSS_BUMPENV_MAT00
Definition: wined3d.h:600
@ WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
Definition: wined3d.h:607

Referenced by debug_d3dstate(), wined3d_device_set_texture_stage_state(), and wined3d_stateblock_set_texture_stage_state().

◆ debug_d3dtop()

const char * debug_d3dtop ( enum wined3d_texture_op  d3dtop)

Definition at line 5244 of file utils.c.

5245{
5246 switch (d3dtop)
5247 {
5248#define D3DTOP_TO_STR(u) case u: return #u
5275#undef D3DTOP_TO_STR
5276 default:
5277 FIXME("Unrecognized texture op %#x.\n", d3dtop);
5278 return "unrecognized";
5279 }
5280}
#define D3DTOP_TO_STR(u)
@ WINED3D_TOP_SELECT_ARG1
Definition: wined3d.h:629
@ WINED3D_TOP_DISABLE
Definition: wined3d.h:628
@ WINED3D_TOP_BLEND_DIFFUSE_ALPHA
Definition: wined3d.h:639
@ WINED3D_TOP_ADD
Definition: wined3d.h:634
@ WINED3D_TOP_BLEND_TEXTURE_ALPHA_PM
Definition: wined3d.h:642
@ WINED3D_TOP_BLEND_CURRENT_ALPHA
Definition: wined3d.h:643
@ WINED3D_TOP_ADD_SIGNED_2X
Definition: wined3d.h:636
@ WINED3D_TOP_MODULATE_INVCOLOR_ADD_ALPHA
Definition: wined3d.h:648
@ WINED3D_TOP_MULTIPLY_ADD
Definition: wined3d.h:652
@ WINED3D_TOP_MODULATE_INVALPHA_ADD_COLOR
Definition: wined3d.h:647
@ WINED3D_TOP_SUBTRACT
Definition: wined3d.h:637
@ WINED3D_TOP_BUMPENVMAP_LUMINANCE
Definition: wined3d.h:650
@ WINED3D_TOP_MODULATE_COLOR_ADD_ALPHA
Definition: wined3d.h:646
@ WINED3D_TOP_MODULATE
Definition: wined3d.h:631
@ WINED3D_TOP_BUMPENVMAP
Definition: wined3d.h:649
@ WINED3D_TOP_MODULATE_4X
Definition: wined3d.h:633
@ WINED3D_TOP_SELECT_ARG2
Definition: wined3d.h:630
@ WINED3D_TOP_LERP
Definition: wined3d.h:653
@ WINED3D_TOP_MODULATE_ALPHA_ADD_COLOR
Definition: wined3d.h:645
@ WINED3D_TOP_BLEND_TEXTURE_ALPHA
Definition: wined3d.h:640
@ WINED3D_TOP_ADD_SIGNED
Definition: wined3d.h:635
@ WINED3D_TOP_DOTPRODUCT3
Definition: wined3d.h:651
@ WINED3D_TOP_PREMODULATE
Definition: wined3d.h:644
@ WINED3D_TOP_ADD_SMOOTH
Definition: wined3d.h:638
@ WINED3D_TOP_MODULATE_2X
Definition: wined3d.h:632
@ WINED3D_TOP_BLEND_FACTOR_ALPHA
Definition: wined3d.h:641

◆ debug_d3dtstype()

const char * debug_d3dtstype ( enum wined3d_transform_state  tstype)

Definition at line 5282 of file utils.c.

5283{
5284 switch (tstype)
5285 {
5286#define TSTYPE_TO_STR(tstype) case tstype: return #tstype
5301#undef TSTYPE_TO_STR
5302 default:
5303 if (tstype > 256 && tstype < 512)
5304 {
5305 FIXME("WINED3D_TS_WORLD_MATRIX(%u). 1..255 not currently supported.\n", tstype);
5306 return ("WINED3D_TS_WORLD_MATRIX > 0");
5307 }
5308 FIXME("Unrecognized transform state %#x.\n", tstype);
5309 return "unrecognized";
5310 }
5311}
#define TSTYPE_TO_STR(tstype)
#define WINED3D_TS_WORLD_MATRIX(index)
Definition: wined3d.h:683
@ WINED3D_TS_TEXTURE1
Definition: wined3d.h:670
@ WINED3D_TS_TEXTURE0
Definition: wined3d.h:669
@ WINED3D_TS_TEXTURE2
Definition: wined3d.h:671
@ WINED3D_TS_PROJECTION
Definition: wined3d.h:668
@ WINED3D_TS_VIEW
Definition: wined3d.h:667
@ WINED3D_TS_TEXTURE7
Definition: wined3d.h:676
@ WINED3D_TS_TEXTURE6
Definition: wined3d.h:675
@ WINED3D_TS_TEXTURE4
Definition: wined3d.h:673
@ WINED3D_TS_TEXTURE3
Definition: wined3d.h:672
@ WINED3D_TS_TEXTURE5
Definition: wined3d.h:674

Referenced by wined3d_device_set_transform(), wined3d_stateblock_multiply_transform(), and wined3d_stateblock_set_transform().

◆ debug_d3dusage()

const char * debug_d3dusage ( uint32_t  usage)

Definition at line 4895 of file utils.c.

4896{
4897 struct debug_buffer buffer;
4898
4900#define WINED3DUSAGE_TO_STR(x) if (usage & x) { debug_append(&buffer, #x, " | "); usage &= ~x; }
4926#undef WINED3DUSAGE_TO_STR
4927 if (usage)
4928 FIXME("Unrecognized usage flag(s) %#x.\n", usage);
4929
4930 return wine_dbg_sprintf("%s", buffer.str);
4931}
static void init_debug_buffer(struct debug_buffer *buffer, const char *default_string)
Definition: utils.c:4803
#define WINED3DUSAGE_TO_STR(x)
#define WINED3DUSAGE_QUERY_LEGACYBUMPMAP
Definition: wined3d.h:942
#define WINED3DUSAGE_POINTS
Definition: wined3d.h:921
#define WINED3DUSAGE_DONOTCLIP
Definition: wined3d.h:920
#define WINED3DUSAGE_DMAP
Definition: wined3d.h:928
#define WINED3DUSAGE_OWNDC
Definition: wined3d.h:935
#define WINED3DUSAGE_LEGACY_CUBEMAP
Definition: wined3d.h:934
#define WINED3DUSAGE_RESTRICTED_CONTENT
Definition: wined3d.h:925
#define WINED3DUSAGE_QUERY_SRGBREAD
Definition: wined3d.h:945
#define WINED3DUSAGE_QUERY_FILTER
Definition: wined3d.h:943
#define WINED3DUSAGE_OVERLAY
Definition: wined3d.h:937
#define WINED3DUSAGE_VIDMEM_ACCOUNTING
Definition: wined3d.h:939
#define WINED3DUSAGE_QUERY_WRAPANDMIP
Definition: wined3d.h:948
#define WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING
Definition: wined3d.h:944
#define WINED3DUSAGE_NPATCHES
Definition: wined3d.h:923
#define WINED3DUSAGE_TEXTAPI
Definition: wined3d.h:929
#define WINED3DUSAGE_MANAGED
Definition: wined3d.h:938
#define WINED3DUSAGE_QUERY_VERTEXTEXTURE
Definition: wined3d.h:947
#define WINED3DUSAGE_QUERY_GENMIPMAP
Definition: wined3d.h:941
#define WINED3DUSAGE_RTPATCHES
Definition: wined3d.h:922
#define WINED3DUSAGE_DYNAMIC
Definition: wined3d.h:924
#define WINED3DUSAGE_QUERY_SRGBWRITE
Definition: wined3d.h:946
#define WINED3DUSAGE_RESTRICT_SHARED_RESOURCE_DRIVER
Definition: wined3d.h:926
#define WINED3DUSAGE_STATICDECL
Definition: wined3d.h:936
#define WINED3DUSAGE_SOFTWAREPROCESSING
Definition: wined3d.h:919
#define WINED3DUSAGE_RESTRICT_SHARED_RESOURCE
Definition: wined3d.h:927

Referenced by resource_init(), texture2d_blt(), wined3d_buffer_gl_create_buffer_object(), wined3d_buffer_init(), wined3d_check_device_format(), and wined3d_texture_init().

◆ debug_ivec4()

const char * debug_ivec4 ( const struct wined3d_ivec4 *  v)

Definition at line 4569 of file utils.c.

4570{
4571 if (!v)
4572 return "(null)";
4573 return wine_dbg_sprintf("{%d, %d, %d, %d}",
4574 v->x, v->y, v->z, v->w);
4575}
const GLdouble * v
Definition: gl.h:2040

Referenced by wined3d_device_set_ps_consts_i(), and wined3d_device_set_vs_consts_i().

◆ debug_shader_type()

const char * debug_shader_type ( enum wined3d_shader_type  shader_type)

Definition at line 5313 of file utils.c.

5314{
5315 switch(type)
5316 {
5317#define WINED3D_TO_STR(type) case type: return #type
5324#undef WINED3D_TO_STR
5325 default:
5326 FIXME("Unrecognized shader type %#x.\n", type);
5327 return "unrecognized";
5328 }
5329}
@ WINED3D_SHADER_TYPE_HULL
Definition: wined3d.h:844
@ WINED3D_SHADER_TYPE_PIXEL
Definition: wined3d.h:841
@ WINED3D_SHADER_TYPE_GEOMETRY
Definition: wined3d.h:843
@ WINED3D_SHADER_TYPE_DOMAIN
Definition: wined3d.h:845
@ WINED3D_SHADER_TYPE_VERTEX
Definition: wined3d.h:842

Referenced by debug_d3dstate(), geometry_shader_init_stream_output(), shader_record_shader_phase(), shader_set_function(), vk_shader_stage_from_wined3d(), and vkd3d_shader_visibility_from_wined3d().

◆ debug_uvec4()

const char * debug_uvec4 ( const struct wined3d_uvec4 *  v)

Definition at line 4577 of file utils.c.

4578{
4579 if (!v)
4580 return "(null)";
4581 return wine_dbg_sprintf("{%u, %u, %u, %u}",
4582 v->x, v->y, v->z, v->w);
4583}

Referenced by adapter_gl_clear_uav(), adapter_no3d_clear_uav(), adapter_vk_clear_uav(), and wined3d_device_context_clear_uav_uint().

◆ debug_vec4()

const char * debug_vec4 ( const struct wined3d_vec4 *  v)

Definition at line 4585 of file utils.c.

4586{
4587 if (!v)
4588 return "(null)";
4589 return wine_dbg_sprintf("{%.8e, %.8e, %.8e, %.8e}",
4590 v->x, v->y, v->z, v->w);
4591}

Referenced by wined3d_device_context_clear_uav_float(), wined3d_device_set_ps_consts_f(), and wined3d_device_set_vs_consts_f().

◆ device_context_add()

BOOL device_context_add ( struct wined3d_device *  device,
struct wined3d_context *  context 
)

Definition at line 84 of file device.c.

85{
86 struct wined3d_context **new_array;
87
88 TRACE("Adding context %p.\n", context);
89
90 if (!device->shader_backend->shader_allocate_context_data(context))
91 {
92 ERR("Failed to allocate shader backend context data.\n");
93 return FALSE;
94 }
95 device->shader_backend->shader_init_context_state(context);
96
97 if (!device->adapter->fragment_pipe->allocate_context_data(context))
98 {
99 ERR("Failed to allocate fragment pipeline context data.\n");
100 device->shader_backend->shader_free_context_data(context);
101 return FALSE;
102 }
103
104 if (!(new_array = realloc(device->contexts, sizeof(*new_array) * (device->context_count + 1))))
105 {
106 ERR("Failed to grow the context array.\n");
107 device->adapter->fragment_pipe->free_context_data(context);
108 device->shader_backend->shader_free_context_data(context);
109 return FALSE;
110 }
111
112 new_array[device->context_count++] = context;
113 device->contexts = new_array;
114
115 return TRUE;
116}
#define FALSE
Definition: types.h:117

Referenced by adapter_no3d_init_3d(), adapter_vk_init_3d(), and wined3d_swapchain_gl_create_context().

◆ device_context_remove()

void device_context_remove ( struct wined3d_device *  device,
struct wined3d_context *  context 
)

Definition at line 118 of file device.c.

119{
120 struct wined3d_context **new_array;
121 BOOL found = FALSE;
122 UINT i;
123
124 TRACE("Removing context %p.\n", context);
125
126 device->adapter->fragment_pipe->free_context_data(context);
127 device->shader_backend->shader_free_context_data(context);
128
129 for (i = 0; i < device->context_count; ++i)
130 {
131 if (device->contexts[i] == context)
132 {
133 found = TRUE;
134 break;
135 }
136 }
137
138 if (!found)
139 {
140 ERR("Context %p doesn't exist in context array.\n", context);
141 return;
142 }
143
144 if (!--device->context_count)
145 {
146 free(device->contexts);
147 device->contexts = NULL;
148 return;
149 }
150
151 memmove(&device->contexts[i], &device->contexts[i + 1], (device->context_count - i) * sizeof(*device->contexts));
152 if (!(new_array = realloc(device->contexts, device->context_count * sizeof(*device->contexts))))
153 {
154 ERR("Failed to shrink context array. Oh well.\n");
155 return;
156 }
157
158 device->contexts = new_array;
159}
unsigned int UINT
Definition: sysinfo.c:13
#define memmove(s1, s2, n)
Definition: mkisofs.h:881

Referenced by adapter_no3d_init_3d(), adapter_no3d_uninit_3d(), adapter_vk_init_3d(), adapter_vk_uninit_3d(), and wined3d_context_gl_destroy().

◆ device_invalidate_state()

void device_invalidate_state ( const struct wined3d_device *  device,
unsigned int  state 
)

Definition at line 5565 of file device.c.

5566{
5567 unsigned int representative, i, idx, shift;
5568 struct wined3d_context *context;
5569
5571
5572 if (STATE_IS_COMPUTE(state_id))
5573 {
5574 for (i = 0; i < device->context_count; ++i)
5575 context_invalidate_compute_state(device->contexts[i], state_id);
5576 return;
5577 }
5578
5579 representative = device->state_table[state_id].representative;
5580 idx = representative / (sizeof(*context->dirty_graphics_states) * CHAR_BIT);
5581 shift = representative & ((sizeof(*context->dirty_graphics_states) * CHAR_BIT) - 1);
5582 for (i = 0; i < device->context_count; ++i)
5583 {
5584 device->contexts[i]->dirty_graphics_states[idx] |= (1u << shift);
5585 }
5586}
void context_invalidate_compute_state(struct wined3d_context *context, DWORD state_id)
Definition: context.c:66
#define STATE_IS_COMPUTE(a)

Referenced by context_apply_draw_state(), context_gl_load_shader_resources(), context_gl_load_stream_output_buffers(), texture_resource_unload(), wined3d_cs_exec_draw(), wined3d_cs_exec_reset_state(), wined3d_cs_exec_set_blend_state(), wined3d_cs_exec_set_clip_plane(), wined3d_cs_exec_set_color_key(), wined3d_cs_exec_set_constant_buffers(), wined3d_cs_exec_set_depth_bounds(), wined3d_cs_exec_set_depth_stencil_state(), wined3d_cs_exec_set_depth_stencil_view(), wined3d_cs_exec_set_index_buffer(), wined3d_cs_exec_set_rasterizer_state(), wined3d_cs_exec_set_render_state(), wined3d_cs_exec_set_rendertarget_views(), wined3d_cs_exec_set_samplers(), wined3d_cs_exec_set_scissor_rects(), wined3d_cs_exec_set_shader(), wined3d_cs_exec_set_shader_resource_views(), wined3d_cs_exec_set_stream_outputs(), wined3d_cs_exec_set_stream_sources(), wined3d_cs_exec_set_texture(), wined3d_cs_exec_set_texture_state(), wined3d_cs_exec_set_transform(), wined3d_cs_exec_set_unordered_access_views(), wined3d_cs_exec_set_vertex_declaration(), wined3d_cs_exec_set_viewports(), wined3d_swapchain_gl_rotate(), and wined3d_swapchain_vk_rotate().

◆ device_process_message()

LRESULT device_process_message ( struct wined3d_device *  device,
HWND  window,
BOOL  unicode,
UINT  message,
WPARAM  wparam,
LPARAM  lparam,
WNDPROC  proc 
)

Definition at line 5588 of file device.c.

5590{
5591 if (message == WM_DESTROY)
5592 {
5593 TRACE("unregister window %p.\n", window);
5595
5596 if (InterlockedCompareExchangePointer((void **)&device->focus_window, NULL, window) != window)
5597 ERR("Window %p is not the focus window for device %p.\n", window, device);
5598 }
5599 else if (message == WM_DISPLAYCHANGE)
5600 {
5601 device->device_parent->ops->mode_changed(device->device_parent);
5602 }
5603 else if (message == WM_ACTIVATEAPP)
5604 {
5605 unsigned int i = device->swapchain_count;
5606
5607 /* Deactivating the implicit swapchain may cause the application
5608 * (e.g. Deus Ex: GOTY) to destroy the device, so take care to
5609 * deactivate the implicit swapchain last, and to avoid accessing the
5610 * "device" pointer afterwards. */
5611 while (i--)
5613 }
5614 else if (message == WM_SYSCOMMAND)
5615 {
5616 if (wparam == SC_RESTORE && device->wined3d->flags & WINED3D_HANDLE_RESTORE)
5617 {
5618 if (unicode)
5620 else
5622 }
5623 }
5624
5625 if (unicode)
5627 else
5629}
@ lparam
Definition: SystemMenu.c:31
@ wparam
Definition: SystemMenu.c:30
#define InterlockedCompareExchangePointer
Definition: interlocked.h:144
static IHTMLWindow2 * window
Definition: events.c:77
static HANDLE proc()
Definition: pdb.c:32
#define WM_SYSCOMMAND
Definition: winuser.h:1769
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI DefWindowProcA(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_ACTIVATEAPP
Definition: winuser.h:1660
#define WM_DESTROY
Definition: winuser.h:1637
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SC_RESTORE
Definition: winuser.h:2634
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
Definition: tftpd.h:60
void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activate)
Definition: swapchain.c:1826
#define WINED3D_HANDLE_RESTORE
Definition: wined3d.h:1327
void wined3d_unregister_window(HWND window)
Definition: wined3d_main.c:790

Referenced by wined3d_wndproc().

◆ device_resource_add()

void device_resource_add ( struct wined3d_device *  device,
struct wined3d_resource *  resource 
)

Definition at line 5340 of file device.c.

5341{
5342 TRACE("device %p, resource %p.\n", device, resource);
5343
5345
5346 list_add_head(&device->resources, &resource->resource_list_entry);
5347}
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
static void wined3d_not_from_cs(const struct wined3d_cs *cs)

Referenced by resource_init().

◆ device_resource_released()

void device_resource_released ( struct wined3d_device *  device,
struct wined3d_resource *  resource 
)

Definition at line 5358 of file device.c.

5359{
5360 enum wined3d_resource_type type = resource->type;
5361 struct wined3d_state *state = device->cs->c.state;
5362 struct wined3d_rendertarget_view *rtv;
5363 unsigned int i;
5364
5365 TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type));
5366
5367 for (i = 0; i < ARRAY_SIZE(state->fb.render_targets); ++i)
5368 {
5369 if ((rtv = state->fb.render_targets[i]) && rtv->resource == resource)
5370 ERR("Resource %p is still in use as render target %u.\n", resource, i);
5371 }
5372
5373 if ((rtv = state->fb.depth_stencil) && rtv->resource == resource)
5374 ERR("Resource %p is still in use as depth/stencil buffer.\n", resource);
5375
5376 switch (type)
5377 {
5379 for (i = 0; i < WINED3D_MAX_STREAMS; ++i)
5380 {
5381 if (&state->streams[i].buffer->resource == resource)
5382 {
5383 ERR("Buffer resource %p is still in use, stream %u.\n", resource, i);
5384 state->streams[i].buffer = NULL;
5385 }
5386 }
5387
5388 if (&state->index_buffer->resource == resource)
5389 {
5390 ERR("Buffer resource %p is still in use as index buffer.\n", resource);
5391 state->index_buffer = NULL;
5392 }
5393 break;
5394
5395 default:
5396 break;
5397 }
5398
5399 /* Remove the resource from the resourceStore */
5401
5402 TRACE("Resource released.\n");
5403}
static void device_resource_remove(struct wined3d_device *device, struct wined3d_resource *resource)
Definition: device.c:5349
const char * debug_d3dresourcetype(enum wined3d_resource_type resource_type)
Definition: utils.c:4992
#define resource
Definition: kernel32.h:9
struct wined3d_resource * resource
wined3d_resource_type
Definition: wined3d.h:716
#define WINED3D_MAX_STREAMS
Definition: wined3d.h:1596

Referenced by resource_cleanup().

◆ dispatch_compute()

void dispatch_compute ( struct wined3d_device *  device,
const struct wined3d_state *  state,
const struct wined3d_dispatch_parameters *  dispatch_parameters 
)

Definition at line 4402 of file context_gl.c.

4404{
4405 const struct wined3d_gl_info *gl_info;
4406 struct wined3d_context_gl *context_gl;
4407
4408 context_gl = wined3d_context_gl(context_acquire(device, NULL, 0));
4409 if (!context_gl->valid)
4410 {
4411 context_release(&context_gl->c);
4412 WARN("Invalid context, skipping dispatch.\n");
4413 return;
4414 }
4415 gl_info = context_gl->gl_info;
4416
4417 if (!gl_info->supported[ARB_COMPUTE_SHADER])
4418 {
4419 context_release(&context_gl->c);
4420 FIXME("OpenGL implementation does not support compute shaders.\n");
4421 return;
4422 }
4423
4424 if (parameters->indirect)
4425 wined3d_buffer_load(parameters->u.indirect.buffer, &context_gl->c, state);
4426
4428
4429 if (parameters->indirect)
4430 {
4431 const struct wined3d_indirect_dispatch_parameters *indirect = &parameters->u.indirect;
4432 struct wined3d_bo_gl *bo_gl = wined3d_bo_gl(indirect->buffer->buffer_object);
4433
4434 GL_EXTCALL(glBindBuffer(GL_DISPATCH_INDIRECT_BUFFER, bo_gl->id));
4435 GL_EXTCALL(glDispatchComputeIndirect(bo_gl->b.buffer_offset + (GLintptr)indirect->offset));
4436 GL_EXTCALL(glBindBuffer(GL_DISPATCH_INDIRECT_BUFFER, 0));
4437 wined3d_context_gl_reference_bo(context_gl, bo_gl);
4438 }
4439 else
4440 {
4441 const struct wined3d_direct_dispatch_parameters *direct = &parameters->u.direct;
4442 GL_EXTCALL(glDispatchCompute(direct->group_count_x, direct->group_count_y, direct->group_count_z));
4443 }
4444 checkGLcall("dispatch compute");
4445
4446 GL_EXTCALL(glMemoryBarrier(GL_ALL_BARRIER_BITS));
4447 checkGLcall("glMemoryBarrier");
4448
4449 context_release(&context_gl->c);
4450}
#define WARN(fmt,...)
Definition: precomp.h:61
static void wined3d_context_gl_apply_compute_state(struct wined3d_context_gl *context_gl, const struct wined3d_device *device, const struct wined3d_state *state)
Definition: context_gl.c:4170
ptrdiff_t GLintptr
Definition: glext.h:5498
#define GL_ALL_BARRIER_BITS
Definition: glext.h:2341
static BYTE parameters[]
Definition: asn.c:558
struct wined3d_bo b
Definition: wined3d_gl.h:415
struct wined3d_context c
Definition: wined3d_gl.h:601
#define GL_DISPATCH_INDIRECT_BUFFER
Definition: wgl.h:1033
@ ARB_COMPUTE_SHADER
Definition: wined3d_gl.h:60
static void wined3d_context_gl_reference_bo(struct wined3d_context_gl *context_gl, struct wined3d_bo_gl *bo_gl)
Definition: wined3d_gl.h:912
#define GL_EXTCALL(f)
Definition: wined3d_gl.h:360
#define checkGLcall(A)
Definition: wined3d_gl.h:402

◆ draw_primitive()

void draw_primitive ( struct wined3d_device *  device,
const struct wined3d_state *  state,
const struct wined3d_draw_parameters *  draw_parameters 
)

Definition at line 4648 of file context_gl.c.

4650{
4651 const struct wined3d_fb_state *fb = &state->fb;
4652 const struct wined3d_stream_info *stream_info;
4653 struct wined3d_rendertarget_view *dsv, *rtv;
4654 const struct wined3d_gl_info *gl_info;
4655 struct wined3d_context_gl *context_gl;
4656 struct wined3d_context *context;
4657 bool rasterizer_discard = false;
4658 unsigned int i, idx_size = 0;
4659 const void *idx_data = NULL;
4660
4661 TRACE("device %p, state %p, parameters %p.\n", device, state, parameters);
4662
4663 if (!parameters->indirect && !parameters->u.direct.index_count)
4664 return;
4665
4666 if (!parameters->indirect)
4667 TRACE("base_vertex_idx %d, start_idx %u, index_count %u, start_instance %u, instance_count %u.\n",
4668 parameters->u.direct.base_vertex_idx, parameters->u.direct.start_idx,
4669 parameters->u.direct.index_count, parameters->u.direct.start_instance,
4670 parameters->u.direct.instance_count);
4671
4672 if (!(rtv = fb->render_targets[0]))
4673 rtv = fb->depth_stencil;
4674
4675 if (rtv && rtv->resource->type == WINED3D_RTYPE_BUFFER)
4676 {
4677 FIXME("Buffer render targets not implemented.\n");
4678 return;
4679 }
4680
4681 if (rtv)
4683 else
4685 context_gl = wined3d_context_gl(context);
4686 if (!context_gl->valid)
4687 {
4689 WARN("Invalid context, skipping draw.\n");
4690 return;
4691 }
4692 gl_info = context_gl->gl_info;
4693
4696
4697 for (i = 0; i < gl_info->limits.buffers; ++i)
4698 {
4699 if (!(rtv = fb->render_targets[i]) || rtv->format->id == WINED3DFMT_NULL)
4700 continue;
4701
4702 if (wined3d_blend_state_get_writemask(state->blend_state, i))
4703 {
4706 }
4707 else
4708 {
4710 }
4711 }
4712
4713 if ((dsv = fb->depth_stencil))
4714 {
4715 /* We don't currently take the Z-compare function into account,
4716 * but we could skip loading the depthstencil for D3DCMP_NEVER and
4717 * D3DCMP_ALWAYS as well.
4718 * Also note that we never copy the stencil data. */
4719 uint32_t location = dsv->resource->draw_binding;
4720
4723 else
4725 }
4726
4727 if (parameters->indirect)
4728 wined3d_buffer_load(parameters->u.indirect.buffer, context, state);
4729
4731 {
4733 WARN("Unable to apply draw state, skipping draw.\n");
4734 return;
4735 }
4736
4737 if (dsv && (!state->depth_stencil_state || state->depth_stencil_state->writes_ds))
4738 {
4739 uint32_t location = dsv->resource->draw_binding;
4740
4743 }
4744
4745 stream_info = &context->stream_info;
4746
4747 if (parameters->indexed)
4748 {
4749 struct wined3d_buffer *index_buffer = state->index_buffer;
4750 struct wined3d_bo *bo = index_buffer->buffer_object;
4751
4752 if (!bo || !stream_info->all_vbo)
4753 idx_data = index_buffer->resource.heap_memory;
4754 else
4755 idx_data = (void *)bo->buffer_offset;
4756 idx_data = (const BYTE *)idx_data + state->index_offset;
4757
4758 if (state->index_format == WINED3DFMT_R16_UINT)
4759 idx_size = 2;
4760 else
4761 idx_size = 4;
4762 }
4763
4765 {
4767
4769 {
4771 checkGLcall("enable rasterizer discard");
4772 rasterizer_discard = true;
4773 }
4774
4775 if (context->transform_feedback_paused)
4776 {
4777 GL_EXTCALL(glResumeTransformFeedback());
4778 checkGLcall("glResumeTransformFeedback");
4779 context->transform_feedback_paused = 0;
4780 }
4781 else if (!context->transform_feedback_active)
4782 {
4783 enum wined3d_primitive_type primitive_type = shader->u.gs.output_type
4784 ? shader->u.gs.output_type : state->primitive_type;
4785 GLenum mode = gl_tfb_primitive_type_from_d3d(primitive_type);
4786 GL_EXTCALL(glBeginTransformFeedback(mode));
4787 checkGLcall("glBeginTransformFeedback");
4788 context->transform_feedback_active = 1;
4789 }
4790 }
4791
4792 if (state->primitive_type == WINED3D_PT_PATCH)
4793 {
4794 GL_EXTCALL(glPatchParameteri(GL_PATCH_VERTICES, state->patch_vertex_count));
4795 checkGLcall("glPatchParameteri");
4796 }
4797
4798 if (context->uses_fbo_attached_resources)
4799 {
4800 static unsigned int fixme_once;
4801
4802 if (gl_info->supported[ARB_TEXTURE_BARRIER])
4803 {
4804 GL_EXTCALL(glTextureBarrier());
4805 }
4806 else if (gl_info->supported[NV_TEXTURE_BARRIER])
4807 {
4808 GL_EXTCALL(glTextureBarrierNV());
4809 }
4810 else
4811 {
4812 if (!fixme_once++)
4813 FIXME("Sampling attached render targets is not supported.\n");
4814
4815 WARN("Sampling attached render targets is not supported, skipping draw.\n");
4817 return;
4818 }
4819 checkGLcall("glTextureBarrier");
4820 }
4821
4822 if (parameters->indirect)
4823 {
4824 wined3d_context_gl_draw_indirect(context_gl, state, &parameters->u.indirect, idx_size);
4825 }
4826 else
4827 {
4828 wined3d_context_gl_draw_primitive_arrays(context_gl, state, idx_data, idx_size,
4829 parameters->u.direct.base_vertex_idx, parameters->u.direct.start_idx,
4830 parameters->u.direct.index_count, parameters->u.direct.start_instance,
4831 parameters->u.direct.instance_count);
4832 }
4833
4834 if (context->uses_uavs)
4835 {
4836 GL_EXTCALL(glMemoryBarrier(GL_ALL_BARRIER_BITS));
4837 checkGLcall("glMemoryBarrier");
4838 }
4839
4840 if (rasterizer_discard)
4841 {
4843 checkGLcall("disable rasterizer discard");
4844 }
4845
4847
4848 TRACE("Draw completed.\n");
4849}
static void wined3d_context_gl_draw_primitive_arrays(struct wined3d_context_gl *context_gl, const struct wined3d_state *state, const void *idx_data, unsigned int idx_size, int base_vertex_idx, unsigned int start_idx, unsigned int count, unsigned int start_instance, unsigned int instance_count)
Definition: context_gl.c:4453
static void wined3d_context_gl_draw_indirect(struct wined3d_context_gl *context_gl, const struct wined3d_state *state, const struct wined3d_indirect_draw_parameters *parameters, unsigned int idx_size)
Definition: context_gl.c:4586
static GLenum gl_tfb_primitive_type_from_d3d(enum wined3d_primitive_type primitive_type)
Definition: context_gl.c:4621
static void wined3d_context_gl_pause_transform_feedback(struct wined3d_context_gl *context_gl, BOOL force)
Definition: context_gl.c:4241
static BOOL context_apply_draw_state(struct wined3d_context *context, const struct wined3d_device *device, const struct wined3d_state *state, BOOL indexed)
Definition: context_gl.c:4039
struct wined3d_texture *__cdecl wined3d_texture_from_resource(struct wined3d_resource *resource)
Definition: texture.c:3343
void wined3d_rendertarget_view_prepare_location(struct wined3d_rendertarget_view *view, struct wined3d_context *context, uint32_t location)
Definition: view.c:469
void wined3d_rendertarget_view_load_location(struct wined3d_rendertarget_view *view, struct wined3d_context *context, uint32_t location)
Definition: view.c:489
void wined3d_rendertarget_view_validate_location(struct wined3d_rendertarget_view *view, uint32_t location)
Definition: view.c:495
void wined3d_rendertarget_view_invalidate_location(struct wined3d_rendertarget_view *view, uint32_t location)
Definition: view.c:514
GLAPI void GLAPIENTRY glEnable(GLenum cap)
unsigned int GLenum
Definition: gl.h:150
GLAPI void GLAPIENTRY glDisable(GLenum cap)
#define GL_RASTERIZER_DISCARD
Definition: glext.h:552
GLuint shader
Definition: glext.h:6030
GLenum mode
Definition: glext.h:6217
#define GL_PATCH_VERTICES
Definition: glext.h:2091
size_t buffer_offset
struct wined3d_bo * buffer_object
struct wined3d_resource resource
BOOL supported[WINED3D_GL_EXT_COUNT]
Definition: wined3d_gl.h:347
struct wined3d_gl_limits limits
Definition: wined3d_gl.h:344
const struct wined3d_format * format
wined3d_primitive_type
Definition: wined3d.h:74
@ ARB_TEXTURE_BARRIER
Definition: wined3d_gl.h:159
@ NV_TEXTURE_BARRIER
Definition: wined3d_gl.h:224
static BOOL use_transform_feedback(const struct wined3d_state *state)
static bool wined3d_state_uses_depth_buffer(const struct wined3d_state *state)
static BOOL is_rasterization_disabled(const struct wined3d_shader *geometry_shader)
static unsigned int wined3d_blend_state_get_writemask(const struct wined3d_blend_state *state, unsigned int index)
unsigned char BYTE
Definition: xxhash.c:193

◆ dump_color_fixup_desc()

void dump_color_fixup_desc ( struct color_fixup_desc  fixup)

Definition at line 5540 of file utils.c.

5541{
5542 if (is_complex_fixup(fixup))
5543 {
5544 TRACE("\tComplex: %s\n", debug_complex_fixup(get_complex_fixup(fixup)));
5545 return;
5546 }
5547
5548 TRACE("\tX: %s%s\n", debug_fixup_channel_source(fixup.x_source), fixup.x_sign_fixup ? ", SIGN_FIXUP" : "");
5549 TRACE("\tY: %s%s\n", debug_fixup_channel_source(fixup.y_source), fixup.y_sign_fixup ? ", SIGN_FIXUP" : "");
5550 TRACE("\tZ: %s%s\n", debug_fixup_channel_source(fixup.z_source), fixup.z_sign_fixup ? ", SIGN_FIXUP" : "");
5551 TRACE("\tW: %s%s\n", debug_fixup_channel_source(fixup.w_source), fixup.w_sign_fixup ? ", SIGN_FIXUP" : "");
5552}
static const char * debug_fixup_channel_source(enum fixup_channel_source source)
Definition: utils.c:5502
static const char * debug_complex_fixup(enum complex_fixup fixup)
Definition: utils.c:5522
unsigned short x_source
unsigned short y_sign_fixup
unsigned short w_source
unsigned short x_sign_fixup
unsigned short z_sign_fixup
unsigned short y_source
unsigned short w_sign_fixup
unsigned short z_source
static enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup)

Referenced by apply_format_fixups().

◆ ffp_hlsl_compile_ps()

bool ffp_hlsl_compile_ps ( const struct ffp_frag_settings *  settings,
struct wined3d_shader_desc *  shader_desc 
)

Definition at line 971 of file ffp_hlsl.c.

972{
974 struct vkd3d_shader_code sm1;
975
976 if (!string_buffer_init(&string))
977 return false;
978
980 {
981 string_buffer_free(&string);
982 return false;
983 }
984
985 if (!compile_hlsl_shader(&string, &sm1, "ps_2_a"))
986 {
987 string_buffer_free(&string);
988 return false;
989 }
990 string_buffer_free(&string);
991
992 shader_desc->byte_code = sm1.code;
993 shader_desc->byte_code_size = ~(size_t)0;
994 return true;
995}
struct mke2fs_defaults settings[]
void string_buffer_free(struct wined3d_string_buffer *buffer)
Definition: shader.c:430
BOOL string_buffer_init(struct wined3d_string_buffer *buffer)
Definition: shader.c:417
unsigned int size_t
Definition: corecrt.h:203
static bool compile_hlsl_shader(const struct wined3d_string_buffer *hlsl, struct vkd3d_shader_code *sm1, const char *profile)
Definition: ffp_hlsl.c:904
static bool ffp_hlsl_generate_pixel_shader(const struct ffp_frag_settings *settings, struct wined3d_string_buffer *buffer)
Definition: ffp_hlsl.c:616
const DWORD * byte_code
Definition: wined3d.h:2105
size_t byte_code_size
Definition: wined3d.h:2106

Referenced by wined3d_shader_init_object().

◆ ffp_hlsl_compile_vs()

bool ffp_hlsl_compile_vs ( const struct wined3d_ffp_vs_settings *  settings,
struct wined3d_shader_desc *  shader_desc,
struct wined3d_device *  device 
)

Definition at line 944 of file ffp_hlsl.c.

946{
948 struct vkd3d_shader_code sm1;
949
950 if (!string_buffer_init(&string))
951 return false;
952
954 {
955 string_buffer_free(&string);
956 return false;
957 }
958
959 if (!compile_hlsl_shader(&string, &sm1, "vs_2_a"))
960 {
961 string_buffer_free(&string);
962 return false;
963 }
964 string_buffer_free(&string);
965
966 shader_desc->byte_code = sm1.code;
967 shader_desc->byte_code_size = ~(size_t)0;
968 return true;
969}
static bool ffp_hlsl_generate_vertex_shader(const struct wined3d_ffp_vs_settings *settings, struct wined3d_string_buffer *buffer, bool legacy_lighting)
Definition: ffp_hlsl.c:199
#define WINED3D_LEGACY_FFP_LIGHTING
Definition: wined3d.h:1329

Referenced by wined3d_shader_init_object().

◆ find_ds_compile_args()

void find_ds_compile_args ( const struct wined3d_state *  state,
const struct wined3d_shader *  shader,
struct ds_compile_args *  args,
const struct wined3d_context *  context 
)

Definition at line 2838 of file shader.c.

2840{
2841 const struct wined3d_shader *geometry_shader = state->shader[WINED3D_SHADER_TYPE_GEOMETRY];
2842 const struct wined3d_shader *pixel_shader = state->shader[WINED3D_SHADER_TYPE_PIXEL];
2843 const struct wined3d_shader *hull_shader = state->shader[WINED3D_SHADER_TYPE_HULL];
2844
2845 args->tessellator_output_primitive = hull_shader->u.hs.tessellator_output_primitive;
2846 args->tessellator_partitioning = hull_shader->u.hs.tessellator_partitioning;
2847
2848 args->output_count = geometry_shader ? geometry_shader->limits->packed_input
2849 : pixel_shader ? pixel_shader->limits->packed_input : shader->limits->packed_output;
2850 args->next_shader_type = geometry_shader ? WINED3D_SHADER_TYPE_GEOMETRY : WINED3D_SHADER_TYPE_PIXEL;
2851
2852 init_interpolation_compile_args(args->interpolation_mode,
2853 args->next_shader_type == WINED3D_SHADER_TYPE_PIXEL ? pixel_shader : NULL, context->d3d_info);
2854
2855 args->padding = 0;
2856}
static void init_interpolation_compile_args(uint32_t *interpolation_args, const struct wined3d_shader *pixel_shader, const struct wined3d_d3d_info *d3d_info)
Definition: shader.c:2675
Definition: match.c:390
union wined3d_shader::@358 u
const struct wined3d_shader_limits * limits
struct wined3d_hull_shader hs

Referenced by set_glsl_shader_program().

◆ find_ffp_frag_shader()

const struct ffp_frag_desc * find_ffp_frag_shader ( const struct wine_rb_tree *  fragment_shaders,
const struct ffp_frag_settings *  settings 
)

Definition at line 6419 of file utils.c.

6421{
6422 struct wine_rb_entry *entry = wine_rb_get(fragment_shaders, settings);
6424}
uint32_t entry
Definition: isohybrid.c:63
#define wine_rb_entry
Definition: rbtree.h:404
#define WINE_RB_ENTRY_VALUE
Definition: rbtree.h:414
#define wine_rb_get
Definition: rbtree.h:409

Referenced by get_ffp_pixel_shader(), and shader_glsl_find_ffp_fragment_shader().

◆ find_gs_compile_args()

void find_gs_compile_args ( const struct wined3d_state *  state,
const struct wined3d_shader *  shader,
struct gs_compile_args *  args,
const struct wined3d_context *  context 
)

Definition at line 2858 of file shader.c.

2860{
2861 const struct wined3d_shader *pixel_shader = state->shader[WINED3D_SHADER_TYPE_PIXEL];
2862
2863 args->output_count = pixel_shader ? pixel_shader->limits->packed_input : shader->limits->packed_output;
2864
2865 if (!(args->primitive_type = shader->u.gs.input_type))
2866 args->primitive_type = state->primitive_type;
2867
2868 init_interpolation_compile_args(args->interpolation_mode, pixel_shader, context->d3d_info);
2869}

Referenced by set_glsl_shader_program().

◆ find_ps_compile_args()

void find_ps_compile_args ( const struct wined3d_state *  state,
const struct wined3d_shader *  shader,
BOOL  position_transformed,
struct ps_compile_args *  args,
const struct wined3d_context *  context 
)

Definition at line 2871 of file shader.c.

2873{
2874 const struct wined3d_shader *vs = state->shader[WINED3D_SHADER_TYPE_VERTEX];
2875 const struct wined3d_d3d_info *d3d_info = context->d3d_info;
2877 struct wined3d_texture *texture;
2878 unsigned int i;
2879
2880 memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */
2881 if (!d3d_info->srgb_write_control && needs_srgb_write(d3d_info, state, &state->fb))
2882 {
2883 static unsigned int warned = 0;
2884
2885 args->srgb_correction = 1;
2886 if (state->blend_state && state->blend_state->desc.rt[0].enable && !warned++)
2887 WARN("Blending into a sRGB render target with no GL_ARB_framebuffer_sRGB "
2888 "support, expect rendering artifacts.\n");
2889 }
2890
2891 if (shader->reg_maps.shader_version.major == 1
2892 && shader->reg_maps.shader_version.minor <= 3)
2893 {
2894 for (i = 0; i < shader->limits->sampler; ++i)
2895 {
2897
2899 {
2900 uint32_t tex_transform = flags & ~WINED3D_TTFF_PROJECTED;
2901
2902 if (!vs || vs->is_ffp_vs)
2903 {
2904 enum wined3d_shader_resource_type resource_type = shader->reg_maps.resource_info[i].type;
2905 unsigned int j;
2906 unsigned int index = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
2907 uint32_t max_valid = WINED3D_TTFF_COUNT4;
2908
2909 for (j = 0; j < state->vertex_declaration->element_count; ++j)
2910 {
2912 &state->vertex_declaration->elements[j];
2913
2915 && element->usage_idx == index)
2916 {
2917 max_valid = element->format->component_count;
2918 break;
2919 }
2920 }
2921 if (!tex_transform || tex_transform > max_valid)
2922 {
2923 WARN("Fixing up projected texture transform flags from %#x to %#x.\n",
2924 tex_transform, max_valid);
2925 tex_transform = max_valid;
2926 }
2927 if ((resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_1D && tex_transform > WINED3D_TTFF_COUNT1)
2928 || (resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_2D
2929 && tex_transform > WINED3D_TTFF_COUNT2)
2930 || (resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_3D
2931 && tex_transform > WINED3D_TTFF_COUNT3))
2932 tex_transform |= WINED3D_PSARGS_PROJECTED;
2933 else
2934 {
2935 WARN("Application requested projected texture with unsuitable texture coordinates.\n");
2936 WARN("(texture unit %u, transform flags %#x, sampler type %u).\n",
2937 i, tex_transform, resource_type);
2938 }
2939 }
2940 else
2942
2943 args->tex_transform |= tex_transform << i * WINED3D_PSARGS_TEXTRANSFORM_SHIFT;
2944 }
2945 }
2946 }
2947 if (shader->reg_maps.shader_version.major == 1
2948 && shader->reg_maps.shader_version.minor <= 4)
2949 {
2950 for (i = 0; i < shader->limits->sampler; ++i)
2951 {
2953
2954 if (!shader->reg_maps.resource_info[i].type)
2955 continue;
2956
2957 /* Treat unbound textures as 2D. The dummy texture will provide
2958 * the proper sample value. The tex_types bitmap defaults to
2959 * 2D because of the memset. */
2960 if (!(view = state->shader_resource_view[WINED3D_SHADER_TYPE_PIXEL][i]))
2961 continue;
2962 texture = texture_from_resource(view->resource);
2963
2964 switch (texture->resource.type)
2965 {
2966 case WINED3D_RTYPE_NONE:
2969 assert(0);
2970
2972 if (texture->resource.usage & WINED3DUSAGE_LEGACY_CUBEMAP)
2974 break;
2975
2978 break;
2979 }
2980
2981 args->tex_types |= (type << (i * WINED3D_PSARGS_TEXTYPE_SHIFT));
2982 }
2983 }
2984 else if (shader->reg_maps.shader_version.major <= 3)
2985 {
2986 for (i = 0; i < shader->limits->sampler; ++i)
2987 {
2988 enum wined3d_shader_resource_type resource_type;
2989 enum wined3d_shader_tex_types tex_type;
2990
2991 if (!(resource_type = shader->reg_maps.resource_info[i].type))
2992 continue;
2993
2994 switch (resource_type)
2995 {
2997 tex_type = WINED3D_SHADER_TEX_3D;
2998 break;
3000 tex_type = WINED3D_SHADER_TEX_CUBE;
3001 break;
3002 default:
3003 tex_type = WINED3D_SHADER_TEX_2D;
3004 break;
3005 }
3006
3007 if ((view = state->shader_resource_view[WINED3D_SHADER_TYPE_PIXEL][i]))
3008 {
3009 texture = texture_from_resource(view->resource);
3010 /* Star Wars: The Old Republic uses mismatched samplers for rendering water. */
3011 if (texture->resource.type == WINED3D_RTYPE_TEXTURE_2D
3012 && resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_3D
3013 && !(texture->resource.usage & WINED3DUSAGE_LEGACY_CUBEMAP))
3014 tex_type = WINED3D_SHADER_TEX_2D;
3015 else if (texture->resource.type == WINED3D_RTYPE_TEXTURE_3D
3016 && resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_2D)
3017 tex_type = WINED3D_SHADER_TEX_3D;
3018 }
3019 args->tex_types |= tex_type << i * WINED3D_PSARGS_TEXTYPE_SHIFT;
3020 }
3021 }
3022
3023 if (shader->reg_maps.shader_version.major >= 4)
3024 {
3025 /* In SM4+ we use dcl_sampler in order to determine if we should use shadow sampler. */
3026 args->shadow = 0;
3027 for (i = 0 ; i < WINED3D_MAX_FRAGMENT_SAMPLERS; ++i)
3028 args->color_fixup[i] = COLOR_FIXUP_IDENTITY;
3029 }
3030 else
3031 {
3032 for (i = 0; i < WINED3D_MAX_FRAGMENT_SAMPLERS; ++i)
3033 {
3034 if (!shader->reg_maps.resource_info[i].type)
3035 continue;
3036
3037 if (!(view = state->shader_resource_view[WINED3D_SHADER_TYPE_PIXEL][i]))
3038 {
3039 args->color_fixup[i] = COLOR_FIXUP_IDENTITY;
3040 continue;
3041 }
3042 texture = texture_from_resource(view->resource);
3043
3044 if (can_use_texture_swizzle(d3d_info, texture->resource.format))
3045 args->color_fixup[i] = COLOR_FIXUP_IDENTITY;
3046 else
3047 args->color_fixup[i] = texture->resource.format->color_fixup;
3048
3049 if (texture->resource.format_caps & WINED3D_FORMAT_CAP_SHADOW)
3050 args->shadow |= 1u << i;
3051 }
3052 }
3053
3054 if (shader->reg_maps.shader_version.major >= 3)
3055 {
3056 if (position_transformed)
3057 args->vp_mode = WINED3D_VP_MODE_NONE;
3058 else if (use_vs(state))
3059 args->vp_mode = WINED3D_VP_MODE_SHADER;
3060 else
3061 args->vp_mode = WINED3D_VP_MODE_FF;
3063 }
3064 else
3065 {
3066 args->vp_mode = WINED3D_VP_MODE_SHADER;
3067 if (state->render_states[WINED3D_RS_FOGENABLE])
3068 {
3069 switch (state->render_states[WINED3D_RS_FOGTABLEMODE])
3070 {
3071 case WINED3D_FOG_NONE:
3073 case WINED3D_FOG_EXP: args->fog = WINED3D_FFP_PS_FOG_EXP; break;
3074 case WINED3D_FOG_EXP2: args->fog = WINED3D_FFP_PS_FOG_EXP2; break;
3075 }
3076 }
3077 else
3078 {
3080 }
3081 }
3082
3083 if (!d3d_info->full_ffp_varyings)
3084 {
3085 const struct wined3d_shader *vs = state->shader[WINED3D_SHADER_TYPE_VERTEX];
3086
3087 args->texcoords_initialized = 0;
3088 for (i = 0; i < WINED3D_MAX_FFP_TEXTURES; ++i)
3089 {
3090 if (vs)
3091 {
3092 if (state->shader[WINED3D_SHADER_TYPE_VERTEX]->reg_maps.output_registers & (1u << i))
3093 args->texcoords_initialized |= 1u << i;
3094 }
3095 else
3096 {
3097 const struct wined3d_stream_info *si = &context->stream_info;
3098 unsigned int coord_idx = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
3099
3100 if ((state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX] >> WINED3D_FFP_TCI_SHIFT)
3102 || (coord_idx < WINED3D_MAX_FFP_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx)))))
3103 args->texcoords_initialized |= 1u << i;
3104 }
3105 }
3106 }
3107 else
3108 {
3109 args->texcoords_initialized = wined3d_mask_from_size(WINED3D_MAX_FFP_TEXTURES);
3110 }
3111
3112 args->pointsprite = state->render_states[WINED3D_RS_POINTSPRITEENABLE]
3113 && state->primitive_type == WINED3D_PT_POINTLIST;
3114
3115 if (d3d_info->ffp_alpha_test)
3116 args->alpha_test_func = WINED3D_CMP_ALWAYS - 1;
3117 else
3118 args->alpha_test_func = (state->render_states[WINED3D_RS_ALPHATESTENABLE]
3120 : WINED3D_CMP_ALWAYS) - 1;
3121
3122 if (d3d_info->emulated_flatshading)
3123 args->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT;
3124
3125 for (i = 0; i < ARRAY_SIZE(state->fb.render_targets); ++i)
3126 {
3127 struct wined3d_rendertarget_view *rtv = state->fb.render_targets[i];
3128 if (rtv && rtv->format->id == WINED3DFMT_A8_UNORM && !is_identity_fixup(rtv->format->color_fixup))
3129 args->rt_alpha_swizzle |= 1u << i;
3130 }
3131
3132 args->dual_source_blend = state->blend_state && state->blend_state->dual_source;
3133}
#define assert(_expr)
Definition: assert.h:32
GLbitfield flags
Definition: glext.h:7161
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
static SYSTEM_INFO si
Definition: virtual.c:39
static vector_t * vs
Definition: server.c:146
uint32_t full_ffp_varyings
uint32_t emulated_flatshading
uint32_t srgb_write_control
@ WINED3D_SHADE_FLAT
Definition: wined3d.h:488
@ WINED3D_FOG_LINEAR
Definition: wined3d.h:483
@ WINED3D_FOG_EXP
Definition: wined3d.h:481
@ WINED3D_FOG_NONE
Definition: wined3d.h:480
@ WINED3D_FOG_EXP2
Definition: wined3d.h:482
#define WINED3D_MAX_FRAGMENT_SAMPLERS
Definition: wined3d.h:1598
@ WINED3D_CMP_ALWAYS
Definition: wined3d.h:468
@ WINED3D_TTFF_COUNT2
Definition: wined3d.h:620
@ WINED3D_TTFF_COUNT4
Definition: wined3d.h:622
@ WINED3D_TTFF_COUNT3
Definition: wined3d.h:621
@ WINED3D_TTFF_COUNT1
Definition: wined3d.h:619
@ WINED3D_TTFF_PROJECTED
Definition: wined3d.h:623
#define WINED3D_MAX_FFP_TEXTURES
Definition: wined3d.h:1597
#define WINED3D_PSARGS_PROJECTED
#define WINED3D_FFP_TCI_SHIFT
static BOOL use_vs(const struct wined3d_state *state)
#define WINED3D_FORMAT_CAP_SHADOW
#define WINED3D_PSARGS_TEXTRANSFORM_SHIFT
#define WINED3D_FFP_TCI_MASK
wined3d_shader_resource_type
static enum wined3d_cmp_func wined3d_sanitize_cmp_func(enum wined3d_cmp_func func)
static BOOL can_use_texture_swizzle(const struct wined3d_d3d_info *d3d_info, const struct wined3d_format *format)
static uint32_t wined3d_mask_from_size(unsigned int size)
static const struct color_fixup_desc COLOR_FIXUP_IDENTITY
static BOOL is_identity_fixup(struct color_fixup_desc fixup)
#define WINED3D_PSARGS_TEXTYPE_SHIFT
static BOOL needs_srgb_write(const struct wined3d_d3d_info *d3d_info, const struct wined3d_state *state, const struct wined3d_fb_state *fb)
wined3d_shader_tex_types
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)

Referenced by set_glsl_shader_program(), and shader_spirv_compile_arguments_init().

◆ find_vs_compile_args()

void find_vs_compile_args ( const struct wined3d_state *  state,
const struct wined3d_shader *  shader,
struct vs_compile_args *  args,
const struct wined3d_context *  context 
)

Definition at line 2689 of file shader.c.

2691{
2692 const struct wined3d_shader *geometry_shader = state->shader[WINED3D_SHADER_TYPE_GEOMETRY];
2693 const struct wined3d_shader *pixel_shader = state->shader[WINED3D_SHADER_TYPE_PIXEL];
2694 const struct wined3d_shader *hull_shader = state->shader[WINED3D_SHADER_TYPE_HULL];
2695 const struct wined3d_d3d_info *d3d_info = context->d3d_info;
2696 WORD swizzle_map = context->stream_info.swizzle_map;
2697
2698 if (state->render_states[WINED3D_RS_FOGTABLEMODE] != WINED3D_FOG_NONE)
2699 {
2700 if (state->transforms[WINED3D_TS_PROJECTION]._14 == 0.0f
2701 && state->transforms[WINED3D_TS_PROJECTION]._24 == 0.0f
2702 && state->transforms[WINED3D_TS_PROJECTION]._34 == 0.0f
2703 && state->transforms[WINED3D_TS_PROJECTION]._44 == 1.0f)
2704 {
2705 /* Fog source is vertex output Z.
2706 *
2707 * However, if drawing RHW (which means we are using an HLSL
2708 * replacement shader, since we got here), and depth testing is
2709 * disabled, primitives are not supposed to be clipped by the
2710 * viewport. We handle this in the vertex shader by essentially
2711 * flushing output Z to zero.
2712 *
2713 * Fog needs to still read from the original Z, however. In this
2714 * case we read from oFog, which contains the original Z. */
2715
2716 if (state->vertex_declaration->position_transformed)
2717 args->fog_src = VS_FOG_COORD;
2718 else
2719 args->fog_src = VS_FOG_Z;
2720 }
2721 else
2722 {
2723 args->fog_src = VS_FOG_W;
2724 }
2725 }
2726 else
2727 {
2728 args->fog_src = VS_FOG_COORD;
2729 }
2730
2731 args->clip_enabled = state->render_states[WINED3D_RS_CLIPPING]
2732 && state->render_states[WINED3D_RS_CLIPPLANEENABLE];
2733 args->point_size = state->primitive_type == WINED3D_PT_POINTLIST;
2734 args->next_shader_type = hull_shader ? WINED3D_SHADER_TYPE_HULL
2736 if (shader->reg_maps.shader_version.major >= 4)
2737 args->next_shader_input_count = hull_shader ? hull_shader->limits->packed_input
2738 : geometry_shader ? geometry_shader->limits->packed_input
2739 : pixel_shader ? pixel_shader->limits->packed_input : 0;
2740 else
2741 args->next_shader_input_count = 0;
2742 args->swizzle_map = swizzle_map;
2743 if (d3d_info->emulated_flatshading)
2744 args->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT;
2745 else
2746 args->flatshading = 0;
2747
2748 init_interpolation_compile_args(args->interpolation_mode,
2749 args->next_shader_type == WINED3D_SHADER_TYPE_PIXEL ? pixel_shader : NULL, d3d_info);
2750}
unsigned short WORD
Definition: ntddk_ex.h:93

Referenced by set_glsl_shader_program().

◆ float_16_to_32()

static float float_16_to_32 ( const unsigned short *  in)
inlinestatic

Definition at line 330 of file wined3d_private.h.

331{
332 const unsigned short s = ((*in) & 0x8000u);
333 const unsigned short e = ((*in) & 0x7c00u) >> 10;
334 const unsigned short m = (*in) & 0x3ffu;
335 const float sgn = (s ? -1.0f : 1.0f);
336
337 if(e == 0) {
338 if(m == 0) return sgn * 0.0f; /* +0.0 or -0.0 */
339 else return sgn * powf(2, -14.0f) * ((float)m / 1024.0f);
340 } else if(e < 31) {
341 return sgn * powf(2, (float)e - 15.0f) * (1.0f + ((float)m / 1024.0f));
342 } else {
343 if(m == 0) return sgn * INFINITY;
344 else return NAN;
345 }
346}
_ACRTIMP float __cdecl powf(float, float)
Definition: powf.c:14
#define NAN
Definition: math.h:273
#define INFINITY
Definition: math.h:272
GLdouble s
Definition: gl.h:2039
const GLfloat * m
Definition: glext.h:10848
#define e
Definition: ke_i.h:82
static float(__cdecl *square_half_float)(float x
long sgn(REAL x)
Definition: varray.cc:48

◆ float_24_to_32()

static float float_24_to_32 ( DWORD  in)
inlinestatic

Definition at line 348 of file wined3d_private.h.

349{
350 const float sgn = in & 0x800000u ? -1.0f : 1.0f;
351 const unsigned short e = (in & 0x780000u) >> 19;
352 const unsigned int m = in & 0x7ffffu;
353
354 if (e == 0)
355 {
356 if (m == 0) return sgn * 0.0f; /* +0.0 or -0.0 */
357 else return sgn * powf(2, -6.0f) * ((float)m / 524288.0f);
358 }
359 else if (e < 15)
360 {
361 return sgn * powf(2, (float)e - 7.0f) * (1.0f + ((float)m / 524288.0f));
362 }
363 else
364 {
365 if (m == 0) return sgn * INFINITY;
366 else return NAN;
367 }
368}
GLuint in
Definition: glext.h:9616

Referenced by convert_s8_uint_d24_float().

◆ float_32_to_16()

static unsigned short float_32_to_16 ( const float *  in)
inlinestatic

Definition at line 370 of file wined3d_private.h.

371{
372 int exp = 0;
373 float tmp = fabsf(*in);
374 unsigned int mantissa;
375 unsigned short ret;
376
377 /* Deal with special numbers */
378 if (*in == 0.0f)
379 return 0x0000;
380 if (isnan(*in))
381 return 0x7c01;
382 if (isinf(*in))
383 return (*in < 0.0f ? 0xfc00 : 0x7c00);
384
385 if (tmp < (float)(1u << 10))
386 {
387 do
388 {
389 tmp = tmp * 2.0f;
390 exp--;
391 } while (tmp < (float)(1u << 10));
392 }
393 else if (tmp >= (float)(1u << 11))
394 {
395 do
396 {
397 tmp /= 2.0f;
398 exp++;
399 } while (tmp >= (float)(1u << 11));
400 }
401
402 mantissa = (unsigned int)tmp;
403 if (tmp - mantissa >= 0.5f)
404 ++mantissa; /* Round to nearest, away from zero. */
405
406 exp += 10; /* Normalize the mantissa. */
407 exp += 15; /* Exponent is encoded with excess 15. */
408
409 if (exp > 30) /* too big */
410 {
411 ret = 0x7c00; /* INF */
412 }
413 else if (exp <= 0)
414 {
415 /* exp == 0: Non-normalized mantissa. Returns 0x0000 (=0.0) for too small numbers. */
416 while (exp <= 0)
417 {
418 mantissa = mantissa >> 1;
419 ++exp;
420 }
421 ret = mantissa & 0x3ff;
422 }
423 else
424 {
425 ret = (exp << 10) | (mantissa & 0x3ff);
426 }
427
428 ret |= ((*in < 0.0f ? 1 : 0) << 15); /* Add the sign */
429 return ret;
430}
#define isinf(x)
Definition: math.h:359
#define isnan(x)
Definition: math.h:360
_ACRTIMP float __cdecl fabsf(float)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
DWORD exp
Definition: msg.c:18625

◆ float_to_int()

static uint32_t float_to_int ( float  f)
inlinestatic

Definition at line 59 of file wined3d_private.h.

60{
61 union
62 {
63 uint32_t u;
64 float f;
65 } u;
66
67 u.f = f;
68 return u.u;
69}
#define f
Definition: ke_i.h:83

◆ get_complex_fixup()

static enum complex_fixup get_complex_fixup ( struct color_fixup_desc  fixup)
inlinestatic

◆ get_fog_start_end()

void get_fog_start_end ( const struct wined3d_context *  context,
const struct wined3d_state *  state,
float *  start,
float *  end 
)

Definition at line 5703 of file utils.c.

5705{
5706 union
5707 {
5708 DWORD d;
5709 float f;
5710 } tmpvalue;
5711
5712 switch (context->fog_source)
5713 {
5714 case FOGSOURCE_VS:
5715 *start = 1.0f;
5716 *end = 0.0f;
5717 break;
5718
5719 case FOGSOURCE_FFP:
5720 tmpvalue.d = state->render_states[WINED3D_RS_FOGSTART];
5721 *start = tmpvalue.f;
5722 tmpvalue.d = state->render_states[WINED3D_RS_FOGEND];
5723 *end = tmpvalue.f;
5724 /* Special handling for fog_start == fog_end. In d3d with vertex
5725 * fog, everything is fogged. With table fog, everything with
5726 * fog_coord < fog_start is unfogged, and fog_coord > fog_start
5727 * is fogged. Windows drivers disagree when fog_coord == fog_start. */
5728 if (state->render_states[WINED3D_RS_FOGTABLEMODE] == WINED3D_FOG_NONE && *start == *end)
5729 {
5730 *start = -INFINITY;
5731 *end = 0.0f;
5732 }
5733 break;
5734
5735 default:
5736 /* This should not happen, context->fog_source is set in wined3d, not the app. */
5737 ERR("Unexpected fog coordinate source.\n");
5738 *start = 0.0f;
5739 *end = 0.0f;
5740 }
5741}
GLuint start
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
#define d
Definition: ke_i.h:81

Referenced by shader_glsl_load_fog_uniform().

◆ get_identity_matrix()

void get_identity_matrix ( struct wined3d_matrix *  mat)

Definition at line 5575 of file utils.c.

5576{
5577 static const struct wined3d_matrix identity =
5578 {
5579 1.0f, 0.0f, 0.0f, 0.0f,
5580 0.0f, 1.0f, 0.0f, 0.0f,
5581 0.0f, 0.0f, 1.0f, 0.0f,
5582 0.0f, 0.0f, 0.0f, 1.0f,
5583 };
5584
5585 *mat = identity;
5586}
static const MAT2 mat
Definition: font.c:51

Referenced by compute_texture_matrix(), state_init_default(), and stateblock_state_init_default().

◆ get_modelview_matrix()

void get_modelview_matrix ( const struct wined3d_stateblock_state *  state,
unsigned int  index,
struct wined3d_matrix *  mat 
)

Definition at line 5588 of file utils.c.

5589{
5591}
void multiply_matrix(struct wined3d_matrix *dst, const struct wined3d_matrix *src1, const struct wined3d_matrix *src2)
Definition: utils.c:6112

Referenced by wined3d_device_apply_stateblock().

◆ get_pointsize_minmax()

void get_pointsize_minmax ( const struct wined3d_context *  context,
const struct wined3d_state *  state,
float *  out_min,
float *  out_max 
)

Definition at line 5684 of file utils.c.

5686{
5687 union
5688 {
5689 DWORD d;
5690 float f;
5691 } min, max;
5692
5693 min.d = state->render_states[WINED3D_RS_POINTSIZE_MIN];
5694 max.d = state->render_states[WINED3D_RS_POINTSIZE_MAX];
5695
5696 if (min.f > max.f)
5697 min.f = max.f;
5698
5699 *out_min = min.f;
5700 *out_max = max.f;
5701}
#define min(a, b)
Definition: monoChain.cc:55
#define max(a, b)
Definition: svc.c:63

Referenced by shader_glsl_pointsize_uniform().

◆ get_texture_matrix()

void get_texture_matrix ( const struct wined3d_stateblock_state *  state,
const unsigned int  tex,
struct wined3d_matrix *  mat 
)

Definition at line 5671 of file utils.c.

5673{
5674 BOOL generated = (state->texture_states[tex][WINED3D_TSS_TEXCOORD_INDEX] & 0xffff0000)
5676 unsigned int coord_idx = min(state->texture_states[tex][WINED3D_TSS_TEXCOORD_INDEX] & 0x0000ffff,
5678
5680 state->texture_states[tex][WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS],
5681 generated, get_texcoord_format(state->vertex_declaration, coord_idx), mat);
5682}
static void compute_texture_matrix(const struct wined3d_matrix *matrix, uint32_t flags, BOOL calculated_coords, enum wined3d_format_id format_id, struct wined3d_matrix *out_matrix)
Definition: utils.c:5594
static enum wined3d_format_id get_texcoord_format(const struct wined3d_vertex_declaration *decl, unsigned int index)
Definition: utils.c:5659
#define WINED3DTSS_TCI_PASSTHRU
Definition: wined3d.h:874

Referenced by wined3d_device_apply_stateblock().

◆ int_to_float()

static float int_to_float ( uint32_t  i)
inlinestatic

Definition at line 71 of file wined3d_private.h.

72{
73 union
74 {
75 uint32_t u;
76 float f;
77 } u;
78
79 u.u = i;
80 return u.f;
81}

Referenced by init_transformed_lights(), sampler_desc_from_sampler_states(), shader_glsl_pointsize_uniform(), wined3d_device_apply_stateblock(), and wined3d_stateblock_apply_clear_state().

◆ invert_matrix()

BOOL invert_matrix ( struct wined3d_matrix *  out,
const struct wined3d_matrix *  m 
)

Definition at line 6775 of file utils.c.

6776{
6777 float wtmp[4][8];
6778 float m0, m1, m2, m3, s;
6779 float *r0, *r1, *r2, *r3;
6780
6781 r0 = wtmp[0];
6782 r1 = wtmp[1];
6783 r2 = wtmp[2];
6784 r3 = wtmp[3];
6785
6786 r0[0] = m->_11;
6787 r0[1] = m->_12;
6788 r0[2] = m->_13;
6789 r0[3] = m->_14;
6790 r0[4] = 1.0f;
6791 r0[5] = r0[6] = r0[7] = 0.0f;
6792
6793 r1[0] = m->_21;
6794 r1[1] = m->_22;
6795 r1[2] = m->_23;
6796 r1[3] = m->_24;
6797 r1[5] = 1.0f;
6798 r1[4] = r1[6] = r1[7] = 0.0f;
6799
6800 r2[0] = m->_31;
6801 r2[1] = m->_32;
6802 r2[2] = m->_33;
6803 r2[3] = m->_34;
6804 r2[6] = 1.0f;
6805 r2[4] = r2[5] = r2[7] = 0.0f;
6806
6807 r3[0] = m->_41;
6808 r3[1] = m->_42;
6809 r3[2] = m->_43;
6810 r3[3] = m->_44;
6811 r3[7] = 1.0f;
6812 r3[4] = r3[5] = r3[6] = 0.0f;
6813
6814 /* Choose pivot - or die. */
6815 if (fabsf(r3[0]) > fabsf(r2[0]))
6816 swap_rows(&r3, &r2);
6817 if (fabsf(r2[0]) > fabsf(r1[0]))
6818 swap_rows(&r2, &r1);
6819 if (fabsf(r1[0]) > fabsf(r0[0]))
6820 swap_rows(&r1, &r0);
6821 if (r0[0] == 0.0f)
6822 return FALSE;
6823
6824 /* Eliminate first variable. */
6825 m1 = r1[0] / r0[0]; m2 = r2[0] / r0[0]; m3 = r3[0] / r0[0];
6826 s = r0[1]; r1[1] -= m1 * s; r2[1] -= m2 * s; r3[1] -= m3 * s;
6827 s = r0[2]; r1[2] -= m1 * s; r2[2] -= m2 * s; r3[2] -= m3 * s;
6828 s = r0[3]; r1[3] -= m1 * s; r2[3] -= m2 * s; r3[3] -= m3 * s;
6829 s = r0[4];
6830 if (s != 0.0f)
6831 {
6832 r1[4] -= m1 * s;
6833 r2[4] -= m2 * s;
6834 r3[4] -= m3 * s;
6835 }
6836 s = r0[5];
6837 if (s != 0.0f)
6838 {
6839 r1[5] -= m1 * s;
6840 r2[5] -= m2 * s;
6841 r3[5] -= m3 * s;
6842 }
6843 s = r0[6];
6844 if (s != 0.0f)
6845 {
6846 r1[6] -= m1 * s;
6847 r2[6] -= m2 * s;
6848 r3[6] -= m3 * s;
6849 }
6850 s = r0[7];
6851 if (s != 0.0f)
6852 {
6853 r1[7] -= m1 * s;
6854 r2[7] -= m2 * s;
6855 r3[7] -= m3 * s;
6856 }
6857
6858 /* Choose pivot - or die. */
6859 if (fabsf(r3[1]) > fabsf(r2[1]))
6860 swap_rows(&r3, &r2);
6861 if (fabsf(r2[1]) > fabsf(r1[1]))
6862 swap_rows(&r2, &r1);
6863 if (r1[1] == 0.0f)
6864 return FALSE;
6865
6866 /* Eliminate second variable. */
6867 m2 = r2[1] / r1[1]; m3 = r3[1] / r1[1];
6868 r2[2] -= m2 * r1[2]; r3[2] -= m3 * r1[2];
6869 r2[3] -= m2 * r1[3]; r3[3] -= m3 * r1[3];
6870 s = r1[4];
6871 if (s != 0.0f)
6872 {
6873 r2[4] -= m2 * s;
6874 r3[4] -= m3 * s;
6875 }
6876 s = r1[5];
6877 if (s != 0.0f)
6878 {
6879 r2[5] -= m2 * s;
6880 r3[5] -= m3 * s;
6881 }
6882 s = r1[6];
6883 if (s != 0.0f)
6884 {
6885 r2[6] -= m2 * s;
6886 r3[6] -= m3 * s;
6887 }
6888 s = r1[7];
6889 if (s != 0.0f)
6890 {
6891 r2[7] -= m2 * s;
6892 r3[7] -= m3 * s;
6893 }
6894
6895 /* Choose pivot - or die. */
6896 if (fabsf(r3[2]) > fabsf(r2[2]))
6897 swap_rows(&r3, &r2);
6898 if (r2[2] == 0.0f)
6899 return FALSE;
6900
6901 /* Eliminate third variable. */
6902 m3 = r3[2] / r2[2];
6903 r3[3] -= m3 * r2[3];
6904 r3[4] -= m3 * r2[4];
6905 r3[5] -= m3 * r2[5];
6906 r3[6] -= m3 * r2[6];
6907 r3[7] -= m3 * r2[7];
6908
6909 /* Last check. */
6910 if (r3[3] == 0.0f)
6911 return FALSE;
6912
6913 /* Back substitute row 3. */
6914 s = 1.0f / r3[3];
6915 r3[4] *= s;
6916 r3[5] *= s;
6917 r3[6] *= s;
6918 r3[7] *= s;
6919
6920 /* Back substitute row 2. */
6921 m2 = r2[3];
6922 s = 1.0f / r2[2];
6923 r2[4] = s * (r2[4] - r3[4] * m2);
6924 r2[5] = s * (r2[5] - r3[5] * m2);
6925 r2[6] = s * (r2[6] - r3[6] * m2);
6926 r2[7] = s * (r2[7] - r3[7] * m2);
6927 m1 = r1[3];
6928 r1[4] -= r3[4] * m1;
6929 r1[5] -= r3[5] * m1;
6930 r1[6] -= r3[6] * m1;
6931 r1[7] -= r3[7] * m1;
6932 m0 = r0[3];
6933 r0[4] -= r3[4] * m0;
6934 r0[5] -= r3[5] * m0;
6935 r0[6] -= r3[6] * m0;
6936 r0[7] -= r3[7] * m0;
6937
6938 /* Back substitute row 1. */
6939 m1 = r1[2];
6940 s = 1.0f / r1[1];
6941 r1[4] = s * (r1[4] - r2[4] * m1);
6942 r1[5] = s * (r1[5] - r2[5] * m1);
6943 r1[6] = s * (r1[6] - r2[6] * m1);
6944 r1[7] = s * (r1[7] - r2[7] * m1);
6945 m0 = r0[2];
6946 r0[4] -= r2[4] * m0;
6947 r0[5] -= r2[5] * m0;
6948 r0[6] -= r2[6] * m0;
6949 r0[7] -= r2[7] * m0;
6950
6951 /* Back substitute row 0. */
6952 m0 = r0[1];
6953 s = 1.0f / r0[0];
6954 r0[4] = s * (r0[4] - r1[4] * m0);
6955 r0[5] = s * (r0[5] - r1[5] * m0);
6956 r0[6] = s * (r0[6] - r1[6] * m0);
6957 r0[7] = s * (r0[7] - r1[7] * m0);
6958
6959 out->_11 = r0[4];
6960 out->_12 = r0[5];
6961 out->_13 = r0[6];
6962 out->_14 = r0[7];
6963 out->_21 = r1[4];
6964 out->_22 = r1[5];
6965 out->_23 = r1[6];
6966 out->_24 = r1[7];
6967 out->_31 = r2[4];
6968 out->_32 = r2[5];
6969 out->_33 = r2[6];
6970 out->_34 = r2[7];
6971 out->_41 = r3[4];
6972 out->_42 = r3[5];
6973 out->_43 = r3[6];
6974 out->_44 = r3[7];
6975
6976 return TRUE;
6977}
static void swap_rows(float **a, float **b)
Definition: utils.c:6767
static DNS_RECORDW r3
Definition: record.c:39
static DNS_RECORDW r1
Definition: record.c:37
static DNS_RECORDW r2
Definition: record.c:38
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383

Referenced by compute_normal_matrix(), and wined3d_device_apply_stateblock().

◆ is_complex_fixup()

◆ is_identity_fixup()

◆ is_invalid_op()

BOOL is_invalid_op ( const struct wined3d_state *  state,
int  stage,
enum wined3d_texture_op  op,
DWORD  arg1,
DWORD  arg2,
DWORD  arg3 
)

Definition at line 5554 of file utils.c.

5556{
5557 if (op == WINED3D_TOP_DISABLE)
5558 return FALSE;
5560 return FALSE;
5561
5564 return TRUE;
5567 return TRUE;
5570 return TRUE;
5571
5572 return FALSE;
5573}
UINT op
Definition: effect.c:235
GLuint GLuint GLuint GLuint arg1
Definition: glext.h:9513
GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg3
Definition: glext.h:9515
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
Definition: glext.h:9514
#define WINED3DTA_SELECTMASK
Definition: wined3d.h:880
#define WINED3DTA_TEXTURE
Definition: wined3d.h:883
static struct wined3d_texture * wined3d_state_get_ffp_texture(const struct wined3d_state *state, unsigned int idx)

Referenced by wined3d_ffp_get_fs_settings().

◆ is_rasterization_disabled()

static BOOL is_rasterization_disabled ( const struct wined3d_shader *  geometry_shader)
inlinestatic

Definition at line 4666 of file wined3d_private.h.

4667{
4668 return geometry_shader && geometry_shader->u.gs.so_desc
4669 && geometry_shader->u.gs.so_desc->rasterizer_stream_idx == WINED3D_NO_RASTERIZER_STREAM;
4670}
struct wined3d_geometry_shader gs
#define WINED3D_NO_RASTERIZER_STREAM
Definition: wined3d.h:1577

Referenced by draw_primitive(), glsl_vertex_pipe_geometry_shader(), rasterizer_state_from_wined3d(), set_glsl_shader_program(), and shader_glsl_generate_geometry_shader().

◆ is_same_fixup()

static BOOL is_same_fixup ( struct color_fixup_desc  f1,
struct color_fixup_desc  f2 
)
inlinestatic

Definition at line 283 of file wined3d_private.h.

284{
285 return f1.x_sign_fixup == f2.x_sign_fixup && f1.x_source == f2.x_source
286 && f1.y_sign_fixup == f2.y_sign_fixup && f1.y_source == f2.y_source
287 && f1.z_sign_fixup == f2.z_sign_fixup && f1.z_source == f2.z_source
288 && f1.w_sign_fixup == f2.w_sign_fixup && f1.w_source == f2.w_source;
289}
#define f2(x, y, z)
Definition: sha1.c:31
#define f1(x, y, z)
Definition: sha1.c:30

Referenced by texture_binding_might_invalidate_fs_settings(), and texture_binding_might_invalidate_ps().

◆ is_scaling_fixup()

static BOOL is_scaling_fixup ( struct color_fixup_desc  fixup)
inlinestatic

Definition at line 278 of file wined3d_private.h.

279{
280 return fixup.x_sign_fixup || fixup.y_sign_fixup || fixup.z_sign_fixup || fixup.w_sign_fixup;
281}

Referenced by can_use_texture_swizzle(), and fbo_blitter_supported().

◆ isStateDirty()

static bool isStateDirty ( const struct wined3d_context *  context,
unsigned int  state_id 
)
inlinestatic

Definition at line 5019 of file wined3d_private.h.

5020{
5022}
static bool wined3d_context_is_graphics_state_dirty(const struct wined3d_context *context, unsigned int state_id)

Referenced by context_apply_draw_state(), context_state_drawbuf(), glsl_fragment_pipe_vdecl(), glsl_vertex_pipe_vs(), vdecl_miscpart(), wined3d_context_gl_apply_clear_state(), and wined3d_context_vk_update_graphics_pipeline_key().

◆ multiply_matrix()

void multiply_matrix ( struct wined3d_matrix *  dest,
const struct wined3d_matrix *  src1,
const struct wined3d_matrix *  src2 
)

Definition at line 1153 of file utils.c.

1154{
1155 struct wined3d_matrix temp;
1156
1157 /* Now do the multiplication 'by hand'.
1158 I know that all this could be optimised, but this will be done later :-) */
1159 temp._11 = (src1->_11 * src2->_11) + (src1->_21 * src2->_12) + (src1->_31 * src2->_13) + (src1->_41 * src2->_14);
1160 temp._21 = (src1->_11 * src2->_21) + (src1->_21 * src2->_22) + (src1->_31 * src2->_23) + (src1->_41 * src2->_24);
1161 temp._31 = (src1->_11 * src2->_31) + (src1->_21 * src2->_32) + (src1->_31 * src2->_33) + (src1->_41 * src2->_34);
1162 temp._41 = (src1->_11 * src2->_41) + (src1->_21 * src2->_42) + (src1->_31 * src2->_43) + (src1->_41 * src2->_44);
1163
1164 temp._12 = (src1->_12 * src2->_11) + (src1->_22 * src2->_12) + (src1->_32 * src2->_13) + (src1->_42 * src2->_14);
1165 temp._22 = (src1->_12 * src2->_21) + (src1->_22 * src2->_22) + (src1->_32 * src2->_23) + (src1->_42 * src2->_24);
1166 temp._32 = (src1->_12 * src2->_31) + (src1->_22 * src2->_32) + (src1->_32 * src2->_33) + (src1->_42 * src2->_34);
1167 temp._42 = (src1->_12 * src2->_41) + (src1->_22 * src2->_42) + (src1->_32 * src2->_43) + (src1->_42 * src2->_44);
1168
1169 temp._13 = (src1->_13 * src2->_11) + (src1->_23 * src2->_12) + (src1->_33 * src2->_13) + (src1->_43 * src2->_14);
1170 temp._23 = (src1->_13 * src2->_21) + (src1->_23 * src2->_22) + (src1->_33 * src2->_23) + (src1->_43 * src2->_24);
1171 temp._33 = (src1->_13 * src2->_31) + (src1->_23 * src2->_32) + (src1->_33 * src2->_33) + (src1->_43 * src2->_34);
1172 temp._43 = (src1->_13 * src2->_41) + (src1->_23 * src2->_42) + (src1->_33 * src2->_43) + (src1->_43 * src2->_44);
1173
1174 temp._14 = (src1->_14 * src2->_11) + (src1->_24 * src2->_12) + (src1->_34 * src2->_13) + (src1->_44 * src2->_14);
1175 temp._24 = (src1->_14 * src2->_21) + (src1->_24 * src2->_22) + (src1->_34 * src2->_23) + (src1->_44 * src2->_24);
1176 temp._34 = (src1->_14 * src2->_31) + (src1->_24 * src2->_32) + (src1->_34 * src2->_33) + (src1->_44 * src2->_34);
1177 temp._44 = (src1->_14 * src2->_41) + (src1->_24 * src2->_42) + (src1->_34 * src2->_43) + (src1->_44 * src2->_44);
1178
1179 *dst = temp;
1180}
GLenum GLenum dst
Definition: glext.h:6340
static calc_node_t temp
Definition: rpn_ieee.c:38

Referenced by get_modelview_matrix().

◆ needs_separate_srgb_gl_texture()

static BOOL needs_separate_srgb_gl_texture ( const struct wined3d_context *  context,
const struct wined3d_texture *  texture 
)
inlinestatic

Definition at line 4634 of file wined3d_private.h.

4636{
4637 if (!(context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL))
4638 return FALSE;
4639
4640 if (!context->d3d_info->srgb_read_control
4641 && (texture->resource.bind_flags & WINED3D_BIND_SHADER_RESOURCE)
4642 && (texture->resource.format_caps & WINED3D_FORMAT_CAP_SRGB_READ))
4643 return TRUE;
4644
4645 if (!context->d3d_info->srgb_write_control
4646 && (texture->resource.bind_flags & WINED3D_BIND_RENDER_TARGET)
4647 && (texture->resource.format_caps & WINED3D_FORMAT_CAP_SRGB_WRITE))
4648 return TRUE;
4649
4650 return FALSE;
4651}
#define WINED3D_BIND_SHADER_RESOURCE
Definition: wined3d.h:912
#define WINED3D_BIND_RENDER_TARGET
Definition: wined3d.h:914
#define WINED3D_SRGB_READ_WRITE_CONTROL
Definition: wined3d.h:1330
#define WINED3D_FORMAT_CAP_SRGB_WRITE
#define WINED3D_FORMAT_CAP_SRGB_READ

Referenced by wined3d_texture_gl_bind(), wined3d_texture_gl_get_texture_name(), and wined3d_texture_load().

◆ needs_srgb_write()

static BOOL needs_srgb_write ( const struct wined3d_d3d_info *  d3d_info,
const struct wined3d_state *  state,
const struct wined3d_fb_state *  fb 
)
inlinestatic

◆ pixelformat_for_depth()

enum wined3d_format_id pixelformat_for_depth ( DWORD  depth)

Definition at line 6067 of file utils.c.

6068{
6069 switch (depth)
6070 {
6071 case 8: return WINED3DFMT_P8_UINT;
6072 case 15: return WINED3DFMT_B5G5R5X1_UNORM;
6073 case 16: return WINED3DFMT_B5G6R5_UNORM;
6074 case 24: return WINED3DFMT_B8G8R8X8_UNORM; /* Robots needs 24bit to be WINED3DFMT_B8G8R8X8_UNORM */
6075 case 32: return WINED3DFMT_B8G8R8X8_UNORM; /* EVE online and the Fur demo need 32bit AdapterDisplayMode to return WINED3DFMT_B8G8R8X8_UNORM */
6076 default: return WINED3DFMT_UNKNOWN;
6077 }
6078}
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546

Referenced by adapter_format_from_backbuffer_format(), wined3d_output_get_display_mode(), wined3d_output_update_modes(), and wined3d_restore_display_modes().

◆ pixelshader_get_resource_type()

enum wined3d_shader_resource_type pixelshader_get_resource_type ( const struct wined3d_shader_reg_maps *  reg_maps,
unsigned int  resource_idx,
DWORD  tex_types 
)

Definition at line 3153 of file shader.c.

3155{
3156 static enum wined3d_shader_resource_type shader_resource_type_from_shader_tex_types[] =
3157 {
3158 WINED3D_SHADER_RESOURCE_TEXTURE_2D, /* WINED3D_SHADER_TEX_2D */
3159 WINED3D_SHADER_RESOURCE_TEXTURE_3D, /* WINED3D_SHADER_TEX_3D */
3160 WINED3D_SHADER_RESOURCE_TEXTURE_CUBE, /* WINED3D_SHADER_TEX_CUBE */
3161 };
3162
3163 unsigned int idx;
3164
3165 if (reg_maps->shader_version.major > 3)
3166 return reg_maps->resource_info[resource_idx].type;
3167
3168 if (!reg_maps->resource_info[resource_idx].type)
3169 return 0;
3170
3171 idx = (tex_types >> resource_idx * WINED3D_PSARGS_TEXTYPE_SHIFT) & WINED3D_PSARGS_TEXTYPE_MASK;
3172 assert(idx < ARRAY_SIZE(shader_resource_type_from_shader_tex_types));
3173 return shader_resource_type_from_shader_tex_types[idx];
3174}
struct wined3d_shader_version shader_version
struct wined3d_shader_resource_info resource_info[MAX_SHADER_RESOURCE_VIEWS]
#define WINED3D_PSARGS_TEXTYPE_MASK

Referenced by shader_generate_glsl_declarations(), shader_glsl_get_sample_function(), and shader_glsl_tex().

◆ resource_cleanup()

void resource_cleanup ( struct wined3d_resource *  resource)

Definition at line 224 of file resource.c.

225{
226 TRACE("Cleaning up resource %p.\n", resource);
227
229 {
230 TRACE("Decrementing device memory pool by %u.\n", resource->size);
231 adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size);
232 }
233
234 if (!(resource->usage & WINED3DUSAGE_CS))
236
239}
COMPILER_DEPENDENT_INT64 INT64
Definition: actypes.h:132
void wined3d_cs_destroy_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
Definition: cs.c:2299
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource)
Definition: device.c:5358
static void wined3d_resource_destroy_object(void *object)
Definition: resource.c:214
size_t size
Definition: utils.c:170
UINT64 adapter_adjust_memory(struct wined3d_adapter *adapter, INT64 amount)
Definition: directx.c:158
#define WINED3D_RESOURCE_ACCESS_CPU
Definition: wined3d.h:52
#define WINED3DUSAGE_CS
Definition: wined3d.h:933
static void wined3d_resource_reference(struct wined3d_resource *resource)

Referenced by wined3d_buffer_cleanup(), wined3d_buffer_init(), and wined3d_texture_cleanup().

◆ resource_init()

HRESULT resource_init ( struct wined3d_resource *  resource,
struct wined3d_device *  device,
enum wined3d_resource_type  type,
const struct wined3d_format *  format,
enum wined3d_multisample_type  multisample_type,
unsigned int  multisample_quality,
unsigned int  usage,
unsigned int  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 
)

◆ resource_offset_map_pointer()

void * resource_offset_map_pointer ( struct wined3d_resource *  resource,
unsigned int  sub_resource_idx,
uint8_t *  base_memory,
const struct wined3d_box *  box 
)

Definition at line 574 of file resource.c.

576{
577 const struct wined3d_format *format = resource->format;
578 unsigned int row_pitch, slice_pitch;
579
580 wined3d_resource_get_sub_resource_map_pitch(resource, sub_resource_idx, &row_pitch, &slice_pitch);
581
584 {
585 /* Compressed textures are block based, so calculate the offset of
586 * the block that contains the top-left pixel of the mapped box. */
587 return base_memory
588 + (box->front * slice_pitch)
589 + ((box->top / format->block_height) * row_pitch)
590 + ((box->left / format->block_width) * format->block_byte_count);
591 }
592 else
593 {
594 return base_memory
595 + (box->front * slice_pitch)
596 + (box->top * row_pitch)
597 + (box->left * format->byte_count);
598 }
599}
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_FORMAT_ATTR_BROKEN_PITCH

Referenced by texture_resource_sub_resource_map(), and wined3d_cs_map_upload_bo().

◆ resource_unload()

void resource_unload ( struct wined3d_resource *  resource)

Definition at line 241 of file resource.c.

242{
243 if (resource->map_count)
244 ERR("Resource %p is being unloaded while mapped.\n", resource);
245}

Referenced by buffer_resource_unload(), and texture_resource_unload().

◆ shader_addline()

int shader_addline ( struct wined3d_string_buffer *  buffer,
const char *  fmt,
  ... 
)

◆ shader_constant_is_local()

static BOOL shader_constant_is_local ( const struct wined3d_shader *  shader,
DWORD  reg 
)
inlinestatic

Definition at line 4415 of file wined3d_private.h.

4416{
4417 struct wined3d_shader_lconst *lconst;
4418
4419 if (shader->load_local_constsF)
4420 return FALSE;
4421
4422 LIST_FOR_EACH_ENTRY(lconst, &shader->constantsF, struct wined3d_shader_lconst, entry)
4423 {
4424 if (lconst->idx == reg)
4425 return TRUE;
4426 }
4427
4428 return FALSE;
4429}
static int reg
Definition: i386-dis.c:1290
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:236

Referenced by shader_glsl_get_register_name().

◆ shader_find_free_input_register()

unsigned int shader_find_free_input_register ( const struct wined3d_shader_reg_maps *  reg_maps,
unsigned int  max 
)

Definition at line 1863 of file shader.c.

1864{
1865 DWORD map = 1u << max;
1866 map |= map - 1;
1867 map &= reg_maps->shader_version.major < 3 ? ~reg_maps->texcoord : ~reg_maps->input_registers;
1868
1869 return wined3d_log2i(map);
1870}
static unsigned int wined3d_log2i(unsigned int x)
Definition: wined3d.h:2952

◆ shader_generate_code()

HRESULT shader_generate_code ( const struct wined3d_shader *  shader,
struct wined3d_string_buffer *  buffer,
const struct wined3d_shader_reg_maps *  reg_maps,
void *  backend_ctx,
const DWORD *  start,
const DWORD *  end 
)

Definition at line 1873 of file shader.c.

1876{
1877 struct wined3d_device *device = shader->device;
1878 const struct wined3d_shader_frontend *fe = shader->frontend;
1879 void *fe_data = shader->frontend_data;
1880 struct wined3d_shader_version shader_version;
1882 struct wined3d_shader_instruction ins;
1883 struct wined3d_shader_tex_mx tex_mx;
1885 const DWORD *ptr;
1886
1887 /* Initialize current parsing state. */
1888 tex_mx.current_row = 0;
1889 state.current_loop_depth = 0;
1890 state.current_loop_reg = 0;
1891 state.in_subroutine = FALSE;
1892
1893 ctx.shader = shader;
1894 ctx.reg_maps = reg_maps;
1895 ctx.buffer = buffer;
1896 ctx.tex_mx = &tex_mx;
1897 ctx.state = &state;
1898 ctx.backend_data = backend_ctx;
1899 ins.ctx = &ctx;
1900
1901 fe->shader_read_header(fe_data, &ptr, &shader_version);
1902 if (start)
1903 ptr = start;
1904
1905 while (!fe->shader_is_end(fe_data, &ptr) && ptr != end)
1906 {
1907 /* Read opcode. */
1908 fe->shader_read_instruction(fe_data, &ptr, &ins);
1909
1910 /* Unknown opcode and its parameters. */
1911 if (ins.handler_idx == WINED3DSIH_TABLE_SIZE)
1912 {
1913 WARN("Encountered unrecognised or invalid instruction.\n");
1915 }
1916
1917 if (ins.predicate)
1918 FIXME("Predicates not implemented.\n");
1919
1920 /* Call appropriate function for output target */
1921 device->shader_backend->shader_handle_instruction(&ins);
1922 }
1923
1924 return WINED3D_OK;
1925}
static PVOID ptr
Definition: dispmode.c:27
const struct wined3d_shader_reg_maps * reg_maps
struct wined3d_shader_tex_mx * tex_mx
void(* shader_read_header)(void *data, const DWORD **ptr, struct wined3d_shader_version *shader_version)
BOOL(* shader_is_end)(void *data, const DWORD **ptr)
void(* shader_read_instruction)(void *data, const DWORD **ptr, struct wined3d_shader_instruction *ins)
#define WINED3DERR_INVALIDCALL
Definition: wined3d.h:44

Referenced by shader_glsl_generate_compute_shader(), shader_glsl_generate_domain_shader(), shader_glsl_generate_fragment_shader(), shader_glsl_generate_geometry_shader(), shader_glsl_generate_hull_shader(), shader_glsl_generate_shader_phase(), and shader_glsl_generate_vertex_shader().

◆ shader_get_position_fixup()

static void shader_get_position_fixup ( const struct wined3d_context *  context,
const struct wined3d_state *  state,
unsigned int  fixup_count,
float *  position_fixup 
)
inlinestatic

Definition at line 4384 of file wined3d_private.h.

4386{
4387 float center_offset, x = 0.0f, y = 0.0f;
4388 unsigned int i;
4389
4390 /* See get_projection_matrix() in glsl_shader.c for a discussion of the position fixup.
4391 * This function here also applies to d3d10+ which does not need adjustment for
4392 * integer pixel centers, but it may need the filling convention offset. */
4393 if (context->d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER)
4394 center_offset = 1.0f;
4395 else
4396 center_offset = 0.0f;
4397
4398 center_offset += context->d3d_info->filling_convention_offset;
4399
4400 for (i = 0; i < fixup_count; ++i)
4401 {
4402 position_fixup[4 * i ] = 1.0f;
4403 position_fixup[4 * i + 1] = -1.0f;
4404 if (!context->d3d_info->subpixel_viewport)
4405 {
4406 double dummy;
4407 x = modf(state->viewports[i].x, &dummy) * 2.0f;
4408 y = modf(state->viewports[i].y, &dummy) * 2.0f;
4409 }
4410 position_fixup[4 * i + 2] = (center_offset + x) / state->viewports[i].width;
4411 position_fixup[4 * i + 3] = (center_offset + y) / state->viewports[i].height;
4412 }
4413}
_ACRTIMP double __cdecl modf(double, double *)
Definition: modf.c:30
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define WINED3D_PIXEL_CENTER_INTEGER
Definition: wined3d.h:1328

Referenced by shader_glsl_load_constants().

◆ shader_get_stream_output_register_info()

BOOL shader_get_stream_output_register_info ( const struct wined3d_shader *  shader,
const struct wined3d_stream_output_element *  so_element,
unsigned int *  register_idx,
unsigned int *  component_idx 
)

Definition at line 2117 of file shader.c.

2119{
2120 const struct wined3d_shader_signature_element *output;
2121 unsigned int idx;
2122
2123 if (!(output = shader_find_signature_element(&shader->output_signature,
2124 so_element->stream_idx, so_element->semantic_name, so_element->semantic_idx)))
2125 return FALSE;
2126
2127 for (idx = 0; idx < 4; ++idx)
2128 {
2129 if (output->mask & (1u << idx))
2130 break;
2131 }
2132 idx += so_element->component_idx;
2133
2134 *register_idx = output->register_idx;
2135 *component_idx = idx;
2136 return TRUE;
2137}
static struct wined3d_shader_signature_element * shader_find_signature_element(const struct wined3d_shader_signature *s, unsigned int stream_idx, const char *semantic_name, unsigned int semantic_idx)
Definition: shader.c:2100

Referenced by geometry_shader_init_stream_output(), shader_glsl_generate_stream_output_setup(), and shader_glsl_generate_transform_feedback_varyings().

◆ shader_is_scalar()

static BOOL shader_is_scalar ( const struct wined3d_shader_register *  reg)
inlinestatic

Definition at line 4341 of file wined3d_private.h.

4342{
4343 switch (reg->type)
4344 {
4345 case WINED3DSPR_RASTOUT:
4346 /* oFog & oPts */
4347 if (reg->idx[0].offset)
4348 return TRUE;
4349 /* oPos */
4350 return FALSE;
4351
4352 case WINED3DSPR_CONSTBOOL: /* b# */
4353 case WINED3DSPR_DEPTHOUT: /* oDepth */
4356 case WINED3DSPR_LOOP: /* aL */
4358 case WINED3DSPR_PREDICATE: /* p0 */
4359 case WINED3DSPR_PRIMID: /* primID */
4360 case WINED3DSPR_COVERAGE: /* vCoverage */
4361 case WINED3DSPR_SAMPLEMASK: /* oMask */
4362 case WINED3DSPR_STENCILREF: /* oStencilRef */
4363 return TRUE;
4364
4366 switch (reg->idx[0].offset)
4367 {
4368 case 0: /* vPos */
4369 return FALSE;
4370 case 1: /* vFace */
4371 return TRUE;
4372 default:
4373 return FALSE;
4374 }
4375
4377 return reg->immconst_type == WINED3D_IMMCONST_SCALAR;
4378
4379 default:
4380 return FALSE;
4381 }
4382}

Referenced by shader_glsl_conditional_move(), shader_glsl_get_swizzle(), and shader_glsl_get_write_mask().

◆ shader_match_semantic()

BOOL shader_match_semantic ( const char *  semantic_name,
enum wined3d_decl_usage  usage 
)

Definition at line 366 of file shader.c.

367{
368 return !strcmp(semantic_name, shader_semantic_name_from_usage(usage));
369}
static const char * shader_semantic_name_from_usage(enum wined3d_decl_usage usage)
Definition: shader.c:331
_ACRTIMP int __cdecl strcmp(const char *, const char *)
Definition: string.c:3324

Referenced by glsl_is_color_reg_read(), shader_glsl_generate_vs3_rasterizer_input_setup(), shader_glsl_input_pack(), and shader_glsl_setup_sm3_rasterizer_input().

◆ shader_sampler_is_shadow()

static BOOL shader_sampler_is_shadow ( const struct wined3d_shader *  shader,
const struct ps_compile_args *  ps_args,
unsigned int  resource_idx,
unsigned int  sampler_idx 
)
inlinestatic

Definition at line 4431 of file wined3d_private.h.

4433{
4434 const struct wined3d_shader_version *version = &shader->reg_maps.shader_version;
4435
4436 if (version->major >= 4)
4437 return shader->reg_maps.sampler_comparison_mode & (1u << sampler_idx);
4438 else
4439 return version->type == WINED3D_SHADER_TYPE_PIXEL && (ps_args->shadow & (1u << resource_idx));
4440}
static const WCHAR version[]
Definition: asmname.c:66

Referenced by shader_generate_glsl_declarations(), and shader_glsl_get_sample_function().

◆ shader_vaddline()

int shader_vaddline ( struct wined3d_string_buffer *  buffer,
const char *  fmt,
va_list  args 
)

Definition at line 453 of file shader.c.

454{
455 unsigned int rem;
456 int rc;
457
458 rem = buffer->buffer_size - buffer->content_size;
459 rc = vsnprintf(&buffer->buffer[buffer->content_size], rem, format, args);
460 if (rc < 0 /* C89 */ || (unsigned int)rc >= rem /* C99 */)
461 return rc;
462
463 buffer->content_size += rc;
464 return 0;
465}
#define vsnprintf
Definition: acwin.h:108

Referenced by PRINTF_ATTR(), shader_addline(), and string_buffer_vsprintf().

◆ state_cleanup()

void state_cleanup ( struct wined3d_state *  state)

Definition at line 648 of file stateblock.c.

649{
651 unsigned int i;
652
653 if (!(state->flags & WINED3D_STATE_NO_REF))
655
656 for (i = 0; i < WINED3D_MAX_ACTIVE_LIGHTS; ++i)
657 {
658 state->light_state.lights[i] = NULL;
659 }
660
661 RB_FOR_EACH_ENTRY_DESTRUCTOR(light, cursor, &state->light_state.lights_tree, struct wined3d_light_info, entry)
662 {
663 if (light->changed)
664 list_remove(&light->changed_entry);
665 rb_remove(&state->light_state.lights_tree, &light->entry);
666 free(light);
667 }
668}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
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 light
Definition: glfuncs.h:170
const char cursor[]
Definition: icontest.c:13
#define RB_FOR_EACH_ENTRY_DESTRUCTOR(elem, elem2, tree, type, field)
Definition: rbtree.h:160
static void rb_remove(struct rb_tree *tree, struct rb_entry *entry)
Definition: rbtree.h:272
void state_unbind_resources(struct wined3d_state *state)
Definition: stateblock.c:475
#define WINED3D_STATE_NO_REF
#define WINED3D_MAX_ACTIVE_LIGHTS

Referenced by wined3d_cs_create(), wined3d_cs_destroy(), wined3d_cs_exec_reset_state(), wined3d_device_context_reset_state(), wined3d_device_reset(), wined3d_device_uninit_3d(), and wined3d_state_destroy().

◆ state_clipping()

void state_clipping ( struct wined3d_context *  context,
const struct wined3d_state *  state,
DWORD  state_id 
)

Definition at line 535 of file ffp_gl.c.

536{
537 struct wined3d_context_gl *context_gl = wined3d_context_gl(context);
538 uint32_t enable_mask;
539
540 /* glEnable(GL_CLIP_PLANEx) doesn't apply to (ARB backend) vertex shaders.
541 * The enabled / disabled planes are hardcoded into the shader. Update the
542 * shader to update the enabled clipplanes. In case of fixed function, we
543 * need to update the clipping field from ffp_vertex_settings. */
544 context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX;
545
546 /* If enabling / disabling all
547 * TODO: Is this correct? Doesn't D3DRS_CLIPPING disable clipping on the viewport frustrum?
548 */
549 enable_mask = state->render_states[WINED3D_RS_CLIPPING] ?
550 state->render_states[WINED3D_RS_CLIPPLANEENABLE] : 0;
551 wined3d_context_gl_enable_clip_distances(context_gl, enable_mask);
552}
void wined3d_context_gl_enable_clip_distances(struct wined3d_context_gl *context_gl, uint32_t enable_mask)
Definition: context_gl.c:2408

◆ state_init()

void state_init ( struct wined3d_state *  state,
const struct wined3d_d3d_info *  d3d_info,
uint32_t  flags,
enum wined3d_feature_level  feature_level 
)

Definition at line 2324 of file stateblock.c.

2326{
2327 state->feature_level = feature_level;
2328 state->flags = flags;
2329
2330 rb_init(&state->light_state.lights_tree, lights_compare);
2331
2333 state_init_default(state, d3d_info);
2334}
static void rb_init(struct rb_tree *tree, rb_compare_func_t compare)
Definition: rbtree.h:173
static void state_init_default(struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info)
Definition: stateblock.c:2270
static int lights_compare(const void *key, const struct rb_entry *entry)
Definition: stateblock.c:2316
#define WINED3D_STATE_INIT_DEFAULT

Referenced by wined3d_state_create(), and wined3d_state_reset().

◆ state_nop()

void state_nop ( struct wined3d_context *  context,
const struct wined3d_state *  state,
DWORD  state_id 
)

Definition at line 42 of file ffp_gl.c.

43{
44 TRACE("%s: nop in current pipe config.\n", debug_d3dstate(state_id));
45}

◆ state_shademode()

void state_shademode ( struct wined3d_context *  context,
const struct wined3d_state *  state,
DWORD  state_id 
)

Definition at line 99 of file ffp_gl.c.

100{
101 const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
102
103 switch (state->render_states[WINED3D_RS_SHADEMODE])
104 {
106 gl_info->gl_ops.gl.p_glShadeModel(GL_FLAT);
107 checkGLcall("glShadeModel(GL_FLAT)");
108 break;
110 /* WINED3D_SHADE_PHONG in practice is the same as WINED3D_SHADE_GOURAUD
111 * in D3D. */
113 gl_info->gl_ops.gl.p_glShadeModel(GL_SMOOTH);
114 checkGLcall("glShadeModel(GL_SMOOTH)");
115 break;
116 default:
117 FIXME("Unrecognized shade mode %#x.\n",
118 state->render_states[WINED3D_RS_SHADEMODE]);
119 }
120}
#define GL_SMOOTH
Definition: gl.h:339
#define GL_FLAT
Definition: gl.h:338
struct opengl_funcs gl_ops
Definition: wined3d_gl.h:353
@ WINED3D_SHADE_GOURAUD
Definition: wined3d.h:489
@ WINED3D_SHADE_PHONG
Definition: wined3d.h:490

◆ state_srgbwrite()

void state_srgbwrite ( struct wined3d_context *  context,
const struct wined3d_state *  state,
DWORD  state_id 
)

Definition at line 1266 of file ffp_gl.c.

1267{
1268 const struct wined3d_gl_info *gl_info = wined3d_context_gl(context)->gl_info;
1269
1270 TRACE("context %p, state %p, state_id %#lx.\n", context, state, state_id);
1271
1272 if (needs_srgb_write(context->d3d_info, state, &state->fb))
1273 gl_info->gl_ops.gl.p_glEnable(GL_FRAMEBUFFER_SRGB);
1274 else
1275 gl_info->gl_ops.gl.p_glDisable(GL_FRAMEBUFFER_SRGB);
1276}
#define GL_FRAMEBUFFER_SRGB
Definition: glext.h:1758

◆ state_unbind_resources()

void state_unbind_resources ( struct wined3d_state *  state)

Definition at line 475 of file stateblock.c.

476{
479 struct wined3d_vertex_declaration *decl;
480 struct wined3d_blend_state *blend_state;
481 struct wined3d_rendertarget_view *rtv;
482 struct wined3d_sampler *sampler;
483 struct wined3d_buffer *buffer;
484 struct wined3d_shader *shader;
485 unsigned int i, j;
486
487 if ((decl = state->vertex_declaration))
488 {
489 state->vertex_declaration = NULL;
491 }
492
493 for (i = 0; i < WINED3D_MAX_STREAM_OUTPUT_BUFFERS; ++i)
494 {
495 if ((buffer = state->stream_output[i].buffer))
496 {
497 state->stream_output[i].buffer = NULL;
499 }
500 }
501
502 for (i = 0; i < WINED3D_MAX_STREAMS; ++i)
503 {
504 if ((buffer = state->streams[i].buffer))
505 {
506 state->streams[i].buffer = NULL;
508 }
509 }
510
511 if ((buffer = state->index_buffer))
512 {
513 state->index_buffer = NULL;
515 }
516
517 for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i)
518 {
519 if ((shader = state->shader[i]))
520 {
521 state->shader[i] = NULL;
523 }
524
525 for (j = 0; j < MAX_CONSTANT_BUFFERS; ++j)
526 {
527 if ((buffer = state->cb[i][j].buffer))
528 {
529 state->cb[i][j].buffer = NULL;
531 }
532 }
533
534 for (j = 0; j < MAX_SAMPLER_OBJECTS; ++j)
535 {
536 if ((sampler = state->sampler[i][j]))
537 {
538 state->sampler[i][j] = NULL;
540 }
541 }
542
543 for (j = 0; j < MAX_SHADER_RESOURCE_VIEWS; ++j)
544 {
545 if ((srv = state->shader_resource_view[i][j]))
546 {
547 state->shader_resource_view[i][j] = NULL;
550 }
551 }
552 }
553
554 for (i = 0; i < WINED3D_PIPELINE_COUNT; ++i)
555 {
556 for (j = 0; j < MAX_UNORDERED_ACCESS_VIEWS; ++j)
557 {
558 if ((uav = state->unordered_access_view[i][j]))
559 {
560 state->unordered_access_view[i][j] = NULL;
562 }
563 }
564 }
565
566 if ((blend_state = state->blend_state))
567 {
568 state->blend_state = NULL;
569 wined3d_blend_state_decref(blend_state);
570 }
571
572 for (i = 0; i < ARRAY_SIZE(state->fb.render_targets); ++i)
573 {
574 if ((rtv = state->fb.render_targets[i]))
575 {
576 state->fb.render_targets[i] = NULL;
578 }
579 }
580
581 if ((rtv = state->fb.depth_stencil))
582 {
583 state->fb.depth_stencil = NULL;
585 }
586}
ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
Definition: buffer.c:459
ULONG CDECL wined3d_blend_state_decref(struct wined3d_blend_state *state)
Definition: device.c:284
ULONG CDECL wined3d_shader_decref(struct wined3d_shader *shader)
Definition: shader.c:2588
ULONG CDECL wined3d_unordered_access_view_decref(struct wined3d_unordered_access_view *view)
Definition: view.c:1536
ULONG CDECL wined3d_rendertarget_view_decref(struct wined3d_rendertarget_view *view)
Definition: view.c:379
ULONG CDECL wined3d_shader_resource_view_decref(struct wined3d_shader_resource_view *view)
Definition: view.c:990
GLuint sampler
Definition: glext.h:7283
ULONG CDECL wined3d_sampler_decref(struct wined3d_sampler *sampler)
Definition: sampler.c:35
ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration)
#define WINED3D_MAX_STREAM_OUTPUT_BUFFERS
Definition: wined3d.h:1576
@ WINED3D_PIPELINE_COUNT
Definition: wined3d.h:857
@ WINED3D_SHADER_TYPE_COUNT
Definition: wined3d.h:849
#define MAX_SAMPLER_OBJECTS
#define MAX_CONSTANT_BUFFERS
#define MAX_UNORDERED_ACCESS_VIEWS
static void wined3d_srv_bind_count_dec(struct wined3d_shader_resource_view *srv)
#define MAX_SHADER_RESOURCE_VIEWS

Referenced by state_cleanup(), and wined3d_device_reset().

◆ string_buffer_clear()

◆ string_buffer_free()

◆ string_buffer_get()

Definition at line 484 of file shader.c.

485{
487
488 if (list_empty(&list->list))
489 {
490 buffer = malloc(sizeof(*buffer));
492 {
493 ERR("Couldn't allocate buffer for temporary string.\n");
494 free(buffer);
495 return NULL;
496 }
497 }
498 else
499 {
501 list_remove(&buffer->entry);
502 }
504 return buffer;
505}
static int list_empty(struct list_entry *head)
Definition: list.h:58
Definition: list.h:39
list(size_type __n, const_reference __val=_STLP_DEFAULT_CONSTRUCTED(value_type), const allocator_type &__a=allocator_type())
Definition: _list.h:306
#define malloc
Definition: debug_ros.c:4
void string_buffer_clear(struct wined3d_string_buffer *buffer)
Definition: shader.c:411
Definition: list.h:15
#define LIST_ENTRY(type)
Definition: queue.h:175

Referenced by glsl_blitter_generate_program(), set_glsl_shader_program(), shader_glsl_add_dst_param(), shader_glsl_add_src_param_ext(), shader_glsl_atomic(), shader_glsl_color_correction(), shader_glsl_generate_color_output(), shader_glsl_generate_ffp_fragment_shader(), shader_glsl_generate_ffp_vertex_shader(), shader_glsl_get_sample_function(), shader_glsl_init_ps_uniform_locations(), shader_glsl_init_transform_feedback(), shader_glsl_init_uniform_block_bindings(), shader_glsl_init_vs_uniform_locations(), shader_glsl_ld_raw_structured(), shader_glsl_load_icb(), shader_glsl_load_images(), shader_glsl_load_samplers_range(), shader_glsl_loop(), shader_glsl_setup_vs3_output(), shader_glsl_store_raw_structured(), shader_glsl_texreg2ar(), and shader_glsl_texreg2gb().

◆ string_buffer_init()

BOOL string_buffer_init ( struct wined3d_string_buffer *  buffer)

Definition at line 417 of file shader.c.

418{
419 buffer->buffer_size = 32;
420 if (!(buffer->buffer = malloc(buffer->buffer_size)))
421 {
422 ERR("Failed to allocate shader buffer memory.\n");
423 return FALSE;
424 }
425
427 return TRUE;
428}

Referenced by ffp_hlsl_compile_ps(), ffp_hlsl_compile_vs(), ffp_hlsl_generate_vertex_shader(), shader_glsl_alloc(), and string_buffer_get().

◆ string_buffer_list_cleanup()

void string_buffer_list_cleanup ( struct wined3d_string_buffer_list *  list)

Definition at line 544 of file shader.c.

545{
546 struct wined3d_string_buffer *buffer, *buffer_next;
547
549 {
551 free(buffer);
552 }
554}
static void list_init(struct list_entry *head)
Definition: list.h:51
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:242

Referenced by glsl_blitter_destroy(), and shader_glsl_free().

◆ string_buffer_list_init()

void string_buffer_list_init ( struct wined3d_string_buffer_list *  list)

Definition at line 539 of file shader.c.

540{
542}

Referenced by shader_glsl_alloc(), and wined3d_glsl_blitter_create().

◆ string_buffer_release()

◆ string_buffer_resize()

int BOOL string_buffer_resize ( struct wined3d_string_buffer *  buffer,
int  rc 
)

Definition at line 435 of file shader.c.

436{
437 char *new_buffer;
438 unsigned int new_buffer_size = buffer->buffer_size * 2;
439
440 while (rc > 0 && (unsigned int)rc >= new_buffer_size - buffer->content_size)
441 new_buffer_size *= 2;
442 if (!(new_buffer = realloc(buffer->buffer, new_buffer_size)))
443 {
444 ERR("Failed to grow buffer.\n");
445 buffer->buffer[buffer->content_size] = '\0';
446 return FALSE;
447 }
448 buffer->buffer = new_buffer;
449 buffer->buffer_size = new_buffer_size;
450 return TRUE;
451}

Referenced by PRINTF_ATTR(), shader_addline(), and string_buffer_sprintf().

◆ string_buffer_sprintf()

void string_buffer_sprintf ( struct wined3d_string_buffer *  buffer,
const char *  format,
  ... 
)

◆ swapchain_set_max_frame_latency()

void swapchain_set_max_frame_latency ( struct wined3d_swapchain *  swapchain,
const struct wined3d_device *  device 
)

Definition at line 1374 of file swapchain.c.

1375{
1376 /* Subtract 1 for the implicit OpenGL latency. */
1377 swapchain->max_frame_latency = device->max_frame_latency >= 2 ? device->max_frame_latency - 1 : 1;
1378}
unsigned int max_frame_latency

Referenced by wined3d_device_set_max_frame_latency(), and wined3d_swapchain_init().

◆ swapchain_update_draw_bindings()

void swapchain_update_draw_bindings ( struct wined3d_swapchain *  swapchain)

Definition at line 1814 of file swapchain.c.

1815{
1816 UINT i;
1817
1819
1820 for (i = 0; i < swapchain->state.desc.backbuffer_count; ++i)
1821 {
1822 wined3d_resource_update_draw_binding(&swapchain->back_buffers[i]->resource);
1823 }
1824}
void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
Definition: resource.c:425
struct wined3d_texture ** back_buffers
struct wined3d_texture * front_buffer
struct wined3d_swapchain_state state

Referenced by wined3d_swapchain_resize_buffers().

◆ texture2d_blt()

HRESULT texture2d_blt ( struct wined3d_texture *  dst_texture,
unsigned int  dst_sub_resource_idx,
const struct wined3d_box *  dst_box,
struct wined3d_texture *  src_texture,
unsigned int  src_sub_resource_idx,
const struct wined3d_box *  src_box,
uint32_t  flags,
const struct wined3d_blt_fx *  blt_fx,
enum wined3d_texture_filter_type  filter 
)

Definition at line 1342 of file surface.c.

1346{
1347 struct wined3d_texture_sub_resource *src_sub_resource, *dst_sub_resource;
1348 struct wined3d_device *device = dst_texture->resource.device;
1349 struct wined3d_swapchain *src_swapchain, *dst_swapchain;
1350 BOOL scale, convert, resolve, resolve_typeless = FALSE;
1351 const struct wined3d_format *resolve_format = NULL;
1352 const struct wined3d_color_key *colour_key = NULL;
1353 DWORD src_location, dst_location, valid_locations;
1354 struct wined3d_context *context;
1355 enum wined3d_blit_op blit_op;
1356 RECT src_rect, dst_rect;
1357 bool src_ds, dst_ds;
1358
1359 static const DWORD simple_blit = WINED3D_BLT_SRC_CKEY
1363
1364 TRACE("dst_texture %p, dst_sub_resource_idx %u, dst_box %s, src_texture %p, "
1365 "src_sub_resource_idx %u, src_box %s, flags %#x, fx %p, filter %s.\n",
1366 dst_texture, dst_sub_resource_idx, debug_box(dst_box), src_texture, src_sub_resource_idx,
1368 TRACE("Usage is %s.\n", debug_d3dusage(dst_texture->resource.usage));
1369
1370 if (fx)
1371 {
1372 TRACE("fx %#x.\n", fx->fx);
1373 TRACE("dst_color_key {0x%08x, 0x%08x}.\n",
1374 fx->dst_color_key.color_space_low_value,
1375 fx->dst_color_key.color_space_high_value);
1376 TRACE("src_color_key {0x%08x, 0x%08x}.\n",
1377 fx->src_color_key.color_space_low_value,
1378 fx->src_color_key.color_space_high_value);
1379 TRACE("resolve_format_id %s.\n", debug_d3dformat(fx->resolve_format_id));
1380
1381 if (fx->resolve_format_id != WINED3DFMT_UNKNOWN)
1382 resolve_format = wined3d_get_format(device->adapter, fx->resolve_format_id, 0);
1383 }
1384
1385 dst_sub_resource = &dst_texture->sub_resources[dst_sub_resource_idx];
1386 src_sub_resource = &src_texture->sub_resources[src_sub_resource_idx];
1387
1388 if (src_sub_resource->locations & WINED3D_LOCATION_DISCARDED)
1389 {
1390 WARN("Source sub-resource is discarded, nothing to do.\n");
1391 return WINED3D_OK;
1392 }
1393
1394 SetRect(&src_rect, src_box->left, src_box->top, src_box->right, src_box->bottom);
1395 SetRect(&dst_rect, dst_box->left, dst_box->top, dst_box->right, dst_box->bottom);
1396
1397 if (!fx || !(fx->fx))
1398 flags &= ~WINED3D_BLT_FX;
1399
1400 /* WINED3D_BLT_DO_NOT_WAIT appeared in DX7. */
1402 {
1403 static unsigned int once;
1404
1405 if (!once++)
1406 FIXME("Can't handle WINED3D_BLT_DO_NOT_WAIT flag.\n");
1407 }
1408
1410
1411 if (flags & ~simple_blit)
1412 {
1413 WARN_(d3d_perf)("Using CPU fallback for complex blit (%#x).\n", flags);
1414 goto cpu;
1415 }
1416
1417 src_swapchain = src_texture->swapchain;
1418 dst_swapchain = dst_texture->swapchain;
1419
1420 if (src_swapchain && dst_swapchain && src_swapchain != dst_swapchain
1421 && src_texture == src_swapchain->front_buffer)
1422 {
1423 /* TODO: We could support cross-swapchain blits by first downloading
1424 * the source to a texture. */
1425 FIXME("Cross-swapchain blit not supported.\n");
1427 }
1428
1429 scale = src_box->right - src_box->left != dst_box->right - dst_box->left
1430 || src_box->bottom - src_box->top != dst_box->bottom - dst_box->top;
1431 convert = src_texture->resource.format->id != dst_texture->resource.format->id;
1432 resolve = src_texture->resource.multisample_type != dst_texture->resource.multisample_type;
1433 if (resolve)
1434 {
1435 resolve_typeless = (wined3d_format_is_typeless(src_texture->resource.format)
1436 || wined3d_format_is_typeless(dst_texture->resource.format))
1437 && (src_texture->resource.format->typeless_id == dst_texture->resource.format->typeless_id);
1438 if (resolve_typeless && !resolve_format)
1439 WARN("Resolve format for typeless resolve not specified.\n");
1440 }
1441
1442 dst_ds = dst_texture->resource.format->depth_size || dst_texture->resource.format->stencil_size;
1443 src_ds = src_texture->resource.format->depth_size || src_texture->resource.format->stencil_size;
1444
1445 if (src_ds || dst_ds)
1446 {
1447 TRACE("Depth/stencil blit.\n");
1448
1449 if (dst_texture->resource.access & WINED3D_RESOURCE_ACCESS_GPU)
1450 dst_location = dst_texture->resource.draw_binding;
1451 else
1452 dst_location = dst_texture->resource.map_binding;
1453
1454 if ((flags & WINED3D_BLT_RAW) || (!scale && !convert && !resolve))
1455 blit_op = WINED3D_BLIT_OP_RAW_BLIT;
1456 else
1458
1459 context = context_acquire(device, dst_texture, dst_sub_resource_idx);
1460 valid_locations = device->blitter->ops->blitter_blit(device->blitter, blit_op, context,
1461 src_texture, src_sub_resource_idx, src_texture->resource.draw_binding, &src_rect,
1462 dst_texture, dst_sub_resource_idx, dst_location, &dst_rect, NULL, filter, resolve_format);
1464
1465 wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, valid_locations);
1466 wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~valid_locations);
1467
1468 return WINED3D_OK;
1469 }
1470
1471 TRACE("Colour blit.\n");
1472
1473 /* In principle this would apply to depth blits as well, but we don't
1474 * implement those in the CPU blitter at the moment. */
1475 if ((dst_sub_resource->locations & dst_texture->resource.map_binding)
1476 && (src_sub_resource->locations & src_texture->resource.map_binding))
1477 {
1478 if (scale)
1479 TRACE("Not doing sysmem blit because of scaling.\n");
1480 else if (convert)
1481 TRACE("Not doing sysmem blit because of format conversion.\n");
1482 else
1483 goto cpu;
1484 }
1485
1488 {
1489 colour_key = &fx->src_color_key;
1491 }
1492 else if (flags & WINED3D_BLT_SRC_CKEY)
1493 {
1494 colour_key = &src_texture->async.src_blt_color_key;
1496 }
1497 else if (flags & WINED3D_BLT_ALPHA_TEST)
1498 {
1500 }
1501 else if (sub_resource_is_on_cpu(src_texture, src_sub_resource_idx)
1502 && !sub_resource_is_on_cpu(dst_texture, dst_sub_resource_idx)
1503 && (dst_texture->resource.access & WINED3D_RESOURCE_ACCESS_GPU))
1504 {
1505 /* Upload */
1506 if (scale)
1507 TRACE("Not doing upload because of scaling.\n");
1508 else if (convert)
1509 TRACE("Not doing upload because of format conversion.\n");
1510 else if (dst_texture->resource.format->conv_byte_count)
1511 TRACE("Not doing upload because the destination format needs conversion.\n");
1512 else
1513 {
1514 wined3d_texture_upload_from_texture(dst_texture, dst_sub_resource_idx, dst_box->left,
1515 dst_box->top, dst_box->front, src_texture, src_sub_resource_idx, src_box);
1516 if (!wined3d_resource_is_offscreen(&dst_texture->resource))
1517 {
1518 context = context_acquire(device, dst_texture, dst_sub_resource_idx);
1519 wined3d_texture_load_location(dst_texture, dst_sub_resource_idx,
1520 context, dst_texture->resource.draw_binding);
1522 }
1523 return WINED3D_OK;
1524 }
1525 }
1526 else if (!sub_resource_is_on_cpu(src_texture, src_sub_resource_idx)
1527 && !(dst_texture->resource.access & WINED3D_RESOURCE_ACCESS_GPU))
1528 {
1529 /* Download */
1530 if (scale)
1531 TRACE("Not doing download because of scaling.\n");
1532 else if (convert)
1533 TRACE("Not doing download because of format conversion.\n");
1534 else if (src_texture->resource.format->conv_byte_count)
1535 TRACE("Not doing download because the source format needs conversion.\n");
1536 else if (!(src_texture->flags & WINED3D_TEXTURE_DOWNLOADABLE))
1537 TRACE("Not doing download because texture is not downloadable.\n");
1538 else if (!wined3d_texture_is_full_rect(src_texture, src_sub_resource_idx % src_texture->level_count, &src_rect))
1539 TRACE("Not doing download because of partial download (src).\n");
1540 else if (!wined3d_texture_is_full_rect(dst_texture, dst_sub_resource_idx % dst_texture->level_count, &dst_rect))
1541 TRACE("Not doing download because of partial download (dst).\n");
1542 else
1543 {
1544 wined3d_texture_download_from_texture(dst_texture, dst_sub_resource_idx, src_texture,
1545 src_sub_resource_idx);
1546 return WINED3D_OK;
1547 }
1548 }
1549 else if (dst_swapchain && dst_swapchain->back_buffers
1550 && dst_texture == dst_swapchain->front_buffer
1551 && src_texture == dst_swapchain->back_buffers[0])
1552 {
1553 /* Use present for back -> front blits. The idea behind this is that
1554 * present is potentially faster than a blit, in particular when FBO
1555 * blits aren't available. Some ddraw applications like Half-Life and
1556 * Prince of Persia 3D use Blt() from the backbuffer to the
1557 * frontbuffer instead of doing a Flip(). D3d8 and d3d9 applications
1558 * can't blit directly to the frontbuffer. */
1559 enum wined3d_swap_effect swap_effect = dst_swapchain->state.desc.swap_effect;
1560
1561 TRACE("Using present for backbuffer -> frontbuffer blit.\n");
1562
1563 /* Set the swap effect to COPY, we don't want the backbuffer to become
1564 * undefined. */
1565 dst_swapchain->state.desc.swap_effect = WINED3D_SWAP_EFFECT_COPY;
1566 wined3d_swapchain_present(dst_swapchain, NULL, NULL,
1567 dst_swapchain->win_handle, dst_swapchain->swap_interval, 0);
1568 dst_swapchain->state.desc.swap_effect = swap_effect;
1569
1570 return WINED3D_OK;
1571 }
1572
1573 if ((flags & WINED3D_BLT_RAW) || (blit_op == WINED3D_BLIT_OP_COLOR_BLIT && !scale && !convert && !resolve))
1574 blit_op = WINED3D_BLIT_OP_RAW_BLIT;
1575
1576 context = context_acquire(device, dst_texture, dst_sub_resource_idx);
1577
1578 if (src_texture->resource.multisample_type != WINED3D_MULTISAMPLE_NONE && !resolve_typeless
1579 && ((scale && !context->d3d_info->scaled_resolve)
1580 || convert || !wined3d_is_colour_blit(blit_op)))
1581 src_location = WINED3D_LOCATION_RB_RESOLVED;
1582 else
1583 src_location = src_texture->resource.draw_binding;
1584
1585 if (!(dst_texture->resource.access & WINED3D_RESOURCE_ACCESS_GPU))
1586 dst_location = dst_texture->resource.map_binding;
1587 else if (dst_texture->resource.multisample_type != WINED3D_MULTISAMPLE_NONE
1588 && (scale || convert || !wined3d_is_colour_blit(blit_op)))
1589 dst_location = WINED3D_LOCATION_RB_RESOLVED;
1590 else
1591 dst_location = dst_texture->resource.draw_binding;
1592
1593 valid_locations = device->blitter->ops->blitter_blit(device->blitter, blit_op, context,
1594 src_texture, src_sub_resource_idx, src_location, &src_rect,
1595 dst_texture, dst_sub_resource_idx, dst_location, &dst_rect, colour_key, filter, resolve_format);
1596
1598
1599 wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, valid_locations);
1600 wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~valid_locations);
1601
1602 return WINED3D_OK;
1603
1604cpu:
1605 return surface_cpu_blt(dst_texture, dst_sub_resource_idx, dst_box,
1606 src_texture, src_sub_resource_idx, src_box, flags, fx, filter);
1607}
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource)
Definition: resource.c:406
static HRESULT surface_cpu_blt(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const struct wined3d_box *dst_box, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, uint32_t flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
Definition: surface.c:596
static bool sub_resource_is_on_cpu(const struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: surface.c:1329
static bool wined3d_is_colour_blit(enum wined3d_blit_op blit_op)
Definition: surface.c:1315
void wined3d_texture_validate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, uint32_t location)
Definition: texture.c:678
void wined3d_texture_upload_from_texture(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box)
Definition: texture.c:4335
void wined3d_texture_download_from_texture(struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx)
Definition: texture.c:4381
const char * debug_d3dusage(uint32_t usage)
Definition: utils.c:4895
const struct wined3d_format * wined3d_get_format(const struct wined3d_adapter *adapter, enum wined3d_format_id format_id, unsigned int bind_flags)
Definition: utils.c:4428
const char * debug_d3dtexturefiltertype(enum wined3d_texture_filter_type filter_type)
Definition: utils.c:5194
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
int convert
Definition: msacm.c:1374
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
Definition: dcommon.idl:28
Definition: filter.c:165
UINT left
Definition: wined3d.h:1873
UINT right
Definition: wined3d.h:1875
UINT front
Definition: wined3d.h:1877
UINT bottom
Definition: wined3d.h:1876
UINT top
Definition: wined3d.h:1874
unsigned int swap_interval
struct wined3d_texture::wined3d_texture_sub_resource * sub_resources
struct wined3d_swapchain * swapchain
struct wined3d_resource resource
struct wined3d_texture::wined3d_texture_async async
unsigned int level_count
GLfixed fx
Definition: tritemp.h:484
HRESULT CDECL wined3d_swapchain_present(struct wined3d_swapchain *swapchain, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, unsigned int swap_interval, uint32_t flags)
Definition: swapchain.c:192
@ WINED3D_MULTISAMPLE_NONE
Definition: wined3d.h:573
#define WINED3D_BLT_ALPHA_TEST
Definition: wined3d.h:1373
wined3d_swap_effect
Definition: wined3d.h:533
@ WINED3D_SWAP_EFFECT_COPY
Definition: wined3d.h:538
#define WINED3D_RESOURCE_ACCESS_GPU
Definition: wined3d.h:51
#define WINED3D_BLT_SRC_CKEY
Definition: wined3d.h:1367
#define WINED3D_BLT_SRC_CKEY_OVERRIDE
Definition: wined3d.h:1368
#define WINED3D_BLT_SYNCHRONOUS
Definition: wined3d.h:1372
#define WINED3D_BLT_DO_NOT_WAIT
Definition: wined3d.h:1370
#define WINED3D_BLT_WAIT
Definition: wined3d.h:1369
#define WINED3D_BLT_RAW
Definition: wined3d.h:1371
static BOOL wined3d_format_is_typeless(const struct wined3d_format *format)
#define WINED3D_TEXTURE_DOWNLOADABLE
static bool wined3d_texture_is_full_rect(const struct wined3d_texture *texture, unsigned int level, const RECT *r)
#define WINED3D_LOCATION_RB_RESOLVED
#define WINED3D_LOCATION_DISCARDED
wined3d_blit_op

Referenced by wined3d_cs_exec_blt_sub_resource().

◆ texture_from_resource()

static struct wined3d_texture * texture_from_resource ( struct wined3d_resource *  resource)
inlinestatic

Definition at line 3469 of file wined3d_private.h.

3470{
3472}

Referenced by adapter_gl_alloc_bo(), adapter_vk_alloc_bo(), blitter_use_cpu_clear(), context_generate_rt_mask_from_resource(), context_gl_load_shader_resources(), context_gl_load_unordered_access_resources(), cpu_blitter_clear_rtv(), ffp_blitter_clear_rendertargets(), find_ps_compile_args(), mark_managed_resource_dirty(), texture_resource_decref(), texture_resource_incref(), texture_resource_preload(), texture_resource_sub_resource_get_desc(), texture_resource_sub_resource_get_map_pitch(), texture_resource_sub_resource_map(), texture_resource_sub_resource_unmap(), texture_resource_unload(), validate_resource_view(), vk_blitter_clear_rendertargets(), wined3d_context_gl_bind_unordered_access_views(), wined3d_context_gl_generate_rt_mask_no_fbo(), wined3d_context_vk_begin_render_pass(), wined3d_context_vk_load_shader_resources(), wined3d_context_vk_reference_resource(), wined3d_cs_exec_blt_sub_resource(), wined3d_cs_exec_present(), wined3d_cs_exec_set_depth_stencil_view(), wined3d_cs_exec_update_sub_resource(), wined3d_device_context_copy_resource(), wined3d_device_context_copy_sub_resource_region(), wined3d_device_context_generate_mipmaps(), wined3d_device_context_resolve_sub_resource(), wined3d_render_target_view_gl_cs_init(), wined3d_render_target_view_vk_cs_init(), wined3d_rendertarget_view_get_box(), wined3d_rendertarget_view_get_drawable_size(), wined3d_rendertarget_view_get_locations(), wined3d_rendertarget_view_get_sub_resource_parent(), wined3d_rendertarget_view_init(), wined3d_rendertarget_view_prepare_location(), wined3d_rendertarget_view_validate_location(), wined3d_resource_is_offscreen(), wined3d_resource_vk_barrier(), wined3d_rtv_all_subresources(), wined3d_shader_descriptor_writes_vk_add_srv_write(), wined3d_shader_descriptor_writes_vk_add_uav_write(), wined3d_shader_resource_view_gl_cs_init(), wined3d_shader_resource_view_gl_generate_mipmap(), wined3d_shader_resource_view_vk_cs_init(), wined3d_shader_resource_view_vk_generate_mipmap(), wined3d_srv_all_subresources(), wined3d_state_get_ffp_texture(), wined3d_texture_from_resource(), wined3d_unordered_access_view_gl_clear(), wined3d_unordered_access_view_gl_cs_init(), wined3d_unordered_access_view_vk_cs_init(), wined3d_view_invalidate_location(), and wined3d_view_load_location().

◆ use_ps()

static BOOL use_ps ( const struct wined3d_state *  state)
inlinestatic

◆ use_transform_feedback()

static BOOL use_transform_feedback ( const struct wined3d_state *  state)
inlinestatic

Definition at line 4617 of file wined3d_private.h.

4618{
4619 const struct wined3d_shader *shader;
4620
4621 if (!(shader = state->shader[WINED3D_SHADER_TYPE_GEOMETRY]))
4622 return FALSE;
4623 return !!shader->u.gs.so_desc;
4624}

Referenced by draw_primitive(), and wined3d_context_vk_load_buffers().

◆ use_vs()

static BOOL use_vs ( const struct wined3d_state *  state)
inlinestatic

Definition at line 4604 of file wined3d_private.h.

4605{
4606 /* Check state->vertex_declaration to allow this to be used before the
4607 * stream info is validated, for example in device_update_tex_unit_map(). */
4608 return state->shader[WINED3D_SHADER_TYPE_VERTEX]
4609 && (!state->vertex_declaration || !state->vertex_declaration->position_transformed);
4610}

Referenced by find_ps_compile_args(), glsl_fragment_pipe_fog(), glsl_vertex_pipe_vdecl(), set_glsl_shader_program(), use_ffp_ps(), wined3d_context_gl_update_tex_unit_map(), wined3d_ffp_get_fs_settings(), and wined3d_stream_info_from_declaration().

◆ validate_material_colour_source()

static enum wined3d_material_color_source validate_material_colour_source ( const struct wined3d_vertex_declaration *  vdecl,
enum wined3d_material_color_source  source 
)
inlinestatic

Definition at line 4726 of file wined3d_private.h.

4728{
4729 if (source == WINED3D_MCS_COLOR1 && vdecl->diffuse)
4730 return source;
4731 if (source == WINED3D_MCS_COLOR2 && vdecl->specular)
4732 return source;
4733 return WINED3D_MCS_MATERIAL;
4734}
@ WINED3D_MCS_COLOR2
Definition: wined3d.h:523
@ WINED3D_MCS_MATERIAL
Definition: wined3d.h:521
@ WINED3D_MCS_COLOR1
Definition: wined3d.h:522

Referenced by wined3d_get_material_colour_source().

◆ vkd3d_shader_visibility_from_wined3d()

enum vkd3d_shader_visibility vkd3d_shader_visibility_from_wined3d ( enum wined3d_shader_type  shader_type)

Definition at line 309 of file shader.c.

310{
311 switch (shader_type)
312 {
325 default:
326 ERR("Invalid shader type %s.\n", debug_shader_type(shader_type));
328 }
329}
@ VKD3D_SHADER_VISIBILITY_DOMAIN
Definition: vkd3d_shader.h:391
@ VKD3D_SHADER_VISIBILITY_COMPUTE
Definition: vkd3d_shader.h:398
@ VKD3D_SHADER_VISIBILITY_PIXEL
Definition: vkd3d_shader.h:395
@ VKD3D_SHADER_VISIBILITY_ALL
Definition: vkd3d_shader.h:385
@ VKD3D_SHADER_VISIBILITY_GEOMETRY
Definition: vkd3d_shader.h:393
@ VKD3D_SHADER_VISIBILITY_VERTEX
Definition: vkd3d_shader.h:387
@ VKD3D_SHADER_VISIBILITY_HULL
Definition: vkd3d_shader.h:389

Referenced by create_combined_resource_sampler_bindings(), create_resource_bindings(), and shader_spirv_resource_bindings_init().

◆ vshader_get_input()

bool vshader_get_input ( const struct wined3d_shader *  shader,
uint8_t  usage_req,
uint8_t  usage_idx_req,
unsigned int *  regnum 
)

Definition at line 2766 of file shader.c.

2768{
2769 uint32_t map = shader->reg_maps.input_registers & 0xffff;
2770 unsigned int i;
2771
2772 while (map)
2773 {
2775 if (match_usage(shader->u.vs.attributes[i].usage,
2776 shader->u.vs.attributes[i].usage_idx, usage_req, usage_idx_req))
2777 {
2778 *regnum = i;
2779 return true;
2780 }
2781 }
2782
2783 return false;
2784}
static BOOL match_usage(BYTE usage1, BYTE usage_idx1, BYTE usage2, BYTE usage_idx2)
Definition: shader.c:2752

Referenced by wined3d_stream_info_from_declaration().

◆ wined3d_adapter_cleanup()

void wined3d_adapter_cleanup ( struct wined3d_adapter *  adapter)

Definition at line 176 of file directx.c.

177{
178 D3DKMT_CLOSEADAPTER close_adapter_desc;
179 unsigned int output_idx;
180
181 for (output_idx = 0; output_idx < adapter->output_count; ++output_idx)
182 wined3d_output_cleanup(&adapter->outputs[output_idx]);
183 free(adapter->outputs);
184 free(adapter->formats);
185 close_adapter_desc.hAdapter = adapter->kmt_adapter;
186 D3DKMTCloseAdapter(&close_adapter_desc);
187}
D3DKMT_HANDLE hAdapter
Definition: d3dkmthk.h:156
NTSTATUS WINAPI D3DKMTCloseAdapter(const D3DKMT_CLOSEADAPTER *desc)
static void wined3d_output_cleanup(const struct wined3d_output *output)
Definition: directx.c:118

Referenced by adapter_gl_destroy(), adapter_no3d_destroy(), adapter_vk_destroy(), wined3d_adapter_no3d_create(), and wined3d_adapter_vk_init().

◆ wined3d_adapter_gl_create()

struct wined3d_adapter * wined3d_adapter_gl_create ( unsigned int  ordinal,
unsigned int  wined3d_creation_flags 
)

Definition at line 5190 of file adapter_gl.c.

5191{
5193
5194 if (!(adapter = calloc(1, sizeof(*adapter))))
5195 return NULL;
5196
5197 if (!wined3d_adapter_gl_init(adapter, ordinal, wined3d_creation_flags))
5198 {
5199 free(adapter);
5200 return NULL;
5201 }
5202
5203 TRACE("Created adapter %p.\n", adapter);
5204
5205 return &adapter->a;
5206}
static BOOL wined3d_adapter_gl_init(struct wined3d_adapter_gl *adapter_gl, unsigned int ordinal, unsigned int wined3d_creation_flags)
Definition: adapter_gl.c:5031

Referenced by wined3d_adapter_create().

◆ wined3d_adapter_init()

BOOL wined3d_adapter_init ( struct wined3d_adapter *  adapter,
unsigned int  ordinal,
const LUID *  luid,
const struct wined3d_adapter_ops *  adapter_ops 
)

Definition at line 3383 of file directx.c.

3385{
3386 D3DKMT_OPENADAPTERFROMLUID open_adapter_desc;
3387 unsigned int output_idx = 0, primary_idx = 0;
3388 D3DKMT_CLOSEADAPTER close_adapter_desc;
3389 DISPLAY_DEVICEW display_device;
3390 BOOL ret = FALSE;
3391
3392 adapter->ordinal = ordinal;
3393 adapter->output_count = 0;
3394 adapter->outputs = NULL;
3395
3396 if (luid)
3397 {
3398 adapter->luid = *luid;
3399 }
3400 else
3401 {
3402 WARN("Allocating a random LUID.\n");
3403 if (!AllocateLocallyUniqueId(&adapter->luid))
3404 {
3405 ERR("Failed to allocate a LUID, error %#lx.\n", GetLastError());
3406 return FALSE;
3407 }
3408 }
3409 TRACE("adapter %p LUID %08lx:%08lx.\n", adapter, adapter->luid.HighPart, adapter->luid.LowPart);
3410
3411 open_adapter_desc.AdapterLuid = adapter->luid;
3412 if (D3DKMTOpenAdapterFromLuid(&open_adapter_desc))
3413 return FALSE;
3414 adapter->kmt_adapter = open_adapter_desc.hAdapter;
3415
3416 display_device.cb = sizeof(display_device);
3417 while (EnumDisplayDevicesW(NULL, output_idx++, &display_device, 0))
3418 {
3419 /* Detached outputs are not enumerated */
3420 if (!(display_device.StateFlags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP))
3421 continue;
3422
3423 if (display_device.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE)
3424 primary_idx = adapter->output_count;
3425
3426 if (!wined3d_adapter_create_output(adapter, display_device.DeviceName))
3427 goto done;
3428 }
3429 TRACE("Initialised %Iu outputs for adapter %p.\n", adapter->output_count, adapter);
3430
3431 /* Make the primary output first */
3432 if (primary_idx)
3433 {
3434 struct wined3d_output tmp = adapter->outputs[0];
3435 adapter->outputs[0] = adapter->outputs[primary_idx];
3436 adapter->outputs[0].ordinal = 0;
3437 adapter->outputs[primary_idx] = tmp;
3438 adapter->outputs[primary_idx].ordinal = primary_idx;
3439 }
3440
3441 memset(&adapter->driver_uuid, 0, sizeof(adapter->driver_uuid));
3442 memset(&adapter->device_uuid, 0, sizeof(adapter->device_uuid));
3443
3444 adapter->formats = NULL;
3445 adapter->adapter_ops = adapter_ops;
3446 ret = TRUE;
3447done:
3448 if (!ret)
3449 {
3450 for (output_idx = 0; output_idx < adapter->output_count; ++output_idx)
3451 wined3d_output_cleanup(&adapter->outputs[output_idx]);
3452 free(adapter->outputs);
3453 close_adapter_desc.hAdapter = adapter->kmt_adapter;
3454 D3DKMTCloseAdapter(&close_adapter_desc);
3455 }
3456 return ret;
3457}
BOOL WINAPI AllocateLocallyUniqueId(PLUID Luid)
Definition: security.c:1218
D3DKMT_HANDLE hAdapter
Definition: d3dkmthk.h:135
WCHAR DeviceName[32]
Definition: wingdi.h:3264
DWORD StateFlags
Definition: wingdi.h:3266
BOOL WINAPI EnumDisplayDevicesW(LPCWSTR lpDevice, DWORD iDevNum, PDISPLAY_DEVICEW lpDisplayDevice, DWORD dwFlags)
Definition: display.c:78
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
NTSTATUS WINAPI D3DKMTOpenAdapterFromLuid(D3DKMT_OPENADAPTERFROMLUID *desc)
static BOOL wined3d_adapter_create_output(struct wined3d_adapter *adapter, const WCHAR *output_name)
Definition: directx.c:3363
#define DISPLAY_DEVICE_PRIMARY_DEVICE
Definition: wingdi.h:1398
#define DISPLAY_DEVICE_ATTACHED_TO_DESKTOP
Definition: wingdi.h:1396

Referenced by wined3d_adapter_gl_init(), wined3d_adapter_no3d_create(), and wined3d_adapter_vk_init().

◆ wined3d_adapter_no3d_init_format_info()

BOOL wined3d_adapter_no3d_init_format_info ( struct wined3d_adapter *  adapter)

Definition at line 4135 of file utils.c.

4136{
4137 struct wined3d_format *format;
4138 unsigned int i;
4139
4140 static const enum wined3d_format_id blit_formats[] =
4141 {
4159 };
4160
4162 return FALSE;
4163
4164 for (i = 0; i < ARRAY_SIZE(blit_formats); ++i)
4165 {
4166 if (!(format = get_format_internal(adapter, blit_formats[i])))
4167 return FALSE;
4168
4171 }
4172
4173 return TRUE;
4174}
static struct wined3d_format * get_format_internal(const struct wined3d_adapter *adapter, enum wined3d_format_id format_id)
Definition: utils.c:1968
static BOOL wined3d_adapter_init_format_info(struct wined3d_adapter *adapter, size_t format_size)
Definition: utils.c:4107
wined3d_format_id
Definition: wined3d.h:126
#define WINED3D_FORMAT_CAP_BLIT

Referenced by wined3d_adapter_no3d_create().

◆ wined3d_adapter_vk_create()

struct wined3d_adapter * wined3d_adapter_vk_create ( unsigned int  ordinal,
unsigned int  wined3d_creation_flags 
)

Definition at line 2555 of file adapter_vk.c.

2557{
2558 struct wined3d_adapter_vk *adapter_vk;
2559
2560 if (!(adapter_vk = calloc(1, sizeof(*adapter_vk))))
2561 return NULL;
2562
2563 if (!wined3d_adapter_vk_init(adapter_vk, ordinal, wined3d_creation_flags))
2564 {
2565 free(adapter_vk);
2566 return NULL;
2567 }
2568
2569 TRACE("Created adapter %p.\n", adapter_vk);
2570
2571 return &adapter_vk->a;
2572}
static BOOL wined3d_adapter_vk_init(struct wined3d_adapter_vk *adapter_vk, unsigned int ordinal, unsigned int wined3d_creation_flags)
Definition: adapter_vk.c:2476
struct wined3d_adapter a
Definition: wined3d_vk.h:726

Referenced by wined3d_adapter_create().

◆ wined3d_allocator_allocate()

struct wined3d_allocator_block * wined3d_allocator_allocate ( struct wined3d_allocator *  allocator,
struct wined3d_context *  context,
unsigned int  memory_type,
size_t  size 
)

Definition at line 7234 of file utils.c.

7236{
7239 unsigned int order;
7240
7242 return NULL;
7243
7246 else
7248
7249 LIST_FOR_EACH_ENTRY(chunk, &allocator->pools[memory_type].chunks, struct wined3d_allocator_chunk, entry)
7250 {
7252 return block;
7253 }
7254
7255 if (!(chunk = allocator->ops->allocator_create_chunk(allocator,
7256 context, memory_type, WINED3D_ALLOCATOR_CHUNK_SIZE)))
7257 return NULL;
7258
7260 return NULL;
7261
7262 return block;
7263}
static struct wined3d_allocator_block * wined3d_allocator_chunk_allocate(struct wined3d_allocator_chunk *chunk, unsigned int order)
Definition: utils.c:7187
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
#define WINED3D_ALLOCATOR_MIN_BLOCK_SIZE
#define WINED3D_ALLOCATOR_CHUNK_ORDER_COUNT
#define WINED3D_ALLOCATOR_CHUNK_SIZE
static unsigned int block
Definition: xmlmemory.c:101

Referenced by wined3d_context_vk_allocate_memory(), and wined3d_device_gl_allocate_memory().

◆ wined3d_allocator_block_free()

void wined3d_allocator_block_free ( struct wined3d_allocator_block *  block)

Definition at line 7087 of file utils.c.

7088{
7089 struct wined3d_allocator *allocator = block->chunk->allocator;
7091
7092 while ((parent = block->parent) && block->sibling->free)
7093 {
7094 list_remove(&block->sibling->entry);
7097 block = parent;
7098 }
7099
7100 block->free = true;
7101 list_add_head(&block->chunk->available[block->order], &block->entry);
7102}
static void wined3d_allocator_release_block(struct wined3d_allocator *allocator, struct wined3d_allocator_block *block)
Definition: utils.c:7067
r parent
Definition: btrfs.c:3010

Referenced by wined3d_context_vk_free_memory(), and wined3d_device_gl_free_memory().

◆ wined3d_allocator_chunk_cleanup()

void wined3d_allocator_chunk_cleanup ( struct wined3d_allocator_chunk *  chunk)

Definition at line 7117 of file utils.c.

7118{
7120 size_t i;
7121
7122 if (list_empty(&chunk->available[0]))
7123 {
7124 ERR("Chunk %p is not empty.\n", chunk);
7125 return;
7126 }
7127
7128 for (i = 1; i < ARRAY_SIZE(chunk->available); ++i)
7129 {
7130 if (!list_empty(&chunk->available[i]))
7131 {
7132 ERR("Chunk %p is not empty.\n", chunk);
7133 return;
7134 }
7135 }
7136
7137 block = LIST_ENTRY(list_head(&chunk->available[0]), struct wined3d_allocator_block, entry);
7139}

Referenced by wined3d_allocator_gl_create_chunk(), wined3d_allocator_gl_destroy_chunk(), wined3d_allocator_vk_create_chunk(), and wined3d_allocator_vk_destroy_chunk().

◆ wined3d_allocator_chunk_init()

bool wined3d_allocator_chunk_init ( struct wined3d_allocator_chunk *  chunk,
struct wined3d_allocator *  allocator 
)

Definition at line 7141 of file utils.c.

7142{
7144 unsigned int i;
7145
7147 return false;
7149
7150 list_init(&chunk->entry);
7151 for (i = 0; i < ARRAY_SIZE(chunk->available); ++i)
7152 {
7153 list_init(&chunk->available[i]);
7154 }
7155 list_add_head(&chunk->available[0], &block->entry);
7156 chunk->allocator = allocator;
7157 chunk->map_count = 0;
7158 chunk->map_ptr = NULL;
7159
7160 return true;
7161}
static struct wined3d_allocator_block * wined3d_allocator_acquire_block(struct wined3d_allocator *allocator)
Definition: utils.c:7074
static void wined3d_allocator_block_init(struct wined3d_allocator_block *block, struct wined3d_allocator_chunk *chunk, struct wined3d_allocator_block *parent, struct wined3d_allocator_block *sibling, unsigned int order, size_t offset, bool free)
Definition: utils.c:7104

Referenced by wined3d_allocator_gl_create_chunk(), and wined3d_allocator_vk_create_chunk().

◆ wined3d_allocator_cleanup()

void wined3d_allocator_cleanup ( struct wined3d_allocator *  allocator)

Definition at line 7163 of file utils.c.

7164{
7165 struct wined3d_allocator_chunk *chunk, *chunk2;
7167 size_t i;
7168
7169 for (i = 0; i < allocator->pool_count; ++i)
7170 {
7171 LIST_FOR_EACH_ENTRY_SAFE(chunk, chunk2, &allocator->pools[i].chunks, struct wined3d_allocator_chunk, entry)
7172 {
7173 list_remove(&chunk->entry);
7174 allocator->ops->allocator_destroy_chunk(chunk);
7175 }
7176 }
7177 free(allocator->pools);
7178
7179 next = allocator->free;
7180 while ((block = next))
7181 {
7182 next = block->parent;
7183 free(block);
7184 }
7185}
static unsigned __int64 next
Definition: rand_nt.c:6

Referenced by adapter_vk_create_device(), adapter_vk_destroy_device(), wined3d_device_gl_create_primary_opengl_context_cs(), and wined3d_device_gl_delete_opengl_contexts_cs().

◆ wined3d_allocator_init()

bool wined3d_allocator_init ( struct wined3d_allocator *  allocator,
size_t  pool_count,
const struct wined3d_allocator_ops *  allocator_ops 
)

Definition at line 7265 of file utils.c.

7267{
7268 size_t i;
7269
7270 allocator->ops = allocator_ops;
7271 allocator->pool_count = pool_count;
7272 if (!(allocator->pools = calloc(pool_count, sizeof(*allocator->pools))))
7273 return false;
7274 for (i = 0; i < pool_count; ++i)
7275 {
7276 list_init(&allocator->pools[i].chunks);
7277 }
7278
7279 allocator->free = NULL;
7280
7281 return true;
7282}

Referenced by adapter_vk_create_device(), and wined3d_device_gl_create_primary_opengl_context_cs().

◆ wined3d_array_reserve()

BOOL wined3d_array_reserve ( void **  elements,
SIZE_T *  capacity,
SIZE_T  count,
SIZE_T  size 
)

Definition at line 6740 of file utils.c.

6741{
6742 SIZE_T max_capacity, new_capacity;
6743 void *new_elements;
6744
6745 if (count <= *capacity)
6746 return TRUE;
6747
6748 max_capacity = ~(SIZE_T)0 / size;
6749 if (count > max_capacity)
6750 return FALSE;
6751
6752 new_capacity = max(1, *capacity);
6753 while (new_capacity < count && new_capacity <= max_capacity / 2)
6754 new_capacity *= 2;
6755 if (new_capacity < count)
6756 new_capacity = count;
6757
6758 new_elements = _recalloc(*elements, new_capacity, size);
6759 if (!new_elements)
6760 return FALSE;
6761
6762 *elements = new_elements;
6763 *capacity = new_capacity;
6764 return TRUE;
6765}
_ACRTIMP void *__cdecl _recalloc(void *, size_t, size_t) __WINE_ALLOC_SIZE(2
GLuint GLuint GLsizei count
Definition: gl.h:1545
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by buffer_invalidate_bo_range(), shader_record_shader_phase(), shader_reg_maps_add_tgsm(), shader_spirv_find_graphics_program_variant_vk(), shader_spirv_resource_bindings_add_binding(), shader_spirv_resource_bindings_add_vk_binding(), wined3d_adapter_create_output(), wined3d_adapter_vk_init_device_extensions(), wined3d_buffer_init(), wined3d_context_gl_destroy_allocator_block(), wined3d_context_gl_free_fence(), wined3d_context_gl_free_occlusion_query(), wined3d_context_gl_free_pipeline_statistics_query(), wined3d_context_gl_free_so_statistics_query(), wined3d_context_gl_free_timestamp_query(), wined3d_context_gl_submit_command_fence(), wined3d_context_vk_get_retired_object_vk(), wined3d_context_vk_get_vk_descriptor_pool(), wined3d_context_vk_remove_command_buffer(), wined3d_context_vk_return_vk_descriptor_pool(), wined3d_context_vk_submit_command_buffer(), wined3d_deferred_context_issue_query(), wined3d_deferred_context_map_upload_bo(), wined3d_deferred_context_reference_command_list(), wined3d_deferred_context_reference_resource(), wined3d_deferred_context_require_space(), wined3d_output_update_modes(), wined3d_query_vk_suspend(), wined3d_register_window(), wined3d_shader_descriptor_writes_vk_add_write(), wined3d_shader_resource_bindings_add_binding(), wined3d_swapchain_state_register(), and wined3d_texture_dirty_region_add().

◆ wined3d_atomic_decrement_mutex_lock()

static ULONG wined3d_atomic_decrement_mutex_lock ( volatile LONG *  refcount)
inlinestatic

Definition at line 3184 of file wined3d_private.h.

3185{
3186 ULONG count, old_count = *refcount;
3187 do
3188 {
3189 if ((count = old_count) == 1)
3190 {
3192 count = InterlockedDecrement(refcount);
3194 return count;
3195 }
3196
3197 old_count = InterlockedCompareExchange(refcount, count - 1, count);
3198 }
3199 while (old_count != count);
3200
3201 return count - 1;
3202}
#define InterlockedDecrement
Definition: armddk.h:52
#define InterlockedCompareExchange
Definition: interlocked.h:119
uint32_t ULONG
Definition: typedefs.h:59
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:544
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:539

Referenced by wined3d_blend_state_decref(), wined3d_depth_stencil_state_decref(), wined3d_rasterizer_state_decref(), and wined3d_sampler_decref().

◆ wined3d_bind_layer_count()

static unsigned int wined3d_bind_layer_count ( const struct wined3d_texture *  texture)
inlinestatic

Definition at line 4845 of file wined3d_private.h.

4846{
4847 return texture->resource.type == WINED3D_RTYPE_TEXTURE_3D ? texture->resource.depth : texture->layer_count;
4848}

Referenced by wined3d_rtv_all_subresources(), and wined3d_srv_all_subresources().

◆ wined3d_bitmap_clear()

static BOOL wined3d_bitmap_clear ( uint32_t *  map,
unsigned int  idx 
)
inlinestatic

Definition at line 4940 of file wined3d_private.h.

4941{
4942 return map[idx >> 5] &= ~(1u << (idx & 0x1f));
4943}

Referenced by wined3d_query_pool_vk_mark_free().

◆ wined3d_bitmap_ffs()

static unsigned int wined3d_bitmap_ffs ( const uint32_t *  bitmap,
unsigned int  bit_count,
unsigned int  start 
)
inlinestatic

Definition at line 4981 of file wined3d_private.h.

4982{
4983 return wined3d_bitmap_ffs_xor(bitmap, bit_count, start, 0);
4984}
Definition: uimain.c:89
static unsigned int wined3d_bitmap_ffs_xor(const uint32_t *bitmap, unsigned int bit_count, unsigned int start, uint32_t xor_mask)

Referenced by wined3d_bitmap_get_range().

◆ wined3d_bitmap_ffs_xor()

static unsigned int wined3d_bitmap_ffs_xor ( const uint32_t *  bitmap,
unsigned int  bit_count,
unsigned int  start,
uint32_t  xor_mask 
)
inlinestatic

Definition at line 4955 of file wined3d_private.h.

4957{
4958 const unsigned int word_bit_count = sizeof(*bitmap) * CHAR_BIT;
4959 const uint32_t *ptr, *end_ptr;
4960 uint32_t map, mask;
4961
4962 assert(bit_count < word_bit_count || !(bit_count % word_bit_count));
4963
4964 ptr = bitmap + start / word_bit_count;
4965 end_ptr = bitmap + (bit_count + word_bit_count - 1) / word_bit_count;
4966
4967 if (ptr >= end_ptr)
4968 return ~0u;
4969
4970 mask = ~0u << start % word_bit_count;
4971 map = (*ptr ^ xor_mask) & mask;
4972 while (!map)
4973 {
4974 if (++ptr == end_ptr)
4975 return ~0u;
4976 map = *ptr ^ xor_mask;
4977 }
4978 return (ptr - bitmap) * word_bit_count + wined3d_bit_scan(&map);
4979}
GLenum GLint GLuint mask
Definition: glext.h:6028

Referenced by wined3d_bitmap_ffs(), and wined3d_bitmap_ffz().

◆ wined3d_bitmap_ffz()

static unsigned int wined3d_bitmap_ffz ( const uint32_t *  bitmap,
unsigned int  bit_count,
unsigned int  start 
)
inlinestatic

Definition at line 4986 of file wined3d_private.h.

4987{
4988 return wined3d_bitmap_ffs_xor(bitmap, bit_count, start, ~0u);
4989}

Referenced by wined3d_bitmap_get_range(), and wined3d_query_pool_vk_allocate_query().

◆ wined3d_bitmap_get_range()

static BOOL wined3d_bitmap_get_range ( const uint32_t *  bitmap,
unsigned int  bit_count,
unsigned int  start,
struct wined3d_range *  range 
)
inlinestatic

Definition at line 4991 of file wined3d_private.h.

4993{
4994 unsigned int range_start, range_end;
4995
4996 range_start = wined3d_bitmap_ffs(bitmap, bit_count, start);
4997 if (range_start == ~0u)
4998 return FALSE;
4999
5000 range_end = wined3d_bitmap_ffz(bitmap, bit_count, range_start + 1);
5001 if (range_end == ~0u)
5002 range_end = bit_count;
5003
5004 range->offset = range_start;
5005 range->size = range_end - range_start;
5006 return TRUE;
5007}
static unsigned int wined3d_bitmap_ffs(const uint32_t *bitmap, unsigned int bit_count, unsigned int start)
static unsigned int wined3d_bitmap_ffz(const uint32_t *bitmap, unsigned int bit_count, unsigned int start)

Referenced by wined3d_context_vk_reset_completed_queries(), wined3d_device_apply_stateblock(), wined3d_stateblock_apply(), and wined3d_stateblock_capture().

◆ wined3d_bitmap_is_set()

static BOOL wined3d_bitmap_is_set ( const uint32_t *  map,
unsigned int  idx 
)
inlinestatic

◆ wined3d_bitmap_set()

static BOOL wined3d_bitmap_set ( uint32_t *  map,
unsigned int  idx 
)
inlinestatic

Definition at line 4945 of file wined3d_private.h.

4946{
4947 return map[idx >> 5] |= (1u << (idx & 0x1f));
4948}

Referenced by shader_get_registers_used(), wined3d_query_pool_vk_allocate_query(), and wined3d_query_pool_vk_mark_complete().

◆ wined3d_blend_state_get_writemask()

static unsigned int wined3d_blend_state_get_writemask ( const struct wined3d_blend_state *  state,
unsigned int  index 
)
inlinestatic

Definition at line 2879 of file wined3d_private.h.

2881{
2882 if (!state)
2883 return 0xf;
2884 if (!state->desc.independent)
2885 index = 0;
2886 return state->desc.rt[index].writemask;
2887}

Referenced by draw_primitive(), and wined3d_context_vk_apply_draw_state().

◆ wined3d_buffer_acquire_bo_for_write()

void wined3d_buffer_acquire_bo_for_write ( struct wined3d_buffer *  buffer,
struct wined3d_context *  context 
)

Definition at line 750 of file buffer.c.

751{
752 const struct wined3d_range range = {.size = buffer->resource.size};
753 struct wined3d_bo_address dst, src;
754 struct wined3d_bo *bo;
755
756 if (!(bo = buffer->buffer_object))
757 return;
758
759 /* If we are the only owner of this BO, there is nothing to do. */
760 if (bo->refcount == 1)
761 return;
762
763 TRACE("Performing copy-on-write for BO %p.\n", bo);
764
765 /* Grab a reference to the current BO. It's okay if this overflows, because
766 * the following unload will release it. */
767 ++bo->refcount;
768
769 /* Unload and re-prepare to get a new buffer. This is a bit cheap and not
770 * perfectly idiomatic—we should really just factor out an adapter-agnostic
771 * function to create a BO and then use wined3d_buffer_set_bo()—but it'll
772 * do nonetheless. */
775
776 /* And finally, perform the actual copy. */
777 assert(buffer->buffer_object != bo);
778 dst.buffer_object = buffer->buffer_object;
779 dst.addr = NULL;
780 src.buffer_object = bo;
781 src.addr = NULL;
783}
BOOL wined3d_buffer_prepare_location(struct wined3d_buffer *buffer, struct wined3d_context *context, unsigned int location)
Definition: buffer.c:257
static void wined3d_buffer_unload_location(struct wined3d_buffer *buffer, struct wined3d_context *context, unsigned int location)
Definition: buffer.c:263
GLenum src
Definition: glext.h:6340
uint8_t refcount
unsigned int size
#define WINED3D_MAP_DISCARD
Definition: wined3d.h:953
#define WINED3D_LOCATION_BUFFER
static void wined3d_context_copy_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *dst, const struct wined3d_bo_address *src, unsigned int range_count, const struct wined3d_range *ranges, uint32_t map_flags)

Referenced by buffer_resource_sub_resource_map(), context_gl_load_stream_output_buffers(), context_gl_load_unordered_access_resources(), wined3d_buffer_copy_bo_address(), wined3d_context_vk_load_buffers(), wined3d_context_vk_load_shader_resources(), wined3d_unordered_access_view_gl_clear(), and wined3d_unordered_access_view_vk_clear().

◆ wined3d_buffer_cleanup()

void wined3d_buffer_cleanup ( struct wined3d_buffer *  buffer)

Definition at line 453 of file buffer.c.

454{
456 resource_cleanup(&buffer->resource);
457}
static void wined3d_buffer_destroy_object(void *object)
Definition: buffer.c:437
void resource_cleanup(struct wined3d_resource *resource)
Definition: resource.c:224

Referenced by adapter_gl_destroy_buffer(), adapter_no3d_destroy_buffer(), and adapter_vk_destroy_buffer().

◆ wined3d_buffer_copy()

void wined3d_buffer_copy ( struct wined3d_buffer *  dst_buffer,
unsigned int  dst_offset,
struct wined3d_buffer *  src_buffer,
unsigned int  src_offset,
unsigned int  size 
)

Definition at line 808 of file buffer.c.

810{
811 struct wined3d_context *context;
812 struct wined3d_bo_address src;
813
814 TRACE("dst_buffer %p, dst_offset %u, src_buffer %p, src_offset %u, size %u.\n",
815 dst_buffer, dst_offset, src_buffer, src_offset, size);
816
817 context = context_acquire(dst_buffer->resource.device, NULL, 0);
818
820 src.addr += src_offset;
821
823
825}
void wined3d_buffer_copy_bo_address(struct wined3d_buffer *dst_buffer, struct wined3d_context *context, unsigned int dst_offset, const struct wined3d_const_bo_address *src_addr, unsigned int size)
Definition: buffer.c:785

Referenced by wined3d_cs_exec_blt_sub_resource().

◆ wined3d_buffer_copy_bo_address()

void wined3d_buffer_copy_bo_address ( struct wined3d_buffer *  dst_buffer,
struct wined3d_context *  context,
unsigned int  dst_offset,
const struct wined3d_const_bo_address *  src_addr,
unsigned int  size 
)

Definition at line 785 of file buffer.c.

787{
788 uint32_t map_flags = WINED3D_MAP_WRITE;
789 struct wined3d_bo_address dst_addr;
790 struct wined3d_range range;
791 DWORD dst_location;
792
793 if (!dst_offset && size == dst_buffer->resource.size)
794 map_flags |= WINED3D_MAP_DISCARD;
795
796 if (map_flags & WINED3D_MAP_DISCARD)
798
799 dst_location = wined3d_buffer_get_memory(dst_buffer, context, &dst_addr);
800 dst_addr.addr += dst_offset;
801
802 range.offset = 0;
803 range.size = size;
804 wined3d_context_copy_bo_address(context, &dst_addr, (const struct wined3d_bo_address *)src_addr, 1, &range, map_flags);
805 wined3d_buffer_invalidate_range(dst_buffer, ~dst_location, dst_offset, size);
806}
void wined3d_buffer_acquire_bo_for_write(struct wined3d_buffer *buffer, struct wined3d_context *context)
Definition: buffer.c:750
static void wined3d_buffer_invalidate_range(struct wined3d_buffer *buffer, DWORD location, unsigned int offset, unsigned int size)
Definition: buffer.c:114

Referenced by wined3d_buffer_copy(), wined3d_buffer_update_sub_resource(), and wined3d_unordered_access_view_copy_counter().

◆ wined3d_buffer_get_memory()

DWORD wined3d_buffer_get_memory ( struct wined3d_buffer *  buffer,
struct wined3d_context *  context,
struct wined3d_bo_address *  data 
)

Definition at line 369 of file buffer.c.

371{
372 unsigned int locations = buffer->locations;
373
374 TRACE("buffer %p, context %p, data %p, locations %s.\n",
376
378 {
381 {
382 data->buffer_object = 0;
383 data->addr = NULL;
384 return 0;
385 }
386 }
388 {
389 data->buffer_object = buffer->buffer_object;
390 data->addr = NULL;
392 }
394 {
395 data->buffer_object = 0;
396 data->addr = buffer->resource.heap_memory;
398 }
399
400 ERR("Unexpected locations %s.\n", wined3d_debug_location(locations));
401 data->buffer_object = 0;
402 data->addr = NULL;
403 return 0;
404}
BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer, struct wined3d_context *context, uint32_t location)
Definition: buffer.c:269
#define WINED3D_BUFFER_USE_BO
Definition: buffer.c:32
GLsizei const GLint * locations
Definition: glext.h:10542
#define WINED3D_LOCATION_SYSMEM
#define WINED3D_LOCATION_CLEARED

Referenced by context_update_stream_info(), wined3d_buffer_copy(), and wined3d_buffer_copy_bo_address().

◆ wined3d_buffer_invalidate_location()

◆ wined3d_buffer_load()

void wined3d_buffer_load ( struct wined3d_buffer *  buffer,
struct wined3d_context *  context,
const struct wined3d_state *  state 
)

Definition at line 484 of file buffer.c.

486{
487 TRACE("buffer %p.\n", buffer);
488
489 if (buffer->resource.map_count && buffer->map_ptr)
490 {
491 FIXME("Buffer is mapped through buffer object, not loading.\n");
492 return;
493 }
494 else if (buffer->resource.map_count)
495 {
496 WARN("Loading mapped buffer.\n");
497 }
498
499 if (!(buffer->flags & WINED3D_BUFFER_USE_BO))
500 return;
501
503 {
504 ERR("Failed to prepare buffer location.\n");
505 return;
506 }
507
508 /* Reading the declaration makes only sense if we have valid state information
509 * (i.e., if this function is called during draws). */
510 if (state)
512
514 return;
515
517 ERR("Failed to load buffer location.\n");
518}
static BOOL buffer_is_dirty(const struct wined3d_buffer *buffer)
Definition: buffer.c:91
#define WINED3D_BUFFER_HASDESC
Definition: buffer.c:31

Referenced by buffer_resource_preload(), context_apply_draw_state(), context_gl_load_shader_resources(), context_gl_load_stream_output_buffers(), context_update_stream_info(), dispatch_compute(), draw_primitive(), wined3d_context_vk_load_buffers(), and wined3d_context_vk_load_shader_resources().

◆ wined3d_buffer_load_location()

BOOL wined3d_buffer_load_location ( struct wined3d_buffer *  buffer,
struct wined3d_context *  context,
uint32_t  location 
)

Definition at line 269 of file buffer.c.

271{
272 struct wined3d_bo_address src, dst;
273 struct wined3d_range range;
274
275 TRACE("buffer %p, context %p, location %s.\n",
277
278 if (buffer->locations & location)
279 {
280 TRACE("Location (%#x) is already up to date.\n", location);
281 return TRUE;
282 }
283
284 if (!buffer->locations)
285 {
286 ERR("Buffer %p does not have any up to date location.\n", buffer);
289 }
290
291 TRACE("Current buffer location %s.\n", wined3d_debug_location(buffer->locations));
292
294 return FALSE;
295
296 if (buffer->locations & WINED3D_LOCATION_DISCARDED)
297 {
298 TRACE("Buffer previously discarded, nothing to do.\n");
301 return TRUE;
302 }
303
304 switch (location)
305 {
307 if (buffer->locations & WINED3D_LOCATION_CLEARED)
308 {
309 memset(buffer->resource.heap_memory, 0, buffer->resource.size);
310 }
311 else
312 {
313 dst.buffer_object = NULL;
314 dst.addr = buffer->resource.heap_memory;
315 src.buffer_object = buffer->buffer_object;
316 src.addr = NULL;
317 range.offset = 0;
318 range.size = buffer->resource.size;
320 }
321 break;
322
324 {
325 uint32_t map_flags = WINED3D_MAP_WRITE;
326
327 if (buffer->locations & WINED3D_LOCATION_CLEARED)
328 {
329 /* FIXME: Clear the buffer on the GPU if possible. */
331 return FALSE;
332 memset(buffer->resource.heap_memory, 0, buffer->resource.size);
333 }
334
335 dst.buffer_object = buffer->buffer_object;
336 dst.addr = NULL;
337 src.buffer_object = NULL;
338 src.addr = buffer->resource.heap_memory;
339
341 map_flags |= WINED3D_MAP_DISCARD;
342
344 buffer->dirty_range_count, buffer->dirty_ranges, map_flags);
345 break;
346 }
347
348 default:
349 ERR("Invalid location %s.\n", wined3d_debug_location(location));
350 return FALSE;
351 }
352
354 if (buffer->resource.heap_memory && location == WINED3D_LOCATION_BUFFER
355 && !(buffer->resource.usage & WINED3DUSAGE_DYNAMIC))
357
358 return TRUE;
359}
static void wined3d_buffer_evict_sysmem(struct wined3d_buffer *buffer)
Definition: buffer.c:44
static BOOL buffer_is_fully_dirty(const struct wined3d_buffer *buffer)
Definition: buffer.c:96
void wined3d_buffer_invalidate_location(struct wined3d_buffer *buffer, uint32_t location)
Definition: buffer.c:131
void wined3d_buffer_validate_location(struct wined3d_buffer *buffer, uint32_t location)
Definition: buffer.c:102

Referenced by buffer_resource_sub_resource_map(), buffer_resource_unload(), context_gl_load_unordered_access_resources(), create_buffer_texture(), wined3d_buffer_get_memory(), wined3d_buffer_load(), wined3d_buffer_load_location(), wined3d_buffer_load_sysmem(), wined3d_context_vk_apply_compute_state(), wined3d_unordered_access_view_gl_clear(), wined3d_unordered_access_view_vk_clear(), and wined3d_view_load_location().

◆ wined3d_buffer_load_sysmem()

◆ wined3d_buffer_no3d_init()

HRESULT wined3d_buffer_no3d_init ( struct wined3d_buffer *  buffer_no3d,
struct wined3d_device *  device,
const struct wined3d_buffer_desc *  desc,
const struct wined3d_sub_resource_data *  data,
void *  parent,
const struct wined3d_parent_ops *  parent_ops 
)

Definition at line 1040 of file buffer.c.

1043{
1044 TRACE("buffer_no3d %p, device %p, desc %p, data %p, parent %p, parent_ops %p.\n",
1045 buffer_no3d, device, desc, data, parent, parent_ops);
1046
1047 return wined3d_buffer_init(buffer_no3d, device, desc, data, parent, parent_ops, &wined3d_buffer_no3d_ops);
1048}
static HRESULT wined3d_buffer_init(struct wined3d_buffer *buffer, struct wined3d_device *device, const struct wined3d_buffer_desc *desc, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_buffer_ops *buffer_ops)
Definition: buffer.c:931
static const struct wined3d_buffer_ops wined3d_buffer_no3d_ops
Definition: buffer.c:1034

Referenced by adapter_no3d_create_buffer().

◆ wined3d_buffer_prepare_location()

◆ wined3d_buffer_update_sub_resource()

void wined3d_buffer_update_sub_resource ( struct wined3d_buffer *  buffer,
struct wined3d_context *  context,
const struct upload_bo *  upload_bo,
unsigned int  offset,
unsigned int  size 
)

Definition at line 827 of file buffer.c.

829{
830 struct wined3d_bo *bo = upload_bo->addr.buffer_object;
832
833 /* Try to take this buffer for COW. Don't take it if we've saturated the
834 * refcount. */
835 if (!offset && size == buffer->resource.size
837 {
839 ++bo->refcount;
840 }
841
843 {
844 /* Don't increment the refcount. UPLOAD_BO_RENAME_ON_UNMAP transfers an
845 * existing reference.
846 *
847 * FIXME: We could degenerate RENAME to a copy + free and rely on the
848 * COW logic to detect this case.
849 */
853 }
854
855 if (upload_bo->addr.buffer_object && upload_bo->addr.buffer_object == buffer->buffer_object)
856 {
857 struct wined3d_range range;
858
859 /* We need to flush changes, which is implicitly done by
860 * wined3d_context_unmap_bo_address() even if we aren't actually going
861 * to unmap.
862 *
863 * We would also like to free up virtual address space used by this BO
864 * if it's at a premium—note that this BO was allocated for an
865 * accelerated map. Hence we unmap the BO instead of merely flushing it;
866 * if we don't care about unmapping BOs then
867 * wined3d_context_unmap_bo_address() will flush and return.
868 */
870 range.size = size;
871 if (upload_bo->addr.buffer_object->map_ptr)
873 }
874 else
875 {
877 }
878}
static void wined3d_buffer_set_bo(struct wined3d_buffer *buffer, struct wined3d_context *context, struct wined3d_bo *bo)
Definition: buffer.c:721
#define UINT8_MAX
Definition: stdint.h:83
GLintptr offset
Definition: glext.h:5920
struct wined3d_const_bo_address addr
uint32_t flags
unsigned int offset
#define UPLOAD_BO_RENAME_ON_UNMAP

Referenced by wined3d_cs_exec_update_sub_resource().

◆ wined3d_buffer_validate_location()

void wined3d_buffer_validate_location ( struct wined3d_buffer *  buffer,
uint32_t  location 
)

Definition at line 102 of file buffer.c.

103{
104 TRACE("buffer %p, location %s.\n", buffer, wined3d_debug_location(location));
105
108
109 buffer->locations |= location;
110
111 TRACE("New locations flags are %s.\n", wined3d_debug_location(buffer->locations));
112}
static void buffer_clear_dirty_areas(struct wined3d_buffer *buffer)
Definition: buffer.c:86
#define location(file, line)
Definition: kmtest.h:18

Referenced by buffer_resource_sub_resource_map(), wined3d_buffer_init_data(), wined3d_buffer_load_location(), wined3d_buffer_update_sub_resource(), and wined3d_unordered_access_view_vk_clear().

◆ wined3d_buffer_validate_user()

static void wined3d_buffer_validate_user ( struct wined3d_buffer *  buffer)
inlinestatic

Definition at line 3898 of file wined3d_private.h.

3899{
3900 if (buffer->bo_user.valid)
3901 return;
3902 buffer->bo_user.valid = true;
3903 list_add_head(&buffer->buffer_object->users, &buffer->bo_user.entry);
3904}

Referenced by indexbuffer(), state_cb(), state_so(), wined3d_buffer_vk_get_buffer_info(), and wined3d_context_gl_load_numbered_arrays().

◆ wined3d_clip_blit()

BOOL wined3d_clip_blit ( const RECT *  clip_rect,
RECT *  clipped,
RECT *  other 
)

Definition at line 6672 of file utils.c.

6673{
6674 RECT orig = *clipped;
6675 float scale_x = (float)(orig.right - orig.left) / (float)(other->right - other->left);
6676 float scale_y = (float)(orig.bottom - orig.top) / (float)(other->bottom - other->top);
6677
6678 IntersectRect(clipped, clipped, clip_rect);
6679
6680 if (IsRectEmpty(clipped))
6681 {
6683 return FALSE;
6684 }
6685
6686 other->left += (LONG)((clipped->left - orig.left) / scale_x);
6687 other->top += (LONG)((clipped->top - orig.top) / scale_y);
6688 other->right -= (LONG)((orig.right - clipped->right) / scale_x);
6689 other->bottom -= (LONG)((orig.bottom - clipped->bottom) / scale_y);
6690
6691 return TRUE;
6692}
int other
Definition: msacm.c:1376
long LONG
Definition: pedump.c:60
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)
long bottom
Definition: dcommon.idl:29
long right
Definition: dcommon.idl:29
long left
Definition: dcommon.idl:29
long top
Definition: dcommon.idl:29

Referenced by wined3d_cs_exec_present().

◆ wined3d_color_from_d3dcolor()

static void wined3d_color_from_d3dcolor ( struct wined3d_color *  wined3d_color,
DWORD  d3d_color 
)
inlinestatic

Definition at line 1563 of file wined3d_private.h.

1564{
1565 wined3d_color->r = D3DCOLOR_B_R(d3d_color) / 255.0f;
1566 wined3d_color->g = D3DCOLOR_B_G(d3d_color) / 255.0f;
1567 wined3d_color->b = D3DCOLOR_B_B(d3d_color) / 255.0f;
1568 wined3d_color->a = D3DCOLOR_B_A(d3d_color) / 255.0f;
1569}
#define D3DCOLOR_B_G(dw)
#define D3DCOLOR_B_R(dw)
#define D3DCOLOR_B_A(dw)
#define D3DCOLOR_B_B(dw)

◆ wined3d_colour_srgb_from_linear()

static void wined3d_colour_srgb_from_linear ( struct wined3d_color *  colour_srgb,
const struct wined3d_color *  colour 
)
inlinestatic

Definition at line 1584 of file wined3d_private.h.

1586{
1587 colour_srgb->r = wined3d_srgb_from_linear(colour->r);
1588 colour_srgb->g = wined3d_srgb_from_linear(colour->g);
1589 colour_srgb->b = wined3d_srgb_from_linear(colour->b);
1590 colour_srgb->a = colour->a;
1591}
static float wined3d_srgb_from_linear(float colour)

Referenced by ffp_blitter_clear_rendertargets(), and wined3d_format_convert_from_float().

◆ wined3d_const_bo_address()

Definition at line 1628 of file wined3d_private.h.

1629{
1630 return (struct wined3d_const_bo_address *)data;
1631}

◆ wined3d_context_cleanup()

void wined3d_context_cleanup ( struct wined3d_context *  context)

◆ wined3d_context_copy_bo_address()

static void wined3d_context_copy_bo_address ( struct wined3d_context *  context,
const struct wined3d_bo_address *  dst,
const struct wined3d_bo_address *  src,
unsigned int  range_count,
const struct wined3d_range *  ranges,
uint32_t  map_flags 
)
inlinestatic

Definition at line 4820 of file wined3d_private.h.

4823{
4824 context->device->adapter->adapter_ops->adapter_copy_bo_address(context, dst, src, range_count, ranges, map_flags);
4825}

Referenced by wined3d_buffer_acquire_bo_for_write(), wined3d_buffer_copy_bo_address(), wined3d_buffer_load_location(), wined3d_texture_load_location(), and wined3d_unordered_access_view_set_counter().

◆ wined3d_context_destroy_bo()

static void wined3d_context_destroy_bo ( struct wined3d_context *  context,
struct wined3d_bo *  bo 
)
inlinestatic

Definition at line 4833 of file wined3d_private.h.

4834{
4835 context->device->adapter->adapter_ops->adapter_destroy_bo(context, bo);
4836}

Referenced by wined3d_buffer_set_bo(), wined3d_command_list_destroy_object(), and wined3d_texture_set_bo().

◆ wined3d_context_flush_bo_address()

static void wined3d_context_flush_bo_address ( struct wined3d_context *  context,
const struct wined3d_const_bo_address *  data,
size_t  size 
)
inlinestatic

Definition at line 4827 of file wined3d_private.h.

4829{
4830 context->device->adapter->adapter_ops->adapter_flush_bo_address(context, data, size);
4831}

◆ wined3d_context_init()

void wined3d_context_init ( struct wined3d_context *  context,
struct wined3d_swapchain *  swapchain 
)

Definition at line 89 of file context.c.

90{
91 struct wined3d_device *device = swapchain->device;
93
94 context->d3d_info = &device->adapter->d3d_info;
95 context->state_table = device->state_table;
96
97 /* Mark all states dirty to force a proper initialization of the states on
98 * the first use of the context. Compute states do not need initialization. */
99 for (state = 0; state <= STATE_HIGHEST; ++state)
100 {
101 if (context->state_table[state].representative && !STATE_IS_COMPUTE(state))
103 }
104
105 context->device = device;
106 context->swapchain = swapchain;
107 context->current_rt.texture = swapchain->front_buffer;
108 context->current_rt.sub_resource_idx = 0;
109
110 context->shader_update_mask = (1u << WINED3D_SHADER_TYPE_PIXEL)
116
117 context->update_primitive_type = 1;
118 context->update_patch_vertex_count = 1;
119 context->update_multisample_state = 1;
120}
struct wined3d_device * device

Referenced by wined3d_context_gl_init(), wined3d_context_no3d_init(), and wined3d_context_vk_init().

◆ wined3d_context_is_compute_state_dirty()

static bool wined3d_context_is_compute_state_dirty ( const struct wined3d_context *  context,
unsigned int  state_id 
)
inlinestatic

Definition at line 5014 of file wined3d_private.h.

5015{
5016 return wined3d_bitmap_is_set(context->dirty_compute_states, state_id - STATE_COMPUTE_OFFSET);
5017}
static BOOL wined3d_bitmap_is_set(const uint32_t *map, unsigned int idx)

Referenced by wined3d_context_vk_apply_compute_state().

◆ wined3d_context_is_graphics_state_dirty()

static bool wined3d_context_is_graphics_state_dirty ( const struct wined3d_context *  context,
unsigned int  state_id 
)
inlinestatic

◆ wined3d_context_map_bo_address()

static void * wined3d_context_map_bo_address ( struct wined3d_context *  context,
const struct wined3d_bo_address *  data,
size_t  size,
uint32_t  map_flags 
)
inlinestatic

◆ wined3d_context_no3d_init()

HRESULT wined3d_context_no3d_init ( struct wined3d_context *  context_no3d,
struct wined3d_swapchain *  swapchain 
)

Definition at line 122 of file context.c.

123{
124 TRACE("context_no3d %p, swapchain %p.\n", context_no3d, swapchain);
125
126 wined3d_context_init(context_no3d, swapchain);
127
128 return WINED3D_OK;
129}
void wined3d_context_init(struct wined3d_context *context, struct wined3d_swapchain *swapchain)
Definition: context.c:89

Referenced by adapter_no3d_init_3d().

◆ wined3d_context_unmap_bo_address()

◆ wined3d_cpu_blitter_create()

struct wined3d_blitter * wined3d_cpu_blitter_create ( void  )

Definition at line 1300 of file surface.c.

1301{
1302 struct wined3d_blitter *blitter;
1303
1304 if (!(blitter = malloc(sizeof(*blitter))))
1305 return NULL;
1306
1307 TRACE("Created blitter %p.\n", blitter);
1308
1309 blitter->ops = &cpu_blitter_ops;
1310 blitter->next = NULL;
1311
1312 return blitter;
1313}
static const struct wined3d_blitter_ops cpu_blitter_ops
Definition: surface.c:1293
struct wined3d_blitter * next
const struct wined3d_blitter_ops * ops

Referenced by adapter_no3d_init_3d(), adapter_vk_init_3d(), and wined3d_device_gl_create_primary_opengl_context_cs().

◆ wined3d_cs_create()

struct wined3d_cs * wined3d_cs_create ( struct wined3d_device *  device,
const enum wined3d_feature_level *  levels,
unsigned int  level_count 
)

Definition at line 3561 of file cs.c.

3563{
3564 const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
3565 struct wined3d_cs *cs;
3566
3567 if (!(cs = calloc(1, sizeof(*cs))))
3568 return NULL;
3569
3570 if (FAILED(wined3d_state_create(device, levels, level_count, &cs->c.state)))
3571 {
3572 free(cs);
3573 return NULL;
3574 }
3575
3576 cs->c.ops = &wined3d_cs_st_ops;
3577 cs->c.device = device;
3578 cs->serialize_commands = TRACE_ON(d3d_sync) || wined3d_settings.cs_multithreaded & WINED3D_CSMT_SERIALIZE;
3579
3580 if (cs->serialize_commands)
3581 ERR_(d3d_sync)("Forcing serialization of all command streams.\n");
3582
3583 state_init(&cs->state, d3d_info, WINED3D_STATE_NO_REF | WINED3D_STATE_INIT_DEFAULT, cs->c.state->feature_level);
3584
3585 cs->data_size = WINED3D_INITIAL_CS_SIZE;
3586 if (!(cs->data = malloc(cs->data_size)))
3587 goto fail;
3588
3590 {
3591 if (!d3d_info->fences)
3592 {
3593 WARN("Disabling CSMT, adapter doesn't support fences.\n");
3594 wined3d_settings.cs_multithreaded &= ~WINED3D_CSMT_ENABLE;
3595 }
3596 }
3597
3600 {
3601 cs->c.ops = &wined3d_cs_mt_ops;
3602
3603 if (!pNtAlertThreadByThreadId)
3604 {
3605 HANDLE ntdll = GetModuleHandleW(L"ntdll.dll");
3606
3607 pNtAlertThreadByThreadId = (void *)GetProcAddress(ntdll, "NtAlertThreadByThreadId");
3608 pNtWaitForAlertByThreadId = (void *)GetProcAddress(ntdll, "NtWaitForAlertByThreadId");
3609 }
3610
3611 if (!pNtAlertThreadByThreadId && !(cs->event = CreateEventW(NULL, FALSE, FALSE, NULL)))
3612 {
3613 ERR("Failed to create command stream event.\n");
3614 free(cs->data);
3615 goto fail;
3616 }
3617 if (!(cs->present_event = CreateEventW(NULL, FALSE, FALSE, NULL)))
3618 {
3619 ERR("Failed to create command stream present event.\n");
3620 free(cs->data);
3621 goto fail;
3622 }
3623
3624 if (!(GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
3625 (const WCHAR *)wined3d_cs_run, &cs->wined3d_module)))
3626 {
3627 ERR("Failed to get wined3d module handle.\n");
3628 CloseHandle(cs->present_event);
3629 if (cs->event)
3630 CloseHandle(cs->event);
3631 free(cs->data);
3632 goto fail;
3633 }
3634
3635 if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL)))
3636 {
3637 ERR("Failed to create wined3d command stream thread.\n");
3638 FreeLibrary(cs->wined3d_module);
3639 CloseHandle(cs->present_event);
3640 if (cs->event)
3641 CloseHandle(cs->event);
3642 free(cs->data);
3643 goto fail;
3644 }
3645 }
3646
3647 TRACE("Created command stream %p.\n", cs);
3648 return cs;
3649
3650fail:
3651 wined3d_state_destroy(cs->c.state);
3652 state_cleanup(&cs->state);
3653 free(cs);
3654 return NULL;
3655}
static DWORD WINAPI wined3d_cs_run(void *ctx)
Definition: cs.c:3477
#define WINED3D_INITIAL_CS_SIZE
Definition: cs.c:31
static const struct wined3d_device_context_ops wined3d_cs_st_ops
Definition: cs.c:3215
static const struct wined3d_device_context_ops wined3d_cs_mt_ops
Definition: cs.c:3349
void state_init(void *ipp)
Definition: dhclient.c:210
#define CloseHandle
Definition: compat.h:739
#define GetProcAddress(x, y)
Definition: compat.h:753
#define FreeLibrary(x)
Definition: compat.h:748
#define TRACE_ON(x)
Definition: compat.h:75
PPEB Peb
Definition: dllmain.c:27
BOOL WINAPI GetModuleHandleExW(IN DWORD dwFlags, IN LPCWSTR lpwModuleName OPTIONAL, OUT HMODULE *phModule)
Definition: loader.c:866
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
#define L(x)
Definition: resources.c:13
GLsizei levels
Definition: glext.h:7884
#define cs
Definition: i386-dis.c:442
#define FAILED(hr)
Definition: intsafe.h:51
#define NtCurrentTeb
static HMODULE ntdll
Definition: debugger.c:59
NTSYSAPI LOGICAL NTAPI RtlIsCriticalSectionLockedByThread(_In_ PRTL_CRITICAL_SECTION CriticalSection)
short WCHAR
Definition: pedump.c:58
#define ERR_(ch,...)
Definition: debug.h:156
PVOID LoaderLock
Definition: ntddk_ex.h:295
unsigned int cs_multithreaded
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:587
void state_cleanup(struct wined3d_state *state)
Definition: stateblock.c:648
void CDECL wined3d_state_destroy(struct wined3d_state *state)
Definition: stateblock.c:2385
HRESULT CDECL wined3d_state_create(struct wined3d_device *device, const enum wined3d_feature_level *levels, unsigned int level_count, struct wined3d_state **state)
Definition: stateblock.c:2357
#define WINED3D_CSMT_ENABLE
#define WINED3D_CSMT_SERIALIZE

Referenced by wined3d_device_init().

◆ wined3d_cs_destroy()

void wined3d_cs_destroy ( struct wined3d_cs *  cs)

Definition at line 3657 of file cs.c.

3658{
3659 if (cs->thread)
3660 {
3662 CloseHandle(cs->thread);
3663 if (!CloseHandle(cs->present_event))
3664 ERR("Closing present event failed.\n");
3665 if (cs->event && !CloseHandle(cs->event))
3666 ERR("Closing event failed.\n");
3667 }
3668
3669 wined3d_state_destroy(cs->c.state);
3670 state_cleanup(&cs->state);
3671 free(cs->data);
3672 free(cs);
3673}
static void wined3d_cs_emit_stop(struct wined3d_cs *cs)
Definition: cs.c:2922

Referenced by wined3d_device_cleanup().

◆ wined3d_cs_destroy_object()

◆ wined3d_cs_emit_add_dirty_texture_region()

void wined3d_cs_emit_add_dirty_texture_region ( struct wined3d_cs *  cs,
struct wined3d_texture *  texture,
unsigned int  layer 
)

Definition at line 2828 of file cs.c.

2830{
2832
2835 op->texture = texture;
2836 op->layer = layer;
2837
2839
2841}
static void wined3d_device_context_submit(struct wined3d_device_context *context, enum wined3d_cs_queue_id queue_id)
Definition: cs.c:552
@ WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION
Definition: cs.c:138
static void * wined3d_device_context_require_space(struct wined3d_device_context *context, size_t size, enum wined3d_cs_queue_id queue_id)
Definition: cs.c:546
GLenum GLuint GLint GLint layer
Definition: glext.h:7007

Referenced by wined3d_texture_add_dirty_region().

◆ wined3d_cs_emit_clear()

void wined3d_cs_emit_clear ( struct wined3d_cs *  cs,
DWORD  rect_count,
const RECT *  rects,
uint32_t  flags,
const struct wined3d_color *  color,
float  depth,
DWORD  stencil 
)

Definition at line 804 of file cs.c.

806{
807 const struct wined3d_state *state = cs->c.state;
808 const struct wined3d_viewport *vp = &state->viewports[0];
810 struct wined3d_cs_clear *op;
811 unsigned int rt_count, i;
812
813 rt_count = flags & WINED3DCLEAR_TARGET ? cs->c.device->adapter->d3d_info.limits.max_rt_count : 0;
814
817 op->opcode = WINED3D_CS_OP_CLEAR;
819 op->rt_count = rt_count;
820 op->fb = state->fb;
821 SetRect(&op->draw_rect, vp->x, vp->y, vp->x + vp->width, vp->y + vp->height);
822 if (state->rasterizer_state && state->rasterizer_state->desc.scissor)
823 IntersectRect(&op->draw_rect, &op->draw_rect, &state->scissor_rects[0]);
824 op->color = *color;
825 op->depth = depth;
826 op->stencil = stencil;
827 op->rect_count = rect_count;
828 memcpy(op->rects, rects, sizeof(*rects) * rect_count);
829
830 for (i = 0; i < rt_count; ++i)
831 {
832 if ((view = state->fb.render_targets[i]))
834 }
836 {
837 view = state->fb.depth_stencil;
839 }
840
842}
@ WINED3D_CS_OP_CLEAR
Definition: cs.c:96
GLint GLfloat GLint stencil
Definition: glext.h:6260
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned int rt_count
Definition: cs.c:173
RECT rects[1]
Definition: cs.c:180
unsigned int rect_count
Definition: cs.c:179
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define WINED3DCLEAR_TARGET
Definition: wined3d.h:1008
#define WINED3DCLEAR_STENCIL
Definition: wined3d.h:1010
#define WINED3DCLEAR_ZBUFFER
Definition: wined3d.h:1009

Referenced by wined3d_device_clear().

◆ wined3d_cs_emit_preload_resource()

void wined3d_cs_emit_preload_resource ( struct wined3d_cs *  cs,
struct wined3d_resource *  resource 
)

Definition at line 2419 of file cs.c.

Referenced by wined3d_resource_preload().

◆ wined3d_cs_emit_present()

void wined3d_cs_emit_present ( struct wined3d_cs *  cs,
struct wined3d_swapchain *  swapchain,
const RECT *  src_rect,
const RECT *  dst_rect,
HWND  dst_window_override,
unsigned int  swap_interval,
uint32_t  flags 
)

Definition at line 748 of file cs.c.

751{
752 struct wined3d_cs_present *op;
753 unsigned int i;
754 LONG pending;
755
757
759 op->opcode = WINED3D_CS_OP_PRESENT;
760 op->dst_window_override = dst_window_override;
761 op->swapchain = swapchain;
762 op->src_rect = *src_rect;
763 op->dst_rect = *dst_rect;
764 op->swap_interval = swap_interval;
765 op->flags = flags;
766
767 pending = InterlockedIncrement(&cs->pending_presents);
768
769 wined3d_resource_reference(&swapchain->front_buffer->resource);
770 for (i = 0; i < swapchain->state.desc.backbuffer_count; ++i)
771 {
772 wined3d_resource_reference(&swapchain->back_buffers[i]->resource);
773 }
774
776
777 /* Limit input latency by limiting the number of presents that we can get
778 * ahead of the worker thread. */
779 while (pending >= swapchain->max_frame_latency)
780 {
781 InterlockedExchange(&cs->waiting_for_present, TRUE);
782
783 pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0);
784 if (pending >= swapchain->max_frame_latency || !InterlockedCompareExchange(&cs->waiting_for_present, FALSE, TRUE))
785 {
786 TRACE_(d3d_perf)("Reached latency limit (%u frames), blocking to wait.\n", swapchain->max_frame_latency);
788 WaitForSingleObject(cs->present_event, INFINITE);
790 TRACE_(d3d_perf)("Woken up from the wait.\n");
791 }
792 }
793}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedExchange
Definition: armddk.h:54
@ WINED3D_CS_OP_PRESENT
Definition: cs.c:95
#define TRACE_(x)
Definition: compat.h:76
#define INFINITE
Definition: serial.h:102
HWND dst_window_override
Definition: cs.c:161
unsigned int swap_interval
Definition: cs.c:165
RECT src_rect
Definition: cs.c:163
struct wined3d_swapchain * swapchain
Definition: cs.c:162
RECT dst_rect
Definition: cs.c:164
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82

Referenced by wined3d_swapchain_present().

◆ wined3d_cs_emit_set_color_key()

void wined3d_cs_emit_set_color_key ( struct wined3d_cs *  cs,
struct wined3d_texture *  texture,
WORD  flags,
const struct wined3d_color_key *  color_key 
)

Definition at line 2037 of file cs.c.

2039{
2041
2044 op->texture = texture;
2045 op->flags = flags;
2046 if (color_key)
2047 {
2048 op->color_key = *color_key;
2049 op->set = 1;
2050 }
2051 else
2052 op->set = 0;
2053
2055}
@ WINED3D_CS_OP_SET_COLOR_KEY
Definition: cs.c:123
struct wined3d_color_key color_key
Definition: cs.c:297

Referenced by wined3d_texture_set_color_key().

◆ wined3d_cs_emit_set_render_state()

void wined3d_cs_emit_set_render_state ( struct wined3d_cs *  cs,
enum wined3d_render_state  state,
DWORD  value 
)

◆ wined3d_cs_emit_unload_resource()

void wined3d_cs_emit_unload_resource ( struct wined3d_cs *  cs,
struct wined3d_resource *  resource 
)

Definition at line 2440 of file cs.c.

2441{
2443
2445
2448 op->resource = resource;
2449
2451
2453}
@ WINED3D_CS_OP_UNLOAD_RESOURCE
Definition: cs.c:132
static void discard_client_address(struct wined3d_resource *resource)
Definition: cs.c:77

Referenced by wined3d_device_evict_managed_resources(), wined3d_device_reset(), wined3d_device_uninit_3d(), and wined3d_texture_update_desc().

◆ wined3d_cs_finish()

◆ wined3d_cs_init_object()

◆ wined3d_cs_map_bo_address()

Definition at line 2586 of file cs.c.

2588{
2589 struct wined3d_device_context *context = &cs->c;
2591
2594 op->addr = *addr;
2595 op->size = size;
2596 op->flags = flags;
2599}
static void wined3d_device_context_finish(struct wined3d_device_context *context, enum wined3d_cs_queue_id queue_id)
Definition: cs.c:558
@ WINED3D_CS_OP_MAP_BO_ADDRESS
Definition: cs.c:135

◆ wined3d_debug_bind_flags()

const char * wined3d_debug_bind_flags ( uint32_t  bind_flags)

Definition at line 4845 of file utils.c.

4846{
4847 struct debug_buffer buffer;
4848
4850#define BIND_FLAG_TO_STR(x) if (bind_flags & x) { debug_append(&buffer, #x, " | "); bind_flags &= ~x; }
4860#undef BIND_FLAG_TO_STR
4861 if (bind_flags)
4862 FIXME("Unrecognised bind flag(s) %#x.\n", bind_flags);
4863
4864 return wine_dbg_sprintf("%s", buffer.str);
4865}
#define BIND_FLAG_TO_STR(x)
#define WINED3D_BIND_VERTEX_BUFFER
Definition: wined3d.h:909
#define WINED3D_BIND_UNORDERED_ACCESS
Definition: wined3d.h:916
#define WINED3D_BIND_INDIRECT_BUFFER
Definition: wined3d.h:917
#define WINED3D_BIND_DEPTH_STENCIL
Definition: wined3d.h:915
#define WINED3D_BIND_CONSTANT_BUFFER
Definition: wined3d.h:911
#define WINED3D_BIND_STREAM_OUTPUT
Definition: wined3d.h:913
#define WINED3D_BIND_INDEX_BUFFER
Definition: wined3d.h:910

Referenced by resource_init(), wined3d_buffer_init(), wined3d_buffer_vk_barrier(), wined3d_check_device_format(), wined3d_device_context_set_depth_stencil_view(), wined3d_device_context_set_render_targets_and_unordered_access_views(), wined3d_layout_from_bind_mask(), wined3d_texture_init(), wined3d_texture_vk_barrier(), and wined3d_texture_vk_prepare_texture().

◆ wined3d_debug_feature_level()

const char * wined3d_debug_feature_level ( enum wined3d_feature_level  level)

Definition at line 6619 of file utils.c.

6620{
6621 switch (level)
6622 {
6623#define LEVEL_TO_STR(level) case level: return #level
6635#undef LEVEL_TO_STR
6636 default:
6637 return wine_dbg_sprintf("%#x", level);
6638 }
6639}
#define LEVEL_TO_STR(level)
@ WINED3D_FEATURE_LEVEL_11
Definition: wined3d.h:109
@ WINED3D_FEATURE_LEVEL_10_1
Definition: wined3d.h:108
@ WINED3D_FEATURE_LEVEL_8
Definition: wined3d.h:103
@ WINED3D_FEATURE_LEVEL_7
Definition: wined3d.h:102
@ WINED3D_FEATURE_LEVEL_6
Definition: wined3d.h:101
@ WINED3D_FEATURE_LEVEL_9_3
Definition: wined3d.h:106
@ WINED3D_FEATURE_LEVEL_10
Definition: wined3d.h:107
@ WINED3D_FEATURE_LEVEL_11_1
Definition: wined3d.h:110
@ WINED3D_FEATURE_LEVEL_5
Definition: wined3d.h:100
@ WINED3D_FEATURE_LEVEL_9_1
Definition: wined3d.h:104
@ WINED3D_FEATURE_LEVEL_9_2
Definition: wined3d.h:105

Referenced by wined3d_state_create().

◆ wined3d_debug_location()

const char * wined3d_debug_location ( uint32_t  location)

Definition at line 6588 of file utils.c.

6589{
6590 struct debug_buffer buffer;
6591 const char *prefix = "";
6592 const char *suffix = "";
6593
6594 if (wined3d_popcount(location) > 16)
6595 {
6596 prefix = "~(";
6598 suffix = ")";
6599 }
6600
6602#define LOCATION_TO_STR(x) if (location & x) { debug_append(&buffer, #x, " | "); location &= ~x; }
6612#undef LOCATION_TO_STR
6613 if (location)
6614 FIXME("Unrecognized location flag(s) %#x.\n", location);
6615
6616 return wine_dbg_sprintf("%s%s%s", prefix, buffer.str, suffix);
6617}
#define LOCATION_TO_STR(x)
Character const *const prefix
Definition: tempnam.cpp:195
#define WINED3D_LOCATION_TEXTURE_SRGB
#define WINED3D_LOCATION_TEXTURE_RGB
#define WINED3D_LOCATION_DRAWABLE
#define WINED3D_LOCATION_RB_MULTISAMPLE
static unsigned int wined3d_popcount(unsigned int x)

Referenced by context_gl_apply_texture_draw_state(), cpu_blitter_clear_texture(), fbo_blitter_blit(), glsl_blitter_blit(), raw_blitter_blit(), surface_convert_format(), surface_cpu_blt(), texture2d_blt_fbo(), texture2d_depth_blt_fbo(), texture2d_read_from_framebuffer(), texture_resource_sub_resource_map(), vk_blitter_blit(), wined3d_buffer_get_memory(), wined3d_buffer_gl_prepare_location(), wined3d_buffer_gl_unload_location(), wined3d_buffer_invalidate_range(), wined3d_buffer_load_location(), wined3d_buffer_no3d_prepare_location(), wined3d_buffer_no3d_unload_location(), wined3d_buffer_validate_location(), wined3d_buffer_vk_prepare_location(), wined3d_buffer_vk_unload_location(), wined3d_cs_exec_add_dirty_texture_region(), wined3d_cs_exec_blt_sub_resource(), wined3d_texture_get_memory(), wined3d_texture_gl_download_data(), wined3d_texture_gl_load_location(), wined3d_texture_gl_load_sysmem(), wined3d_texture_gl_prepare_location(), wined3d_texture_gl_unload_location(), wined3d_texture_gl_upload_data(), wined3d_texture_invalidate_location(), wined3d_texture_load_drawable(), wined3d_texture_load_location(), wined3d_texture_load_renderbuffer(), wined3d_texture_no3d_load_location(), wined3d_texture_no3d_prepare_location(), wined3d_texture_no3d_unload_location(), wined3d_texture_update_map_binding(), wined3d_texture_validate_location(), wined3d_texture_vk_download_data(), wined3d_texture_vk_load_location(), wined3d_texture_vk_load_sysmem(), wined3d_texture_vk_load_texture(), wined3d_texture_vk_prepare_location(), wined3d_texture_vk_unload_location(), and wined3d_texture_vk_upload_data().

◆ wined3d_debug_resource_access()

const char * wined3d_debug_resource_access ( uint32_t  access)

Definition at line 4828 of file utils.c.

4829{
4830 struct debug_buffer buffer;
4831
4833#define ACCESS_TO_STR(x) if (access & x) { debug_append(&buffer, #x, " | "); access &= ~x; }
4838#undef ACCESS_TO_STR
4839 if (access)
4840 FIXME("Unrecognised access flag(s) %#x.\n", access);
4841
4842 return wine_dbg_sprintf("%s", buffer.str);
4843}
#define ACCESS_TO_STR(x)
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
#define WINED3D_RESOURCE_ACCESS_MAP_R
Definition: wined3d.h:53
#define WINED3D_RESOURCE_ACCESS_MAP_W
Definition: wined3d.h:54

Referenced by resource_init(), texture_resource_unload(), wined3d_buffer_init(), wined3d_texture_init(), and wined3d_texture_set_lod().

◆ wined3d_debug_view_desc()

const char * wined3d_debug_view_desc ( const struct wined3d_view_desc *  d,
const struct wined3d_resource *  resource 
)

Definition at line 4867 of file utils.c.

4868{
4869 struct debug_buffer buffer;
4870 unsigned int flags = d->flags;
4871
4873#define VIEW_FLAG_TO_STR(x) if (flags & x) { debug_append(&buffer, #x, " | "); flags &= ~x; }
4882#undef VIEW_FLAG_TO_STR
4883 if (flags)
4884 FIXME("Unrecognised view flag(s) %#x.\n", flags);
4885
4886 if (resource->type == WINED3D_RTYPE_BUFFER)
4887 return wine_dbg_sprintf("format %s, flags %s, start_idx %u, count %u",
4888 debug_d3dformat(d->format_id), buffer.str, d->u.buffer.start_idx, d->u.buffer.count);
4889 else
4890 return wine_dbg_sprintf("format %s, flags %s, level_idx %u, level_count %u, layer_idx %u, layer_count %u",
4891 debug_d3dformat(d->format_id), buffer.str, d->u.texture.level_idx, d->u.texture.level_count,
4892 d->u.texture.layer_idx, d->u.texture.layer_count);
4893}
#define VIEW_FLAG_TO_STR(x)
#define WINED3D_VIEW_READ_ONLY_DEPTH
Definition: wined3d.h:1584
#define WINED3D_VIEW_READ_ONLY_STENCIL
Definition: wined3d.h:1585
#define WINED3D_VIEW_TEXTURE_CUBE
Definition: wined3d.h:1582
#define WINED3D_VIEW_TEXTURE_ARRAY
Definition: wined3d.h:1583
#define WINED3D_VIEW_BUFFER_RAW
Definition: wined3d.h:1579
#define WINED3D_VIEW_FORWARD_REFERENCE
Definition: wined3d.h:1588
#define WINED3D_VIEW_BUFFER_APPEND
Definition: wined3d.h:1580
#define WINED3D_VIEW_BUFFER_COUNTER
Definition: wined3d.h:1581

Referenced by adapter_gl_create_rendertarget_view(), adapter_gl_create_shader_resource_view(), adapter_gl_create_unordered_access_view(), adapter_no3d_create_rendertarget_view(), adapter_no3d_create_shader_resource_view(), adapter_no3d_create_unordered_access_view(), adapter_vk_create_rendertarget_view(), adapter_vk_create_shader_resource_view(), adapter_vk_create_unordered_access_view(), wined3d_rendertarget_view_create(), wined3d_rendertarget_view_gl_init(), wined3d_rendertarget_view_no3d_init(), wined3d_rendertarget_view_vk_init(), wined3d_shader_resource_view_create(), wined3d_shader_resource_view_gl_init(), wined3d_shader_resource_view_vk_init(), wined3d_unordered_access_view_create(), wined3d_unordered_access_view_gl_init(), and wined3d_unordered_access_view_vk_init().

◆ wined3d_device_bo_map_lock()

static void wined3d_device_bo_map_lock ( struct wined3d_device *  device)
inlinestatic

Definition at line 3100 of file wined3d_private.h.

3101{
3102 EnterCriticalSection(&device->bo_map_lock);
3103}
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by wined3d_bo_gl_unmap(), wined3d_bo_vk_unmap(), wined3d_cs_map_upload_bo(), wined3d_cs_unmap_upload_bo(), and wined3d_deferred_context_map_upload_bo().

◆ wined3d_device_bo_map_unlock()

static void wined3d_device_bo_map_unlock ( struct wined3d_device *  device)
inlinestatic

Definition at line 3105 of file wined3d_private.h.

3106{
3107 LeaveCriticalSection(&device->bo_map_lock);
3108}
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

Referenced by wined3d_bo_gl_unmap(), wined3d_bo_vk_unmap(), wined3d_cs_map_upload_bo(), wined3d_cs_unmap_upload_bo(), and wined3d_deferred_context_map_upload_bo().

◆ wined3d_device_cleanup()

void wined3d_device_cleanup ( struct wined3d_device *  device)

Definition at line 205 of file device.c.

206{
207 unsigned int i;
208
209 if (device->swapchain_count)
211
213
214 for (i = 0; i < ARRAY_SIZE(device->multistate_funcs); ++i)
215 {
216 free(device->multistate_funcs[i]);
217 device->multistate_funcs[i] = NULL;
218 }
219
220 if (!list_empty(&device->resources))
221 {
223
224 ERR("Device released with resources still bound.\n");
225
227 {
228 ERR("Leftover resource %p with type %s (%#x).\n",
230 }
231 }
232
233 if (device->contexts)
234 ERR("Context array not freed!\n");
235 if (device->hardwareCursor)
236 DestroyCursor(device->hardwareCursor);
237 device->hardwareCursor = 0;
238
244
245 wined3d_lock_cleanup(&device->bo_map_lock);
246
247 wined3d_decref(device->wined3d);
248 device->wined3d = NULL;
249}
void wined3d_cs_destroy(struct wined3d_cs *cs)
Definition: cs.c:3657
static void device_leftover_rasterizer_state(struct wine_rb_entry *entry, void *context)
Definition: device.c:184
static void device_free_so_desc(struct wine_rb_entry *entry, void *context)
Definition: device.c:170
static void device_leftover_depth_stencil_state(struct wine_rb_entry *entry, void *context)
Definition: device.c:198
void wined3d_device_uninit_3d(struct wined3d_device *device)
Definition: device.c:1662
static void device_leftover_sampler(struct wine_rb_entry *entry, void *context)
Definition: device.c:177
static void device_leftover_blend_state(struct wine_rb_entry *entry, void *context)
Definition: device.c:191
BOOL WINAPI DestroyCursor(_In_ HCURSOR)
Definition: cursoricon.c:3093
#define wine_rb_destroy
Definition: rbtree.h:408
struct list resource_list_entry
ULONG CDECL wined3d_decref(struct wined3d *wined3d)
Definition: directx.c:198
static void wined3d_lock_cleanup(CRITICAL_SECTION *lock)

Referenced by adapter_gl_destroy_device(), adapter_no3d_destroy_device(), and adapter_vk_destroy_device().

◆ wined3d_device_context_emit_blt_sub_resource()

void wined3d_device_context_emit_blt_sub_resource ( struct wined3d_device_context *  context,
struct wined3d_resource *  dst_resource,
unsigned int  dst_sub_resource_idx,
const struct wined3d_box *  dst_box,
struct wined3d_resource *  src_resource,
unsigned int  src_sub_resource_idx,
const struct wined3d_box *  src_box,
unsigned int  flags,
const struct wined3d_blt_fx *  fx,
enum wined3d_texture_filter_type  filter 
)

Definition at line 2703 of file cs.c.

2707{
2709
2710 /* If we are replacing the whole resource, the CS thread might discard and
2711 * rename the buffer object, in which case ours is no longer valid. */
2712 if (dst_resource->type == WINED3D_RTYPE_BUFFER && dst_box->right - dst_box->left == dst_resource->size)
2714
2717 op->dst_resource = dst_resource;
2718 op->dst_sub_resource_idx = dst_sub_resource_idx;
2719 op->dst_box = *dst_box;
2720 op->src_resource = src_resource;
2721 op->src_sub_resource_idx = src_sub_resource_idx;
2722 op->src_box = *src_box;
2723 op->flags = flags;
2724 if (fx)
2725 op->fx = *fx;
2726 else
2727 memset(&op->fx, 0, sizeof(op->fx));
2728 op->filter = filter;
2729
2731 if (src_resource)
2733
2737}
static void invalidate_client_address(struct wined3d_resource *resource)
Definition: cs.c:85
@ WINED3D_CS_OP_BLT_SUB_RESOURCE
Definition: cs.c:136
static void wined3d_device_context_reference_resource(struct wined3d_device_context *context, struct wined3d_resource *resource)
Definition: cs.c:564
struct wined3d_resource * dst_resource
Definition: cs.c:485
struct wined3d_box src_box
Definition: cs.c:490
struct wined3d_resource * src_resource
Definition: cs.c:488
unsigned int src_sub_resource_idx
Definition: cs.c:489
struct wined3d_box dst_box
Definition: cs.c:487
enum wined3d_texture_filter_type filter
Definition: cs.c:493
unsigned int dst_sub_resource_idx
Definition: cs.c:486

Referenced by wined3d_device_context_blt(), wined3d_device_context_copy_resource(), wined3d_device_context_copy_sub_resource_region(), and wined3d_device_update_texture().

◆ wined3d_device_context_emit_clear_rendertarget_view()

void wined3d_device_context_emit_clear_rendertarget_view ( struct wined3d_device_context *  context,
struct wined3d_rendertarget_view *  view,
const RECT *  rect,
unsigned int  flags,
const struct wined3d_color *  color,
float  depth,
unsigned int  stencil 
)

Definition at line 844 of file cs.c.

847{
848 struct wined3d_cs_clear *op;
849 size_t size;
850
853
854 op->opcode = WINED3D_CS_OP_CLEAR;
857 {
858 op->rt_count = 1;
859 op->fb.render_targets[0] = view;
860 op->fb.depth_stencil = NULL;
861 op->color = *color;
862 }
863 else
864 {
865 op->rt_count = 0;
866 op->fb.render_targets[0] = NULL;
867 op->fb.depth_stencil = view;
868 op->depth = depth;
869 op->stencil = stencil;
870 }
871 SetRect(&op->draw_rect, 0, 0, view->width, view->height);
872 op->rect_count = 1;
873 op->rects[0] = *rect;
874
876
880}
RECT rect
Definition: combotst.c:67
#define WINED3DCLEAR_SYNCHRONOUS
Definition: wined3d.h:1011

Referenced by wined3d_device_context_clear_rendertarget_view().

◆ wined3d_device_context_emit_clear_uav()

void wined3d_device_context_emit_clear_uav ( struct wined3d_device_context *  context,
struct wined3d_unordered_access_view *  view,
const struct wined3d_uvec4 *  clear_value,
bool  fp 
)

◆ wined3d_device_context_emit_copy_uav_counter()

void wined3d_device_context_emit_copy_uav_counter ( struct wined3d_device_context *  context,
struct wined3d_buffer *  dst_buffer,
unsigned int  offset,
struct wined3d_unordered_access_view *  uav 
)

Definition at line 2881 of file cs.c.

2883{
2885
2888 op->buffer = dst_buffer;
2889 op->offset = offset;
2890 op->view = uav;
2891
2893
2895}
@ WINED3D_CS_OP_COPY_UAV_COUNTER
Definition: cs.c:141

Referenced by wined3d_device_context_copy_uav_counter().

◆ wined3d_device_context_emit_draw()

void wined3d_device_context_emit_draw ( struct wined3d_device_context *  context,
enum wined3d_primitive_type  primitive_type,
unsigned int  patch_vertex_count,
int  base_vertex_idx,
unsigned int  start_idx,
unsigned int  index_count,
unsigned int  start_instance,
unsigned int  instance_count,
bool  indexed 
)

Definition at line 1166 of file cs.c.

1170{
1171 const struct wined3d_d3d_info *d3d_info = &context->device->adapter->d3d_info;
1172 struct wined3d_cs_draw *op;
1173
1175 op->opcode = WINED3D_CS_OP_DRAW;
1176 op->primitive_type = primitive_type;
1177 op->patch_vertex_count = patch_vertex_count;
1178 op->parameters.indirect = FALSE;
1179 op->parameters.u.direct.base_vertex_idx = base_vertex_idx;
1180 op->parameters.u.direct.start_idx = start_idx;
1181 op->parameters.u.direct.index_count = index_count;
1182 op->parameters.u.direct.start_instance = start_instance;
1183 op->parameters.u.direct.instance_count = instance_count;
1184 op->parameters.indexed = indexed;
1185
1187
1189}
@ WINED3D_CS_OP_DRAW
Definition: cs.c:98
static void reference_graphics_pipeline_resources(struct wined3d_device_context *context, BOOL indexed, const struct wined3d_d3d_info *d3d_info)
Definition: cs.c:1131
enum wined3d_primitive_type primitive_type
Definition: cs.c:201
unsigned int patch_vertex_count
Definition: cs.c:202

Referenced by wined3d_device_context_draw(), and wined3d_device_context_draw_indexed().

◆ wined3d_device_context_emit_execute_command_list()

void wined3d_device_context_emit_execute_command_list ( struct wined3d_device_context *  context,
struct wined3d_command_list *  list,
bool  restore_state 
)

Definition at line 2994 of file cs.c.

2996{
2998
3001 op->list = list;
3002
3003 context->ops->reference_command_list(context, list);
3004
3006
3007 if (restore_state)
3009 else
3011}
@ WINED3D_CS_OP_EXECUTE_COMMAND_LIST
Definition: cs.c:143
void CDECL wined3d_device_context_set_state(struct wined3d_device_context *context, struct wined3d_state *state)
Definition: device.c:1915
void CDECL wined3d_device_context_reset_state(struct wined3d_device_context *context)
Definition: device.c:1904
#define list
Definition: rosglue.h:35

Referenced by wined3d_device_context_execute_command_list().

◆ wined3d_device_context_emit_generate_mipmaps()

void wined3d_device_context_emit_generate_mipmaps ( struct wined3d_device_context *  context,
struct wined3d_shader_resource_view *  view 
)

Definition at line 2908 of file cs.c.

2910{
2912
2915 op->view = view;
2916
2918
2920}
@ WINED3D_CS_OP_GENERATE_MIPMAPS
Definition: cs.c:142
struct wined3d_shader_resource_view * view
Definition: cs.c:532

Referenced by wined3d_device_context_generate_mipmaps().

◆ wined3d_device_context_emit_map()

HRESULT wined3d_device_context_emit_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 
)

Definition at line 2488 of file cs.c.

2491{
2492 struct wined3d_cs_map *op;
2493 HRESULT hr;
2494
2495 /* Mapping resources from the worker thread isn't an issue by itself, but
2496 * increasing the map count would be visible to applications. */
2497 wined3d_not_from_cs(context->device->cs);
2498
2500 && context->ops->map_upload_bo(context, resource, sub_resource_idx, map_desc, box, flags))
2501 {
2502 TRACE("Returning map pointer %p, row pitch %u, slice pitch %u.\n",
2503 map_desc->data, map_desc->row_pitch, map_desc->slice_pitch);
2504 return WINED3D_OK;
2505 }
2506
2507 TRACE_(d3d_perf)("Mapping resource %p (type %u), flags %#x through the CS.\n", resource, resource->type, flags);
2508
2510
2511 /* We might end up invalidating the resource on the CS thread. */
2513
2515 return E_OUTOFMEMORY;
2516 op->opcode = WINED3D_CS_OP_MAP;
2517 op->resource = resource;
2518 op->sub_resource_idx = sub_resource_idx;
2519 op->map_ptr = &map_desc->data;
2520 op->box = box;
2521 op->flags = flags;
2522 op->hr = &hr;
2523
2526
2527 if (SUCCEEDED(hr))
2529 &map_desc->row_pitch, &map_desc->slice_pitch);
2530 return hr;
2531}
@ WINED3D_CS_OP_MAP
Definition: cs.c:133
HRESULT hr
Definition: delayimp.cpp:582
#define SUCCEEDED(hr)
Definition: intsafe.h:50
unsigned int sub_resource_idx
Definition: cs.c:459
const struct wined3d_box * box
Definition: cs.c:461
#define WINED3D_MAP_NOOVERWRITE
Definition: wined3d.h:952
static void wined3d_resource_wait_idle(const struct wined3d_resource *resource)

Referenced by wined3d_device_context_map().

◆ wined3d_device_context_emit_reset_state()

void wined3d_device_context_emit_reset_state ( struct wined3d_device_context *  context,
bool  invalidate 
)

◆ wined3d_device_context_emit_set_blend_state()

void wined3d_device_context_emit_set_blend_state ( struct wined3d_device_context *  context,
struct wined3d_blend_state *  state,
const struct wined3d_color *  blend_factor,
unsigned int  sample_mask 
)

Definition at line 1800 of file cs.c.

1802{
1804
1807 op->state = state;
1808 op->factor = *blend_factor;
1809 op->sample_mask = sample_mask;
1810
1812}
@ WINED3D_CS_OP_SET_BLEND_STATE
Definition: cs.c:115
unsigned int sample_mask
Definition: cs.c:343

Referenced by wined3d_device_context_set_blend_state(), and wined3d_device_context_set_state().

◆ wined3d_device_context_emit_set_clip_plane()

void wined3d_device_context_emit_set_clip_plane ( struct wined3d_device_context *  context,
unsigned int  plane_idx,
const struct wined3d_vec4 *  plane 
)

Definition at line 1961 of file cs.c.

1963{
1965
1968 op->plane_idx = plane_idx;
1969 op->plane = *plane;
1970
1972}
@ WINED3D_CS_OP_SET_CLIP_PLANE
Definition: cs.c:122
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 GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum plane
Definition: glfuncs.h:270

Referenced by wined3d_device_set_clip_plane().

◆ wined3d_device_context_emit_set_constant_buffers()

void wined3d_device_context_emit_set_constant_buffers ( struct wined3d_device_context *  context,
enum wined3d_shader_type  type,
unsigned int  start_idx,
unsigned int  count,
const struct wined3d_constant_buffer_state *  buffers 
)

Definition at line 1546 of file cs.c.

1549{
1551
1555 op->type = type;
1556 op->start_idx = start_idx;
1557 op->count = count;
1558 memcpy(op->buffers, buffers, count * sizeof(*buffers));
1559
1561}
@ WINED3D_CS_OP_SET_CONSTANT_BUFFERS
Definition: cs.c:109
const GLuint * buffers
Definition: glext.h:5916
#define offsetof(TYPE, MEMBER)
unsigned int start_idx
Definition: cs.c:278

Referenced by wined3d_device_context_set_constant_buffers(), and wined3d_device_context_set_state().

◆ wined3d_device_context_emit_set_depth_stencil_state()

void wined3d_device_context_emit_set_depth_stencil_state ( struct wined3d_device_context *  context,
struct wined3d_depth_stencil_state *  state,
unsigned int  stencil_ref 
)

◆ wined3d_device_context_emit_set_depth_stencil_view()

void wined3d_device_context_emit_set_depth_stencil_view ( struct wined3d_device_context *  context,
struct wined3d_rendertarget_view *  view 
)

◆ wined3d_device_context_emit_set_feature_level()

void wined3d_device_context_emit_set_feature_level ( struct wined3d_device_context *  context,
enum wined3d_feature_level  level 
)

Definition at line 2129 of file cs.c.

Referenced by wined3d_device_context_set_state().

◆ wined3d_device_context_emit_set_index_buffer()

void wined3d_device_context_emit_set_index_buffer ( struct wined3d_device_context *  context,
struct wined3d_buffer *  buffer,
enum wined3d_format_id  format_id,
unsigned int  offset 
)

Definition at line 1511 of file cs.c.

1513{
1515
1518 op->buffer = buffer;
1519 op->format_id = format_id;
1520 op->offset = offset;
1521
1523}
@ WINED3D_CS_OP_SET_INDEX_BUFFER
Definition: cs.c:108

Referenced by wined3d_device_context_set_index_buffer(), and wined3d_device_context_set_state().

◆ wined3d_device_context_emit_set_light()

void wined3d_device_context_emit_set_light ( struct wined3d_device_context *  context,
const struct wined3d_light_info *  light 
)

Definition at line 2083 of file cs.c.

Referenced by wined3d_device_context_set_light().

◆ wined3d_device_context_emit_set_light_enable()

void wined3d_device_context_emit_set_light_enable ( struct wined3d_device_context *  context,
unsigned int  idx,
BOOL  enable 
)

Definition at line 2110 of file cs.c.

2111{
2113
2116 op->idx = idx;
2117 op->enable = enable;
2118
2120}
@ WINED3D_CS_OP_SET_LIGHT_ENABLE
Definition: cs.c:125
GLboolean enable
Definition: glext.h:11120

Referenced by wined3d_device_set_light_enable().

◆ wined3d_device_context_emit_set_predication()

void wined3d_device_context_emit_set_predication ( struct wined3d_device_context *  context,
struct wined3d_query *  predicate,
BOOL  value 
)

Definition at line 1245 of file cs.c.

1247{
1249
1252 op->predicate = predicate;
1253 op->value = value;
1254
1256}
@ WINED3D_CS_OP_SET_PREDICATION
Definition: cs.c:100
struct wined3d_query * predicate
Definition: cs.c:214

Referenced by wined3d_device_context_set_predication(), and wined3d_device_context_set_state().

◆ wined3d_device_context_emit_set_rasterizer_state()

void wined3d_device_context_emit_set_rasterizer_state ( struct wined3d_device_context *  context,
struct wined3d_rasterizer_state *  rasterizer_state 
)

◆ wined3d_device_context_emit_set_render_state()

void wined3d_device_context_emit_set_render_state ( struct wined3d_device_context *  context,
enum wined3d_render_state  state,
unsigned int  value 
)

Definition at line 1893 of file cs.c.

Referenced by wined3d_device_set_render_state().

◆ wined3d_device_context_emit_set_rendertarget_views()

void wined3d_device_context_emit_set_rendertarget_views ( struct wined3d_device_context *  context,
unsigned int  start_idx,
unsigned int  count,
struct wined3d_rendertarget_view *const *  views 
)

Definition at line 1343 of file cs.c.

1345{
1347
1351 op->start_idx = start_idx;
1352 op->count = count;
1353 memcpy(op->views, views, count * sizeof(*views));
1354
1356}
@ WINED3D_CS_OP_SET_RENDERTARGET_VIEWS
Definition: cs.c:103
struct wined3d_rendertarget_view * views[1]
Definition: cs.c:237

Referenced by wined3d_device_context_set_rendertarget_views(), and wined3d_device_context_set_state().

◆ wined3d_device_context_emit_set_samplers()

void wined3d_device_context_emit_set_samplers ( struct wined3d_device_context *  context,
enum wined3d_shader_type  type,
unsigned int  start_idx,
unsigned int  count,
struct wined3d_sampler *const *  samplers 
)

Definition at line 1737 of file cs.c.

1739{
1741
1745 op->type = type;
1746 op->start_idx = start_idx;
1747 op->count = count;
1748 memcpy(op->samplers, samplers, count * sizeof(*samplers));
1749
1751}
@ WINED3D_CS_OP_SET_SAMPLERS
Definition: cs.c:113
GLuint * samplers
Definition: glext.h:7280
unsigned int start_idx
Definition: cs.c:326

Referenced by wined3d_device_context_set_samplers(), and wined3d_device_context_set_state().

◆ wined3d_device_context_emit_set_scissor_rects()

void wined3d_device_context_emit_set_scissor_rects ( struct wined3d_device_context *  context,
unsigned int  rect_count,
const RECT *  rects 
)

◆ wined3d_device_context_emit_set_shader()

void wined3d_device_context_emit_set_shader ( struct wined3d_device_context *  context,
enum wined3d_shader_type  type,
struct wined3d_shader *  shader 
)

◆ wined3d_device_context_emit_set_shader_resource_views()

void wined3d_device_context_emit_set_shader_resource_views ( struct wined3d_device_context *  context,
enum wined3d_shader_type  type,
unsigned int  start_idx,
unsigned int  count,
struct wined3d_shader_resource_view *const *  views 
)

Definition at line 1659 of file cs.c.

1662{
1664
1668 op->type = type;
1669 op->start_idx = start_idx;
1670 op->count = count;
1671 memcpy(op->views, views, count * sizeof(*views));
1672
1674}
@ WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEWS
Definition: cs.c:111
struct wined3d_shader_resource_view * views[1]
Definition: cs.c:306

Referenced by wined3d_device_context_set_shader_resource_views(), and wined3d_device_context_set_state().

◆ wined3d_device_context_emit_set_stream_outputs()

void wined3d_device_context_emit_set_stream_outputs ( struct wined3d_device_context *  context,
const struct wined3d_stream_output  outputs[WINED3D_MAX_STREAM_OUTPUT_BUFFERS] 
)

Definition at line 1481 of file cs.c.

1483{
1485
1488 memcpy(op->outputs, outputs, sizeof(op->outputs));
1489
1491}
@ WINED3D_CS_OP_SET_STREAM_OUTPUTS
Definition: cs.c:107
struct wined3d_stream_output outputs[WINED3D_MAX_STREAM_OUTPUT_BUFFERS]
Definition: cs.c:263

Referenced by wined3d_device_context_set_state(), and wined3d_device_context_set_stream_outputs().

◆ wined3d_device_context_emit_set_stream_sources()

void wined3d_device_context_emit_set_stream_sources ( struct wined3d_device_context *  context,
unsigned int  start_idx,
unsigned int  count,
const struct wined3d_stream_state *  streams 
)

Definition at line 1446 of file cs.c.

1448{
1450
1454 op->start_idx = start_idx;
1455 op->count = count;
1456 memcpy(op->streams, streams, count * sizeof(*streams));
1457
1459}
@ WINED3D_CS_OP_SET_STREAM_SOURCES
Definition: cs.c:106
struct wined3d_stream_state streams[1]
Definition: cs.c:257
unsigned int start_idx
Definition: cs.c:255

Referenced by wined3d_device_context_set_state(), and wined3d_device_context_set_stream_sources().

◆ wined3d_device_context_emit_set_texture()

void wined3d_device_context_emit_set_texture ( struct wined3d_device_context *  context,
enum wined3d_shader_type  shader_type,
unsigned int  bind_index,
struct wined3d_shader_resource_view *  view 
)

Definition at line 1621 of file cs.c.

1623{
1624 struct wined3d_cs_set_texture *op;
1625
1627 op->opcode = WINED3D_CS_OP_SET_TEXTURE;
1628 op->shader_type = shader_type;
1629 op->bind_index = bind_index;
1630 op->view = view;
1631
1633}
@ WINED3D_CS_OP_SET_TEXTURE
Definition: cs.c:110
struct wined3d_shader_resource_view * view
Definition: cs.c:288
unsigned int bind_index
Definition: cs.c:287

Referenced by wined3d_device_set_texture().

◆ wined3d_device_context_emit_set_texture_state()

void wined3d_device_context_emit_set_texture_state ( struct wined3d_device_context *  context,
unsigned int  stage,
enum wined3d_texture_stage_state  state,
unsigned int  value 
)

Definition at line 1914 of file cs.c.

Referenced by wined3d_device_set_texture_stage_state().

◆ wined3d_device_context_emit_set_transform()

void wined3d_device_context_emit_set_transform ( struct wined3d_device_context *  context,
enum wined3d_transform_state  state,
const struct wined3d_matrix *  matrix 
)

Definition at line 1940 of file cs.c.

1942{
1944
1947 op->state = state;
1948 op->matrix = *matrix;
1949
1951}
@ WINED3D_CS_OP_SET_TRANSFORM
Definition: cs.c:121
GLuint GLenum matrix
Definition: glext.h:9407

Referenced by wined3d_device_set_transform().

◆ wined3d_device_context_emit_set_unordered_access_views()

void wined3d_device_context_emit_set_unordered_access_views ( struct wined3d_device_context *  context,
enum wined3d_pipeline  pipeline,
unsigned int  start_idx,
unsigned int  count,
struct wined3d_unordered_access_view *const *  views,
const unsigned int *  initial_count 
)

Definition at line 1701 of file cs.c.

1704{
1706 unsigned int i;
1707
1711 op->pipeline = pipeline;
1712 op->start_idx = start_idx;
1713 op->count = count;
1714 for (i = 0; i < count; ++i)
1715 {
1716 op->uavs[i].view = views[i];
1717 op->uavs[i].initial_count = initial_counts ? initial_counts[i] : ~0u;
1718 }
1719
1721}
@ WINED3D_CS_OP_SET_UNORDERED_ACCESS_VIEWS
Definition: cs.c:112
struct wined3d_cs_set_unordered_access_views::@333 uavs[1]
enum wined3d_pipeline pipeline
Definition: cs.c:312

Referenced by wined3d_device_context_set_state(), and wined3d_device_context_set_unordered_access_views().

◆ wined3d_device_context_emit_set_vertex_declaration()

void wined3d_device_context_emit_set_vertex_declaration ( struct wined3d_device_context *  context,
struct wined3d_vertex_declaration *  declaration 
)

◆ wined3d_device_context_emit_set_viewports()

void wined3d_device_context_emit_set_viewports ( struct wined3d_device_context *  context,
unsigned int  viewport_count,
const struct wined3d_viewport *  viewports 
)

◆ wined3d_device_context_emit_unmap()

HRESULT wined3d_device_context_emit_unmap ( struct wined3d_device_context *  context,
struct wined3d_resource *  resource,
unsigned int  sub_resource_idx 
)

Definition at line 2541 of file cs.c.

2543{
2544 struct wined3d_cs_unmap *op;
2545 struct wined3d_box box;
2546 struct upload_bo bo;
2547 HRESULT hr;
2548
2549 if (context->ops->unmap_upload_bo(context, resource, sub_resource_idx, &box, &bo))
2550 {
2551 unsigned int row_pitch, slice_pitch;
2552
2553 wined3d_resource_get_sub_resource_map_pitch(resource, sub_resource_idx, &row_pitch, &slice_pitch);
2554 if (bo.flags & UPLOAD_BO_UPLOAD_ON_UNMAP)
2555 wined3d_device_context_upload_bo(context, resource, sub_resource_idx, &box, &bo, row_pitch, slice_pitch);
2556 return WINED3D_OK;
2557 }
2558
2559 wined3d_not_from_cs(context->device->cs);
2560
2561 TRACE_(d3d_perf)("Unmapping resource %p (type %u) through the CS.\n", resource, resource->type);
2562
2564 return E_OUTOFMEMORY;
2565 op->opcode = WINED3D_CS_OP_UNMAP;
2566 op->resource = resource;
2567 op->sub_resource_idx = sub_resource_idx;
2568 op->hr = &hr;
2569
2572
2573 return hr;
2574}
@ WINED3D_CS_OP_UNMAP
Definition: cs.c:134
static void wined3d_device_context_upload_bo(struct wined3d_device_context *context, struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, const struct upload_bo *bo, unsigned int row_pitch, unsigned int slice_pitch)
Definition: cs.c:2455
#define UPLOAD_BO_UPLOAD_ON_UNMAP

Referenced by wined3d_device_context_unmap().

◆ wined3d_device_context_emit_update_sub_resource()

void wined3d_device_context_emit_update_sub_resource ( struct wined3d_device_context *  context,
struct wined3d_resource *  resource,
unsigned int  sub_resource_idx,
const struct wined3d_box *  box,
const void *  data,
unsigned int  row_pitch,
unsigned int  slice_pitch 
)

Definition at line 2766 of file cs.c.

2769{
2771 struct wined3d_map_desc map_desc;
2772 struct wined3d_box dummy_box;
2773 struct upload_bo bo;
2774
2775 /* If we are replacing the whole resource, the CS thread might discard and
2776 * rename the buffer object, in which case ours is no longer valid. */
2777 if (resource->type == WINED3D_RTYPE_BUFFER && box->right - box->left == resource->size)
2779
2780 if (context->ops->map_upload_bo(context, resource, sub_resource_idx, &map_desc, box, WINED3D_MAP_WRITE))
2781 {
2782 wined3d_format_copy_data(resource->format, data, row_pitch, slice_pitch, map_desc.data, map_desc.row_pitch,
2783 map_desc.slice_pitch, box->right - box->left, box->bottom - box->top, box->back - box->front);
2784 context->ops->unmap_upload_bo(context, resource, sub_resource_idx, &dummy_box, &bo);
2786 box, &bo, map_desc.row_pitch, map_desc.slice_pitch);
2787 return;
2788 }
2789
2791
2794 op->resource = resource;
2795 op->sub_resource_idx = sub_resource_idx;
2796 op->box = *box;
2797 op->bo.addr.buffer_object = 0;
2798 op->bo.addr.addr = data;
2799 op->bo.flags = 0;
2800 op->row_pitch = row_pitch;
2801 op->slice_pitch = slice_pitch;
2802
2804 /* The data pointer may go away, so we need to wait until it is read.
2805 * Copying the data may be faster if it's small. */
2807}
@ WINED3D_CS_OP_UPDATE_SUB_RESOURCE
Definition: cs.c:137
void wined3d_format_copy_data(const struct wined3d_format *format, const uint8_t *src, unsigned int src_row_pitch, unsigned int src_slice_pitch, uint8_t *dst, unsigned int dst_row_pitch, unsigned int dst_slice_pitch, unsigned int w, unsigned int h, unsigned int d)
Definition: utils.c:6080
unsigned char * data
Definition: utils.c:169

Referenced by wined3d_buffer_init_data(), wined3d_device_context_push_constants(), wined3d_device_context_update_sub_resource(), and wined3d_texture_create().

◆ wined3d_device_context_lock()

static void wined3d_device_context_lock ( struct wined3d_device_context *  context)
inlinestatic

Definition at line 3676 of file wined3d_private.h.

3677{
3678 if (context == &context->device->cs->c)
3680}

Referenced by wined3d_deferred_context_record_command_list(), wined3d_device_context_clear_rendertarget_view(), wined3d_device_context_clear_sysmem_texture(), wined3d_device_context_clear_uav_float(), wined3d_device_context_clear_uav_uint(), wined3d_device_context_copy_resource(), wined3d_device_context_copy_sub_resource_region(), wined3d_device_context_copy_uav_counter(), wined3d_device_context_dispatch(), wined3d_device_context_dispatch_indirect(), wined3d_device_context_draw(), wined3d_device_context_draw_indexed(), wined3d_device_context_draw_indirect(), wined3d_device_context_execute_command_list(), wined3d_device_context_flush(), wined3d_device_context_generate_mipmaps(), wined3d_device_context_issue_query(), wined3d_device_context_map(), wined3d_device_context_reset_state(), wined3d_device_context_resolve_sub_resource(), wined3d_device_context_set_blend_state(), wined3d_device_context_set_constant_buffers(), wined3d_device_context_set_depth_stencil_state(), wined3d_device_context_set_depth_stencil_view(), wined3d_device_context_set_index_buffer(), wined3d_device_context_set_predication(), wined3d_device_context_set_primitive_type(), wined3d_device_context_set_rasterizer_state(), wined3d_device_context_set_render_targets_and_unordered_access_views(), wined3d_device_context_set_rendertarget_views(), wined3d_device_context_set_samplers(), wined3d_device_context_set_scissor_rects(), wined3d_device_context_set_shader(), wined3d_device_context_set_shader_resource_views(), wined3d_device_context_set_state(), wined3d_device_context_set_stream_outputs(), wined3d_device_context_set_stream_sources(), wined3d_device_context_set_unordered_access_views(), wined3d_device_context_set_vertex_declaration(), wined3d_device_context_set_viewports(), wined3d_device_context_unmap(), and wined3d_device_context_update_sub_resource().

◆ wined3d_device_context_push_constants()

void wined3d_device_context_push_constants ( struct wined3d_device_context *  context,
enum wined3d_push_constants  type,
uint32_t  update_mask,
unsigned int  start_idx,
unsigned int  count,
const void *  constants 
)

Definition at line 2231 of file cs.c.

2234{
2236 unsigned int byte_offset = start_idx * info->size;
2237 unsigned int byte_size = count * info->size;
2238 struct wined3d_box box;
2239
2241 return;
2242
2243 wined3d_box_set(&box, byte_offset, 0, byte_offset + byte_size, 1, 0, 1);
2245 &context->device->push_constants[type]->resource, 0, &box, constants, byte_size, byte_size);
2247}
static const struct push_constant_info wined3d_cs_push_constant_info[]
static bool prepare_push_constant_buffer(struct wined3d_device_context *context, enum wined3d_push_constants type)
Definition: cs.c:2159
static void wined3d_device_context_emit_push_constants(struct wined3d_device_context *context, enum wined3d_push_constants type, uint32_t update_mask, unsigned int start_idx, unsigned int count)
Definition: cs.c:2215
void wined3d_device_context_emit_update_sub_resource(struct wined3d_device_context *context, struct wined3d_resource *resource, unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch, unsigned int slice_pitch)
Definition: cs.c:2766
constants
Definition: resource.c:30
static void wined3d_box_set(struct wined3d_box *box, unsigned int left, unsigned int top, unsigned int right, unsigned int bottom, unsigned int front, unsigned int back)
Definition: wined3d.h:3006

Referenced by wined3d_device_apply_stateblock(), wined3d_device_set_ps_consts_b(), wined3d_device_set_ps_consts_f(), wined3d_device_set_ps_consts_i(), wined3d_device_set_vs_consts_b(), wined3d_device_set_vs_consts_f(), and wined3d_device_set_vs_consts_i().

◆ wined3d_device_context_set_depth_bounds()

void wined3d_device_context_set_depth_bounds ( struct wined3d_device_context *  context,
bool  enable,
float  min_depth,
float  max_depth 
)

Definition at line 1871 of file cs.c.

1873{
1875
1878 op->enable = enable;
1879 op->min_depth = min_depth;
1880 op->max_depth = max_depth;
1881
1883}
@ WINED3D_CS_OP_SET_DEPTH_BOUNDS
Definition: cs.c:118

Referenced by wined3d_device_apply_stateblock().

◆ wined3d_device_context_unlock()

static void wined3d_device_context_unlock ( struct wined3d_device_context *  context)
inlinestatic

Definition at line 3682 of file wined3d_private.h.

3683{
3684 if (context == &context->device->cs->c)
3686}

Referenced by wined3d_deferred_context_record_command_list(), wined3d_device_context_clear_rendertarget_view(), wined3d_device_context_clear_sysmem_texture(), wined3d_device_context_clear_uav_float(), wined3d_device_context_clear_uav_uint(), wined3d_device_context_copy_resource(), wined3d_device_context_copy_sub_resource_region(), wined3d_device_context_copy_uav_counter(), wined3d_device_context_dispatch(), wined3d_device_context_dispatch_indirect(), wined3d_device_context_draw(), wined3d_device_context_draw_indexed(), wined3d_device_context_draw_indirect(), wined3d_device_context_execute_command_list(), wined3d_device_context_flush(), wined3d_device_context_generate_mipmaps(), wined3d_device_context_issue_query(), wined3d_device_context_map(), wined3d_device_context_reset_state(), wined3d_device_context_resolve_sub_resource(), wined3d_device_context_set_blend_state(), wined3d_device_context_set_constant_buffers(), wined3d_device_context_set_depth_stencil_state(), wined3d_device_context_set_depth_stencil_view(), wined3d_device_context_set_index_buffer(), wined3d_device_context_set_predication(), wined3d_device_context_set_primitive_type(), wined3d_device_context_set_rasterizer_state(), wined3d_device_context_set_render_targets_and_unordered_access_views(), wined3d_device_context_set_rendertarget_views(), wined3d_device_context_set_samplers(), wined3d_device_context_set_scissor_rects(), wined3d_device_context_set_shader(), wined3d_device_context_set_shader_resource_views(), wined3d_device_context_set_state(), wined3d_device_context_set_stream_outputs(), wined3d_device_context_set_stream_sources(), wined3d_device_context_set_unordered_access_views(), wined3d_device_context_set_vertex_declaration(), wined3d_device_context_set_viewports(), wined3d_device_context_unmap(), and wined3d_device_context_update_sub_resource().

◆ wined3d_device_create_default_samplers()

void wined3d_device_create_default_samplers ( struct wined3d_device *  device,
struct wined3d_context *  context 
)

Definition at line 737 of file device.c.

738{
740 HRESULT hr;
741
742 desc.address_u = WINED3D_TADDRESS_WRAP;
743 desc.address_v = WINED3D_TADDRESS_WRAP;
744 desc.address_w = WINED3D_TADDRESS_WRAP;
745 memset(desc.border_color, 0, sizeof(desc.border_color));
746 desc.mag_filter = WINED3D_TEXF_POINT;
747 desc.min_filter = WINED3D_TEXF_POINT;
748 desc.mip_filter = WINED3D_TEXF_NONE;
749 desc.lod_bias = 0.0f;
750 desc.min_lod = -1000.0f;
751 desc.max_lod = 1000.0f;
752 desc.mip_base_level = 0;
753 desc.max_anisotropy = 1;
754 desc.compare = FALSE;
755 desc.comparison_func = WINED3D_CMP_NEVER;
756 desc.srgb_decode = TRUE;
757
758 /* In SM4+ shaders there is a separation between resources and samplers. Some shader
759 * instructions allow access to resources without using samplers.
760 * In GLSL, resources are always accessed through sampler or image variables. The default
761 * sampler object is used to emulate the direct resource access when there is no sampler state
762 * to use.
763 */
765 {
766 ERR("Failed to create default sampler, hr %#lx.\n", hr);
767 device->default_sampler = NULL;
768 }
769
770 /* In D3D10+, a NULL sampler maps to the default sampler state. */
771 desc.address_u = WINED3D_TADDRESS_CLAMP;
772 desc.address_v = WINED3D_TADDRESS_CLAMP;
773 desc.address_w = WINED3D_TADDRESS_CLAMP;
774 desc.mag_filter = WINED3D_TEXF_LINEAR;
775 desc.min_filter = WINED3D_TEXF_LINEAR;
776 desc.mip_filter = WINED3D_TEXF_LINEAR;
778 {
779 ERR("Failed to create null sampler, hr %#lx.\n", hr);
780 device->null_sampler = NULL;
781 }
782}
HRESULT CDECL wined3d_sampler_create(struct wined3d_device *device, const struct wined3d_sampler_desc *desc, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_sampler **sampler)
Definition: sampler.c:287
const struct wined3d_parent_ops wined3d_null_parent_ops
Definition: directx.c:3472
@ WINED3D_TADDRESS_WRAP
Definition: wined3d.h:658
@ WINED3D_TADDRESS_CLAMP
Definition: wined3d.h:660
@ WINED3D_CMP_NEVER
Definition: wined3d.h:461

Referenced by adapter_vk_init_3d(), and wined3d_device_gl_create_primary_opengl_context_cs().

◆ wined3d_device_destroy_default_samplers()

void wined3d_device_destroy_default_samplers ( struct wined3d_device *  device)

Definition at line 784 of file device.c.

785{
786 wined3d_sampler_decref(device->default_sampler);
787 device->default_sampler = NULL;
788 wined3d_sampler_decref(device->null_sampler);
789 device->null_sampler = NULL;
790}

Referenced by adapter_gl_uninit_3d(), and adapter_vk_uninit_3d().

◆ wined3d_device_init()

HRESULT wined3d_device_init ( struct wined3d_device *  device,
struct wined3d *  wined3d,
unsigned int  adapter_idx,
enum wined3d_device_type  device_type,
HWND  focus_window,
unsigned int  flags,
BYTE  surface_alignment,
const enum wined3d_feature_level *  levels,
unsigned int  level_count,
const BOOL *  supported_extensions,
struct wined3d_device_parent *  device_parent 
)

Definition at line 5479 of file device.c.

5483{
5484 struct wined3d_adapter *adapter = wined3d->adapters[adapter_idx];
5485 const struct wined3d_fragment_pipe_ops *fragment_pipeline;
5486 const struct wined3d_vertex_pipe_ops *vertex_pipeline;
5487 unsigned int i;
5488 HRESULT hr;
5489
5490 device->ref = 1;
5491 device->wined3d = wined3d;
5492 wined3d_incref(device->wined3d);
5493 device->adapter = adapter;
5494 device->device_parent = device_parent;
5495 list_init(&device->resources);
5496 list_init(&device->shaders);
5497 device->surface_alignment = surface_alignment;
5498
5499 /* Save the creation parameters. */
5500 device->create_parms.adapter_idx = adapter_idx;
5501 device->create_parms.device_type = device_type;
5502 device->create_parms.focus_window = focus_window;
5503 device->create_parms.flags = flags;
5504
5505 device->shader_backend = adapter->shader_backend;
5506
5507 vertex_pipeline = adapter->vertex_pipe;
5508
5509 fragment_pipeline = adapter->fragment_pipe;
5510
5518
5519 if (vertex_pipeline->vp_states && fragment_pipeline->states
5520 && FAILED(hr = compile_state_table(device->state_table, device->multistate_funcs,
5521 &adapter->d3d_info, supported_extensions, vertex_pipeline,
5522 fragment_pipeline, adapter->misc_state_template)))
5523 {
5524 ERR("Failed to compile state table, hr %#lx.\n", hr);
5525 wine_rb_destroy(&device->samplers, NULL, NULL);
5526 wine_rb_destroy(&device->rasterizer_states, NULL, NULL);
5527 wine_rb_destroy(&device->blend_states, NULL, NULL);
5528 wine_rb_destroy(&device->depth_stencil_states, NULL, NULL);
5529 wine_rb_destroy(&device->so_descs, NULL, NULL);
5530 wine_rb_destroy(&device->ffp_vertex_shaders, NULL, NULL);
5531 wine_rb_destroy(&device->ffp_pixel_shaders, NULL, NULL);
5532 wined3d_decref(device->wined3d);
5533 return hr;
5534 }
5535
5536 device->max_frame_latency = 3;
5537
5538 if (!(device->cs = wined3d_cs_create(device, levels, level_count)))
5539 {
5540 WARN("Failed to create command stream.\n");
5541 hr = E_FAIL;
5542 goto err;
5543 }
5544
5545 wined3d_lock_init(&device->bo_map_lock, "wined3d_device.bo_map_lock");
5546
5547 return WINED3D_OK;
5548
5549err:
5550 for (i = 0; i < ARRAY_SIZE(device->multistate_funcs); ++i)
5551 {
5552 free(device->multistate_funcs[i]);
5553 }
5554 wine_rb_destroy(&device->samplers, NULL, NULL);
5555 wine_rb_destroy(&device->rasterizer_states, NULL, NULL);
5556 wine_rb_destroy(&device->blend_states, NULL, NULL);
5557 wine_rb_destroy(&device->depth_stencil_states, NULL, NULL);
5558 wine_rb_destroy(&device->so_descs, NULL, NULL);
5559 wine_rb_destroy(&device->ffp_vertex_shaders, NULL, NULL);
5560 wine_rb_destroy(&device->ffp_pixel_shaders, NULL, NULL);
5561 wined3d_decref(device->wined3d);
5562 return hr;
5563}
struct wined3d_cs * wined3d_cs_create(struct wined3d_device *device, const enum wined3d_feature_level *levels, unsigned int level_count)
Definition: cs.c:3561
#define E_FAIL
Definition: ddrawi.h:102
static int wined3d_depth_stencil_state_compare(const void *key, const struct wine_rb_entry *entry)
Definition: device.c:5471
static int wined3d_blend_state_compare(const void *key, const struct wine_rb_entry *entry)
Definition: device.c:5464
static int wined3d_so_desc_compare(const void *key, const struct wine_rb_entry *entry)
Definition: device.c:5405
GLbitfield flags
Definition: device.c:1245
static int wined3d_sampler_compare(const void *key, const struct wine_rb_entry *entry)
Definition: device.c:5450
static int wined3d_rasterizer_state_compare(const void *key, const struct wine_rb_entry *entry)
Definition: device.c:5457
int wined3d_ffp_frag_program_key_compare(const void *key, const struct wine_rb_entry *entry)
Definition: utils.c:6436
int wined3d_ffp_vertex_program_key_compare(const void *key, const struct wine_rb_entry *entry)
Definition: utils.c:6579
HRESULT compile_state_table(struct wined3d_state_entry *state_table, APPLYSTATEFUNC **dev_multistate_funcs, const struct wined3d_d3d_info *d3d_info, const BOOL *supported_extensions, const struct wined3d_vertex_pipe_ops *vertex, const struct wined3d_fragment_pipe_ops *fragment, const struct wined3d_state_entry_template *misc)
Definition: ffp_gl.c:1666
#define err(...)
#define wine_rb_init
Definition: rbtree.h:406
const struct wined3d_state_entry_template * vp_states
struct wined3d_adapter * adapters[1]
ULONG CDECL wined3d_incref(struct wined3d *wined3d)
Definition: directx.c:189
#define wined3d_lock_init(lock, name)

Referenced by adapter_gl_create_device(), adapter_no3d_create_device(), and adapter_vk_create_device().

◆ wined3d_device_no3d()

Definition at line 3117 of file wined3d_private.h.

◆ wined3d_device_set_implicit_swapchain()

HRESULT wined3d_device_set_implicit_swapchain ( struct wined3d_device *  device,
struct wined3d_swapchain *  swapchain 
)

Definition at line 1537 of file device.c.

1538{
1539 static const struct wined3d_color black = {0.0f, 0.0f, 0.0f, 0.0f};
1540 const struct wined3d_swapchain_desc *swapchain_desc;
1541 struct wined3d_fb_state *fb = &device->cs->c.state->fb;
1542 DWORD clear_flags = 0;
1543 unsigned int i;
1544 HRESULT hr;
1545
1546 TRACE("device %p, swapchain %p.\n", device, swapchain);
1547
1548 if (device->d3d_initialized)
1550
1551 device->swapchain_count = 1;
1552 if (!(device->swapchains = calloc(device->swapchain_count, sizeof(*device->swapchains))))
1553 {
1554 ERR("Failed to allocate swapchain array.\n");
1555 hr = E_OUTOFMEMORY;
1556 goto err_out;
1557 }
1558 device->swapchains[0] = swapchain;
1559
1560 for (i = 0; i < ARRAY_SIZE(fb->render_targets); ++i)
1561 {
1562 if (fb->render_targets[i])
1564 }
1565 memset(fb->render_targets, 0, sizeof(fb->render_targets));
1566
1567 if (FAILED(hr = device->adapter->adapter_ops->adapter_init_3d(device)))
1568 goto err_out;
1569 device->d3d_initialized = TRUE;
1570
1571 swapchain_desc = &swapchain->state.desc;
1572 if (swapchain_desc->backbuffer_count && swapchain_desc->backbuffer_bind_flags & WINED3D_BIND_RENDER_TARGET)
1573 {
1574 struct wined3d_resource *back_buffer = &swapchain->back_buffers[0]->resource;
1575 struct wined3d_view_desc view_desc;
1576
1577 view_desc.format_id = back_buffer->format->id;
1578 view_desc.flags = 0;
1579 view_desc.u.texture.level_idx = 0;
1580 view_desc.u.texture.level_count = 1;
1581 view_desc.u.texture.layer_idx = 0;
1582 view_desc.u.texture.layer_count = 1;
1583 if (FAILED(hr = wined3d_rendertarget_view_create(&view_desc, back_buffer,
1584 NULL, &wined3d_null_parent_ops, &device->back_buffer_view)))
1585 {
1586 ERR("Failed to create rendertarget view, hr %#lx.\n", hr);
1587 device->adapter->adapter_ops->adapter_uninit_3d(device);
1588 device->d3d_initialized = FALSE;
1589 goto err_out;
1590 }
1591 }
1592
1594
1595 TRACE("All defaults now set up.\n");
1596
1597 /* Clear the screen. */
1598 if (device->back_buffer_view)
1599 clear_flags |= WINED3DCLEAR_TARGET;
1600 if (swapchain_desc->enable_auto_depth_stencil)
1602 if (clear_flags)
1603 wined3d_device_clear(device, 0, NULL, clear_flags, &black, 1.0f, 0);
1604
1607
1608 return WINED3D_OK;
1609
1610err_out:
1611 free(device->swapchains);
1612 device->swapchains = NULL;
1613 device->swapchain_count = 0;
1614
1615 return hr;
1616}
HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, unsigned int rect_count, const RECT *rects, uint32_t flags, const struct wined3d_color *color, float depth, unsigned int stencil)
Definition: device.c:3729
static void device_load_logo(struct wined3d_device *device, const char *filename)
Definition: device.c:515
static void device_init_swapchain_state(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
Definition: device.c:1167
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:933
const struct wined3d_format * format
unsigned int backbuffer_count
Definition: wined3d.h:1775
BOOL enable_auto_depth_stencil
Definition: wined3d.h:1782
unsigned int backbuffer_bind_flags
Definition: wined3d.h:1776
enum wined3d_format_id format_id
Definition: wined3d.h:2130
static void wined3d_rtv_bind_count_dec(struct wined3d_rendertarget_view *rtv)

Referenced by wined3d_swapchain_create().

◆ wined3d_device_uninit_3d()

void wined3d_device_uninit_3d ( struct wined3d_device *  device)

Definition at line 1662 of file device.c.

1663{
1664 struct wined3d_state *state = device->cs->c.state;
1667 struct wined3d_texture *texture;
1668 struct wined3d_buffer *buffer;
1669 unsigned int i;
1670
1671 TRACE("device %p.\n", device);
1672
1673 if (!device->d3d_initialized)
1674 {
1675 ERR("Called while 3D support was not initialised.\n");
1676 return;
1677 }
1678
1680
1681 device->swapchain_count = 0;
1682
1683 if ((texture = device->logo_texture))
1684 {
1685 device->logo_texture = NULL;
1687 }
1688
1689 if ((texture = device->cursor_texture))
1690 {
1691 device->cursor_texture = NULL;
1693 }
1694
1695 for (i = 0; i < ARRAY_SIZE(device->push_constants); ++i)
1696 {
1697 if ((buffer = device->push_constants[i]))
1699 }
1700 memset(device->push_constants, 0, sizeof(device->push_constants));
1701
1704
1711
1712 LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
1713 {
1714 TRACE("Unloading resource %p.\n", resource);
1716 }
1717
1718 device->adapter->adapter_ops->adapter_uninit_3d(device);
1719 device->d3d_initialized = FALSE;
1720
1721 if ((view = device->auto_depth_stencil_view))
1722 {
1723 device->auto_depth_stencil_view = NULL;
1725 ERR("Something's still holding the auto depth/stencil view (%p).\n", view);
1726 }
1727
1728 if ((view = device->back_buffer_view))
1729 {
1730 device->back_buffer_view = NULL;
1732 }
1733
1734 free(device->swapchains);
1735 device->swapchains = NULL;
1736
1737 wined3d_state_reset(state, &device->adapter->d3d_info);
1738}
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource)
Definition: cs.c:2440
void wined3d_device_context_emit_reset_state(struct wined3d_device_context *context, bool invalidate)
Definition: cs.c:2269
static void device_free_ffp_vertex_shader(struct wine_rb_entry *entry, void *context)
Definition: device.c:1646
static void device_free_blend_state(struct wine_rb_entry *entry, void *context)
Definition: device.c:1632
static void device_free_depth_stencil_state(struct wine_rb_entry *entry, void *context)
Definition: device.c:1639
static void device_free_ffp_pixel_shader(struct wine_rb_entry *entry, void *context)
Definition: device.c:1654
static void device_free_sampler(struct wine_rb_entry *entry, void *context)
Definition: device.c:1618
static void device_free_rasterizer_state(struct wine_rb_entry *entry, void *context)
Definition: device.c:1625
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
Definition: texture.c:1606
static void wined3d_cs_finish(struct wined3d_cs *cs, enum wined3d_cs_queue_id queue_id)
static void wined3d_state_reset(struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info)

Referenced by wined3d_device_cleanup(), and wined3d_swapchain_decref().

◆ wined3d_driver_info_init()

bool wined3d_driver_info_init ( struct wined3d_driver_info *  driver_info,
const struct wined3d_gpu_description *  gpu_description,
enum wined3d_feature_level  feature_level,
UINT64  vram_bytes,
UINT64  sysmem_bytes 
)

Diablo 2 crashes when the amount of video memory is greater than 0x7fffffff. In order to avoid this application bug we limit the amount of video memory to LONG_MAX for older Windows versions.

Definition at line 740 of file directx.c.

743{
745 WORD driver_os_version, driver_feature_level = 10;
748 MEMORYSTATUSEX memory_status;
749 OSVERSIONINFOW os_version;
750
751 memset(&os_version, 0, sizeof(os_version));
752 os_version.dwOSVersionInfoSize = sizeof(os_version);
753 if (!GetVersionExW(&os_version))
754 {
755 ERR("Failed to get OS version, reporting 2000/XP.\n");
756 driver_os_version = 6;
758 }
759 else
760 {
761 TRACE("OS version %lu.%lu.\n", os_version.dwMajorVersion, os_version.dwMinorVersion);
762 switch (os_version.dwMajorVersion)
763 {
764 case 2:
765 case 3:
766 case 4:
767 /* If needed we could distinguish between 9x and NT4, but this code won't make
768 * sense for NT4 since it had no way to obtain this info through DirectDraw 3.0.
769 */
770 driver_os_version = 4;
772 break;
773
774 case 5:
775 driver_os_version = 6;
777 break;
778
779 case 6:
780 if (os_version.dwMinorVersion == 0)
781 {
782 driver_os_version = 7;
784 }
785 else if (os_version.dwMinorVersion == 1)
786 {
787 driver_os_version = 8;
789 }
790 else if (os_version.dwMinorVersion == 2)
791 {
792 driver_os_version = 9;
794 }
795 else
796 {
797 if (os_version.dwMinorVersion > 3)
798 {
799 FIXME("Unhandled OS version %lu.%lu, reporting Windows 8.1.\n",
800 os_version.dwMajorVersion, os_version.dwMinorVersion);
801 }
802 driver_os_version = 10;
804 }
805 break;
806
807 case 10:
808 driver_os_version = 31;
810 break;
811
812 default:
813 FIXME("Unhandled OS version %lu.%lu, reporting Windows 7.\n",
814 os_version.dwMajorVersion, os_version.dwMinorVersion);
815 driver_os_version = 8;
817 break;
818 }
819 }
820
821 TRACE("GPU maximum feature level %#x.\n", feature_level);
822 switch (feature_level)
823 {
827 driver_feature_level = 5;
828 else
829 driver_feature_level = 10;
830 break;
832 driver_feature_level = 11;
833 break;
835 driver_feature_level = 12;
836 break;
838 driver_feature_level = 13;
839 break;
843 driver_feature_level = 14;
844 break;
846 driver_feature_level = 15;
847 break;
849 driver_feature_level = 16;
850 break;
852 driver_feature_level = 17;
853 break;
855 /* Advertise support for everything up to FL 12_x. */
856 driver_feature_level = 21;
857 break;
858 }
859 if (os_version.dwMajorVersion == 6 && !os_version.dwMinorVersion)
860 driver_feature_level = min(driver_feature_level, 18);
861 else if (os_version.dwMajorVersion < 6)
862 driver_feature_level = min(driver_feature_level, 14);
863
864 /* Drivers with the OS version 30+ all have the feature level word set to 0 */
865 if (driver_os_version >= 30)
866 driver_feature_level = 0;
867
868 driver_info->vendor = gpu_desc->vendor;
869 driver_info->device = gpu_desc->device;
870 wined3d_copy_name(driver_info->description, gpu_desc->description, ARRAY_SIZE(driver_info->description));
871 driver_info->vram_bytes = vram_bytes ? vram_bytes : (UINT64)gpu_desc->vidmem * 1024 * 1024;
872 driver = gpu_desc->driver;
873
875 {
877 TRACE("Overriding amount of video memory with 0x%s bytes.\n",
878 wine_dbgstr_longlong(driver_info->vram_bytes));
879 }
880
886 if (driver_model < DRIVER_MODEL_NT6X && driver_info->vram_bytes > LONG_MAX)
887 {
888 TRACE("Limiting amount of video memory to %#lx bytes for OS version older than Vista.\n", LONG_MAX);
889 driver_info->vram_bytes = LONG_MAX;
890 }
891
892 if (!(driver_info->sysmem_bytes = sysmem_bytes))
893 {
894 driver_info->sysmem_bytes = 64 * 1024 * 1024;
895 memory_status.dwLength = sizeof(memory_status);
896 if (GlobalMemoryStatusEx(&memory_status))
897 driver_info->sysmem_bytes = max(memory_status.ullTotalPhys / 2, driver_info->sysmem_bytes);
898 else
899 ERR("Failed to get global memory status.\n");
900 }
901
902 /* Try to obtain driver version information for the current Windows version. This fails in
903 * some cases:
904 * - the gpu is not available on the currently selected OS version:
905 * - Geforce GTX480 on Win98. When running applications in compatibility mode on Windows,
906 * version information for the current Windows version is returned instead of faked info.
907 * We do the same and assume the default Windows version to emulate is WinXP.
908 *
909 * - Videocard is a Riva TNT but winver is set to win7 (there are no drivers for this beast)
910 * For now return the XP driver info. Perhaps later on we should return VESA.
911 *
912 * - the gpu is not in our database (can happen when the user overrides the vendor_id / device_id)
913 * This could be an indication that our database is not up to date, so this should be fixed.
914 */
917 {
918 driver_info->name = version_info->driver_name;
919 driver_info->version_high = MAKEDWORD_VERSION(driver_os_version, driver_feature_level);
920 driver_info->version_low = MAKEDWORD_VERSION(version_info->subversion, version_info->build);
921
922 return true;
923 }
924
925 ERR("No driver version info found for device %04x:%04x, driver model %#x.\n",
926 driver_info->vendor, driver_info->device, driver_model);
927 return false;
928}
COMPILER_DEPENDENT_UINT64 UINT64
Definition: actypes.h:131
BOOL WINAPI GetVersionExW(IN LPOSVERSIONINFOW lpVersionInformation)
Definition: version.c:37
#define LONG_MAX
Definition: limits.h:30
BOOL NTAPI GlobalMemoryStatusEx(LPMEMORYSTATUSEX lpBuffer)
Definition: heapmem.c:1272
if(dx< 0)
Definition: linetemp.h:194
ULONG dwMinorVersion
Definition: rtltypes.h:248
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:246
ULONG dwMajorVersion
Definition: rtltypes.h:247
enum wined3d_driver_model driver_model
Definition: directx.c:272
DWORD build
Definition: version.c:68
unsigned int version_high
enum wined3d_pci_vendor vendor
enum wined3d_pci_device device
unsigned int version_low
char description[WINED3D_MAX_DEVICE_IDENTIFIER_LENGTH]
static WORD const char * driver
Definition: odbccp32.c:56
wined3d_driver_model
Definition: directx.c:35
@ DRIVER_MODEL_NT6X
Definition: directx.c:40
@ DRIVER_MODEL_NT5X
Definition: directx.c:39
@ DRIVER_MODEL_GENERIC
Definition: directx.c:36
@ DRIVER_MODEL_WIN9X
Definition: directx.c:37
static const struct driver_version_information * get_driver_version_info(enum wined3d_display_driver driver, enum wined3d_driver_model driver_model)
Definition: directx.c:666
static void wined3d_copy_name(char *dst, const char *src, unsigned int dst_size)
Definition: directx.c:728
@ WINED3D_FEATURE_LEVEL_NONE
Definition: wined3d.h:99
#define MAKEDWORD_VERSION(maj, min)
wined3d_display_driver

Referenced by adapter_vk_init_driver_info(), wined3d_adapter_gl_init(), and wined3d_adapter_no3d_create().

◆ wined3d_dsv_srv_conflict()

static BOOL wined3d_dsv_srv_conflict ( const struct wined3d_rendertarget_view *  dsv,
const struct wined3d_format *  srv_format 
)
inlinestatic

Definition at line 4838 of file wined3d_private.h.

4840{
4841 return !srv_format || (srv_format->red_size && !(dsv->desc.flags & WINED3D_VIEW_READ_ONLY_DEPTH))
4842 || (srv_format->green_size && !(dsv->desc.flags & WINED3D_VIEW_READ_ONLY_STENCIL));
4843}
struct wined3d_view_desc desc

Referenced by wined3d_device_context_set_shader_resource_views(), and wined3d_device_context_unbind_srv_for_rtv().

◆ wined3d_extract_bits()

static DWORD wined3d_extract_bits ( const uint32_t *  bitstream,
unsigned int  offset,
unsigned int  count 
)
inlinestatic

Definition at line 4677 of file wined3d_private.h.

4679{
4680 const unsigned int word_bit_count = sizeof(*bitstream) * CHAR_BIT;
4681 const unsigned int idx = offset / word_bit_count;
4682 const unsigned int shift = offset % word_bit_count;
4683 DWORD mask = (1u << count) - 1;
4684 DWORD ret;
4685
4686 ret = (bitstream[idx] >> shift) & mask;
4687 if (shift + count > word_bit_count)
4688 {
4689 const unsigned int extracted_bit_count = word_bit_count - shift;
4690 const unsigned int remaining_bit_count = count - extracted_bit_count;
4691 mask = (1u << remaining_bit_count) - 1;
4692 ret |= (bitstream[idx + 1] & mask) << extracted_bit_count;
4693 }
4694 return ret;
4695}

Referenced by wined3d_extract_interpolation_mode().

◆ wined3d_ffp_frag_program_key_compare()

int wined3d_ffp_frag_program_key_compare ( const void *  key,
const struct wine_rb_entry *  entry 
)

Definition at line 6436 of file utils.c.

6437{
6438 const struct ffp_frag_settings *ka = key;
6439 const struct ffp_frag_settings *kb = &WINE_RB_ENTRY_VALUE(entry, const struct ffp_frag_desc, entry)->settings;
6440
6441 return memcmp(ka, kb, sizeof(*ka));
6442}
Definition: copy.c:22

Referenced by glsl_fragment_pipe_alloc(), and wined3d_device_init().

◆ wined3d_ffp_get_fs_settings()

void wined3d_ffp_get_fs_settings ( const struct wined3d_state *  state,
const struct wined3d_d3d_info *  d3d_info,
struct ffp_frag_settings *  settings 
)

Definition at line 6141 of file utils.c.

6143{
6144#define ARG1 0x01
6145#define ARG2 0x02
6146#define ARG0 0x04
6147 static const unsigned char args[WINED3D_TOP_LERP + 1] =
6148 {
6149 /* undefined */ 0,
6150 /* D3DTOP_DISABLE */ 0,
6151 /* D3DTOP_SELECTARG1 */ ARG1,
6152 /* D3DTOP_SELECTARG2 */ ARG2,
6153 /* D3DTOP_MODULATE */ ARG1 | ARG2,
6154 /* D3DTOP_MODULATE2X */ ARG1 | ARG2,
6155 /* D3DTOP_MODULATE4X */ ARG1 | ARG2,
6156 /* D3DTOP_ADD */ ARG1 | ARG2,
6157 /* D3DTOP_ADDSIGNED */ ARG1 | ARG2,
6158 /* D3DTOP_ADDSIGNED2X */ ARG1 | ARG2,
6159 /* D3DTOP_SUBTRACT */ ARG1 | ARG2,
6160 /* D3DTOP_ADDSMOOTH */ ARG1 | ARG2,
6161 /* D3DTOP_BLENDDIFFUSEALPHA */ ARG1 | ARG2,
6162 /* D3DTOP_BLENDTEXTUREALPHA */ ARG1 | ARG2,
6163 /* D3DTOP_BLENDFACTORALPHA */ ARG1 | ARG2,
6164 /* D3DTOP_BLENDTEXTUREALPHAPM */ ARG1 | ARG2,
6165 /* D3DTOP_BLENDCURRENTALPHA */ ARG1 | ARG2,
6166 /* D3DTOP_PREMODULATE */ ARG1 | ARG2,
6167 /* D3DTOP_MODULATEALPHA_ADDCOLOR */ ARG1 | ARG2,
6168 /* D3DTOP_MODULATECOLOR_ADDALPHA */ ARG1 | ARG2,
6169 /* D3DTOP_MODULATEINVALPHA_ADDCOLOR */ ARG1 | ARG2,
6170 /* D3DTOP_MODULATEINVCOLOR_ADDALPHA */ ARG1 | ARG2,
6171 /* D3DTOP_BUMPENVMAP */ ARG1 | ARG2,
6172 /* D3DTOP_BUMPENVMAPLUMINANCE */ ARG1 | ARG2,
6173 /* D3DTOP_DOTPRODUCT3 */ ARG1 | ARG2,
6174 /* D3DTOP_MULTIPLYADD */ ARG1 | ARG2 | ARG0,
6175 /* D3DTOP_LERP */ ARG1 | ARG2 | ARG0
6176 };
6177 unsigned int i;
6178 DWORD ttff;
6179 DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2;
6180 struct wined3d_texture *texture;
6181
6182 settings->padding = 0;
6183
6184 for (i = 0; i < d3d_info->ffp_fragment_caps.max_blend_stages; ++i)
6185 {
6186 settings->op[i].padding = 0;
6187 if (state->texture_states[i][WINED3D_TSS_COLOR_OP] == WINED3D_TOP_DISABLE)
6188 {
6189 settings->op[i].cop = WINED3D_TOP_DISABLE;
6190 settings->op[i].aop = WINED3D_TOP_DISABLE;
6191 settings->op[i].carg0 = settings->op[i].carg1 = settings->op[i].carg2 = ARG_UNUSED;
6192 settings->op[i].aarg0 = settings->op[i].aarg1 = settings->op[i].aarg2 = ARG_UNUSED;
6193 settings->op[i].color_fixup = COLOR_FIXUP_IDENTITY;
6194 settings->op[i].tmp_dst = 0;
6195 settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_1D;
6196 settings->op[i].projected = WINED3D_PROJECTION_NONE;
6197 i++;
6198 break;
6199 }
6200
6202 {
6203 if (can_use_texture_swizzle(d3d_info, texture->resource.format))
6204 settings->op[i].color_fixup = COLOR_FIXUP_IDENTITY;
6205 else
6206 settings->op[i].color_fixup = texture->resource.format->color_fixup;
6207 settings->op[i].tex_type = texture->resource.gl_type;
6208 } else {
6209 settings->op[i].color_fixup = COLOR_FIXUP_IDENTITY;
6210 settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_1D;
6211 }
6212
6213 cop = state->texture_states[i][WINED3D_TSS_COLOR_OP];
6214 aop = state->texture_states[i][WINED3D_TSS_ALPHA_OP];
6215
6216 carg1 = (args[cop] & ARG1) ? state->texture_states[i][WINED3D_TSS_COLOR_ARG1] : ARG_UNUSED;
6217 carg2 = (args[cop] & ARG2) ? state->texture_states[i][WINED3D_TSS_COLOR_ARG2] : ARG_UNUSED;
6218 carg0 = (args[cop] & ARG0) ? state->texture_states[i][WINED3D_TSS_COLOR_ARG0] : ARG_UNUSED;
6219
6220 if (is_invalid_op(state, i, cop, carg1, carg2, carg0))
6221 {
6222 carg0 = ARG_UNUSED;
6223 carg2 = ARG_UNUSED;
6224 carg1 = WINED3DTA_CURRENT;
6226 }
6227
6228 if (cop == WINED3D_TOP_DOTPRODUCT3)
6229 {
6230 /* A dotproduct3 on the colorop overwrites the alphaop operation and replicates
6231 * the color result to the alpha component of the destination
6232 */
6233 aop = cop;
6234 aarg1 = carg1;
6235 aarg2 = carg2;
6236 aarg0 = carg0;
6237 }
6238 else
6239 {
6240 aarg1 = (args[aop] & ARG1) ? state->texture_states[i][WINED3D_TSS_ALPHA_ARG1] : ARG_UNUSED;
6241 aarg2 = (args[aop] & ARG2) ? state->texture_states[i][WINED3D_TSS_ALPHA_ARG2] : ARG_UNUSED;
6242 aarg0 = (args[aop] & ARG0) ? state->texture_states[i][WINED3D_TSS_ALPHA_ARG0] : ARG_UNUSED;
6243 }
6244
6245 if (!i && state->render_states[WINED3D_RS_COLORKEYENABLE]
6246 && texture && !(texture->resource.usage & WINED3DUSAGE_LEGACY_CUBEMAP)
6247 && (texture->async.color_key_flags & WINED3D_CKEY_SRC_BLT) && !texture->resource.format->alpha_size)
6248 {
6249 if (aop == WINED3D_TOP_DISABLE)
6250 {
6251 aarg1 = WINED3DTA_TEXTURE;
6253 }
6254 else if (aop == WINED3D_TOP_SELECT_ARG1 && aarg1 != WINED3DTA_TEXTURE)
6255 {
6256 if (state->blend_state && state->blend_state->desc.rt[0].enable)
6257 {
6258 aarg2 = WINED3DTA_TEXTURE;
6260 }
6261 else
6262 {
6263 aarg1 = WINED3DTA_TEXTURE;
6264 }
6265 }
6266 else if (aop == WINED3D_TOP_SELECT_ARG2 && aarg2 != WINED3DTA_TEXTURE)
6267 {
6268 if (state->blend_state && state->blend_state->desc.rt[0].enable)
6269 {
6270 aarg1 = WINED3DTA_TEXTURE;
6272 }
6273 else
6274 {
6275 aarg2 = WINED3DTA_TEXTURE;
6276 }
6277 }
6278 }
6279
6280 if (is_invalid_op(state, i, aop, aarg1, aarg2, aarg0))
6281 {
6282 aarg0 = ARG_UNUSED;
6283 aarg2 = ARG_UNUSED;
6284 aarg1 = WINED3DTA_CURRENT;
6286 }
6287
6288 if (carg1 == WINED3DTA_TEXTURE || carg2 == WINED3DTA_TEXTURE || carg0 == WINED3DTA_TEXTURE
6289 || aarg1 == WINED3DTA_TEXTURE || aarg2 == WINED3DTA_TEXTURE || aarg0 == WINED3DTA_TEXTURE)
6290 {
6291 ttff = state->texture_states[i][WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS];
6293 settings->op[i].projected = WINED3D_PROJECTION_COUNT3;
6294 else if (ttff & WINED3D_TTFF_PROJECTED)
6295 settings->op[i].projected = WINED3D_PROJECTION_COUNT4;
6296 else
6297 settings->op[i].projected = WINED3D_PROJECTION_NONE;
6298 }
6299 else
6300 {
6301 settings->op[i].projected = WINED3D_PROJECTION_NONE;
6302 }
6303
6304 settings->op[i].cop = cop;
6305 settings->op[i].aop = aop;
6306 settings->op[i].carg0 = carg0;
6307 settings->op[i].carg1 = carg1;
6308 settings->op[i].carg2 = carg2;
6309 settings->op[i].aarg0 = aarg0;
6310 settings->op[i].aarg1 = aarg1;
6311 settings->op[i].aarg2 = aarg2;
6312 settings->op[i].tmp_dst = state->texture_states[i][WINED3D_TSS_RESULT_ARG] == WINED3DTA_TEMP;
6313 }
6314
6315 /* Clear unsupported stages */
6316 for (; i < WINED3D_MAX_FFP_TEXTURES; ++i)
6317 memset(&settings->op[i], 0xff, sizeof(settings->op[i]));
6318
6319 if (!state->render_states[WINED3D_RS_FOGENABLE])
6320 {
6322 }
6323 else if (state->render_states[WINED3D_RS_FOGTABLEMODE] == WINED3D_FOG_NONE)
6324 {
6325 if (use_vs(state) || state->vertex_declaration->position_transformed)
6326 {
6328 }
6329 else
6330 {
6331 switch (state->render_states[WINED3D_RS_FOGVERTEXMODE])
6332 {
6333 case WINED3D_FOG_NONE:
6334 case WINED3D_FOG_LINEAR:
6336 break;
6337 case WINED3D_FOG_EXP:
6339 break;
6340 case WINED3D_FOG_EXP2:
6342 break;
6343 }
6344 }
6345 }
6346 else
6347 {
6348 switch (state->render_states[WINED3D_RS_FOGTABLEMODE])
6349 {
6350 case WINED3D_FOG_LINEAR:
6352 break;
6353 case WINED3D_FOG_EXP:
6355 break;
6356 case WINED3D_FOG_EXP2:
6358 break;
6359 }
6360 }
6361 settings->sRGB_write = !d3d_info->srgb_write_control && needs_srgb_write(d3d_info, state, &state->fb);
6362
6364 if (state->render_states[WINED3D_RS_COLORKEYENABLE]
6365 && texture && (texture->async.color_key_flags & WINED3D_CKEY_SRC_BLT)
6366 && settings->op[0].cop != WINED3D_TOP_DISABLE)
6367 settings->color_key_enabled = 1;
6368 else
6369 settings->color_key_enabled = 0;
6370
6371 /* texcoords_initialized is set to meaningful values only when GL doesn't
6372 * support enough varyings to always pass around all the possible texture
6373 * coordinates.
6374 * This is used to avoid reading a varying not written by the vertex shader.
6375 * Reading uninitialized varyings on core profile contexts results in an
6376 * error while with builtin varyings on legacy contexts you get undefined
6377 * behavior. */
6378 if (d3d_info->limits.varying_count && !d3d_info->full_ffp_varyings)
6379 {
6380 settings->texcoords_initialized = 0;
6381 for (i = 0; i < WINED3D_MAX_FFP_TEXTURES; ++i)
6382 {
6383 if (use_vs(state))
6384 {
6385 if (state->shader[WINED3D_SHADER_TYPE_VERTEX]->reg_maps.output_registers & (1u << i))
6386 settings->texcoords_initialized |= 1u << i;
6387 }
6388 else
6389 {
6390 unsigned int coord_idx = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
6391 if ((state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX] >> WINED3D_FFP_TCI_SHIFT)
6393 || (coord_idx < WINED3D_MAX_FFP_TEXTURES && (state->vertex_declaration->texcoords & (1u << coord_idx))))
6394 settings->texcoords_initialized |= 1u << i;
6395 }
6396 }
6397 }
6398 else
6399 {
6401 }
6402
6403 settings->pointsprite = state->render_states[WINED3D_RS_POINTSPRITEENABLE]
6404 && state->primitive_type == WINED3D_PT_POINTLIST;
6405
6406 if (d3d_info->ffp_alpha_test)
6407 settings->alpha_test_func = WINED3D_CMP_ALWAYS - 1;
6408 else
6409 settings->alpha_test_func = (state->render_states[WINED3D_RS_ALPHATESTENABLE]
6411 : WINED3D_CMP_ALWAYS) - 1;
6412
6413 if (d3d_info->emulated_flatshading)
6414 settings->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT;
6415 else
6416 settings->flatshading = FALSE;
6417}
#define ARG2
BOOL is_invalid_op(const struct wined3d_state *state, int stage, enum wined3d_texture_op op, DWORD arg1, DWORD arg2, DWORD arg3)
Definition: utils.c:5554
#define ARG1
#define ARG0
struct fragment_caps ffp_fragment_caps
struct wined3d_d3d_limits limits
#define WINED3DTA_TEMP
Definition: wined3d.h:886
#define WINED3D_CKEY_SRC_BLT
Definition: wined3d.h:1341
#define WINED3DTA_CURRENT
Definition: wined3d.h:882
#define ARG_UNUSED

Referenced by get_ffp_pixel_shader(), and set_glsl_shader_program().

◆ wined3d_ffp_get_vs_settings()

void wined3d_ffp_get_vs_settings ( const struct wined3d_state *  state,
const struct wined3d_stream_info *  si,
const struct wined3d_d3d_info *  d3d_info,
struct wined3d_ffp_vs_settings *  settings 
)

Definition at line 6444 of file utils.c.

6446{
6447 enum wined3d_material_color_source diffuse_source, emissive_source, ambient_source, specular_source;
6448 const struct wined3d_vertex_declaration *vdecl = state->vertex_declaration;
6449 unsigned int coord_idx, i;
6450
6451 memset(settings, 0, sizeof(*settings));
6452
6453 if (vdecl->position_transformed)
6454 {
6455 settings->transformed = 1;
6456 settings->point_size = state->primitive_type == WINED3D_PT_POINTLIST;
6457 settings->per_vertex_point_size = vdecl->point_size;
6458 settings->diffuse = vdecl->diffuse;
6459 if (!state->render_states[WINED3D_RS_FOGENABLE])
6460 settings->fog_mode = WINED3D_FFP_VS_FOG_OFF;
6461 else if (state->render_states[WINED3D_RS_FOGTABLEMODE] != WINED3D_FOG_NONE)
6463 else
6465
6466 for (i = 0; i < WINED3D_MAX_FFP_TEXTURES; ++i)
6467 {
6468 coord_idx = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
6469 if (coord_idx < WINED3D_MAX_FFP_TEXTURES && (vdecl->texcoords & (1u << coord_idx)))
6470 settings->texcoords |= 1u << i;
6471 settings->texgen[i] = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
6472 }
6473 if (d3d_info->full_ffp_varyings)
6475
6476 if (d3d_info->emulated_flatshading)
6477 settings->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT;
6478 else
6479 settings->flatshading = FALSE;
6480
6481 settings->swizzle_map = si->swizzle_map;
6482
6483 return;
6484 }
6485
6486 switch (state->render_states[WINED3D_RS_VERTEXBLEND])
6487 {
6492 settings->vertexblends = state->render_states[WINED3D_RS_VERTEXBLEND];
6493 break;
6494 default:
6495 FIXME("Unsupported vertex blending: %d\n", state->render_states[WINED3D_RS_VERTEXBLEND]);
6496 break;
6497 }
6498
6499 settings->clipping = state->render_states[WINED3D_RS_CLIPPING]
6500 && state->render_states[WINED3D_RS_CLIPPLANEENABLE];
6501 settings->diffuse = vdecl->diffuse;
6502 settings->normal = vdecl->normal;
6503 settings->normalize = settings->normal && state->render_states[WINED3D_RS_NORMALIZENORMALS];
6504 settings->lighting = !!state->render_states[WINED3D_RS_LIGHTING];
6505 settings->localviewer = !!state->render_states[WINED3D_RS_LOCALVIEWER];
6506 settings->specular_enable = !!state->render_states[WINED3D_RS_SPECULARENABLE];
6507 settings->point_size = state->primitive_type == WINED3D_PT_POINTLIST;
6508 settings->per_vertex_point_size = vdecl->point_size;
6509
6510 wined3d_get_material_colour_source(&diffuse_source, &emissive_source,
6511 &ambient_source, &specular_source, state);
6512 settings->diffuse_source = diffuse_source;
6513 settings->emissive_source = emissive_source;
6514 settings->ambient_source = ambient_source;
6515 settings->specular_source = specular_source;
6516
6517 for (i = 0; i < WINED3D_MAX_FFP_TEXTURES; ++i)
6518 {
6519 coord_idx = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
6520 if (coord_idx < WINED3D_MAX_FFP_TEXTURES && (vdecl->texcoords & (1u << coord_idx)))
6521 settings->texcoords |= 1u << i;
6522 settings->texgen[i] = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
6523 }
6524 if (d3d_info->full_ffp_varyings)
6526
6527 for (i = 0; i < WINED3D_MAX_ACTIVE_LIGHTS; ++i)
6528 {
6529 if (!state->light_state.lights[i])
6530 continue;
6531
6532 switch (state->light_state.lights[i]->OriginalParms.type)
6533 {
6535 ++settings->point_light_count;
6536 break;
6537 case WINED3D_LIGHT_SPOT:
6538 ++settings->spot_light_count;
6539 break;
6541 ++settings->directional_light_count;
6542 break;
6544 ++settings->parallel_point_light_count;
6545 break;
6546 default:
6547 FIXME("Unhandled light type %#x.\n", state->light_state.lights[i]->OriginalParms.type);
6548 break;
6549 }
6550 }
6551
6552 if (!state->render_states[WINED3D_RS_FOGENABLE])
6553 settings->fog_mode = WINED3D_FFP_VS_FOG_OFF;
6554 else if (state->render_states[WINED3D_RS_FOGTABLEMODE] != WINED3D_FOG_NONE)
6555 {
6557
6558 if (state->transforms[WINED3D_TS_PROJECTION]._14 == 0.0f
6559 && state->transforms[WINED3D_TS_PROJECTION]._24 == 0.0f
6560 && state->transforms[WINED3D_TS_PROJECTION]._34 == 0.0f
6561 && state->transforms[WINED3D_TS_PROJECTION]._44 == 1.0f)
6562 settings->ortho_fog = 1;
6563 }
6564 else if (state->render_states[WINED3D_RS_FOGVERTEXMODE] == WINED3D_FOG_NONE)
6566 else if (state->render_states[WINED3D_RS_RANGEFOGENABLE])
6568 else
6570
6571 if (d3d_info->emulated_flatshading)
6572 settings->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT;
6573 else
6574 settings->flatshading = FALSE;
6575
6576 settings->swizzle_map = si->swizzle_map;
6577}
wined3d_material_color_source
Definition: wined3d.h:520
@ WINED3D_LIGHT_SPOT
Definition: wined3d.h:67
@ WINED3D_LIGHT_PARALLELPOINT
Definition: wined3d.h:69
@ WINED3D_LIGHT_POINT
Definition: wined3d.h:66
@ WINED3D_LIGHT_DIRECTIONAL
Definition: wined3d.h:68
@ WINED3D_VBF_1WEIGHTS
Definition: wined3d.h:452
@ WINED3D_VBF_DISABLE
Definition: wined3d.h:451
@ WINED3D_VBF_3WEIGHTS
Definition: wined3d.h:454
@ WINED3D_VBF_2WEIGHTS
Definition: wined3d.h:453
static void wined3d_get_material_colour_source(enum wined3d_material_color_source *diffuse, enum wined3d_material_color_source *emissive, enum wined3d_material_color_source *ambient, enum wined3d_material_color_source *specular, const struct wined3d_state *state)

Referenced by get_ffp_vertex_shader(), and set_glsl_shader_program().

◆ wined3d_ffp_vertex_program_key_compare()

int wined3d_ffp_vertex_program_key_compare ( const void *  key,
const struct wine_rb_entry *  entry 
)

Definition at line 6579 of file utils.c.

6580{
6581 const struct wined3d_ffp_vs_settings *ka = key;
6583 const struct wined3d_ffp_vs_desc, entry)->settings;
6584
6585 return memcmp(ka, kb, sizeof(*ka));
6586}

Referenced by glsl_vertex_pipe_vp_alloc(), and wined3d_device_init().

◆ wined3d_filter_messages()

BOOL wined3d_filter_messages ( HWND  window,
BOOL  filter 
)

Definition at line 605 of file wined3d_main.c.

606{
607 struct wined3d_wndproc *entry;
608 BOOL ret;
609
611
613 {
615 return FALSE;
616 }
617
618 ret = entry->filter;
619 entry->filter = filter;
620
622
623 return ret;
624}
static struct wined3d_wndproc * wined3d_find_wndproc(HWND window, struct wined3d *wined3d)
Definition: wined3d_main.c:590
static void wined3d_wndproc_mutex_lock(void)
Definition: wined3d_main.c:549
static void wined3d_wndproc_mutex_unlock(void)
Definition: wined3d_main.c:554

Referenced by set_window_state_thread(), wined3d_swapchain_activate(), and wined3d_swapchain_state_set_fullscreen().

◆ wined3d_format_calculate_pitch()

void wined3d_format_calculate_pitch ( const struct wined3d_format *  format,
unsigned int  alignment,
unsigned int  width,
unsigned int  height,
unsigned int *  row_pitch,
unsigned int *  slice_pitch 
)

Definition at line 4489 of file utils.c.

4491{
4492 /* For block based formats, pitch means the amount of bytes to the next
4493 * row of blocks rather than the next row of pixels. */
4495 {
4496 unsigned int row_block_count = (width + format->block_width - 1) / format->block_width;
4497 unsigned int slice_block_count = (height + format->block_height - 1) / format->block_height;
4498 *row_pitch = row_block_count * format->block_byte_count;
4499 *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1);
4500 *slice_pitch = *row_pitch * slice_block_count;
4501 }
4502 else
4503 {
4504 *row_pitch = format->byte_count * width; /* Bytes / row */
4505 *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1);
4506 *slice_pitch = *row_pitch * height;
4507 }
4508
4510 {
4511 /* The D3D format requirements make sure that the resulting format is an integer again */
4512 *slice_pitch *= format->height_scale.numerator;
4513 *slice_pitch /= format->height_scale.denominator;
4514 }
4515
4516 TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch);
4517}
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
#define WINED3D_FORMAT_ATTR_HEIGHT_SCALE

Referenced by get_map_pitch(), surface_cpu_blt(), wined3d_calculate_format_pitch(), wined3d_format_calculate_size(), wined3d_texture_get_pitch(), wined3d_texture_gl_download_data_slow_path(), wined3d_texture_gl_load_texture(), wined3d_texture_gl_upload_bo(), wined3d_texture_gl_upload_data(), wined3d_texture_update_desc(), and wined3d_texture_vk_upload_data().

◆ wined3d_format_calculate_size()

UINT wined3d_format_calculate_size ( const struct wined3d_format *  format,
UINT  alignment,
UINT  width,
UINT  height,
UINT  depth 
)

Definition at line 4519 of file utils.c.

4521{
4522 unsigned int row_pitch, slice_pitch;
4523
4524 if (format->id == WINED3DFMT_UNKNOWN)
4525 return 0;
4526
4528 return width * height * depth * format->byte_count;
4529
4530 wined3d_format_calculate_pitch(format, alignment, width, height, &row_pitch, &slice_pitch);
4531
4532 return slice_pitch * depth;
4533}
void wined3d_format_calculate_pitch(const struct wined3d_format *format, unsigned int alignment, unsigned int width, unsigned int height, unsigned int *row_pitch, unsigned int *slice_pitch)
Definition: utils.c:4489

Referenced by wined3d_texture_init().

◆ wined3d_format_convert_from_float()

void wined3d_format_convert_from_float ( const struct wined3d_format *  format,
const struct wined3d_color *  color,
void *  ret 
)

Definition at line 5817 of file utils.c.

5819{
5820 static const struct
5821 {
5823 struct wined3d_vec4 mul;
5824 struct wined3d_uvec4 shift;
5825 }
5826 float_conv[] =
5827 {
5828 {WINED3DFMT_P8_UINT, { 0.0f, 0.0f, 0.0f, 255.0f}, { 0, 0, 0, 0}},
5829 {WINED3DFMT_S1_UINT_D15_UNORM, { 32767.0f, 0.0f, 0.0f, 0.0f}, { 0, 0, 0, 0}},
5830 {WINED3DFMT_D16_UNORM, { 65535.0f, 0.0f, 0.0f, 0.0f}, { 0, 0, 0, 0}},
5831 };
5832 static const struct
5833 {
5835 struct wined3d_dvec4 mul;
5836 struct wined3d_uvec4 shift;
5837 }
5838 double_conv[] =
5839 {
5840 {WINED3DFMT_D24_UNORM_S8_UINT, { 16777215.0, 1.0, 0.0, 0.0}, {8, 0, 0, 0}},
5841 {WINED3DFMT_X8D24_UNORM, { 16777215.0, 0.0, 0.0, 0.0}, {0, 0, 0, 0}},
5842 {WINED3DFMT_D32_UNORM, {4294967295.0, 0.0, 0.0, 0.0}, {0, 0, 0, 0}},
5843 };
5845 struct wined3d_color colour_srgb;
5846 struct wined3d_uvec4 idx, shift;
5847 unsigned int i;
5848
5849 TRACE("Converting colour %s to format %s.\n", debug_color(color), debug_d3dformat(format_id));
5850 memset(ret, 0, max(sizeof(uint32_t), format->byte_count));
5851
5852 for (i = 0; i < ARRAY_SIZE(format_srgb_info); ++i)
5853 {
5854 if (format_id != format_srgb_info[i].srgb_format_id)
5855 continue;
5856
5858 format_id = format_srgb_info[i].base_format_id;
5859 color = &colour_srgb;
5860 break;
5861 }
5862
5863 for (i = 0; i < ARRAY_SIZE(float_conv); ++i)
5864 {
5865 uint32_t *ret_i = ret;
5866
5867 if (format_id != float_conv[i].format_id)
5868 continue;
5869
5870 idx.x = float_conv[i].shift.x / 32;
5871 idx.y = float_conv[i].shift.y / 32;
5872 idx.z = float_conv[i].shift.z / 32;
5873 idx.w = float_conv[i].shift.w / 32;
5874 shift.x = float_conv[i].shift.x % 32;
5875 shift.y = float_conv[i].shift.y % 32;
5876 shift.z = float_conv[i].shift.z % 32;
5877 shift.w = float_conv[i].shift.w % 32;
5878
5879 ret_i[idx.x] = ((uint32_t)((color->r * float_conv[i].mul.x) + 0.5f)) << shift.x;
5880 ret_i[idx.y] |= ((uint32_t)((color->g * float_conv[i].mul.y) + 0.5f)) << shift.y;
5881 ret_i[idx.z] |= ((uint32_t)((color->b * float_conv[i].mul.z) + 0.5f)) << shift.z;
5882 ret_i[idx.w] |= ((uint32_t)((color->a * float_conv[i].mul.w) + 0.5f)) << shift.w;
5883
5884 return;
5885 }
5886
5887 for (i = 0; i < ARRAY_SIZE(double_conv); ++i)
5888 {
5889 uint32_t *ret_i;
5890
5891 if (format_id != double_conv[i].format_id)
5892 continue;
5893
5894 idx.x = double_conv[i].shift.x / 32;
5895 idx.y = double_conv[i].shift.y / 32;
5896 idx.z = double_conv[i].shift.z / 32;
5897 idx.w = double_conv[i].shift.w / 32;
5898 shift.x = double_conv[i].shift.x % 32;
5899 shift.y = double_conv[i].shift.y % 32;
5900 shift.z = double_conv[i].shift.z % 32;
5901 shift.w = double_conv[i].shift.w % 32;
5902
5903 ret_i = ret;
5904 ret_i[idx.x] = ((uint32_t)((color->r * double_conv[i].mul.x) + 0.5)) << shift.x;
5905 ret_i[idx.y] |= ((uint32_t)((color->g * double_conv[i].mul.y) + 0.5)) << shift.y;
5906 ret_i[idx.z] |= ((uint32_t)((color->b * double_conv[i].mul.z) + 0.5)) << shift.z;
5907 ret_i[idx.w] |= ((uint32_t)((color->a * double_conv[i].mul.w) + 0.5)) << shift.w;
5908
5909 return;
5910 }
5911
5913 {
5914 uint32_t *ret_i = ret;
5915
5916 idx.x = format->red_offset / 32;
5917 idx.y = format->green_offset / 32;
5918 idx.z = format->blue_offset / 32;
5919 idx.w = format->alpha_offset / 32;
5920 shift.x = format->red_offset % 32;
5921 shift.y = format->green_offset % 32;
5922 shift.z = format->blue_offset % 32;
5923 shift.w = format->alpha_offset % 32;
5924
5925 ret_i[idx.x] = ((uint32_t)((color->r * wined3d_mask_from_size(format->red_size)) + 0.5f)) << shift.x;
5926 ret_i[idx.y] |= ((uint32_t)((color->g * wined3d_mask_from_size(format->green_size)) + 0.5f)) << shift.y;
5927 ret_i[idx.z] |= ((uint32_t)((color->b * wined3d_mask_from_size(format->blue_size)) + 0.5f)) << shift.z;
5928 ret_i[idx.w] |= ((uint32_t)((color->a * wined3d_mask_from_size(format->alpha_size)) + 0.5f)) << shift.w;
5929
5930 return;
5931 }
5932
5933 /* 32 bit float formats. We don't handle D32_FLOAT_S8X24_UINT for now. */
5934 if ((format->attrs & WINED3D_FORMAT_ATTR_FLOAT)
5935 && (format->red_size == 32 || format->depth_size == 32)
5936 && !format->stencil_size)
5937 {
5938 float *ret_f = ret;
5939
5940 switch (format->byte_count)
5941 {
5942 case 16: ret_f[3] = color->a;
5943 case 12: ret_f[2] = color->b;
5944 case 8: ret_f[1] = color->g;
5945 case 4: ret_f[0] = color->r;
5946 break;
5947
5948 default:
5949 ERR("Unexpected byte count %u, format %s.\n", format->byte_count, debug_d3dformat(format_id));
5950 break;
5951 }
5952
5953 return;
5954 }
5955
5956 if ((format->attrs & WINED3D_FORMAT_ATTR_FLOAT) && format->red_size == 16)
5957 {
5958 uint16_t *ret_s = ret;
5959
5960 switch (format->byte_count)
5961 {
5962 case 8:
5963 ret_s[3] = float_32_to_16(&color->a);
5964 ret_s[2] = float_32_to_16(&color->b);
5965 /* fall through */
5966 case 4:
5967 ret_s[1] = float_32_to_16(&color->g);
5968 /* fall through */
5969 case 2:
5970 ret_s[0] = float_32_to_16(&color->r);
5971 break;
5972
5973 default:
5974 ERR("Unexpected byte count %u, format %s.\n", format->byte_count, debug_d3dformat(format_id));
5975 break;
5976 }
5977
5978 return;
5979 }
5980
5981 FIXME("Conversion for format %s not implemented.\n", debug_d3dformat(format_id));
5982}
unsigned short float_32_to_16(const float in)
Definition: math.c:2102
static const struct wined3d_format_srgb_info format_srgb_info[]
Definition: utils.c:1921
unsigned short uint16_t
Definition: stdint.h:35
#define mul(aa, bb)
Definition: mvAesAlg.c:25
#define uint32_t
Definition: nsiface.idl:61
#define WINED3D_FORMAT_ATTR_FLOAT
static void wined3d_colour_srgb_from_linear(struct wined3d_color *colour_srgb, const struct wined3d_color *colour)
#define WINED3D_FORMAT_ATTR_NORMALISED

Referenced by process_vertices_strided(), and wined3d_resource_memory_colour_fill().

◆ wined3d_format_copy_data()

void wined3d_format_copy_data ( const struct wined3d_format *  format,
const uint8_t *  src,
unsigned int  src_row_pitch,
unsigned int  src_slice_pitch,
uint8_t *  dst,
unsigned int  dst_row_pitch,
unsigned int  dst_slice_pitch,
unsigned int  w,
unsigned int  h,
unsigned int  d 
)

Definition at line 6080 of file utils.c.

6083{
6084 unsigned int row_block_count, row_count, row_size, slice, row;
6085 unsigned int slice_count = d, slice_size;
6086 const uint8_t *src_row;
6087 uint8_t *dst_row;
6088
6089 row_block_count = (w + format->block_width - 1) / format->block_width;
6090 row_count = (h + format->block_height - 1) / format->block_height;
6091 row_size = row_block_count * format->block_byte_count;
6092 slice_size = row_size * row_count;
6093
6094 if (src_row_pitch == row_size && dst_row_pitch == row_size
6095 && ((src_slice_pitch == slice_size && dst_slice_pitch == slice_size) || slice_count == 1))
6096 {
6097 memcpy(dst, src, slice_count * slice_size);
6098 return;
6099 }
6100
6101 for (slice = 0; slice < slice_count; ++slice)
6102 {
6103 for (row = 0; row < row_count; ++row)
6104 {
6105 src_row = &src[slice * src_slice_pitch + row * src_row_pitch];
6106 dst_row = &dst[slice * dst_slice_pitch + row * dst_row_pitch];
6107 memcpy(dst_row, src_row, row_size);
6108 }
6109 }
6110}
unsigned char uint8_t
Definition: stdint.h:33
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723

Referenced by wined3d_device_context_emit_update_sub_resource(), wined3d_texture_vk_download_data(), and wined3d_texture_vk_upload_data().

◆ wined3d_format_get_color_key_conversion()

const struct wined3d_color_key_conversion * wined3d_format_get_color_key_conversion ( const struct wined3d_texture *  texture,
BOOL  need_alpha_ck 
)

Definition at line 1293 of file utils.c.

1295{
1296 const struct wined3d_format *format = texture->resource.format;
1297 unsigned int i;
1298
1299 static const struct
1300 {
1301 enum wined3d_format_id src_format;
1302 struct wined3d_color_key_conversion conversion;
1303 }
1304 color_key_info[] =
1305 {
1311 };
1312
1313 if (need_alpha_ck && (texture->async.flags & WINED3D_TEXTURE_ASYNC_COLOR_KEY))
1314 {
1315 for (i = 0; i < ARRAY_SIZE(color_key_info); ++i)
1316 {
1317 if (color_key_info[i].src_format == format->id)
1318 return &color_key_info[i].conversion;
1319 }
1320
1321 FIXME("Color-keying not supported with format %s.\n", debug_d3dformat(format->id));
1322 }
1323
1324 return NULL;
1325}
static void convert_b5g5r5x1_unorm_b5g5r5a1_unorm_color_key(const BYTE *src, unsigned int src_pitch, BYTE *dst, unsigned int dst_pitch, unsigned int width, unsigned int height, const struct wined3d_color_key *color_key)
Definition: utils.c:1204
static void convert_b5g6r5_unorm_b5g5r5a1_unorm_color_key(const BYTE *src, unsigned int src_pitch, BYTE *dst, unsigned int dst_pitch, unsigned int width, unsigned int height, const struct wined3d_color_key *color_key)
Definition: utils.c:1181
static void convert_b8g8r8a8_unorm_b8g8r8a8_unorm_color_key(const BYTE *src, unsigned int src_pitch, BYTE *dst, unsigned int dst_pitch, unsigned int width, unsigned int height, const struct wined3d_color_key *color_key)
Definition: utils.c:1271
static void convert_b8g8r8x8_unorm_b8g8r8a8_unorm_color_key(const BYTE *src, unsigned int src_pitch, BYTE *dst, unsigned int dst_pitch, unsigned int width, unsigned int height, const struct wined3d_color_key *color_key)
Definition: utils.c:1248
static void convert_b8g8r8_unorm_b8g8r8a8_unorm_color_key(const BYTE *src, unsigned int src_pitch, BYTE *dst, unsigned int dst_pitch, unsigned int width, unsigned int height, const struct wined3d_color_key *color_key)
Definition: utils.c:1227
#define WINED3D_TEXTURE_ASYNC_COLOR_KEY

Referenced by wined3d_texture_gl_load_texture(), and wined3d_texture_gl_prepare_texture().

◆ wined3d_format_get_float_color_key()

void wined3d_format_get_float_color_key ( const struct wined3d_format *  format,
const struct wined3d_color_key *  key,
struct wined3d_color *  float_colors 
)

Definition at line 5997 of file utils.c.

5999{
6000 struct wined3d_color slop = {INFINITY, INFINITY, INFINITY, INFINITY};
6001
6002 switch (format->id)
6003 {
6022 if (format->red_size)
6023 slop.r = 0.5f / wined3d_mask_from_size(format->red_size);
6024 if (format->green_size)
6025 slop.g = 0.5f / wined3d_mask_from_size(format->green_size);
6026 if (format->blue_size)
6027 slop.b = 0.5f / wined3d_mask_from_size(format->blue_size);
6028 if (format->alpha_size)
6029 slop.a = 0.5f / wined3d_mask_from_size(format->alpha_size);
6030
6031 float_colors[0].r = color_to_float(key->color_space_low_value, format->red_size, format->red_offset)
6032 - slop.r;
6033 float_colors[0].g = color_to_float(key->color_space_low_value, format->green_size, format->green_offset)
6034 - slop.g;
6035 float_colors[0].b = color_to_float(key->color_space_low_value, format->blue_size, format->blue_offset)
6036 - slop.b;
6037 float_colors[0].a = color_to_float(key->color_space_low_value, format->alpha_size, format->alpha_offset)
6038 - slop.a;
6039
6040 float_colors[1].r = color_to_float(key->color_space_high_value, format->red_size, format->red_offset)
6041 + slop.r;
6042 float_colors[1].g = color_to_float(key->color_space_high_value, format->green_size, format->green_offset)
6043 + slop.g;
6044 float_colors[1].b = color_to_float(key->color_space_high_value, format->blue_size, format->blue_offset)
6045 + slop.b;
6046 float_colors[1].a = color_to_float(key->color_space_high_value, format->alpha_size, format->alpha_offset)
6047 + slop.a;
6048 break;
6049
6050 case WINED3DFMT_P8_UINT:
6051 float_colors[0].r = 0.0f;
6052 float_colors[0].g = 0.0f;
6053 float_colors[0].b = 0.0f;
6054 float_colors[0].a = (key->color_space_low_value - 0.5f) / 255.0f;
6055
6056 float_colors[1].r = 0.0f;
6057 float_colors[1].g = 0.0f;
6058 float_colors[1].b = 0.0f;
6059 float_colors[1].a = (key->color_space_high_value + 0.5f) / 255.0f;
6060 break;
6061
6062 default:
6063 ERR("Unhandled color key to float conversion for format %s.\n", debug_d3dformat(format->id));
6064 }
6065}
static float color_to_float(DWORD color, DWORD size, DWORD offset)
Definition: utils.c:5984

Referenced by glsl_blitter_blit(), and wined3d_device_apply_stateblock().

◆ wined3d_format_is_depth_view()

BOOL wined3d_format_is_depth_view ( enum wined3d_format_id  resource_format_id,
enum wined3d_format_id  view_format_id 
)

Definition at line 4476 of file utils.c.

4478{
4479 unsigned int i;
4480
4482 {
4483 if (typeless_depth_stencil_formats[i].typeless_id == resource_format_id)
4484 return typeless_depth_stencil_formats[i].depth_view_id == view_format_id;
4485 }
4486 return FALSE;
4487}
static const struct wined3d_typeless_format_depth_stencil_info typeless_depth_stencil_formats[]
Definition: utils.c:280

Referenced by wined3d_shader_resource_view_gl_cs_init().

◆ wined3d_format_is_typeless()

◆ wined3d_format_pack()

uint32_t wined3d_format_pack ( const struct wined3d_format *  format,
const struct wined3d_uvec4 *  value 
)

Definition at line 5778 of file utils.c.

5779{
5780 uint32_t p = 0;
5781
5782 p |= (value->x & wined3d_mask_from_size(format->red_size)) << format->red_offset;
5783 p |= (value->y & wined3d_mask_from_size(format->green_size)) << format->green_offset;
5784 p |= (value->z & wined3d_mask_from_size(format->blue_size)) << format->blue_offset;
5785 p |= (value->w & wined3d_mask_from_size(format->alpha_size)) << format->alpha_offset;
5786
5787 return p;
5788}
GLfloat GLfloat p
Definition: glext.h:8902
Definition: pdh_main.c:64

Referenced by wined3d_unordered_access_view_gl_clear().

◆ wined3d_formats_are_srgb_variants()

BOOL wined3d_formats_are_srgb_variants ( enum wined3d_format_id  format1,
enum wined3d_format_id  format2 
)

Definition at line 4535 of file utils.c.

4536{
4537 unsigned int i;
4538
4539 for (i = 0; i < ARRAY_SIZE(format_srgb_info); ++i)
4540 {
4541 if (format1 == format_srgb_info[i].srgb_format_id)
4542 return format2 == format_srgb_info[i].base_format_id;
4543 if (format1 == format_srgb_info[i].base_format_id)
4544 return format2 == format_srgb_info[i].srgb_format_id;
4545 }
4546 return FALSE;
4547}

Referenced by validate_resource_view().

◆ wined3d_from_cs()

static void wined3d_from_cs ( const struct wined3d_cs *  cs)
inlinestatic

◆ wined3d_ftoa()

void wined3d_ftoa ( float  value,
char *  s 
)

Definition at line 6643 of file utils.c.

6644{
6645 int idx = 1;
6646
6647 if (copysignf(1.0f, value) < 0.0f)
6648 ++idx;
6649
6650 /* Be sure to allocate a buffer of at least 17 characters for the result
6651 as sprintf may return a 3 digit exponent when using the MSVC runtime
6652 instead of a 2 digit exponent. */
6653 sprintf(s, "%.8e", value);
6654 if (isfinite(value))
6655 s[idx] = '.';
6656}
#define isfinite(x)
Definition: math.h:363
#define copysignf(x, y)
Definition: math.h:254
#define sprintf
Definition: sprintf.c:45

Referenced by shader_glsl_append_imm_vec().

◆ wined3d_ge_wrap()

static BOOL wined3d_ge_wrap ( ULONG  x,
ULONG  y 
)
inlinestatic

Definition at line 3821 of file wined3d_private.h.

3822{
3823 return (x - y) < UINT_MAX / 2;
3824}
#define UINT_MAX
Definition: limits.h:27

Referenced by wined3d_resource_wait_idle().

◆ wined3d_get_app_name()

BOOL wined3d_get_app_name ( char *  app_name,
unsigned int  app_name_size 
)

Definition at line 241 of file wined3d_main.c.

242{
243 char buffer[MAX_PATH];
244 unsigned int len;
245 char *p, *name;
246
248 if (!(len && len < MAX_PATH))
249 return FALSE;
250
251 name = buffer;
252 if ((p = strrchr(name, '/' )))
253 name = p + 1;
254 if ((p = strrchr(name, '\\')))
255 name = p + 1;
256
257 len = strlen(name) + 1;
258 if (app_name_size < len)
259 return FALSE;
260
262 return TRUE;
263}
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI GetModuleFileNameA(HINSTANCE hModule, LPSTR lpFilename, DWORD nSize)
Definition: loader.c:539
_ACRTIMP size_t __cdecl strlen(const char *)
Definition: string.c:1597
_ACRTIMP char *__cdecl strrchr(const char *, int)
Definition: string.c:3303
GLenum GLsizei len
Definition: glext.h:6722
LPCWSTR app_name
Definition: notevil.c:34
Definition: name.c:39

Referenced by wined3d_dll_init(), and wined3d_init_vulkan().

◆ wined3d_get_float_state()

static float wined3d_get_float_state ( const struct wined3d_state *  state,
enum wined3d_render_state  rs 
)
inlinestatic

Definition at line 4795 of file wined3d_private.h.

4796{
4797 union
4798 {
4799 DWORD d;
4800 float f;
4801 }
4802 tmpvalue;
4803
4804 tmpvalue.d = state->render_states[rs];
4805 return tmpvalue.f;
4806}

◆ wined3d_get_format()

const struct wined3d_format * wined3d_get_format ( const struct wined3d_adapter *  adapter,
enum wined3d_format_id  format_id,
unsigned int  bind_flags 
)

Definition at line 4428 of file utils.c.

4430{
4431 const struct wined3d_format *format;
4433 unsigned int i;
4434
4435 if (idx == -1)
4436 {
4437 FIXME("Can't find format %s (%#x) in the format lookup table.\n",
4440 }
4441
4443
4445 {
4447 {
4450 }
4451
4452 FIXME("Cannot find depth/stencil typeless format %s (%#x).\n",
4455 }
4456
4457 return format;
4458}
#define WINED3D_FORMAT_COUNT
Definition: utils.c:70
static struct wined3d_format * get_format_by_idx(const struct wined3d_adapter *adapter, int fmt_idx)
Definition: utils.c:1958
static int get_format_idx(enum wined3d_format_id format_id)
Definition: utils.c:1932
enum wined3d_format_id typeless_id

Referenced by adapter_format_from_backbuffer_format(), append_decl_element(), blend_equation_from_wined3d(), mode_matches_filter(), process_vertices_strided(), surface_cpu_blt(), texture2d_blt(), validate_resource_view(), vertexdeclaration_init(), wined3d_buffer_init(), wined3d_calculate_format_pitch(), wined3d_check_depth_stencil_match(), wined3d_check_device_format(), wined3d_check_device_format_conversion(), wined3d_check_device_multisample_type(), wined3d_context_gl_create_wgl_ctx(), wined3d_device_vk_create_null_resources(), wined3d_output_get_mode(), wined3d_output_get_mode_count(), wined3d_output_set_display_mode(), wined3d_resource_get_decompress_format(), wined3d_swapchain_apply_sample_count_override(), wined3d_swapchain_vk_select_vk_format(), wined3d_texture_create(), wined3d_texture_gl_load_texture(), wined3d_texture_gl_prepare_texture(), wined3d_texture_gl_upload_data(), wined3d_texture_init(), and wined3d_unordered_access_view_vk_clear().

◆ wined3d_get_gpu_description()

const struct wined3d_gpu_description * wined3d_get_gpu_description ( enum wined3d_pci_vendor  vendor,
enum wined3d_pci_device  device 
)

Definition at line 688 of file directx.c.

690{
691 unsigned int i;
692
693 for (i = 0; i < ARRAY_SIZE(gpu_description_table); ++i)
694 {
696 return &gpu_description_table[i];
697 }
698
699 return NULL;
700}
const WCHAR * vendor
Definition: db.cpp:873
static const struct wined3d_gpu_description gpu_description_table[]
Definition: directx.c:335

Referenced by adapter_vk_init_driver_info(), query_gpu_description(), wined3d_adapter_init_gl_caps(), and wined3d_get_user_override_gpu_description().

◆ wined3d_get_line()

static const char * wined3d_get_line ( const char **  ptr,
const char *  end 
)
inlinestatic

Definition at line 83 of file wined3d_private.h.

84{
85 const char *p, *q;
86
87 if ((p = *ptr) >= end)
88 return NULL;
89
90 if (!(q = memchr(p, '\n', end - p)))
91 *ptr = end;
92 else
93 *ptr = q + 1;
94 return p;
95}
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
#define memchr(s, c, n)
Definition: mkisofs.h:875

Referenced by compile_hlsl_shader(), print_glsl_info_log(), shader_glsl_compile(), shader_glsl_dump_program_source(), shader_glsl_generate_vkd3d_shader(), shader_spirv_compile_shader(), shader_spirv_scan_shader(), and shader_trace().

◆ wined3d_get_material_colour_source()

static void wined3d_get_material_colour_source ( enum wined3d_material_color_source *  diffuse,
enum wined3d_material_color_source *  emissive,
enum wined3d_material_color_source *  ambient,
enum wined3d_material_color_source *  specular,
const struct wined3d_state *  state 
)
inlinestatic

Definition at line 4736 of file wined3d_private.h.

4739{
4740 const struct wined3d_vertex_declaration *vdecl = state->vertex_declaration;
4741
4742 if (!state->render_states[WINED3D_RS_LIGHTING])
4743 {
4746 *emissive = *ambient = WINED3D_MCS_MATERIAL;
4747
4748 return;
4749 }
4750
4751 if (!state->render_states[WINED3D_RS_COLORVERTEX])
4752 {
4753 *diffuse = *emissive = *ambient = *specular = WINED3D_MCS_MATERIAL;
4754
4755 return;
4756 }
4757
4762}
float specular[3]
Definition: d3drm.c:3534
float emissive[3]
Definition: d3drm.c:3535
static enum wined3d_material_color_source validate_material_colour_source(const struct wined3d_vertex_declaration *vdecl, enum wined3d_material_color_source source)

Referenced by process_vertices_strided(), and wined3d_ffp_get_vs_settings().

◆ wined3d_get_primary_adapter_luid()

BOOL wined3d_get_primary_adapter_luid ( LUID *  luid)

Definition at line 5761 of file utils.c.

5762{
5763 D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME open_adapter_param;
5764 D3DKMT_CLOSEADAPTER close_adapter_param;
5765
5766 if (!wined3d_get_primary_display(open_adapter_param.DeviceName))
5767 return FALSE;
5768
5769 if (D3DKMTOpenAdapterFromGdiDisplayName(&open_adapter_param))
5770 return FALSE;
5771
5772 *luid = open_adapter_param.AdapterLuid;
5773 close_adapter_param.hAdapter = open_adapter_param.hAdapter;
5774 D3DKMTCloseAdapter(&close_adapter_param);
5775 return TRUE;
5776}
static BOOL wined3d_get_primary_display(WCHAR *display)
Definition: utils.c:5743
NTSTATUS WINAPI D3DKMTOpenAdapterFromGdiDisplayName(D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME *desc)

Referenced by wined3d_adapter_gl_init(), wined3d_adapter_no3d_create(), and wined3d_adapter_vk_init().

◆ wined3d_get_typed_format_id()

enum wined3d_format_id wined3d_get_typed_format_id ( const struct wined3d_adapter *  adapter,
const struct wined3d_format *  format,
enum wined3d_channel_type  channel_type 
)

Definition at line 4460 of file utils.c.

4462{
4463 const struct wined3d_typed_format_info *info;
4464 uint32_t i;
4465
4466 for (i = 0; i < ARRAY_SIZE(typed_formats); ++i)
4467 {
4468 info = &typed_formats[i];
4469 if (info->typeless_id == format->typeless_id && map_channel_type(info->channels[0]) == channel_type)
4470 return info->id;
4471 }
4472
4473 return WINED3DFMT_UNKNOWN;
4474}
static const struct wined3d_typed_format_info typed_formats[]
Definition: utils.c:196
static enum wined3d_channel_type map_channel_type(char t)
Definition: utils.c:2017

Referenced by wined3d_unordered_access_view_vk_clear().

◆ wined3d_get_user_override_gpu_description()

const struct wined3d_gpu_description * wined3d_get_user_override_gpu_description ( enum wined3d_pci_vendor  vendor,
enum wined3d_pci_device  device 
)

Definition at line 702 of file directx.c.

704{
705 const struct wined3d_gpu_description *gpu_desc;
706 static unsigned int once;
707
709 return NULL;
710
712 {
714 TRACE("Overriding vendor PCI ID with 0x%04x.\n", vendor);
715 }
717 {
719 TRACE("Overriding device PCI ID with 0x%04x.\n", device);
720 }
721
722 if (!(gpu_desc = wined3d_get_gpu_description(vendor, device)) && !once++)
723 ERR_(winediag)("Invalid GPU override %04x:%04x specified, ignoring.\n", vendor, device);
724
725 return gpu_desc;
726}
enum wined3d_pci_device device
unsigned short pci_vendor_id
unsigned short pci_device_id
const struct wined3d_gpu_description * wined3d_get_gpu_description(enum wined3d_pci_vendor vendor, enum wined3d_pci_device device)
Definition: directx.c:688
#define PCI_VENDOR_NONE
#define PCI_DEVICE_NONE

Referenced by adapter_vk_init_driver_info(), and query_gpu_description().

◆ wined3d_gpu_from_feature_level()

enum wined3d_pci_device wined3d_gpu_from_feature_level ( enum wined3d_pci_vendor *  vendor,
enum wined3d_feature_level  feature_level 
)

Definition at line 930 of file directx.c.

932{
933 static const struct wined3d_fallback_card
934 {
935 enum wined3d_feature_level feature_level;
936 enum wined3d_pci_device device_id;
937 }
938 card_fallback_nvidia[] =
939 {
949 },
950 card_fallback_amd[] =
951 {
960 },
961 card_fallback_intel[] =
962 {
969 };
970
971 static const struct
972 {
974 const struct wined3d_fallback_card *cards;
975 }
976 fallbacks[] =
977 {
978 {HW_VENDOR_AMD, card_fallback_amd},
979 {HW_VENDOR_NVIDIA, card_fallback_nvidia},
980 {HW_VENDOR_VMWARE, card_fallback_amd},
981 {HW_VENDOR_INTEL, card_fallback_intel},
982 };
983
984 const struct wined3d_fallback_card *cards;
985 enum wined3d_pci_device device_id;
986 unsigned int i;
987
988 cards = NULL;
989 for (i = 0; i < ARRAY_SIZE(fallbacks); ++i)
990 {
991 if (*vendor == fallbacks[i].vendor)
992 cards = fallbacks[i].cards;
993 }
994 if (!cards)
995 {
997 cards = card_fallback_nvidia;
998 }
999
1000 device_id = cards->device_id;
1001 for (i = 0; cards[i].feature_level; ++i)
1002 {
1003 if (feature_level >= cards[i].feature_level)
1004 device_id = cards[i].device_id;
1005 }
1006 return device_id;
1007}
#define HW_VENDOR_NVIDIA
Definition: builtin.c:4465
#define HW_VENDOR_AMD
Definition: builtin.c:4464
#define HW_VENDOR_INTEL
Definition: builtin.c:4467
#define HW_VENDOR_VMWARE
Definition: builtin.c:4466
wined3d_feature_level
Definition: wined3d.h:98
wined3d_pci_vendor
wined3d_pci_device

Referenced by wined3d_guess_card().

◆ wined3d_init()

HRESULT wined3d_init ( struct wined3d *  wined3d,
uint32_t  flags 
)

Definition at line 3477 of file directx.c.

3478{
3479 wined3d->ref = 1;
3480 wined3d->flags = flags;
3481
3482 TRACE("Initialising adapters.\n");
3483
3485 {
3486 WARN("Failed to create adapter.\n");
3487 return E_FAIL;
3488 }
3490
3491 return WINED3D_OK;
3492}
unsigned int adapter_count
unsigned int flags
static struct wined3d_adapter * wined3d_adapter_create(unsigned int ordinal, DWORD wined3d_creation_flags)
Definition: directx.c:3459

Referenced by wined3d_create().

◆ wined3d_insert_bits()

static void wined3d_insert_bits ( uint32_t *  bitstream,
unsigned int  offset,
unsigned int  count,
DWORD  bits 
)
inlinestatic

Definition at line 4697 of file wined3d_private.h.

4699{
4700 const unsigned int word_bit_count = sizeof(*bitstream) * CHAR_BIT;
4701 const unsigned int idx = offset / word_bit_count;
4702 const unsigned int shift = offset % word_bit_count;
4703 DWORD mask = (1u << count) - 1;
4704
4705 bitstream[idx] |= (bits & mask) << shift;
4706 if (shift + count > word_bit_count)
4707 {
4708 const unsigned int inserted_bit_count = word_bit_count - shift;
4709 const unsigned int remaining_bit_count = count - inserted_bit_count;
4710 mask = (1u << remaining_bit_count) - 1;
4711 bitstream[idx + 1] |= (bits >> inserted_bit_count) & mask;
4712 }
4713}
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929

Referenced by shader_record_register_usage(), and wined3d_insert_interpolation_mode().

◆ wined3d_is_srv_rtv_bound()

static bool wined3d_is_srv_rtv_bound ( const struct wined3d_state *  state,
const struct wined3d_shader_resource_view *  srv 
)
inlinestatic

Definition at line 4913 of file wined3d_private.h.

4915{
4916 unsigned int i;
4917
4918 if (!srv->resource->rtv_bind_count_device)
4919 return false;
4920
4921 for (i = 0; i < ARRAY_SIZE(state->fb.render_targets); ++i)
4922 {
4923 const struct wined3d_rendertarget_view *rtv;
4924
4925 if ((rtv = state->fb.render_targets[i]) && wined3d_rtv_overlaps_srv(rtv, srv))
4926 return true;
4927 }
4928
4929 return false;
4930}
struct wined3d_resource * resource
static bool wined3d_rtv_overlaps_srv(const struct wined3d_rendertarget_view *rtv, const struct wined3d_shader_resource_view *srv)

Referenced by wined3d_device_context_set_shader_resource_views(), and wined3d_device_context_unbind_srv_for_rtv().

◆ wined3d_light_state_enable_light()

bool wined3d_light_state_enable_light ( struct wined3d_light_state *  state,
const struct wined3d_d3d_info *  d3d_info,
struct wined3d_light_info *  light_info,
BOOL  enable 
)

Definition at line 803 of file stateblock.c.

805{
806 unsigned int light_count, i;
807
808 if (!(light_info->enabled = enable))
809 {
810 if (light_info->glIndex == -1)
811 {
812 TRACE("Light already disabled, nothing to do.\n");
813 return false;
814 }
815
816 state->lights[light_info->glIndex] = NULL;
817 light_info->glIndex = -1;
818 return true;
819 }
820
821 if (light_info->glIndex != -1)
822 {
823 TRACE("Light already enabled, nothing to do.\n");
824 return false;
825 }
826
827 /* Find a free light. */
828 light_count = d3d_info->limits.active_light_count;
829 for (i = 0; i < light_count; ++i)
830 {
831 if (state->lights[i])
832 continue;
833
834 state->lights[i] = light_info;
835 light_info->glIndex = i;
836 return true;
837 }
838
839 /* Our tests show that Windows returns D3D_OK in this situation, even with
840 * D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE devices.
841 * This is consistent among ddraw, d3d8 and d3d9. GetLightEnable returns
842 * TRUE * as well for those lights.
843 *
844 * TODO: Test how this affects rendering. */
845 WARN("Too many concurrently active lights.\n");
846 return false;
847}

Referenced by wined3d_cs_exec_set_light_enable(), wined3d_device_set_light_enable(), and wined3d_stateblock_set_light_enable().

◆ wined3d_light_state_get_light()

struct wined3d_light_info * wined3d_light_state_get_light ( const struct wined3d_light_state *  state,
unsigned int  idx 
)

Definition at line 687 of file stateblock.c.

688{
689 struct rb_entry *entry;
690
691 if (!(entry = rb_get(&state->lights_tree, (void *)(ULONG_PTR)idx)))
692 return NULL;
693
695}
#define RB_ENTRY_VALUE(element, type, field)
Definition: rbtree.h:26
static struct rb_entry * rb_get(const struct rb_tree *tree, const void *key)
Definition: rbtree.h:192
Definition: rbtree.h:30
uint32_t ULONG_PTR
Definition: typedefs.h:65

Referenced by wined3d_cs_exec_set_light(), wined3d_cs_exec_set_light_enable(), wined3d_device_set_light_enable(), wined3d_light_state_set_light(), wined3d_state_record_lights(), wined3d_stateblock_get_light(), wined3d_stateblock_set_light(), and wined3d_stateblock_set_light_enable().

◆ wined3d_lock_cleanup()

static void wined3d_lock_cleanup ( CRITICAL_SECTION *  lock)
inlinestatic

Definition at line 4161 of file wined3d_private.h.

4162{
4163 if (lock->DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1)
4164 lock->DebugInfo->Spare[0] = 0;
4166}
rwlock_t lock
Definition: tcpcore.h:0
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

Referenced by adapter_gl_destroy_device(), adapter_vk_destroy_device(), and wined3d_device_cleanup().

◆ wined3d_lock_init_()

static void wined3d_lock_init_ ( CRITICAL_SECTION *  lock,
const char *  name 
)
inlinestatic

Definition at line 4154 of file wined3d_private.h.

4155{
4157 if (lock->DebugInfo != (RTL_CRITICAL_SECTION_DEBUG *)-1)
4158 lock->DebugInfo->Spare[0] = (DWORD_PTR)name;
4159}
BOOL WINAPI InitializeCriticalSectionEx(OUT LPCRITICAL_SECTION lpCriticalSection, IN DWORD dwSpinCount, IN DWORD flags)
Definition: sync.c:107
#define DWORD_PTR
Definition: treelist.c:76
#define RTL_CRITICAL_SECTION_FLAG_FORCE_DEBUG_INFO
Definition: winnt_old.h:1156

◆ wined3d_map_persistent()

static bool wined3d_map_persistent ( void  )
inlinestatic

Definition at line 5034 of file wined3d_private.h.

5035{
5036 return sizeof(void *) >= sizeof(uint64_t);
5037}
UINT64 uint64_t
Definition: types.h:77

Referenced by wined3d_cs_map_upload_bo(), and wined3d_device_context_flush_mapped_buffer().

◆ wined3d_mask_from_size()

◆ wined3d_not_from_cs()

◆ wined3d_output_get_gamma_ramp()

HRESULT wined3d_output_get_gamma_ramp ( struct wined3d_output *  output,
struct wined3d_gamma_ramp *  ramp 
)

Definition at line 1772 of file directx.c.

1773{
1774 HDC dc;
1775
1776 TRACE("output %p, ramp %p.\n", output, ramp);
1777
1778 dc = CreateDCW(output->device_name, NULL, NULL, NULL);
1780 DeleteDC(dc);
1781
1782 return WINED3D_OK;
1783}
HDC dc
Definition: cylfrac.c:34
static HDC
Definition: imagelist.c:88
static const BYTE ramp[17]
Definition: dib.c:2957
WCHAR device_name[CCHDEVICENAME]
BOOL WINAPI GetDeviceGammaRamp(_In_ HDC hdc, _Out_writes_bytes_(3 *256 *2) LPVOID lpRamp)
BOOL WINAPI DeleteDC(_In_ HDC)
HDC WINAPI CreateDCW(_In_opt_ LPCWSTR pszDriver, _In_opt_ LPCWSTR pszDevice, _In_opt_ LPCWSTR psz, _In_opt_ const DEVMODEW *pdmInit)

Referenced by wined3d_swapchain_get_gamma_ramp().

◆ wined3d_pause()

static void wined3d_pause ( unsigned int *  spin_count)
inlinestatic

Definition at line 3813 of file wined3d_private.h.

3814{
3815 static const LARGE_INTEGER timeout = {.QuadPart = WINED3D_CS_CLIENT_WAIT_TIMEOUT * -10};
3816
3817 if (++*spin_count >= WINED3D_PAUSE_SPIN_COUNT)
3819}
NTSTATUS NTAPI NtDelayExecution(IN BOOLEAN Alertable, IN PLARGE_INTEGER DelayInterval)
Definition: wait.c:889
Definition: dhcpd.h:248
#define WINED3D_PAUSE_SPIN_COUNT
#define WINED3D_CS_CLIENT_WAIT_TIMEOUT

Referenced by wined3d_cs_mt_finish(), and wined3d_resource_wait_idle().

◆ wined3d_popcount()

static unsigned int wined3d_popcount ( unsigned int  x)
inlinestatic

Definition at line 432 of file wined3d_private.h.

433{
434#if defined(__MINGW32__)
435 return __builtin_popcount(x);
436#else
437 x -= x >> 1 & 0x55555555;
438 x = (x & 0x33333333) + (x >> 2 & 0x33333333);
439 return ((x + (x >> 4)) & 0x0f0f0f0f) * 0x01010101 >> 24;
440#endif
441}

Referenced by set_glsl_shader_program(), shader_generate_glsl_declarations(), shader_get_registers_used(), shader_glsl_gen_sample_c_lz_emulation(), shader_glsl_generate_clip_or_cull_distances(), wined3d_check_device_multisample_type(), wined3d_debug_location(), wined3d_layout_from_bind_mask(), wined3d_texture_create(), wined3d_texture_vk_download_data(), and wined3d_texture_vk_upload_data().

◆ wined3d_primitive_type_is_list()

static bool wined3d_primitive_type_is_list ( enum wined3d_primitive_type  t)
inlinestatic

Definition at line 5024 of file wined3d_private.h.

5025{
5026 return t == WINED3D_PT_POINTLIST
5031 || t == WINED3D_PT_PATCH;
5032}
GLdouble GLdouble t
Definition: gl.h:2047

Referenced by wined3d_context_vk_apply_draw_state(), and wined3d_context_vk_update_graphics_pipeline_key().

◆ wined3d_release_dc()

void wined3d_release_dc ( HWND  window,
HDC  dc 
)

Definition at line 6658 of file utils.c.

6659{
6660 /* You'd figure ReleaseDC() would fail if the DC doesn't match the window.
6661 * However, that's not what actually happens, and there are user32 tests
6662 * that confirm ReleaseDC() with the wrong window is supposed to succeed.
6663 * So explicitly check that the DC belongs to the window, since we want to
6664 * avoid releasing a DC that belongs to some other window if the original
6665 * window was already destroyed. */
6666 if (WindowFromDC(dc) != window)
6667 WARN("DC %p does not belong to window %p.\n", dc, window);
6668 else if (!ReleaseDC(window, dc))
6669 ERR("Failed to release device context %p, last error %#lx.\n", dc, GetLastError());
6670}
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HWND WINAPI WindowFromDC(_In_ HDC hDC)

Referenced by wined3d_caps_gl_ctx_destroy(), wined3d_context_gl_cleanup(), wined3d_context_gl_create_wgl_ctx(), wined3d_context_gl_init(), wined3d_context_gl_set_gl_context(), wined3d_context_gl_update_window(), and wined3d_device_gl_delete_opengl_contexts_cs().

◆ wined3d_rendertarget_view_cleanup()

void wined3d_rendertarget_view_cleanup ( struct wined3d_rendertarget_view *  view)

Definition at line 374 of file view.c.

375{
376 view->parent_ops->wined3d_object_destroyed(view->parent);
377}

Referenced by adapter_gl_destroy_rendertarget_view(), adapter_no3d_destroy_rendertarget_view(), and adapter_vk_destroy_rendertarget_view().

◆ wined3d_rendertarget_view_get_box()

void wined3d_rendertarget_view_get_box ( struct wined3d_rendertarget_view *  view,
struct wined3d_box *  box 
)

Definition at line 542 of file view.c.

544{
545 if (view->resource->type != WINED3D_RTYPE_TEXTURE_3D)
546 {
547 wined3d_box_set(box, 0, 0, view->width, view->height, 0, 1);
548 }
549 else
550 {
552 wined3d_texture_get_level_box(texture, view->sub_resource_idx, box);
553 }
554}
enum view_type type

Referenced by cpu_blitter_clear().

◆ 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 437 of file view.c.

439{
440 const struct wined3d_texture *texture;
441
442 if (view->resource->type != WINED3D_RTYPE_TEXTURE_2D)
443 {
444 *width = view->width;
445 *height = view->height;
446 return;
447 }
448
450 if (texture->swapchain)
451 {
452 /* The drawable size of an onscreen drawable is the surface size.
453 * (Actually: The window size, but the surface is created in window
454 * size.) */
455 *width = texture->resource.width;
456 *height = texture->resource.height;
457 }
458 else
459 {
460 unsigned int level_idx = view->sub_resource_idx % texture->level_count;
461
462 /* The drawable size of an FBO target is the OpenGL texture size,
463 * which is the power of two size. */
466 }
467}
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)

Referenced by ffp_blitter_clear_rendertargets().

◆ wined3d_rendertarget_view_get_locations()

DWORD wined3d_rendertarget_view_get_locations ( const struct wined3d_rendertarget_view *  view)

Definition at line 520 of file view.c.

521{
522 struct wined3d_resource *resource = view->resource;
523 unsigned int i, sub_resource_idx, layer_count;
524 const struct wined3d_texture *texture;
525 DWORD ret = ~0u;
526
527 if (resource->type == WINED3D_RTYPE_BUFFER)
528 return buffer_from_resource(resource)->locations;
529
531 sub_resource_idx = view->sub_resource_idx;
532 layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? view->layer_count : 1;
533 for (i = 0; i < layer_count; ++i, sub_resource_idx += texture->level_count)
534 ret &= texture->sub_resources[sub_resource_idx].locations;
535
536 if (!ret)
537 WARN("View %p (texture %p) layers do not have a location in common.\n", view, texture);
538
539 return ret;
540}
static struct wined3d_buffer * buffer_from_resource(struct wined3d_resource *resource)

Referenced by wined3d_context_vk_begin_render_pass(), wined3d_context_vk_prepare_used_rtv(), and wined3d_render_pass_key_vk_init().

◆ wined3d_rendertarget_view_invalidate_location()

void wined3d_rendertarget_view_invalidate_location ( struct wined3d_rendertarget_view *  view,
uint32_t  location 
)

Definition at line 514 of file view.c.

515{
517}
static void wined3d_view_invalidate_location(struct wined3d_resource *resource, const struct wined3d_view_desc *desc, DWORD location)
Definition: view.c:317

Referenced by draw_primitive(), ffp_blitter_clear_rendertargets(), vk_blitter_clear_rendertargets(), and wined3d_context_vk_apply_draw_state().

◆ wined3d_rendertarget_view_load_location()

void wined3d_rendertarget_view_load_location ( struct wined3d_rendertarget_view *  view,
struct wined3d_context *  context,
uint32_t  location 
)

Definition at line 489 of file view.c.

491{
493}
static void wined3d_view_load_location(struct wined3d_resource *resource, const struct wined3d_view_desc *desc, struct wined3d_context *context, DWORD location)
Definition: view.c:341

Referenced by draw_primitive(), ffp_blitter_clear_rendertargets(), vk_blitter_clear_rendertargets(), and wined3d_context_vk_prepare_used_rtv().

◆ wined3d_rendertarget_view_no3d_init()

HRESULT wined3d_rendertarget_view_no3d_init ( struct wined3d_rendertarget_view *  view_no3d,
const struct wined3d_view_desc *  desc,
struct wined3d_resource *  resource,
void *  parent,
const struct wined3d_parent_ops *  parent_ops 
)

Definition at line 649 of file view.c.

652{
653 TRACE("view_no3d %p, desc %s, resource %p, parent %p, parent_ops %p.\n",
654 view_no3d, wined3d_debug_view_desc(desc, resource), resource, parent, parent_ops);
655
656 return wined3d_rendertarget_view_init(view_no3d, desc, resource, parent, parent_ops);
657}
const char * wined3d_debug_view_desc(const struct wined3d_view_desc *d, const struct wined3d_resource *resource)
Definition: utils.c:4867
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:602

Referenced by adapter_no3d_create_rendertarget_view().

◆ wined3d_rendertarget_view_prepare_location()

void wined3d_rendertarget_view_prepare_location ( struct wined3d_rendertarget_view *  view,
struct wined3d_context *  context,
uint32_t  location 
)

Definition at line 469 of file view.c.

471{
472 struct wined3d_resource *resource = view->resource;
473 unsigned int i, sub_resource_idx, layer_count;
474 struct wined3d_texture *texture;
475
476 if (resource->type == WINED3D_RTYPE_BUFFER)
477 {
478 FIXME("Not implemented for resources %s.\n", debug_d3dresourcetype(resource->type));
479 return;
480 }
481
483 sub_resource_idx = view->sub_resource_idx;
484 layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? view->layer_count : 1;
485 for (i = 0; i < layer_count; ++i, sub_resource_idx += texture->level_count)
487}
BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, unsigned int location)
Definition: texture.c:2116

Referenced by draw_primitive(), ffp_blitter_clear_rendertargets(), wined3d_context_vk_apply_draw_state(), and wined3d_context_vk_prepare_used_rtv().

◆ wined3d_rendertarget_view_validate_location()

void wined3d_rendertarget_view_validate_location ( struct wined3d_rendertarget_view *  view,
uint32_t  location 
)

Definition at line 495 of file view.c.

496{
497 struct wined3d_resource *resource = view->resource;
498 unsigned int i, sub_resource_idx, layer_count;
499 struct wined3d_texture *texture;
500
501 if (resource->type == WINED3D_RTYPE_BUFFER)
502 {
503 FIXME("Not implemented for resources %s.\n", debug_d3dresourcetype(resource->type));
504 return;
505 }
506
508 sub_resource_idx = view->sub_resource_idx;
509 layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? view->layer_count : 1;
510 for (i = 0; i < layer_count; ++i, sub_resource_idx += texture->level_count)
512}

Referenced by draw_primitive(), ffp_blitter_clear_rendertargets(), vk_blitter_clear_rendertargets(), wined3d_context_vk_apply_draw_state(), and wined3d_cs_exec_present().

◆ wined3d_resource_access_is_managed()

static BOOL wined3d_resource_access_is_managed ( unsigned int  access)
inlinestatic

Definition at line 3217 of file wined3d_private.h.

◆ wined3d_resource_check_box_dimensions()

HRESULT wined3d_resource_check_box_dimensions ( struct wined3d_resource *  resource,
unsigned int  sub_resource_idx,
const struct wined3d_box *  box 
)

Definition at line 488 of file resource.c.

490{
491 const struct wined3d_format *format = resource->format;
493 unsigned int width_mask, height_mask;
494
496
497 if (box->left >= box->right || box->right > desc.width
498 || box->top >= box->bottom || box->bottom > desc.height
499 || box->front >= box->back || box->back > desc.depth)
500 {
501 WARN("Box %s is invalid.\n", debug_box(box));
503 }
504
505 if (resource->format_attrs & WINED3D_FORMAT_ATTR_BLOCKS)
506 {
507 /* This assumes power of two block sizes, but NPOT block sizes would
508 * be silly anyway.
509 *
510 * This also assumes that the format's block depth is 1. */
511 width_mask = format->block_width - 1;
512 height_mask = format->block_height - 1;
513
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))
517 {
518 WARN("Box %s is misaligned for %ux%u blocks.\n", debug_box(box), format->block_width, format->block_height);
520 }
521 }
522
523 return WINED3D_OK;
524}
#define WINEDDERR_INVALIDRECT
Definition: wined3d.h:48
static HRESULT wined3d_resource_get_sub_resource_desc(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_sub_resource_desc *desc)

Referenced by wined3d_device_context_blt(), wined3d_device_context_clear_rendertarget_view(), wined3d_device_context_clear_sysmem_texture(), wined3d_device_context_copy_sub_resource_region(), wined3d_device_context_map(), and wined3d_texture_add_dirty_region().

◆ wined3d_resource_decref()

static ULONG wined3d_resource_decref ( struct wined3d_resource *  resource)
inlinestatic

◆ wined3d_resource_free_sysmem()

void wined3d_resource_free_sysmem ( struct wined3d_resource *  resource)

Definition at line 345 of file resource.c.

346{
347 if (!resource->heap_memory)
348 return;
349 resource->heap_memory = NULL;
350
351 free(resource->heap_pointer);
352 resource->heap_pointer = NULL;
353}

Referenced by wined3d_buffer_evict_sysmem(), wined3d_resource_destroy_object(), wined3d_texture_evict_sysmem(), and wined3d_texture_update_desc().

◆ wined3d_resource_get_decompress_format()

const struct wined3d_format * wined3d_resource_get_decompress_format ( const struct wined3d_resource *  resource)

Definition at line 447 of file resource.c.

448{
449 const struct wined3d_adapter *adapter = resource->device->adapter;
451 && !(adapter->d3d_info.wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL))
454}

Referenced by wined3d_texture_gl_prepare_texture(), and wined3d_texture_gl_upload_data().

◆ wined3d_resource_get_sample_count()

unsigned int wined3d_resource_get_sample_count ( const struct wined3d_resource *  resource)

Definition at line 456 of file resource.c.

457{
458 const struct wined3d_format *format = resource->format;
459
460 /* TODO: NVIDIA expose their Coverage Sample Anti-Aliasing (CSAA)
461 * feature through type == MULTISAMPLE_XX and quality != 0. This could
462 * be mapped to GL_NV_framebuffer_multisample_coverage.
463 *
464 * AMD have a similar feature called Enhanced Quality Anti-Aliasing
465 * (EQAA), but it does not have an equivalent OpenGL extension. */
466
467 /* We advertise as many WINED3D_MULTISAMPLE_NON_MASKABLE quality
468 * levels as the count of advertised multisample types for the texture
469 * format. */
470 if (resource->multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE)
471 {
472 unsigned int i, count = 0;
473
474 for (i = 0; i < sizeof(format->multisample_types) * CHAR_BIT; ++i)
475 {
476 if (format->multisample_types & 1u << i)
477 {
478 if (resource->multisample_quality == count++)
479 break;
480 }
481 }
482 return i + 1;
483 }
484
485 return resource->multisample_type;
486}
@ WINED3D_MULTISAMPLE_NON_MASKABLE
Definition: wined3d.h:574

Referenced by vk_blitter_blit(), vk_blitter_blit_supported(), wined3d_context_vk_apply_draw_state(), wined3d_render_pass_key_vk_init(), wined3d_shader_resource_view_vk_generate_mipmap(), wined3d_texture_gl_allocate_immutable_storage(), wined3d_texture_gl_prepare_rb(), wined3d_texture_vk_download_data(), wined3d_texture_vk_prepare_texture(), and wined3d_texture_vk_upload_data().

◆ wined3d_resource_get_sub_resource_desc()

static HRESULT wined3d_resource_get_sub_resource_desc ( struct wined3d_resource *  resource,
unsigned int  sub_resource_idx,
struct wined3d_sub_resource_desc *  desc 
)
inlinestatic

Definition at line 3288 of file wined3d_private.h.

3290{
3291 return resource->resource_ops->resource_sub_resource_get_desc(resource, sub_resource_idx, desc);
3292}

Referenced by wined3d_device_context_map(), wined3d_device_context_update_sub_resource(), and wined3d_resource_check_box_dimensions().

◆ wined3d_resource_get_sub_resource_map_pitch()

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 
)
inlinestatic

Definition at line 3294 of file wined3d_private.h.

3296{
3297 resource->resource_ops->resource_sub_resource_get_map_pitch(resource, sub_resource_idx, row_pitch, slice_pitch);
3298}

Referenced by resource_offset_map_pointer(), wined3d_cs_map_upload_bo(), wined3d_device_context_emit_map(), and wined3d_device_context_emit_unmap().

◆ wined3d_resource_incref()

◆ wined3d_resource_is_offscreen()

BOOL wined3d_resource_is_offscreen ( struct wined3d_resource *  resource)

Definition at line 406 of file resource.c.

407{
408 struct wined3d_swapchain *swapchain;
409
410 /* Only 2D texture resources can be onscreen. */
412 return TRUE;
413
414 /* Not on a swapchain - must be offscreen */
415 if (!(swapchain = texture_from_resource(resource)->swapchain))
416 return TRUE;
417
418 /* The front buffer is always onscreen */
419 if (resource == &swapchain->front_buffer->resource)
420 return FALSE;
421
422 return TRUE;
423}

Referenced by ffp_blitter_clear_rendertargets(), texture2d_blt(), texture2d_read_from_framebuffer(), wined3d_context_gl_acquire(), wined3d_context_gl_apply_clear_state(), wined3d_gl_get_internal_format(), wined3d_resource_update_draw_binding(), and wined3d_texture_load_drawable().

◆ wined3d_resource_memory_colour_fill()

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 
)

Definition at line 601 of file resource.c.

604{
605 const struct wined3d_format *format = resource->format;
606 unsigned int w, h, d, x, y, z, bpp;
607 uint8_t *dst, *dst2;
608 uint32_t c[4];
609
610 /* Fast and simple path for setting everything to zero. The C library's memset is
611 * more sophisticated than our code below. Also this works for block formats, which
612 * we still need to zero-initialize for newly created resources. */
613 if (full_subresource && !colour->r && !colour->g && !colour->b && !colour->a)
614 {
615 memset(map->data, 0, map->slice_pitch * box->back);
616 return;
617 }
618
619 w = box->right - box->left;
620 h = box->bottom - box->top;
621 d = box->back - box->front;
622
623 dst = (uint8_t *)map->data
624 + (box->front * map->slice_pitch)
625 + ((box->top / format->block_height) * map->row_pitch)
626 + ((box->left / format->block_width) * format->block_byte_count);
627
629 bpp = format->byte_count;
630
631 switch (bpp)
632 {
633 case 1:
634 for (x = 0; x < w; ++x)
635 {
636 dst[x] = c[0];
637 }
638 break;
639
640 case 2:
641 for (x = 0; x < w; ++x)
642 {
643 ((uint16_t *)dst)[x] = c[0];
644 }
645 break;
646
647 case 3:
648 {
649 dst2 = dst;
650 for (x = 0; x < w; ++x, dst2 += 3)
651 {
652 dst2[0] = (c[0] ) & 0xff;
653 dst2[1] = (c[0] >> 8) & 0xff;
654 dst2[2] = (c[0] >> 16) & 0xff;
655 }
656 break;
657 }
658 case 4:
659 for (x = 0; x < w; ++x)
660 {
661 ((uint32_t *)dst)[x] = c[0];
662 }
663 break;
664
665 case 8:
666 case 12:
667 case 16:
668 for (x = 0; x < w; ++x)
669 memcpy(((uint8_t *)map->data) + x * bpp, c, bpp);
670 break;
671
672 default:
673 FIXME("Not implemented for bpp %u.\n", bpp);
674 return;
675 }
676
677 dst2 = dst;
678 for (y = 1; y < h; ++y)
679 {
680 dst2 += map->row_pitch;
681 memcpy(dst2, dst, w * bpp);
682 }
683
684 dst2 = dst;
685 for (z = 1; z < d; ++z)
686 {
687 dst2 += map->slice_pitch;
688 memcpy(dst2, dst, w * h * bpp);
689 }
690
691}
void wined3d_format_convert_from_float(const struct wined3d_format *format, const struct wined3d_color *color, void *ret)
Definition: utils.c:5817
const GLubyte * c
Definition: glext.h:8905
GLdouble GLdouble z
Definition: glext.h:5874
ULONG bpp[]
Definition: xlate.c:19

Referenced by cpu_blitter_clear_texture(), and wined3d_texture_load_location().

◆ wined3d_resource_prepare_sysmem()

◆ wined3d_resource_reference()

◆ wined3d_resource_update_draw_binding()

void wined3d_resource_update_draw_binding ( struct wined3d_resource *  resource)

Definition at line 425 of file resource.c.

426{
427 const struct wined3d_d3d_info *d3d_info = &resource->device->adapter->d3d_info;
428
430 {
431 resource->draw_binding = WINED3D_LOCATION_DRAWABLE;
432 }
433 else if (resource->multisample_type)
434 {
435 resource->draw_binding = d3d_info->multisample_draw_location;
436 }
437 else if (resource->gl_type == WINED3D_GL_RES_TYPE_RB)
438 {
440 }
441 else
442 {
444 }
445}
DWORD multisample_draw_location

Referenced by swapchain_update_draw_bindings(), wined3d_texture_init(), and wined3d_texture_set_swapchain().

◆ wined3d_resource_wait_idle()

static void wined3d_resource_wait_idle ( const struct wined3d_resource *  resource)
inlinestatic

Definition at line 3827 of file wined3d_private.h.

3828{
3829 const struct wined3d_cs *cs = resource->device->cs;
3830 ULONG access_time, tail, head;
3831 unsigned int spin_count = 0;
3832
3833 if (!cs->thread || cs->thread_id == GetCurrentThreadId())
3834 return;
3835
3836 access_time = resource->access_time;
3837 head = cs->queue[WINED3D_CS_QUEUE_DEFAULT].head;
3838
3839 /* The basic idea is that a resource is busy if tail < access_time <= head.
3840 * But we have to be careful about wrap-around of the head and tail. The
3841 * wined3d_ge_wrap function considers x >= y if x - y is smaller than half the
3842 * UINT range. Head is at most WINED3D_CS_QUEUE_SIZE ahead of tail, because
3843 * otherwise the queue memory is considered full and queue_require_space
3844 * stalls. Thus wined3d_ge_wrap(head, tail) is always true. The C_ASSERT above
3845 * ensures this in case we decide to grow the queue size in the future.
3846 *
3847 * It is possible that a resource has not been used for a long time and is idle, but the head and
3848 * tail wrapped around in such a way that the previously set access time falls between head and tail.
3849 * In this case we will incorrectly wait for the resource. Because we use the entire 32 bits of the
3850 * counters and not just the bits needed to address the actual queue memory, this should happen rarely.
3851 * If it turns out to be a problem we can switch to 64 bit counters or attempt to somehow mark the
3852 * access time of resources invalid. CS packets are at least 4 byte aligned, so we could use the lower
3853 * 2 bits in access_time for such a marker.
3854 *
3855 * Note that the access time is set before the command is submitted, so we have to wait until the
3856 * tail is bigger than access_time, not equal. */
3857
3858 if (!wined3d_ge_wrap(head, access_time))
3859 return;
3860
3861 for (;;)
3862 {
3863 tail = *(volatile ULONG *)&cs->queue[WINED3D_CS_QUEUE_DEFAULT].tail;
3864 if (head == tail) /* Queue empty. */
3865 break;
3866
3867 if (!wined3d_ge_wrap(access_time, tail) && access_time != tail)
3868 break;
3869
3870 wined3d_pause(&spin_count);
3871 }
3872}
struct outqueuenode * tail
Definition: adnsresfilter.c:66
struct outqueuenode * head
Definition: adnsresfilter.c:66
static BOOL wined3d_ge_wrap(ULONG x, ULONG y)
static void wined3d_pause(unsigned int *spin_count)

Referenced by wined3d_buffer_init(), wined3d_device_context_emit_map(), wined3d_device_context_emit_update_sub_resource(), wined3d_texture_cleanup_sync(), wined3d_texture_decref(), and wined3d_texture_update_desc().

◆ wined3d_rtv_all_subresources()

static bool wined3d_rtv_all_subresources ( const struct wined3d_rendertarget_view *  rtv)
inlinestatic

Definition at line 4865 of file wined3d_private.h.

4866{
4867 struct wined3d_texture *texture;
4868
4869 if (rtv->resource->type == WINED3D_RTYPE_BUFFER)
4870 return TRUE;
4871
4872 if (rtv->sub_resource_idx)
4873 return FALSE;
4874
4876 return texture->level_count == 1 && rtv->layer_count == wined3d_bind_layer_count(texture);
4877}
static unsigned int wined3d_bind_layer_count(const struct wined3d_texture *texture)

Referenced by wined3d_rtv_overlaps_srv().

◆ wined3d_rtv_bind_count_dec()

static void wined3d_rtv_bind_count_dec ( struct wined3d_rendertarget_view *  rtv)
inlinestatic

Definition at line 4894 of file wined3d_private.h.

4895{
4896 InterlockedDecrement(&rtv->resource->rtv_bind_count_device);
4897}

Referenced by wined3d_device_context_set_rendertarget_views(), and wined3d_device_set_implicit_swapchain().

◆ wined3d_rtv_bind_count_inc()

static void wined3d_rtv_bind_count_inc ( struct wined3d_rendertarget_view *  rtv)
inlinestatic

Definition at line 4889 of file wined3d_private.h.

4890{
4891 InterlockedIncrement(&rtv->resource->rtv_bind_count_device);
4892}

Referenced by wined3d_device_context_set_rendertarget_views().

◆ wined3d_rtv_overlaps_srv()

static bool wined3d_rtv_overlaps_srv ( const struct wined3d_rendertarget_view *  rtv,
const struct wined3d_shader_resource_view *  srv 
)
inlinestatic

Definition at line 4899 of file wined3d_private.h.

4901{
4902 if (rtv->resource != srv->resource)
4903 return false;
4904
4906 return true;
4907
4908 return rtv->sub_resource_idx >= srv->desc.u.texture.level_idx
4909 && rtv->sub_resource_idx < srv->desc.u.texture.level_idx + srv->desc.u.texture.level_count
4910 && rtv->layer_count >= srv->desc.u.texture.layer_idx;
4911}
struct wined3d_view_desc desc
static bool wined3d_srv_all_subresources(const struct wined3d_shader_resource_view *srv)
static bool wined3d_rtv_all_subresources(const struct wined3d_rendertarget_view *rtv)

Referenced by wined3d_is_srv_rtv_bound().

◆ wined3d_sanitize_cmp_func()

static enum wined3d_cmp_func wined3d_sanitize_cmp_func ( enum wined3d_cmp_func  func)
inlinestatic

Definition at line 314 of file wined3d_private.h.

315{
316 if (func < WINED3D_CMP_NEVER || func > WINED3D_CMP_ALWAYS)
317 return WINED3D_CMP_ALWAYS;
318 return func;
319}
GLenum func
Definition: glext.h:6028

Referenced by find_ps_compile_args(), and wined3d_ffp_get_fs_settings().

◆ wined3d_shader_create_ffp_ps()

HRESULT wined3d_shader_create_ffp_ps ( struct wined3d_device *  device,
const struct ffp_frag_settings *  settings,
struct wined3d_shader **  shader 
)

Definition at line 3370 of file shader.c.

3372{
3373 struct wined3d_shader *object;
3374
3375 if (!(object = calloc(1, sizeof(*object))))
3376 return E_OUTOFMEMORY;
3377
3379 object->is_ffp_ps = true;
3380 if (!(object->byte_code = malloc(sizeof(*settings))))
3381 {
3382 free(object);
3383 return E_OUTOFMEMORY;
3384 }
3385 memcpy(object->byte_code, settings, sizeof(*settings));
3386
3388
3389 TRACE("Created FFP pixel shader %p.\n", object);
3390 *shader = object;
3391
3392 return WINED3D_OK;
3393}
void wined3d_cs_init_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
Definition: cs.c:2304
static void shader_init(struct wined3d_shader *shader, struct wined3d_device *device, void *parent, const struct wined3d_parent_ops *parent_ops)
Definition: shader.c:2786
static void wined3d_shader_init_object(void *object)
Definition: shader.c:2544

Referenced by get_ffp_pixel_shader().

◆ wined3d_shader_create_ffp_vs()

HRESULT wined3d_shader_create_ffp_vs ( struct wined3d_device *  device,
const struct wined3d_ffp_vs_settings *  settings,
struct wined3d_shader **  shader 
)

Definition at line 3345 of file shader.c.

3347{
3348 struct wined3d_shader *object;
3349
3350 if (!(object = calloc(1, sizeof(*object))))
3351 return E_OUTOFMEMORY;
3352
3354 object->is_ffp_vs = true;
3355 if (!(object->byte_code = malloc(sizeof(*settings))))
3356 {
3357 free(object);
3358 return E_OUTOFMEMORY;
3359 }
3360 memcpy(object->byte_code, settings, sizeof(*settings));
3361
3363
3364 TRACE("Created FFP vertex shader %p.\n", object);
3365 *shader = object;
3366
3367 return WINED3D_OK;
3368}

Referenced by get_ffp_vertex_shader().

◆ wined3d_shader_extract_from_dxbc()

HRESULT wined3d_shader_extract_from_dxbc ( struct wined3d_shader *  shader,
unsigned int  max_shader_version,
enum vkd3d_shader_source_type *  source_type 
)

Definition at line 2085 of file shader_sm4.c.

2087{
2088 const struct vkd3d_shader_code dxbc = {.code = shader->byte_code, .size = shader->byte_code_size};
2089 struct vkd3d_shader_dxbc_desc dxbc_desc;
2091 unsigned int i;
2092 int ret;
2093
2094 if ((ret = vkd3d_shader_parse_dxbc(&dxbc, 0, &dxbc_desc, NULL)) < 0)
2095 {
2096 WARN("Failed to parse DXBC, ret %d.\n", ret);
2097 return E_INVALIDARG;
2098 }
2099
2100 for (i = 0; i < dxbc_desc.section_count; ++i)
2101 {
2102 if (FAILED(hr = shader_dxbc_process_section(shader, max_shader_version, source_type, &dxbc_desc.sections[i])))
2103 break;
2104 }
2105 vkd3d_shader_free_dxbc(&dxbc_desc);
2106
2107 if (!shader->function)
2108 hr = E_INVALIDARG;
2109
2110 if (FAILED(hr))
2111 WARN("Failed to parse DXBC, hr %#lx.\n", hr);
2112
2113 return hr;
2114}
#define E_INVALIDARG
Definition: ddrawi.h:101
static HRESULT shader_dxbc_process_section(struct wined3d_shader *shader, unsigned int max_version, enum vkd3d_shader_source_type *source_type, const struct vkd3d_shader_dxbc_section_desc *section)
Definition: shader_sm4.c:1972
const void * code
Definition: vkd3d_shader.h:413
VKD3D_SHADER_API void vkd3d_shader_free_dxbc(struct vkd3d_shader_dxbc_desc *dxbc)
Definition: dxbc.c:290
VKD3D_SHADER_API int vkd3d_shader_parse_dxbc(const struct vkd3d_shader_code *dxbc, uint32_t flags, struct vkd3d_shader_dxbc_desc *desc, char **messages)
Definition: dxbc.c:320

Referenced by shader_set_function().

◆ wined3d_shader_instruction_has_texel_offset()

static BOOL wined3d_shader_instruction_has_texel_offset ( const struct wined3d_shader_instruction *  ins)
inlinestatic

Definition at line 1367 of file wined3d_private.h.

1368{
1369 return ins->texel_offset.u || ins->texel_offset.v || ins->texel_offset.w;
1370}
struct wined3d_shader_texel_offset texel_offset

Referenced by shader_glsl_gather4(), shader_glsl_ld(), shader_glsl_sample(), and shader_glsl_sample_c().

◆ wined3d_shader_resource_view_cleanup()

void wined3d_shader_resource_view_cleanup ( struct wined3d_shader_resource_view *  view)

Definition at line 978 of file view.c.

979{
980 view->parent_ops->wined3d_object_destroyed(view->parent);
981}

Referenced by adapter_gl_destroy_shader_resource_view(), and adapter_vk_destroy_shader_resource_view().

◆ wined3d_shader_resource_view_destroy()

void wined3d_shader_resource_view_destroy ( struct wined3d_shader_resource_view *  view)

Definition at line 983 of file view.c.

984{
986 view->resource->device->adapter->adapter_ops->adapter_destroy_shader_resource_view(view);
988}

Referenced by wined3d_shader_resource_view_decref(), and wined3d_texture_decref().

◆ wined3d_spirv_fragment_pipe_init_vk()

const struct wined3d_fragment_pipe_ops * wined3d_spirv_fragment_pipe_init_vk ( void  )

Definition at line 1311 of file shader_spirv.c.

1312{
1313 return &spirv_fragment_pipe_vk;
1314}
static const struct wined3d_fragment_pipe_ops spirv_fragment_pipe_vk

Referenced by wined3d_adapter_vk_init().

◆ wined3d_spirv_shader_backend_init_vk()

const struct wined3d_shader_backend_ops * wined3d_spirv_shader_backend_init_vk ( void  )

Definition at line 1161 of file shader_spirv.c.

1162{
1163 TRACE("Using %s.\n", vkd3d_shader_get_version(NULL, NULL));
1164
1166}
static const struct wined3d_shader_backend_ops spirv_shader_backend_vk
Definition: shader_spirv.c:25
VKD3D_SHADER_API const char * vkd3d_shader_get_version(unsigned int *major, unsigned int *minor)

Referenced by wined3d_adapter_vk_init().

◆ wined3d_spirv_vertex_pipe_init_vk()

const struct wined3d_vertex_pipe_ops * wined3d_spirv_vertex_pipe_init_vk ( void  )

Definition at line 1227 of file shader_spirv.c.

1228{
1229 return &spirv_vertex_pipe_vk;
1230}
static const struct wined3d_vertex_pipe_ops spirv_vertex_pipe_vk

Referenced by wined3d_adapter_vk_init().

◆ wined3d_srgb_from_linear()

static float wined3d_srgb_from_linear ( float  colour)
inlinestatic

Definition at line 1573 of file wined3d_private.h.

1574{
1575 if (colour < 0.0f)
1576 return 0.0f;
1577 if (colour < wined3d_srgb_const[1].x)
1578 return colour * wined3d_srgb_const[0].w;
1579 if (colour < 1.0f)
1580 return wined3d_srgb_const[0].y * powf(colour, wined3d_srgb_const[0].x) - wined3d_srgb_const[0].z;
1581 return 1.0f;
1582}
const struct wined3d_vec4 wined3d_srgb_const[]
Definition: shader.c:32

Referenced by wined3d_colour_srgb_from_linear().

◆ wined3d_srv_all_subresources()

static bool wined3d_srv_all_subresources ( const struct wined3d_shader_resource_view *  srv)
inlinestatic

Definition at line 4850 of file wined3d_private.h.

4851{
4852 struct wined3d_texture *texture;
4853
4854 if (srv->resource->type == WINED3D_RTYPE_BUFFER)
4855 return TRUE;
4856
4857 if (srv->desc.u.texture.layer_idx || srv->desc.u.texture.level_idx)
4858 return FALSE;
4859
4861 return srv->desc.u.texture.level_count == texture->level_count
4862 && srv->desc.u.texture.layer_count == wined3d_bind_layer_count(texture);
4863}

Referenced by wined3d_rtv_overlaps_srv().

◆ wined3d_srv_bind_count_dec()

static void wined3d_srv_bind_count_dec ( struct wined3d_shader_resource_view *  srv)
inlinestatic

Definition at line 4884 of file wined3d_private.h.

4885{
4886 InterlockedDecrement(&srv->resource->srv_bind_count_device);
4887}

Referenced by state_unbind_resources(), and wined3d_device_context_set_shader_resource_views().

◆ wined3d_srv_bind_count_inc()

static void wined3d_srv_bind_count_inc ( struct wined3d_shader_resource_view *  srv)
inlinestatic

Definition at line 4879 of file wined3d_private.h.

4880{
4881 InterlockedIncrement(&srv->resource->srv_bind_count_device);
4882}

Referenced by wined3d_device_context_set_shader_resource_views().

◆ wined3d_state_get_ffp_texture()

static struct wined3d_texture * wined3d_state_get_ffp_texture ( const struct wined3d_state *  state,
unsigned int  idx 
)
inlinestatic

◆ wined3d_state_reset()

static void wined3d_state_reset ( struct wined3d_state *  state,
const struct wined3d_d3d_info *  d3d_info 
)
inlinestatic

Definition at line 2976 of file wined3d_private.h.

2977{
2978 enum wined3d_feature_level feature_level = state->feature_level;
2979 uint32_t flags = state->flags;
2980
2981 memset(state, 0, sizeof(*state));
2982 state_init(state, d3d_info, flags, feature_level);
2983}
void state_init(struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info, uint32_t flags, enum wined3d_feature_level feature_level)
Definition: stateblock.c:2324

Referenced by wined3d_cs_exec_reset_state(), wined3d_device_context_reset_state(), wined3d_device_reset(), and wined3d_device_uninit_3d().

◆ wined3d_state_uses_depth_buffer()

static bool wined3d_state_uses_depth_buffer ( const struct wined3d_state *  state)
inlinestatic

Definition at line 2985 of file wined3d_private.h.

2986{
2987 if (!state->depth_stencil_state)
2988 return true;
2989 return state->depth_stencil_state->desc.depth || state->depth_stencil_state->desc.depth_write
2990 || state->depth_stencil_state->desc.stencil;
2991}

Referenced by draw_primitive(), and wined3d_context_vk_apply_draw_state().

◆ wined3d_stateblock_invalidate_texture_lod()

void wined3d_stateblock_invalidate_texture_lod ( struct wined3d_stateblock *  stateblock,
struct wined3d_texture *  texture 
)

◆ wined3d_stream_info_from_declaration()

void wined3d_stream_info_from_declaration ( struct wined3d_stream_info *  stream_info,
const struct wined3d_state *  state,
const struct wined3d_d3d_info *  d3d_info 
)

Definition at line 160 of file context.c.

162{
163 /* We need to deal with frequency data! */
164 BOOL use_vshader = use_vs(state) || (d3d_info->ffp_hlsl && state->shader[WINED3D_SHADER_TYPE_VERTEX]);
165 struct wined3d_vertex_declaration *declaration = state->vertex_declaration;
166 unsigned int i;
167
168 stream_info->use_map = 0;
169 stream_info->swizzle_map = 0;
170 stream_info->position_transformed = 0;
171
172 if (!declaration)
173 return;
174
175 stream_info->position_transformed = declaration->position_transformed;
176
177 /* Translate the declaration into strided data. */
178 for (i = 0; i < declaration->element_count; ++i)
179 {
180 const struct wined3d_vertex_declaration_element *element = &declaration->elements[i];
181 const struct wined3d_stream_state *stream = &state->streams[element->input_slot];
182 BOOL stride_used;
183 unsigned int idx;
184
185 TRACE("%p Element %p (%u of %u).\n", declaration->elements,
186 element, i + 1, declaration->element_count);
187
188 if (!stream->buffer)
189 continue;
190
191 TRACE("offset %u input_slot %u usage_idx %d.\n", element->offset, element->input_slot, element->usage_idx);
192
193 if (use_vshader)
194 {
195 if (element->output_slot == WINED3D_OUTPUT_SLOT_UNUSED)
196 {
197 stride_used = FALSE;
198 }
199 else if (element->output_slot == WINED3D_OUTPUT_SLOT_SEMANTIC)
200 {
201 /* TODO: Assuming vertexdeclarations are usually used with the
202 * same or a similar shader, it might be worth it to store the
203 * last used output slot and try that one first. */
205 element->usage, element->usage_idx, &idx);
206 }
207 else
208 {
209 idx = element->output_slot;
210 stride_used = TRUE;
211 }
212 }
213 else
214 {
215 stride_used = fixed_get_input(element->usage, element->usage_idx, &idx);
216 }
217
218 if (stride_used)
219 {
220 TRACE("Load %s array %u [usage %s, usage_idx %u, "
221 "input_slot %u, offset %u, stride %u, format %s, class %s, step_rate %u].\n",
222 use_vshader ? "shader": "fixed function", idx,
223 debug_d3ddeclusage(element->usage), element->usage_idx, element->input_slot,
224 element->offset, stream->stride, debug_d3dformat(element->format->id),
225 debug_d3dinput_classification(element->input_slot_class), element->instance_data_step_rate);
226
227 stream_info->elements[idx].format = element->format;
228 stream_info->elements[idx].data.buffer_object = 0;
229 stream_info->elements[idx].data.addr = (BYTE *)NULL + stream->offset + element->offset;
230 stream_info->elements[idx].stride = stream->stride;
231 stream_info->elements[idx].stream_idx = element->input_slot;
233 {
234 stream_info->elements[idx].divisor = 1;
235 stream_info->elements[idx].instanced = true;
236 }
237 else if (element->input_slot_class == WINED3D_INPUT_PER_INSTANCE_DATA)
238 {
239 stream_info->elements[idx].divisor = element->instance_data_step_rate;
240 stream_info->elements[idx].instanced = true;
241 }
242 else
243 {
244 stream_info->elements[idx].divisor = 0;
245 stream_info->elements[idx].instanced = false;
246 }
247
248 if (!d3d_info->vertex_bgra && element->format->id == WINED3DFMT_B8G8R8A8_UNORM)
249 {
250 stream_info->swizzle_map |= 1u << idx;
251 }
252 stream_info->use_map |= 1u << idx;
253 }
254 }
255}
static BOOL fixed_get_input(BYTE usage, BYTE usage_idx, unsigned int *regnum)
Definition: context.c:131
bool vshader_get_input(const struct wined3d_shader *shader, uint8_t usage_req, uint8_t usage_idx_req, unsigned int *regnum)
Definition: shader.c:2766
const char * debug_d3dinput_classification(enum wined3d_input_classification classification)
Definition: utils.c:4978
const char * debug_d3ddeclusage(enum wined3d_decl_usage usage)
Definition: utils.c:4952
Definition: parse.h:23
#define WINED3DSTREAMSOURCE_INSTANCEDATA
Definition: wined3d.h:1015
#define WINED3D_OUTPUT_SLOT_UNUSED
Definition: wined3d.h:1574
#define WINED3D_OUTPUT_SLOT_SEMANTIC
Definition: wined3d.h:1573

Referenced by context_update_stream_info(), wined3d_context_vk_update_graphics_pipeline_key(), and wined3d_device_process_vertices().

◆ wined3d_swapchain_activate()

void wined3d_swapchain_activate ( struct wined3d_swapchain *  swapchain,
BOOL  activate 
)

Definition at line 1826 of file swapchain.c.

1827{
1828 struct wined3d_device *device = swapchain->device;
1829 HWND window = swapchain->state.device_window;
1830 struct wined3d_output_desc output_desc;
1831 unsigned int screensaver_active;
1832 struct wined3d_output *output;
1833 BOOL focus_messages, filter;
1834 HRESULT hr;
1835
1836 /* This code is not protected by the wined3d mutex, so it may run while
1837 * wined3d_device_reset is active. Testing on Windows shows that changing
1838 * focus during resets and resetting during focus change events causes
1839 * the application to crash with an invalid memory access. */
1840
1841 if (!(focus_messages = device->wined3d->flags & WINED3D_FOCUS_MESSAGES))
1843
1844 if (activate)
1845 {
1846 SystemParametersInfoW(SPI_GETSCREENSAVEACTIVE, 0, &screensaver_active, 0);
1847 if ((device->restore_screensaver = !!screensaver_active))
1849
1850 if (!(device->create_parms.flags & WINED3DCREATE_NOWINDOWCHANGES))
1851 {
1852 /* The d3d versions do not agree on the exact messages here. D3d8 restores
1853 * the window but leaves the size untouched, d3d9 sets the size on an
1854 * invisible window, generates messages but doesn't change the window
1855 * properties. The implementation follows d3d9.
1856 *
1857 * Guild Wars 1 wants a WINDOWPOSCHANGED message on the device window to
1858 * resume drawing after a focus loss. */
1859 output = wined3d_swapchain_get_output(swapchain);
1860 if (!output)
1861 {
1862 ERR("Failed to get output from swapchain %p.\n", swapchain);
1863 return;
1864 }
1865
1866 if (SUCCEEDED(hr = wined3d_output_get_desc(output, &output_desc)))
1867 SetWindowPos(window, NULL, output_desc.desktop_rect.left,
1868 output_desc.desktop_rect.top, swapchain->state.desc.backbuffer_width,
1869 swapchain->state.desc.backbuffer_height, SWP_NOACTIVATE | SWP_NOZORDER);
1870 else
1871 ERR("Failed to get output description, hr %#lx.\n", hr);
1872 }
1873
1874 if (device->wined3d->flags & WINED3D_RESTORE_MODE_ON_ACTIVATE)
1875 {
1876 output = wined3d_swapchain_get_output(swapchain);
1877 if (!output)
1878 {
1879 ERR("Failed to get output from swapchain %p.\n", swapchain);
1880 return;
1881 }
1882
1884 &swapchain->state.d3d_mode)))
1885 ERR("Failed to set display mode, hr %#lx.\n", hr);
1886 }
1887
1888 if (swapchain == device->swapchains[0])
1889 device->device_parent->ops->activate(device->device_parent, TRUE);
1890 }
1891 else
1892 {
1893 if (device->restore_screensaver)
1894 {
1896 device->restore_screensaver = FALSE;
1897 }
1898
1900 ERR("Failed to restore display modes, hr %#lx.\n", hr);
1901
1902 swapchain->reapply_mode = TRUE;
1903
1904 /* Some DDraw apps (Deus Ex: GOTY, and presumably all UT 1 based games) destroy the device
1905 * during window minimization. Do our housekeeping now, as the device may not exist after
1906 * the ShowWindow call.
1907 *
1908 * In d3d9, the device is marked lost after the window is minimized. If we find an app
1909 * that needs this behavior (e.g. because it calls TestCooperativeLevel in the window proc)
1910 * we'll have to control this via a create flag. Note that the device and swapchain are not
1911 * safe to access after the ShowWindow call. */
1912 if (swapchain == device->swapchains[0])
1913 device->device_parent->ops->activate(device->device_parent, FALSE);
1914
1915 if (!(device->create_parms.flags & WINED3DCREATE_NOWINDOWCHANGES) && IsWindowVisible(window))
1917 }
1918
1919 if (!focus_messages)
1921}
#define SWP_NOACTIVATE
Definition: winuser.h:1253
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SW_MINIMIZE
Definition: winuser.h:787
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SPI_SETSCREENSAVEACTIVE
Definition: winuser.h:1377
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define SWP_NOZORDER
Definition: winuser.h:1258
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define SPI_GETSCREENSAVEACTIVE
Definition: winuser.h:1376
HRESULT CDECL wined3d_output_set_display_mode(struct wined3d_output *output, const struct wined3d_display_mode *mode)
Definition: directx.c:1693
HRESULT CDECL wined3d_restore_display_modes(struct wined3d *wined3d)
Definition: directx.c:1618
HRESULT CDECL wined3d_output_get_desc(const struct wined3d_output *output, struct wined3d_output_desc *desc)
Definition: directx.c:1256
struct wined3d_output * wined3d_swapchain_get_output(const struct wined3d_swapchain *swapchain)
Definition: swapchain.c:287
#define WINED3D_RESTORE_MODE_ON_ACTIVATE
Definition: wined3d.h:1325
#define WINED3DCREATE_NOWINDOWCHANGES
Definition: wined3d.h:1029
#define WINED3D_FOCUS_MESSAGES
Definition: wined3d.h:1326
BOOL wined3d_filter_messages(HWND window, BOOL filter)
Definition: wined3d_main.c:605

Referenced by device_process_message().

◆ wined3d_swapchain_cleanup()

void wined3d_swapchain_cleanup ( struct wined3d_swapchain *  swapchain)

Definition at line 30 of file swapchain.c.

31{
32 HRESULT hr;
33 UINT i;
34
35 TRACE("Destroying swapchain %p.\n", swapchain);
36
38 wined3d_swapchain_set_gamma_ramp(swapchain, 0, &swapchain->orig_gamma);
39
40 /* Release the swapchain's draw buffers. Make sure swapchain->back_buffers[0]
41 * is the last buffer to be destroyed, FindContext() depends on that. */
42 if (swapchain->front_buffer)
43 {
46 WARN("Something's still holding the front buffer (%p).\n", swapchain->front_buffer);
47 swapchain->front_buffer = NULL;
48 }
49
50 if (swapchain->back_buffers)
51 {
52 i = swapchain->state.desc.backbuffer_count;
53
54 while (i--)
55 {
57 if (wined3d_texture_decref(swapchain->back_buffers[i]))
58 WARN("Something's still holding back buffer %u (%p).\n", i, swapchain->back_buffers[i]);
59 }
60 free(swapchain->back_buffers);
61 swapchain->back_buffers = NULL;
62 }
63
64 /* Restore the screen resolution if we rendered in fullscreen.
65 * This will restore the screen resolution to what it was before creating
66 * the swapchain. In case of d3d8 and d3d9 this will be the original
67 * desktop resolution. In case of d3d7 this will be a NOP because ddraw
68 * sets the resolution before starting up Direct3D, thus orig_width and
69 * orig_height will be equal to the modes in the presentation params. */
70 if (!swapchain->state.desc.windowed)
71 {
72 if (swapchain->state.desc.auto_restore_display_mode)
73 {
74 if (FAILED(hr = wined3d_restore_display_modes(swapchain->device->wined3d)))
75 ERR("Failed to restore display mode, hr %#lx.\n", hr);
76
77 if (swapchain->state.desc.flags & WINED3D_SWAPCHAIN_RESTORE_WINDOW_RECT)
78 {
80 swapchain->state.device_window, &swapchain->state.original_window_rect);
82 }
83 }
84 else
85 {
86 wined3d_swapchain_state_restore_from_fullscreen(&swapchain->state, swapchain->state.device_window, NULL);
87 }
88 }
89}
void CDECL wined3d_device_release_focus_window(struct wined3d_device *device)
Definition: device.c:1154
void wined3d_texture_set_swapchain(struct wined3d_texture *texture, struct wined3d_swapchain *swapchain)
Definition: texture.c:1263
struct wined3d_gamma_ramp orig_gamma
HRESULT CDECL wined3d_swapchain_set_gamma_ramp(const struct wined3d_swapchain *swapchain, uint32_t flags, const struct wined3d_gamma_ramp *ramp)
Definition: swapchain.c:353
void wined3d_swapchain_state_restore_from_fullscreen(struct wined3d_swapchain_state *state, HWND window, const RECT *window_rect)
Definition: swapchain.c:2275
#define WINED3D_SWAPCHAIN_RESTORE_WINDOW_RECT
Definition: wined3d.h:899
void wined3d_swapchain_state_cleanup(struct wined3d_swapchain_state *state)
Definition: wined3d_main.c:942

Referenced by adapter_no3d_destroy_swapchain(), wined3d_swapchain_gl_cleanup(), and wined3d_swapchain_vk_cleanup().

◆ wined3d_swapchain_get_output()

struct wined3d_output * wined3d_swapchain_get_output ( const struct wined3d_swapchain *  swapchain)

Definition at line 287 of file swapchain.c.

288{
289 TRACE("swapchain %p.\n", swapchain);
290
291 return swapchain->state.desc.output;
292}

Referenced by wined3d_swapchain_activate(), wined3d_swapchain_get_display_mode(), wined3d_swapchain_get_gamma_ramp(), wined3d_swapchain_get_raster_status(), and wined3d_swapchain_set_gamma_ramp().

◆ wined3d_swapchain_no3d_init()

HRESULT wined3d_swapchain_no3d_init ( struct wined3d_swapchain *  swapchain_no3d,
struct wined3d_device *  device,
const struct wined3d_swapchain_desc *  desc,
struct wined3d_swapchain_state_parent *  state_parent,
void *  parent,
const struct wined3d_parent_ops *  parent_ops 
)

Definition at line 1685 of file swapchain.c.

1688{
1689 TRACE("swapchain_no3d %p, device %p, desc %p, state_parent %p, parent %p, parent_ops %p.\n",
1690 swapchain_no3d, device, desc, state_parent, parent, parent_ops);
1691
1692 return wined3d_swapchain_init(swapchain_no3d, device, desc, state_parent, parent, parent_ops,
1694}
static HRESULT wined3d_swapchain_init(struct wined3d_swapchain *swapchain, struct wined3d_device *device, const struct wined3d_swapchain_desc *desc, struct wined3d_swapchain_state_parent *state_parent, void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_swapchain_ops *swapchain_ops)
Definition: swapchain.c:1506
static const struct wined3d_swapchain_ops swapchain_no3d_ops
Definition: swapchain.c:1346

Referenced by adapter_no3d_create_swapchain().

◆ wined3d_swapchain_state_cleanup()

void wined3d_swapchain_state_cleanup ( struct wined3d_swapchain_state *  state)

Definition at line 942 of file wined3d_main.c.

943{
945}
static void wined3d_swapchain_state_unregister(struct wined3d_swapchain_state *state)
Definition: wined3d_main.c:909

Referenced by wined3d_swapchain_cleanup(), wined3d_swapchain_init(), and wined3d_swapchain_state_destroy().

◆ wined3d_swapchain_state_register()

void wined3d_swapchain_state_register ( struct wined3d_swapchain_state *  state)

Definition at line 868 of file wined3d_main.c.

869{
872
874
875 if (!wined3d_array_reserve((void **)&swapchain_state_table.states, &swapchain_state_table.states_size,
876 swapchain_state_table.state_count + 1, sizeof(*state_entry)))
877 {
879 return;
880 }
881
884 state_entry->thread_id = GetWindowThreadProcessId(state->device_window, NULL);
885
886 if ((hook = wined3d_find_hook(state_entry->thread_id)))
887 {
888 ++hook->count;
890 return;
891 }
892
893 if (!wined3d_array_reserve((void **)&swapchain_state_table.hooks, &swapchain_state_table.hooks_size,
894 swapchain_state_table.hook_count + 1, sizeof(*hook)))
895 {
896 --swapchain_state_table.state_count;
898 return;
899 }
900
901 hook = &swapchain_state_table.hooks[swapchain_state_table.hook_count++];
902 hook->thread_id = state_entry->thread_id;
904 hook->count = 1;
905
907}
@ hook
Definition: SystemMenu.c:35
BOOL wined3d_array_reserve(void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T size)
Definition: utils.c:6740
#define state_entry(pos)
Definition: pnfs_layout.c:39
HHOOK WINAPI SetWindowsHookExW(_In_ int, _In_ HOOKPROC, _In_opt_ HINSTANCE, _In_ DWORD)
#define WH_GETMESSAGE
Definition: winuser.h:33
Definition: performance.c:575
IDirectMusicSegmentState * state
Definition: performance.c:577
DWORD WINAPI GetWindowThreadProcessId(HWND hWnd, PDWORD lpdwProcessId)
static struct wined3d_swapchain_state_table swapchain_state_table
Definition: wined3d_main.c:82
static LRESULT CALLBACK wined3d_hook_proc(int code, WPARAM wparam, LPARAM lparam)
Definition: wined3d_main.c:667
static struct wined3d_window_hook * wined3d_find_hook(DWORD thread_id)
Definition: wined3d_main.c:855

Referenced by wined3d_swapchain_state_init().

◆ wined3d_swapchain_state_restore_from_fullscreen()

void wined3d_swapchain_state_restore_from_fullscreen ( struct wined3d_swapchain_state *  state,
HWND  window,
const RECT *  window_rect 
)

Definition at line 2275 of file swapchain.c.

2277{
2278 struct wined3d_window_state *s;
2280
2281 if (!state->style && !state->exstyle)
2282 return;
2283
2284 if (!(s = malloc(sizeof(*s))))
2285 return;
2286
2287 s->window = window;
2288 s->window_pos_after = NULL;
2290
2292 && !(state->desc.flags & WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES))
2293 {
2294 s->window_pos_after = (state->exstyle & WS_EX_TOPMOST) ? HWND_TOPMOST : HWND_NOTOPMOST;
2295 s->flags |= (state->style & WS_VISIBLE) ? SWP_SHOWWINDOW : SWP_HIDEWINDOW;
2296 s->flags &= ~SWP_NOZORDER;
2297 }
2298
2301
2302 /* These flags are set by wined3d_device_setup_fullscreen_window, not the
2303 * application, and we want to ignore them in the test below, since it's
2304 * not the application's fault that they changed. Additionally, we want to
2305 * preserve the current status of these flags (i.e. don't restore them) to
2306 * more closely emulate the behavior of Direct3D, which leaves these flags
2307 * alone when returning to windowed mode. */
2308 state->style ^= (state->style ^ style) & WS_VISIBLE;
2309 state->exstyle ^= (state->exstyle ^ exstyle) & WS_EX_TOPMOST;
2310
2311 TRACE("Restoring window style of window %p to %08lx, %08lx.\n",
2312 window, state->style, state->exstyle);
2313
2314 s->style = state->style;
2315 s->exstyle = state->exstyle;
2316 /* Only restore the style if the application didn't modify it during the
2317 * fullscreen phase. Some applications change it before calling Reset()
2318 * when switching between windowed and fullscreen modes (HL2), some
2319 * depend on the original style (Eve Online). */
2320 s->set_style = style == fullscreen_style(state->style) && exstyle == fullscreen_exstyle(state->exstyle);
2321 s->register_topmost_timer = !!(state->desc.flags & WINED3D_SWAPCHAIN_REGISTER_TOPMOST_TIMER);
2322 s->set_topmost_timer = false;
2323
2324 if (window_rect)
2325 {
2326 s->x = window_rect->left;
2327 s->y = window_rect->top;
2328 s->width = window_rect->right - window_rect->left;
2329 s->height = window_rect->bottom - window_rect->top;
2330 }
2331 else
2332 {
2333 s->x = s->y = s->width = s->height = 0;
2334 s->flags |= (SWP_NOMOVE | SWP_NOSIZE);
2335 }
2336
2338
2339 /* Delete the old values. */
2340 state->style = 0;
2341 state->exstyle = 0;
2342}
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_EX_TOPMOST
Definition: pedump.c:647
#define SWP_FRAMECHANGED
Definition: winuser.h:1251
#define HWND_TOPMOST
Definition: winuser.h:1219
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define SWP_NOMOVE
Definition: winuser.h:1255
#define SWP_NOSIZE
Definition: winuser.h:1256
#define SWP_SHOWWINDOW
Definition: winuser.h:1259
#define SWP_HIDEWINDOW
Definition: winuser.h:1252
#define GWL_STYLE
Definition: winuser.h:863
#define HWND_NOTOPMOST
Definition: winuser.h:1217
#define GWL_EXSTYLE
Definition: winuser.h:862
Definition: style.c:91
static void set_window_state(struct wined3d_window_state *s)
Definition: swapchain.c:2188
static LONG fullscreen_style(LONG style)
Definition: swapchain.c:2128
static LONG fullscreen_exstyle(LONG exstyle)
Definition: swapchain.c:2137
#define WINED3D_SWAPCHAIN_REGISTER_TOPMOST_TIMER
Definition: wined3d.h:905
#define WINED3D_SWAPCHAIN_RESTORE_WINDOW_STATE
Definition: wined3d.h:904
#define WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES
Definition: wined3d.h:903

Referenced by wined3d_swapchain_cleanup(), and wined3d_swapchain_state_set_fullscreen().

◆ wined3d_swapchain_state_setup_fullscreen()

HRESULT wined3d_swapchain_state_setup_fullscreen ( struct wined3d_swapchain_state *  state,
HWND  window,
int  x,
int  y,
int  width,
int  height 
)

Definition at line 2225 of file swapchain.c.

2227{
2228 struct wined3d_window_state *s;
2229
2230 TRACE("Setting up window %p for fullscreen mode.\n", window);
2231
2232 if (!IsWindow(window))
2233 {
2234 WARN("%p is not a valid window.\n", window);
2236 }
2237
2238 if (!(s = malloc(sizeof(*s))))
2239 return E_OUTOFMEMORY;
2240 s->window = window;
2241 s->window_pos_after = HWND_TOPMOST;
2242 s->x = x;
2243 s->y = y;
2244 s->width = width;
2245 s->height = height;
2246
2247 if (state->style || state->exstyle)
2248 {
2249 ERR("Changing the window style for window %p, but another style (%08lx, %08lx) is already stored.\n",
2250 window, state->style, state->exstyle);
2251 }
2252
2255 s->flags |= SWP_NOZORDER;
2256 else
2257 s->flags |= SWP_SHOWWINDOW;
2258
2261
2262 s->style = fullscreen_style(state->style);
2263 s->exstyle = fullscreen_exstyle(state->exstyle);
2264 s->set_style = true;
2265 s->register_topmost_timer = !!(state->desc.flags & WINED3D_SWAPCHAIN_REGISTER_TOPMOST_TIMER);
2266 s->set_topmost_timer = true;
2267
2268 TRACE("Old style was %08lx, %08lx, setting to %08lx, %08lx.\n",
2269 state->style, state->exstyle, s->style, s->exstyle);
2270
2272 return WINED3D_OK;
2273}
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define WINED3DERR_NOTAVAILABLE
Definition: wined3d.h:42

Referenced by wined3d_device_reset(), wined3d_swapchain_init(), and wined3d_swapchain_state_set_fullscreen().

◆ wined3d_texture_allocate_object_memory()

static void * wined3d_texture_allocate_object_memory ( SIZE_T  s,
SIZE_T  level_count,
SIZE_T  layer_count 
)
inlinestatic

Definition at line 3459 of file wined3d_private.h.

3460{
3461 struct wined3d_texture *t;
3462
3463 if (level_count > ((~(SIZE_T)0 - s) / sizeof(*t->sub_resources)) / layer_count)
3464 return NULL;
3465
3466 return calloc(1, s + level_count * layer_count * sizeof(*t->sub_resources));
3467}

Referenced by adapter_gl_create_texture(), adapter_no3d_create_texture(), and adapter_vk_create_texture().

◆ wined3d_texture_can_use_pbo()

BOOL wined3d_texture_can_use_pbo ( const struct wined3d_texture *  texture,
const struct wined3d_d3d_info *  d3d_info 
)

Definition at line 59 of file texture.c.

60{
61 if (!d3d_info->pbo || texture->resource.format->conv_byte_count || texture->resource.pin_sysmem)
62 return FALSE;
63
64 return TRUE;
65}

Referenced by wined3d_cs_exec_blt_sub_resource(), and wined3d_texture_use_pbo().

◆ wined3d_texture_cleanup()

void wined3d_texture_cleanup ( struct wined3d_texture *  texture)

Definition at line 1593 of file texture.c.

1594{
1596 resource_cleanup(&texture->resource);
1597}
static void wined3d_texture_destroy_object(void *object)
Definition: texture.c:1528

Referenced by adapter_gl_destroy_texture(), adapter_no3d_destroy_texture(), adapter_vk_destroy_texture(), and wined3d_texture_cleanup_sync().

◆ wined3d_texture_clear_dirty_regions()

void wined3d_texture_clear_dirty_regions ( struct wined3d_texture *  texture)

Definition at line 753 of file texture.c.

754{
755 unsigned int i;
756
757 TRACE("texture %p\n", texture);
758
759 if (!texture->dirty_regions)
760 return;
761
762 for (i = 0; i < texture->layer_count; ++i)
763 {
764 texture->dirty_regions[i].box_count = 0;
765 }
766}

Referenced by wined3d_device_update_texture().

◆ wined3d_texture_download_from_texture()

void wined3d_texture_download_from_texture ( struct wined3d_texture *  dst_texture,
unsigned int  dst_sub_resource_idx,
struct wined3d_texture *  src_texture,
unsigned int  src_sub_resource_idx 
)

Definition at line 4381 of file texture.c.

4383{
4384 unsigned int src_level, dst_level, dst_row_pitch, dst_slice_pitch;
4385 unsigned int dst_location = dst_texture->resource.map_binding;
4386 struct wined3d_context *context;
4387 struct wined3d_bo_address data;
4388 struct wined3d_box src_box;
4389 unsigned int src_location;
4390
4391 context = context_acquire(src_texture->resource.device, NULL, 0);
4392
4393 wined3d_texture_prepare_location(dst_texture, dst_sub_resource_idx, context, dst_location);
4394 wined3d_texture_get_bo_address(dst_texture, dst_sub_resource_idx, &data, dst_location);
4395
4396 if (src_texture->sub_resources[src_sub_resource_idx].locations & WINED3D_LOCATION_TEXTURE_RGB)
4397 src_location = WINED3D_LOCATION_TEXTURE_RGB;
4398 else
4399 src_location = WINED3D_LOCATION_TEXTURE_SRGB;
4400 src_level = src_sub_resource_idx % src_texture->level_count;
4401 wined3d_texture_get_level_box(src_texture, src_level, &src_box);
4402
4403 dst_level = dst_sub_resource_idx % dst_texture->level_count;
4404 wined3d_texture_get_pitch(dst_texture, dst_level, &dst_row_pitch, &dst_slice_pitch);
4405
4406 src_texture->texture_ops->texture_download_data(context, src_texture, src_sub_resource_idx, src_location,
4407 &src_box, &data, dst_texture->resource.format, 0, 0, 0, dst_row_pitch, dst_slice_pitch);
4408
4410
4411 wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, dst_location);
4412 wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~dst_location);
4413}
const struct wined3d_texture_ops * texture_ops

Referenced by texture2d_blt().

◆ wined3d_texture_get_bo_address()

void wined3d_texture_get_bo_address ( const struct wined3d_texture *  texture,
unsigned int  sub_resource_idx,
struct wined3d_bo_address *  data,
uint32_t  location 
)

Definition at line 727 of file texture.c.

729{
730 struct wined3d_texture_sub_resource *sub_resource = &texture->sub_resources[sub_resource_idx];
731
733 {
734 data->addr = NULL;
735 data->buffer_object = sub_resource->bo;
736 }
737 else
738 {
740 if (sub_resource->user_memory)
741 {
742 data->addr = sub_resource->user_memory;
743 }
744 else
745 {
746 data->addr = texture->resource.heap_memory;
747 data->addr += sub_resource->offset;
748 }
749 data->buffer_object = 0;
750 }
751}

Referenced by cpu_blitter_clear_texture(), surface_convert_format(), surface_cpu_blt(), texture2d_read_from_framebuffer(), texture_resource_sub_resource_map(), texture_resource_sub_resource_unmap(), wined3d_cs_exec_blt_sub_resource(), wined3d_texture_create_dc(), wined3d_texture_destroy_dc(), wined3d_texture_download_from_texture(), wined3d_texture_get_memory(), wined3d_texture_gl_clear(), wined3d_texture_gl_load_sysmem(), wined3d_texture_load_location(), wined3d_texture_vk_clear(), and wined3d_texture_vk_load_sysmem().

◆ wined3d_texture_get_level_box()

◆ wined3d_texture_get_level_depth()

◆ wined3d_texture_get_level_height()

static unsigned int wined3d_texture_get_level_height ( const struct wined3d_texture *  texture,
unsigned int  level 
)
inlinestatic

Definition at line 3480 of file wined3d_private.h.

3482{
3483 return max(1, texture->resource.height >> level);
3484}

Referenced by ffp_blitter_clear_rendertargets(), glsl_blitter_blit(), surface_convert_format(), swapchain_blit_gdi(), texture2d_blt_fbo(), texture2d_get_blt_info(), texture2d_read_from_framebuffer(), texture_resource_sub_resource_get_map_pitch(), wined3d_context_gl_find_fbo_entry(), wined3d_context_gl_get_rt_size(), wined3d_cs_exec_blt_sub_resource(), wined3d_device_context_clear_sysmem_texture(), wined3d_device_context_copy_sub_resource_region(), wined3d_device_context_resolve_sub_resource(), wined3d_device_create_cursor_texture(), wined3d_device_set_cursor_properties(), wined3d_device_update_texture(), wined3d_rendertarget_view_get_drawable_size(), wined3d_rendertarget_view_init(), wined3d_shader_resource_view_vk_generate_mipmap(), wined3d_texture_create_dc(), wined3d_texture_get_level_box(), wined3d_texture_get_pitch(), wined3d_texture_get_sub_resource_desc(), wined3d_texture_gl_allocate_immutable_storage(), wined3d_texture_gl_allocate_mutable_storage(), wined3d_texture_gl_download_data(), wined3d_texture_gl_download_data_slow_path(), wined3d_texture_gl_set_compatible_renderbuffer(), wined3d_texture_is_full_rect(), wined3d_texture_load_drawable(), wined3d_texture_load_renderbuffer(), wined3d_texture_update_desc(), wined3d_texture_update_overlay(), wined3d_texture_update_sub_resource(), wined3d_texture_upload_from_texture(), wined3d_texture_vk_download_data(), wined3d_unordered_access_view_gl_clear(), and wined3d_unordered_access_view_vk_clear().

◆ wined3d_texture_get_level_width()

static unsigned int wined3d_texture_get_level_width ( const struct wined3d_texture *  texture,
unsigned int  level 
)
inlinestatic

Definition at line 3474 of file wined3d_private.h.

3476{
3477 return max(1, texture->resource.width >> level);
3478}

Referenced by ffp_blitter_clear_rendertargets(), glsl_blitter_blit(), surface_convert_format(), swapchain_blit_gdi(), texture2d_blt_fbo(), texture2d_get_blt_info(), texture2d_read_from_framebuffer(), texture_resource_sub_resource_get_map_pitch(), wined3d_context_gl_find_fbo_entry(), wined3d_context_gl_get_rt_size(), wined3d_cs_exec_blt_sub_resource(), wined3d_device_context_clear_sysmem_texture(), wined3d_device_context_copy_sub_resource_region(), wined3d_device_context_resolve_sub_resource(), wined3d_device_create_cursor_texture(), wined3d_device_set_cursor_properties(), wined3d_device_update_texture(), wined3d_rendertarget_view_get_drawable_size(), wined3d_rendertarget_view_init(), wined3d_shader_resource_view_vk_generate_mipmap(), wined3d_texture_create_dc(), wined3d_texture_get_level_box(), wined3d_texture_get_pitch(), wined3d_texture_get_sub_resource_desc(), wined3d_texture_gl_allocate_immutable_storage(), wined3d_texture_gl_allocate_mutable_storage(), wined3d_texture_gl_download_data(), wined3d_texture_gl_download_data_slow_path(), wined3d_texture_gl_set_compatible_renderbuffer(), wined3d_texture_is_full_rect(), wined3d_texture_load_drawable(), wined3d_texture_load_renderbuffer(), wined3d_texture_update_desc(), wined3d_texture_update_overlay(), wined3d_texture_update_sub_resource(), wined3d_texture_upload_from_texture(), wined3d_texture_vk_download_data(), wined3d_unordered_access_view_gl_clear(), and wined3d_unordered_access_view_vk_clear().

◆ wined3d_texture_invalidate_location()

void wined3d_texture_invalidate_location ( struct wined3d_texture *  texture,
unsigned int  sub_resource_idx,
uint32_t  location 
)

Definition at line 702 of file texture.c.

704{
705 struct wined3d_texture_sub_resource *sub_resource;
706 DWORD previous_locations;
707
708 TRACE("texture %p, sub_resource_idx %u, location %s.\n",
709 texture, sub_resource_idx, wined3d_debug_location(location));
710
713
714 sub_resource = &texture->sub_resources[sub_resource_idx];
715 previous_locations = sub_resource->locations;
716 sub_resource->locations &= ~location;
717 if (previous_locations != WINED3D_LOCATION_SYSMEM && sub_resource->locations == WINED3D_LOCATION_SYSMEM)
718 ++texture->sysmem_count;
719
720 TRACE("New locations flags are %s.\n", wined3d_debug_location(sub_resource->locations));
721
722 if (!sub_resource->locations)
723 ERR("Sub-resource %u of texture %p does not have any up to date location.\n",
724 sub_resource_idx, texture);
725}
static void wined3d_texture_set_dirty(struct wined3d_texture *texture)
Definition: texture.c:697

Referenced by cpu_blitter_clear_texture(), raw_blitter_blit(), surface_convert_format(), surface_cpu_blt(), swapchain_blit(), swapchain_gl_present(), swapchain_vk_present(), texture2d_blt(), texture_resource_sub_resource_map(), texture_resource_unload(), vk_blitter_blit(), wined3d_cs_exec_add_dirty_texture_region(), wined3d_cs_exec_blt_sub_resource(), wined3d_shader_resource_view_gl_generate_mipmap(), wined3d_shader_resource_view_vk_generate_mipmap(), wined3d_swapchain_gl_rotate(), wined3d_swapchain_init(), wined3d_swapchain_resize_buffers(), wined3d_swapchain_vk_rotate(), wined3d_texture_create_dc(), wined3d_texture_destroy_object(), wined3d_texture_download_from_texture(), wined3d_texture_force_reload(), wined3d_texture_load_location(), wined3d_texture_remove_buffer_object(), wined3d_texture_update_desc(), wined3d_texture_update_sub_resource(), wined3d_texture_upload_from_texture(), wined3d_unordered_access_view_gl_clear(), wined3d_unordered_access_view_vk_clear(), and wined3d_view_invalidate_location().

◆ wined3d_texture_is_full_rect()

static bool wined3d_texture_is_full_rect ( const struct wined3d_texture *  texture,
unsigned int  level,
const RECT *  r 
)
inlinestatic

Definition at line 3501 of file wined3d_private.h.

3503{
3504 unsigned int t;
3505
3507 if ((r->left && r->right) || abs(r->right - r->left) != t)
3508 return false;
3510 if ((r->top && r->bottom) || abs(r->bottom - r->top) != t)
3511 return false;
3512 return true;
3513}
#define abs(i)
Definition: fconv.c:206
GLdouble GLdouble GLdouble r
Definition: gl.h:2055

Referenced by glsl_blitter_blit(), raw_blitter_blit(), texture2d_blt(), texture2d_blt_fbo(), texture2d_depth_blt_fbo(), and vk_blitter_blit().

◆ wined3d_texture_load()

void wined3d_texture_load ( struct wined3d_texture *  texture,
struct wined3d_context *  context,
BOOL  srgb 
)

Definition at line 1657 of file texture.c.

1659{
1660 UINT sub_count = texture->level_count * texture->layer_count;
1661 DWORD flag;
1662 UINT i;
1663
1664 TRACE("texture %p, context %p, srgb %#x.\n", texture, context, srgb);
1665
1667 srgb = FALSE;
1668
1669 if (srgb)
1671 else
1673
1674 if (texture->flags & flag)
1675 {
1676 TRACE("Texture %p not dirty, nothing to do.\n", texture);
1677 return;
1678 }
1679
1680 /* Reload the surfaces if the texture is marked dirty. */
1681 for (i = 0; i < sub_count; ++i)
1682 {
1685 ERR("Failed to load location (srgb %#x).\n", srgb);
1686 }
1687 texture->flags |= flag;
1688}
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 flag
Definition: glfuncs.h:52
#define WINED3D_TEXTURE_RGB_VALID
#define WINED3D_TEXTURE_SRGB_VALID
static BOOL needs_separate_srgb_gl_texture(const struct wined3d_context *context, const struct wined3d_texture *texture)

Referenced by context_gl_load_shader_resources(), context_gl_load_unordered_access_resources(), glsl_blitter_blit(), texture_resource_preload(), and wined3d_context_vk_load_shader_resources().

◆ wined3d_texture_load_location()

BOOL wined3d_texture_load_location ( struct wined3d_texture *  texture,
unsigned int  sub_resource_idx,
struct wined3d_context *  context,
uint32_t  location 
)

Definition at line 770 of file texture.c.

772{
773 DWORD current = texture->sub_resources[sub_resource_idx].locations;
774 BOOL ret;
775
776 TRACE("texture %p, sub_resource_idx %u, context %p, location %s.\n",
777 texture, sub_resource_idx, context, wined3d_debug_location(location));
778
779 TRACE("Current resource location %s.\n", wined3d_debug_location(current));
780
781 if (current & location)
782 {
783 TRACE("Location %s is already up to date.\n", wined3d_debug_location(location));
784 return TRUE;
785 }
786
787 if (WARN_ON(d3d))
788 {
790 if ((texture->resource.access & required_access) != required_access)
791 WARN("Operation requires %#x access, but texture only has %#x.\n",
792 required_access, texture->resource.access);
793 }
794
796 {
797 TRACE("Sub-resource previously discarded, nothing to do.\n");
799 return FALSE;
802 return TRUE;
803 }
804
805 if (!current)
806 {
807 ERR("Sub-resource %u of texture %p does not have any up to date location.\n",
808 sub_resource_idx, texture);
810 return wined3d_texture_load_location(texture, sub_resource_idx, context, location);
811 }
812
815 {
816 struct wined3d_bo_address source, destination;
817 struct wined3d_range range;
818
820 return FALSE;
821 wined3d_texture_get_bo_address(texture, sub_resource_idx, &destination, location);
822 range.offset = 0;
823 range.size = texture->sub_resources[sub_resource_idx].size;
825 {
826 unsigned int level_idx = sub_resource_idx % texture->level_count;
827 struct wined3d_map_desc map;
828 struct wined3d_box box;
829 struct wined3d_color c;
830
831 if (texture->resource.format->caps[WINED3D_GL_RES_TYPE_TEX_2D]
833 {
834 c.r = texture->sub_resources[sub_resource_idx].clear_value.depth;
835 c.g = texture->sub_resources[sub_resource_idx].clear_value.stencil;
836 c.b = c.a = 0.0f;
837 }
838 else
839 {
840 c = texture->sub_resources[sub_resource_idx].clear_value.colour;
841 }
842
843 wined3d_texture_get_pitch(texture, level_idx, &map.row_pitch, &map.slice_pitch);
844 if (destination.buffer_object)
845 map.data = wined3d_context_map_bo_address(context, &destination, range.size,
847 else
848 map.data = destination.addr;
849
851 wined3d_resource_memory_colour_fill(&texture->resource, &map, &c, &box, true);
852
853 if (destination.buffer_object)
855 }
856 else
857 {
858 wined3d_texture_get_bo_address(texture, sub_resource_idx,
862 }
863 ret = TRUE;
864 }
865 else
866 {
867 ret = texture->texture_ops->texture_load_location(texture, sub_resource_idx, context, location);
868 }
869
870 if (ret)
872
873 return ret;
874}
static uint32_t wined3d_resource_access_from_location(uint32_t location)
Definition: texture.c:141
static const uint32_t wined3d_texture_sysmem_locations
Definition: texture.c:33
struct task_struct * current
Definition: linux.c:32
#define WARN_ON(c)
Definition: module.h:257
#define WINED3D_FORMAT_CAP_DEPTH_STENCIL

Referenced by cpu_blitter_blit(), cpu_blitter_clear_texture(), glsl_blitter_blit(), raw_blitter_blit(), surface_convert_format(), surface_cpu_blt(), swapchain_blit_gdi(), swapchain_frontbuffer_updated(), swapchain_gl_present(), swapchain_vk_present(), texture2d_blt(), texture2d_blt_fbo(), texture2d_depth_blt_fbo(), texture_resource_sub_resource_map(), texture_resource_unload(), vk_blitter_blit(), wined3d_cs_exec_add_dirty_texture_region(), wined3d_cs_exec_blt_sub_resource(), wined3d_shader_resource_view_gl_generate_mipmap(), wined3d_shader_resource_view_vk_generate_mipmap(), wined3d_swapchain_gl_rotate(), wined3d_swapchain_vk_rotate(), wined3d_texture_create_dc(), wined3d_texture_get_memory(), wined3d_texture_gl_load_sysmem(), wined3d_texture_gl_load_texture(), wined3d_texture_load(), wined3d_texture_load_drawable(), wined3d_texture_load_location(), wined3d_texture_update_map_binding(), wined3d_texture_update_sub_resource(), wined3d_texture_upload_from_texture(), and wined3d_view_load_location().

◆ wined3d_texture_no3d_init()

HRESULT wined3d_texture_no3d_init ( struct wined3d_texture *  texture_no3d,
struct wined3d_device *  device,
const struct wined3d_resource_desc *  desc,
unsigned int  layer_count,
unsigned int  level_count,
uint32_t  flags,
void *  parent,
const struct wined3d_parent_ops *  parent_ops 
)

Definition at line 4570 of file texture.c.

4573{
4574 TRACE("texture_no3d %p, device %p, desc %p, layer_count %u, "
4575 "level_count %u, flags %#x, parent %p, parent_ops %p.\n",
4576 texture_no3d, device, desc, layer_count,
4577 level_count, flags, parent, parent_ops);
4578
4579 return wined3d_texture_init(texture_no3d, desc, layer_count, level_count,
4580 flags, device, parent, parent_ops, &texture_no3d[1], &wined3d_texture_no3d_ops);
4581}
static const struct wined3d_texture_ops wined3d_texture_no3d_ops
Definition: texture.c:4561
static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struct wined3d_resource_desc *desc, unsigned int layer_count, unsigned int level_count, uint32_t flags, struct wined3d_device *device, void *parent, const struct wined3d_parent_ops *parent_ops, void *sub_resources, const struct wined3d_texture_ops *texture_ops)
Definition: texture.c:3620

Referenced by adapter_no3d_create_texture().

◆ wined3d_texture_prepare_location()

BOOL wined3d_texture_prepare_location ( struct wined3d_texture *  texture,
unsigned int  sub_resource_idx,
struct wined3d_context *  context,
uint32_t  location 
)

◆ wined3d_texture_set_swapchain()

void wined3d_texture_set_swapchain ( struct wined3d_texture *  texture,
struct wined3d_swapchain *  swapchain 
)

Definition at line 1263 of file texture.c.

1264{
1265 texture->swapchain = swapchain;
1267}

Referenced by swapchain_create_texture(), wined3d_swapchain_cleanup(), wined3d_swapchain_init(), and wined3d_swapchain_resize_buffers().

◆ wined3d_texture_sub_resources_destroyed()

void wined3d_texture_sub_resources_destroyed ( struct wined3d_texture *  texture)

Definition at line 1111 of file texture.c.

1112{
1113 unsigned int sub_count = texture->level_count * texture->layer_count;
1114 struct wined3d_texture_sub_resource *sub_resource;
1115 unsigned int i;
1116
1117 for (i = 0; i < sub_count; ++i)
1118 {
1119 sub_resource = &texture->sub_resources[i];
1120 if (sub_resource->parent)
1121 {
1122 TRACE("sub-resource %u.\n", i);
1123 sub_resource->parent_ops->wined3d_object_destroyed(sub_resource->parent);
1124 sub_resource->parent = NULL;
1125 }
1126 }
1127}

Referenced by adapter_gl_destroy_texture(), adapter_no3d_destroy_texture(), adapter_vk_destroy_texture(), and wined3d_texture_cleanup_sync().

◆ wined3d_texture_translate_drawable_coords()

void wined3d_texture_translate_drawable_coords ( const struct wined3d_texture *  texture,
HWND  window,
RECT *  rect 
)

Definition at line 91 of file texture.c.

92{
93 unsigned int drawable_height;
94 POINT offset = {0, 0};
95 RECT windowsize;
96
97 if (!texture->swapchain)
98 return;
99
100 if (texture == texture->swapchain->front_buffer)
101 {
104 }
105
106 GetClientRect(window, &windowsize);
107 drawable_height = windowsize.bottom - windowsize.top;
108
109 rect->top = drawable_height - rect->top;
110 rect->bottom = drawable_height - rect->bottom;
111}
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

Referenced by glsl_blitter_blit(), and texture2d_blt_fbo().

◆ wined3d_texture_update_sub_resource()

void wined3d_texture_update_sub_resource ( struct wined3d_texture *  texture,
unsigned int  sub_resource_idx,
struct wined3d_context *  context,
const struct upload_bo *  upload_bo,
const struct wined3d_box *  box,
unsigned int  row_pitch,
unsigned int  slice_pitch 
)

Definition at line 4440 of file texture.c.

4443{
4444 unsigned int level = sub_resource_idx % texture->level_count;
4448 struct wined3d_box src_box;
4449
4451 {
4452 wined3d_texture_set_bo(texture, sub_resource_idx, context, upload_bo->addr.buffer_object);
4455 /* Try to free address space if we are not mapping persistently. */
4456 if (upload_bo->addr.buffer_object->map_ptr)
4458 }
4459
4460 /* Only load the sub-resource for partial updates. */
4461 if (!box->left && !box->top && !box->front
4462 && box->right == width && box->bottom == height && box->back == depth)
4464 else
4466
4467 wined3d_box_set(&src_box, 0, 0, box->right - box->left, box->bottom - box->top, 0, box->back - box->front);
4468 texture->texture_ops->texture_upload_data(context, &upload_bo->addr, texture->resource.format,
4469 &src_box, row_pitch, slice_pitch, texture, sub_resource_idx,
4470 WINED3D_LOCATION_TEXTURE_RGB, box->left, box->top, box->front);
4471
4474}
static void wined3d_texture_set_bo(struct wined3d_texture *texture, unsigned sub_resource_idx, struct wined3d_context *context, struct wined3d_bo *bo)
Definition: texture.c:4415

Referenced by wined3d_cs_exec_update_sub_resource().

◆ wined3d_texture_upload_from_texture()

void wined3d_texture_upload_from_texture ( struct wined3d_texture *  dst_texture,
unsigned int  dst_sub_resource_idx,
unsigned int  dst_x,
unsigned int  dst_y,
unsigned int  dst_z,
struct wined3d_texture *  src_texture,
unsigned int  src_sub_resource_idx,
const struct wined3d_box *  src_box 
)

Definition at line 4335 of file texture.c.

4338{
4339 unsigned int src_row_pitch, src_slice_pitch;
4340 unsigned int update_w, update_h, update_d;
4341 unsigned int src_level, dst_level;
4342 struct wined3d_context *context;
4343 struct wined3d_bo_address data;
4344
4345 TRACE("dst_texture %p, dst_sub_resource_idx %u, dst_x %u, dst_y %u, dst_z %u, "
4346 "src_texture %p, src_sub_resource_idx %u, src_box %s.\n",
4347 dst_texture, dst_sub_resource_idx, dst_x, dst_y, dst_z,
4348 src_texture, src_sub_resource_idx, debug_box(src_box));
4349
4350 context = context_acquire(dst_texture->resource.device, NULL, 0);
4351
4352 /* Only load the sub-resource for partial updates. For newly allocated
4353 * textures the texture wouldn't be the current location, and we'd upload
4354 * zeroes just to overwrite them again. */
4355 update_w = src_box->right - src_box->left;
4356 update_h = src_box->bottom - src_box->top;
4357 update_d = src_box->back - src_box->front;
4358 dst_level = dst_sub_resource_idx % dst_texture->level_count;
4359 if (update_w == wined3d_texture_get_level_width(dst_texture, dst_level)
4360 && update_h == wined3d_texture_get_level_height(dst_texture, dst_level)
4361 && update_d == wined3d_texture_get_level_depth(dst_texture, dst_level))
4362 wined3d_texture_prepare_location(dst_texture, dst_sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB);
4363 else
4364 wined3d_texture_load_location(dst_texture, dst_sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB);
4365
4366 src_level = src_sub_resource_idx % src_texture->level_count;
4367 wined3d_texture_get_memory(src_texture, src_sub_resource_idx, context, &data);
4368 wined3d_texture_get_pitch(src_texture, src_level, &src_row_pitch, &src_slice_pitch);
4369
4370 dst_texture->texture_ops->texture_upload_data(context, wined3d_const_bo_address(&data),
4371 src_texture->resource.format, src_box, src_row_pitch, src_slice_pitch, dst_texture,
4372 dst_sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB, dst_x, dst_y, dst_z);
4373
4375
4376 wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB);
4377 wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB);
4378}
static void wined3d_texture_get_memory(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, struct wined3d_bo_address *data)
Definition: texture.c:876
UINT back
Definition: wined3d.h:1878

Referenced by glsl_blitter_blit(), and texture2d_blt().

◆ wined3d_texture_validate_location()

void wined3d_texture_validate_location ( struct wined3d_texture *  texture,
unsigned int  sub_resource_idx,
uint32_t  location 
)

Definition at line 678 of file texture.c.

680{
681 struct wined3d_texture_sub_resource *sub_resource;
682 DWORD previous_locations;
683
684 TRACE("texture %p, sub_resource_idx %u, location %s.\n",
685 texture, sub_resource_idx, wined3d_debug_location(location));
686
687 sub_resource = &texture->sub_resources[sub_resource_idx];
688 previous_locations = sub_resource->locations;
689 sub_resource->locations |= location;
690 if (previous_locations == WINED3D_LOCATION_SYSMEM && location != WINED3D_LOCATION_SYSMEM
691 && !--texture->sysmem_count)
693
694 TRACE("New locations flags are %s.\n", wined3d_debug_location(sub_resource->locations));
695}
static void wined3d_texture_evict_sysmem(struct wined3d_texture *texture)
Definition: texture.c:651

Referenced by raw_blitter_blit(), surface_convert_format(), surface_cpu_blt(), swapchain_blit(), swapchain_gl_present(), swapchain_vk_present(), texture2d_blt(), texture_resource_sub_resource_map(), texture_resource_unload(), vk_blitter_blit(), wined3d_cs_exec_blt_sub_resource(), wined3d_cs_exec_present(), wined3d_cs_exec_set_depth_stencil_view(), wined3d_rendertarget_view_validate_location(), wined3d_shader_resource_view_gl_generate_mipmap(), wined3d_shader_resource_view_vk_generate_mipmap(), wined3d_swapchain_gl_rotate(), wined3d_swapchain_init(), wined3d_swapchain_resize_buffers(), wined3d_swapchain_vk_rotate(), wined3d_texture_destroy_object(), wined3d_texture_download_from_texture(), wined3d_texture_gl_clear(), wined3d_texture_load_location(), wined3d_texture_update_desc(), wined3d_texture_update_sub_resource(), wined3d_texture_upload_from_texture(), wined3d_texture_vk_clear(), wined3d_unordered_access_view_gl_clear(), and wined3d_unordered_access_view_vk_clear().

◆ wined3d_texture_validate_sub_resource_idx()

bool wined3d_texture_validate_sub_resource_idx ( const struct wined3d_texture *  texture,
unsigned int  sub_resource_idx 
)

◆ wined3d_uint32_compare()

static int wined3d_uint32_compare ( uint32_t  x,
uint32_t  y 
)
inlinestatic

◆ wined3d_uint64_compare()

static int wined3d_uint64_compare ( uint64_t  x,
uint64_t  y 
)
inlinestatic

Definition at line 448 of file wined3d_private.h.

449{
450 return (x > y) - (x < y);
451}

Referenced by wined3d_bo_slab_vk_compare(), and wined3d_graphics_pipeline_vk_compare().

◆ wined3d_unordered_access_view_cleanup()

void wined3d_unordered_access_view_cleanup ( struct wined3d_unordered_access_view *  view)

Definition at line 1531 of file view.c.

1532{
1533 view->parent_ops->wined3d_object_destroyed(view->parent);
1534}

Referenced by adapter_gl_destroy_unordered_access_view(), and adapter_vk_destroy_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 1739 of file view.c.

1741{
1743
1744 if (!view->counter_bo)
1745 return;
1746
1747 src.buffer_object = view->counter_bo;
1748 src.addr = NULL;
1749
1751}
struct wined3d_bo * buffer_object

Referenced by wined3d_cs_exec_copy_uav_counter().

◆ wined3d_unordered_access_view_invalidate_location()

void wined3d_unordered_access_view_invalidate_location ( struct wined3d_unordered_access_view *  view,
uint32_t  location 
)

◆ 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 1714 of file view.c.

1716{
1717 struct wined3d_bo_address dst, src;
1718 struct wined3d_context *context;
1719 struct wined3d_range range;
1720
1721 if (!view->counter_bo)
1722 return;
1723
1724 context = context_acquire(view->resource->device, NULL, 0);
1725
1726 src.buffer_object = 0;
1727 src.addr = (void *)&value;
1728
1729 dst.buffer_object = view->counter_bo;
1730 dst.addr = NULL;
1731
1732 range.offset = 0;
1733 range.size = sizeof(value);
1735
1737}

Referenced by wined3d_cs_exec_set_unordered_access_views(), and wined3d_unordered_access_view_gl_cs_init().

◆ wined3d_unregister_window()

void wined3d_unregister_window ( HWND  window)

Definition at line 790 of file wined3d_main.c.

791{
792 struct wined3d_wndproc *entry, *last;
793
795
797 {
799 ERR("Window %p is not registered with wined3d.\n", window);
800 return;
801 }
802
803 if (entry->proc && !restore_wndproc(entry))
804 {
805 entry->device = NULL;
806 WARN("Not unregistering window %p, current window proc doesn't match wined3d window proc.\n", window);
808 return;
809 }
810
811 last = &wndproc_table.entries[--wndproc_table.count];
812 if (entry != last) *entry = *last;
813
815}
static const LARGE_INTEGER *static const HANDLE const LARGE_INTEGER *static PSLIST_ENTRY PSLIST_ENTRY last
Definition: sync.c:64
static struct wined3d_wndproc_table wndproc_table
Definition: wined3d_main.c:81
static BOOL restore_wndproc(struct wined3d_wndproc *entry)
Definition: wined3d_main.c:768

Referenced by device_process_message(), and wined3d_device_release_focus_window().

◆ wined3d_vec4_transform()

static void wined3d_vec4_transform ( struct wined3d_vec4 *  dst,
const struct wined3d_vec4 *  v,
const struct wined3d_matrix *  m 
)
inlinestatic

Definition at line 4764 of file wined3d_private.h.

4766{
4767 struct wined3d_vec4 tmp;
4768
4769 tmp.x = v->x * m->_11 + v->y * m->_21 + v->z * m->_31 + v->w * m->_41;
4770 tmp.y = v->x * m->_12 + v->y * m->_22 + v->z * m->_32 + v->w * m->_42;
4771 tmp.z = v->x * m->_13 + v->y * m->_23 + v->z * m->_33 + v->w * m->_43;
4772 tmp.w = v->x * m->_14 + v->y * m->_24 + v->z * m->_34 + v->w * m->_44;
4773
4774 *dst = tmp;
4775}

Referenced by init_transformed_lights(), light_set_vertex_data(), and wined3d_device_apply_stateblock().

◆ wined3d_viewport_get_z_range()

static void wined3d_viewport_get_z_range ( const struct wined3d_viewport *  vp,
float *  min_z,
float *  max_z 
)
inlinestatic

Definition at line 4932 of file wined3d_private.h.

4933{
4934 *min_z = vp->min_z;
4935
4936 /* The magic constant is derived from tests. */
4937 *max_z = max(vp->max_z, vp->min_z + 0.001f);
4938}

Referenced by process_vertices_strided(), viewport_miscpart(), and viewport_miscpart_cc().

◆ wined3d_vk_blitter_create()

void wined3d_vk_blitter_create ( struct wined3d_blitter **  next)

Definition at line 7048 of file texture.c.

7049{
7050 struct wined3d_blitter *blitter;
7051
7052 if (!(blitter = malloc(sizeof(*blitter))))
7053 return;
7054
7055 TRACE("Created blitter %p.\n", blitter);
7056
7057 blitter->ops = &vk_blitter_ops;
7058 blitter->next = *next;
7059 *next = blitter;
7060}
static const struct wined3d_blitter_ops vk_blitter_ops
Definition: texture.c:7041

Referenced by adapter_vk_init_3d().

Variable Documentation

◆ COLOR_FIXUP_IDENTITY

◆ glsl_fragment_pipe

const struct wined3d_fragment_pipe_ops glsl_fragment_pipe
extern

Definition at line 12311 of file glsl_shader.c.

Referenced by set_glsl_shader_program(), and wined3d_adapter_init_gl_caps().

◆ glsl_shader_backend

◆ glsl_vertex_pipe

const struct wined3d_vertex_pipe_ops glsl_vertex_pipe
extern

Definition at line 11971 of file glsl_shader.c.

Referenced by set_glsl_shader_program(), and wined3d_adapter_init_gl_caps().

◆ misc_state_template_gl

const struct wined3d_state_entry_template misc_state_template_gl[]
extern

Definition at line 1401 of file ffp_gl.c.

Referenced by wined3d_adapter_gl_init_d3d_info().

◆ none_fragment_pipe

const struct wined3d_fragment_pipe_ops none_fragment_pipe
extern

Definition at line 1514 of file ffp_gl.c.

Referenced by wined3d_adapter_no3d_create().

◆ none_shader_backend

const struct wined3d_shader_backend_ops none_shader_backend
extern

Definition at line 2060 of file shader.c.

Referenced by shader_none_alloc(), and wined3d_adapter_no3d_create().

◆ none_vertex_pipe

const struct wined3d_vertex_pipe_ops none_vertex_pipe
extern

Definition at line 1489 of file ffp_gl.c.

Referenced by wined3d_adapter_no3d_create().

◆ sm1_shader_frontend

const struct wined3d_shader_frontend sm1_shader_frontend
extern

Definition at line 804 of file shader_sm1.c.

Referenced by shader_select_frontend().

◆ sm4_shader_frontend

const struct wined3d_shader_frontend sm4_shader_frontend
extern

Definition at line 1831 of file shader_sm4.c.

Referenced by shader_select_frontend().

◆ wined3d_command_cs

CRITICAL_SECTION wined3d_command_cs
extern

◆ WINED3D_default_light

◆ wined3d_null_parent_ops

◆ WINED3D_READ_ONLY_BIND_MASK

◆ wined3d_settings

Definition at line 116 of file wined3d_main.c.

◆ wined3d_srgb_const