ReactOS 0.4.15-dev-7788-g1ad9096
wined3d_private.h File Reference
#include <assert.h>
#include <stdarg.h>
#include <math.h>
#include <limits.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 "wine/heap.h"
#include "wine/unicode.h"
#include "objbase.h"
#include "wine/wined3d.h"
#include "wined3d_gl.h"
#include "wine/list.h"
#include "wine/rbtree.h"
#include "wine/wgl_driver.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  wined3d_d3d_limits
 
struct  wined3d_ffp_attrib_ops
 
struct  wined3d_d3d_info
 
struct  min_lookup
 
struct  wined3d_settings
 
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_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
 
union  wined3d_gl_fence_object
 
struct  wined3d_fence
 
struct  wined3d_query_ops
 
struct  wined3d_query
 
struct  wined3d_event_query
 
struct  wined3d_occlusion_query
 
struct  wined3d_timestamp_query
 
union  wined3d_gl_so_statistics_query
 
struct  wined3d_so_statistics_query
 
union  wined3d_gl_pipeline_statistics_query
 
struct  wined3d_pipeline_statistics_query
 
struct  wined3d_gl_view
 
struct  wined3d_rendertarget_info
 
struct  wined3d_context
 
struct  wined3d_fb_state
 
struct  StateEntry
 
struct  StateEntryTemplate
 
struct  fragment_caps
 
struct  fragment_pipeline
 
struct  wined3d_vertex_caps
 
struct  wined3d_vertex_pipe_ops
 
struct  wined3d_blitter
 
struct  wined3d_blitter_ops
 
struct  wined3d_light_info
 
struct  wined3d_pixel_format
 
struct  wined3d_fbo_ops
 
struct  wined3d_gl_limits
 
struct  wined3d_gl_info
 
struct  wined3d_driver_info
 
struct  wined3d_adapter
 
struct  wined3d_caps_gl_ctx
 
struct  texture_stage_op
 
struct  ffp_frag_settings
 
struct  ffp_frag_desc
 
struct  wined3d_ffp_vs_settings
 
struct  wined3d_ffp_vs_desc
 
struct  wined3d
 
struct  wined3d_blend_state
 
struct  wined3d_rasterizer_state
 
struct  wined3d_stream_output
 
struct  wined3d_stream_state
 
struct  wined3d_state
 
struct  wined3d_dummy_textures
 
struct  wined3d_device
 
struct  wined3d_resource_ops
 
struct  wined3d_resource
 
struct  gl_texture
 
struct  wined3d_texture_ops
 
struct  wined3d_texture
 
struct  wined3d_texture::wined3d_texture_async
 
struct  wined3d_texture::wined3d_overlay_info
 
struct  wined3d_texture::wined3d_texture_sub_resource
 
struct  wined3d_renderbuffer_entry
 
struct  wined3d_fbo_resource
 
struct  fbo_entry
 
struct  fbo_entry::wined3d_fbo_entry_key
 
struct  wined3d_surface
 
struct  wined3d_sampler
 
struct  wined3d_vertex_declaration_element
 
struct  wined3d_vertex_declaration
 
struct  wined3d_saved_states
 
struct  StageState
 
struct  wined3d_stateblock
 
struct  wined3d_cs_queue
 
struct  wined3d_cs_ops
 
struct  wined3d_cs
 
struct  wined3d_map_range
 
struct  wined3d_buffer
 
struct  wined3d_rendertarget_view
 
struct  wined3d_shader_resource_view
 
struct  wined3d_unordered_access_view
 
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  ps_np2fixup_info
 
struct  wined3d_palette
 
struct  wined3d_rational
 
struct  wined3d_color_key_conversion
 
struct  wined3d_format
 

Macros

#define WINE_GLAPI
 
#define WIN32_NO_STATUS
 
#define NONAMELESSUNION
 
#define NONAMELESSSTRUCT
 
#define COBJMACROS
 
#define ARRAY_SIZE(array)   (sizeof(array) / sizeof((array)[0]))
 
#define MAKEDWORD_VERSION(maj, min)   (((maj & 0xffffu) << 16) | (min & 0xffffu))
 
#define WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT   0x00000001
 
#define WINED3D_QUIRK_SET_TEXCOORD_W   0x00000002
 
#define WINED3D_QUIRK_GLSL_CLIP_VARYING   0x00000004
 
#define WINED3D_QUIRK_ALLOWS_SPECULAR_ALPHA   0x00000008
 
#define WINED3D_QUIRK_NV_CLIP_BROKEN   0x00000010
 
#define WINED3D_QUIRK_FBO_TEX_UPDATE   0x00000020
 
#define WINED3D_QUIRK_BROKEN_RGBA16   0x00000040
 
#define WINED3D_QUIRK_INFO_LOG_SPAM   0x00000080
 
#define WINED3D_QUIRK_LIMITED_TEX_FILTERING   0x00000100
 
#define WINED3D_QUIRK_BROKEN_ARB_FOG   0x00000200
 
#define MAX_STREAMS   16
 
#define MAX_TEXTURES   8
 
#define MAX_FRAGMENT_SAMPLERS   16
 
#define MAX_VERTEX_SAMPLERS   4
 
#define MAX_COMBINED_SAMPLERS   (MAX_FRAGMENT_SAMPLERS + MAX_VERTEX_SAMPLERS)
 
#define MAX_ACTIVE_LIGHTS   8
 
#define MAX_CLIP_DISTANCES   8
 
#define MAX_CONSTANT_BUFFERS   15
 
#define MAX_SAMPLER_OBJECTS   16
 
#define MAX_SHADER_RESOURCE_VIEWS   128
 
#define MAX_RENDER_TARGET_VIEWS   8
 
#define MAX_UNORDERED_ACCESS_VIEWS   8
 
#define MAX_TGSM_REGISTERS   8192
 
#define MAX_VERTEX_BLENDS   4
 
#define MAX_VERTEX_INDEX_BLENDS   9
 
#define MAX_MULTISAMPLE_TYPES   8
 
#define MAX_RENDER_TARGETS   8
 
#define ORM_BACKBUFFER   0
 
#define ORM_FBO   1
 
#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_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_PS_Y_CORR   0x00001000
 
#define WINED3D_SHADER_CONST_PS_NP2_FIXUP   0x00002000
 
#define WINED3D_SHADER_CONST_FFP_MODELVIEW   0x00004000
 
#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_FFP_VERTEXBLEND   0xff000000
 
#define WINED3D_SHADER_CONST_FFP_VERTEXBLEND_INDEX(i)   (0x01000000 << ((i) - 1))
 
#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 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   16
 
#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 WINED3D_MAX_CONSTS_B   16
 
#define WINED3D_MAX_CONSTS_I   16
 
#define WINED3D_MAX_VS_CONSTS_F   256
 
#define WINED3D_MAX_PS_CONSTS_F   224
 
#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_VS_CLIPPING   0x00000001
 
#define WINED3D_SHADER_CAP_SRGB_WRITE   0x00000002
 
#define WINED3D_SHADER_CAP_DOUBLE_PRECISION   0x00000004
 
#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 GL_EXTCALL(f)   (gl_info->gl_ops.ext.p_##f)
 
#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 HIGHEST_TRANSFORMSTATE   WINED3D_TS_WORLD_MATRIX(255) /* Highest value in wined3d_transform_state. */
 
#define checkGLcall(A)
 
#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(MAX_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE))
 
#define STATE_SAMPLER(num)   (STATE_TEXTURESTAGE(MAX_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE) + 1 + (num))
 
#define STATE_IS_SAMPLER(num)   ((num) >= STATE_SAMPLER(0) && (num) <= STATE_SAMPLER(MAX_COMBINED_SAMPLERS - 1))
 
#define STATE_GRAPHICS_SHADER(a)   (STATE_SAMPLER(MAX_COMBINED_SAMPLERS) + (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_TRANSFORM(a)   (STATE_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING + (a))
 
#define STATE_IS_TRANSFORM(a)   ((a) >= STATE_TRANSFORM(1) && (a) <= STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(255)))
 
#define STATE_STREAMSRC   (STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(255)) + 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_LIGHT_TYPE   (STATE_VIEWPORT + 1)
 
#define STATE_IS_LIGHT_TYPE(a)   ((a) == STATE_LIGHT_TYPE)
 
#define STATE_ACTIVELIGHT(a)   (STATE_LIGHT_TYPE + 1 + (a))
 
#define STATE_IS_ACTIVELIGHT(a)   ((a) >= STATE_ACTIVELIGHT(0) && (a) < STATE_ACTIVELIGHT(MAX_ACTIVE_LIGHTS))
 
#define STATE_SCISSORRECT   (STATE_ACTIVELIGHT(MAX_ACTIVE_LIGHTS - 1) + 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(MAX_CLIP_DISTANCES - 1))
 
#define STATE_MATERIAL   (STATE_CLIPPLANE(MAX_CLIP_DISTANCES))
 
#define STATE_IS_MATERIAL(a)   ((a) == STATE_MATERIAL)
 
#define STATE_FRONTFACE   (STATE_MATERIAL + 1)
 
#define STATE_IS_FRONTFACE(a)   ((a) == STATE_FRONTFACE)
 
#define STATE_POINTSPRITECOORDORIGIN   (STATE_FRONTFACE + 1)
 
#define STATE_IS_POINTSPRITECOORDORIGIN(a)   ((a) == STATE_POINTSPRITECOORDORIGIN)
 
#define STATE_BASEVERTEXINDEX   (STATE_POINTSPRITECOORDORIGIN + 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_POINT_ENABLE   (STATE_FRAMEBUFFER + 1)
 
#define STATE_IS_POINT_ENABLE(a)   ((a) == STATE_POINT_ENABLE)
 
#define STATE_COLOR_KEY   (STATE_POINT_ENABLE + 1)
 
#define STATE_IS_COLOR_KEY(a)   ((a) == STATE_COLOR_KEY)
 
#define STATE_STREAM_OUTPUT   (STATE_COLOR_KEY + 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_COMPUTE_OFFSET   (STATE_BLEND + 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 MAX_GL_FRAGMENT_SAMPLERS   32
 
#define WINED3D_FRAGMENT_CAP_PROJ_CONTROL   0x00000001
 
#define WINED3D_FRAGMENT_CAP_SRGB_WRITE   0x00000002
 
#define WINED3D_FRAGMENT_CAP_COLOR_KEY   0x00000004
 
#define GL_EXT_EMUL_ARB_MULTITEXTURE   0x00000001
 
#define GL_EXT_EMUL_EXT_FOG_COORD   0x00000002
 
#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_STATE_NO_REF   0x00000001
 
#define WINED3D_STATE_INIT_DEFAULT   0x00000002
 
#define LIGHTMAP_SIZE   43
 
#define LIGHTMAP_HASHFUNC(x)   ((x) % LIGHTMAP_SIZE)
 
#define IS_DUAL_SOURCE_BLEND(x)   ((x) >= WINED3D_BLEND_SRC1COLOR && (x) <= WINED3D_BLEND_INVSRC1ALPHA)
 
#define WINED3D_UNMAPPED_STAGE   ~0u
 
#define WINED3DCREATE_MULTITHREADED   0x00000004
 
#define RESOURCE_ALIGNMENT   16
 
#define WINED3D_CONSTANT_BUFFER_ALIGNMENT   16
 
#define WINED3D_TEXTURE_COND_NP2   0x00000001
 
#define WINED3D_TEXTURE_COND_NP2_EMULATED   0x00000002
 
#define WINED3D_TEXTURE_POW2_MAT_IDENT   0x00000004
 
#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_PIN_SYSMEM   0x00000200
 
#define WINED3D_TEXTURE_NORMALIZED_COORDS   0x00000400
 
#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_ASYNC_COLOR_KEY   0x00000001
 
#define WINED3D_LOCATION_DISCARDED   0x00000001
 
#define WINED3D_LOCATION_SYSMEM   0x00000002
 
#define WINED3D_LOCATION_USER_MEMORY   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_FBO_ENTRY_FLAG_ATTACHED   0x1
 
#define WINED3D_FBO_ENTRY_FLAG_DEPTH   0x2
 
#define WINED3D_FBO_ENTRY_FLAG_STENCIL   0x4
 
#define WINED3D_CS_QUERY_POLL_INTERVAL   10u
 
#define WINED3D_CS_QUEUE_SIZE   0x100000u
 
#define WINED3D_CS_SPIN_COUNT   10000000u
 
#define PRINTF_ATTR(fmt, args)
 
#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING   0x00000001
 
#define WINED3DFMT_FLAG_FILTERING   0x00000002
 
#define WINED3DFMT_FLAG_DEPTH   0x00000004
 
#define WINED3DFMT_FLAG_STENCIL   0x00000008
 
#define WINED3DFMT_FLAG_RENDERTARGET   0x00000010
 
#define WINED3DFMT_FLAG_EXTENSION   0x00000020
 
#define WINED3DFMT_FLAG_FBO_ATTACHABLE   0x00000040
 
#define WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB   0x00000080
 
#define WINED3DFMT_FLAG_FLOAT   0x00000200
 
#define WINED3DFMT_FLAG_BUMPMAP   0x00000400
 
#define WINED3DFMT_FLAG_SRGB_READ   0x00000800
 
#define WINED3DFMT_FLAG_SRGB_WRITE   0x00001000
 
#define WINED3DFMT_FLAG_VTF   0x00002000
 
#define WINED3DFMT_FLAG_SHADOW   0x00004000
 
#define WINED3DFMT_FLAG_COMPRESSED   0x00008000
 
#define WINED3DFMT_FLAG_BROKEN_PITCH   0x00010000
 
#define WINED3DFMT_FLAG_BLOCKS   0x00020000
 
#define WINED3DFMT_FLAG_HEIGHT_SCALE   0x00040000
 
#define WINED3DFMT_FLAG_TEXTURE   0x00080000
 
#define WINED3DFMT_FLAG_BLOCKS_NO_VERIFY   0x00100000
 
#define WINED3DFMT_FLAG_INTEGER   0x00200000
 
#define WINED3DFMT_FLAG_GEN_MIPMAP   0x00400000
 
#define WINED3D_OPENGL_WINDOW_CLASS_NAME   "WineD3D_OpenGL"
 

Typedefs

typedef void(WINE_GLAPIwined3d_ffp_attrib_func) (const void *data)
 
typedef void(WINE_GLAPIwined3d_ffp_texcoord_func) (GLenum unit, const void *data)
 
typedef void(WINE_GLAPIwined3d_generic_attrib_func) (GLuint idx, const void *data)
 
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
}
 
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
}
 
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 }
 
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_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_EVAL_SAMPLE_INDEX , WINED3DSIH_ELSE ,
  WINED3DSIH_EMIT , WINED3DSIH_EMIT_STREAM , WINED3DSIH_ENDIF , WINED3DSIH_ENDLOOP ,
  WINED3DSIH_ENDREP , WINED3DSIH_ENDSWITCH , WINED3DSIH_EQ , 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_type {
  WINED3D_SHADER_TYPE_PIXEL , WINED3D_SHADER_TYPE_VERTEX , WINED3D_SHADER_TYPE_GEOMETRY , WINED3D_SHADER_TYPE_HULL ,
  WINED3D_SHADER_TYPE_DOMAIN , WINED3D_SHADER_TYPE_GRAPHICS_COUNT , WINED3D_SHADER_TYPE_COMPUTE = WINED3D_SHADER_TYPE_GRAPHICS_COUNT , WINED3D_SHADER_TYPE_COUNT
}
 
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_TEX_RECT = 4 , WINED3D_GL_RES_TYPE_BUFFER = 5 , WINED3D_GL_RES_TYPE_RB = 6 , WINED3D_GL_RES_TYPE_COUNT = 7
}
 
enum  vertexprocessing_mode { fixedfunction , vertexshader , pretransformed }
 
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 }
 
enum  fog_src_type { VS_FOG_Z = 0 , VS_FOG_COORD = 1 }
 
enum  wined3d_pipeline { WINED3D_PIPELINE_GRAPHICS , WINED3D_PIPELINE_COMPUTE , WINED3D_PIPELINE_COUNT }
 
enum  fogsource { FOGSOURCE_FFP , FOGSOURCE_VS , FOGSOURCE_COORD }
 
enum  wined3d_fence_result {
  WINED3D_FENCE_OK , WINED3D_FENCE_WAITING , WINED3D_FENCE_NOT_STARTED , WINED3D_FENCE_WRONG_THREAD ,
  WINED3D_FENCE_ERROR
}
 
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_COLOR_FILL ,
  WINED3D_BLIT_OP_DEPTH_FILL , 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_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_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_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_FURY = 0x7300 , CARD_AMD_RADEON_RX_460 = 0x67ef , CARD_AMD_RADEON_RX_480 = 0x67df , 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_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 = 0x11a7 , CARD_NVIDIA_GEFORCE_GTX680 = 0x1180 , CARD_NVIDIA_GEFORCE_GTX690 = 0x1188 , CARD_NVIDIA_GEFORCE_GT730 = 0x1287 ,
  CARD_NVIDIA_GEFORCE_GT730M = 0x0fe1 , CARD_NVIDIA_GEFORCE_GT740M = 0x1292 , CARD_NVIDIA_GEFORCE_GT750M = 0x0fe9 , 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_GTX780 = 0x1004 , 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_GTX1050 = 0x1c81 , CARD_NVIDIA_GEFORCE_GTX1060 = 0x1c03 , CARD_NVIDIA_GEFORCE_GTX1070 = 0x1b81 ,
  CARD_NVIDIA_GEFORCE_GTX1080 = 0x1b80 , CARD_NVIDIA_GEFORCE_GTX1080TI = 0x1b06 , CARD_NVIDIA_TITANX_PASCAL = 0x1b00 , 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 = 0x0a26 , 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_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
}
 
enum  projection_types { proj_none = 0 , proj_count3 = 1 , proj_count4 = 2 }
 
enum  dst_arg { resultreg = 0 , tempreg = 1 }
 
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_cs_queue_id { WINED3D_CS_QUEUE_DEFAULT = 0 , WINED3D_CS_QUEUE_MAP , WINED3D_CS_QUEUE_COUNT }
 
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
}
 
enum  wined3d_buffer_conversion_type { CONV_NONE , CONV_D3DCOLOR , CONV_POSITIONT }
 

Functions

static struct color_fixup_desc create_color_fixup_desc (int sign0, enum fixup_channel_source src0, int sign1, enum fixup_channel_source src1, int sign2, enum fixup_channel_source src2, int sign3, enum fixup_channel_source src3)
 
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)
 
GLenum wined3d_gl_compare_func (enum wined3d_cmp_func f) DECLSPEC_HIDDEN
 
static enum wined3d_cmp_func wined3d_sanitize_cmp_func (enum wined3d_cmp_func func)
 
static GLenum wined3d_gl_mag_filter (enum wined3d_texture_filter_type mag_filter)
 
static GLenum wined3d_gl_min_mip_filter (enum wined3d_texture_filter_type min_filter, enum wined3d_texture_filter_type mip_filter)
 
static float float_16_to_32 (const unsigned short *in)
 
static float float_24_to_32 (DWORD in)
 
static unsigned int wined3d_popcount (unsigned int x)
 
static void wined3d_pause (void)
 
static BOOL wined3d_shader_instruction_has_texel_offset (const struct wined3d_shader_instruction *ins)
 
static void wined3d_color_from_d3dcolor (struct wined3d_color *wined3d_color, DWORD d3d_color)
 
void wined3d_check_gl_call (const struct wined3d_gl_info *gl_info, const char *file, unsigned int line, const char *name) DECLSPEC_HIDDEN
 
static struct wined3d_const_bo_addresswined3d_const_bo_address (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_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info) DECLSPEC_HIDDEN
 
void draw_primitive (struct wined3d_device *device, const struct wined3d_state *state, const struct wined3d_draw_parameters *draw_parameters) DECLSPEC_HIDDEN
 
void dispatch_compute (struct wined3d_device *device, const struct wined3d_state *state, const struct wined3d_dispatch_parameters *dispatch_parameters) DECLSPEC_HIDDEN
 
DWORD get_flexible_vertex_size (DWORD d3dvtVertexType) DECLSPEC_HIDDEN
 
HRESULT wined3d_fence_create (struct wined3d_device *device, struct wined3d_fence **fence) DECLSPEC_HIDDEN
 
void wined3d_fence_destroy (struct wined3d_fence *fence) DECLSPEC_HIDDEN
 
void wined3d_fence_issue (struct wined3d_fence *fence, const struct wined3d_device *device) DECLSPEC_HIDDEN
 
enum wined3d_fence_result wined3d_fence_wait (const struct wined3d_fence *fence, const struct wined3d_device *device) DECLSPEC_HIDDEN
 
void context_alloc_timestamp_query (struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN
 
void context_free_timestamp_query (struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN
 
void context_alloc_so_statistics_query (struct wined3d_context *context, struct wined3d_so_statistics_query *query) DECLSPEC_HIDDEN
 
void context_free_so_statistics_query (struct wined3d_so_statistics_query *query) DECLSPEC_HIDDEN
 
void context_alloc_pipeline_statistics_query (struct wined3d_context *context, struct wined3d_pipeline_statistics_query *query) DECLSPEC_HIDDEN
 
void context_free_pipeline_statistics_query (struct wined3d_pipeline_statistics_query *query) DECLSPEC_HIDDEN
 
HRESULT compile_state_table (struct StateEntry *StateTable, APPLYSTATEFUNC **dev_multistate_funcs, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, const struct wined3d_vertex_pipe_ops *vertex, const struct fragment_pipeline *fragment, const struct StateEntryTemplate *misc) DECLSPEC_HIDDEN
 
void wined3d_arbfp_blitter_create (struct wined3d_blitter **next, const struct wined3d_device *device) DECLSPEC_HIDDEN
 
struct wined3d_blitterwined3d_cpu_blitter_create (void) DECLSPEC_HIDDEN
 
void wined3d_fbo_blitter_create (struct wined3d_blitter **next, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN
 
void wined3d_ffp_blitter_create (struct wined3d_blitter **next, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN
 
void wined3d_raw_blitter_create (struct wined3d_blitter **next, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN
 
BOOL wined3d_clip_blit (const RECT *clip_rect, RECT *clipped, RECT *other) DECLSPEC_HIDDEN
 
struct wined3d_contextcontext_acquire (const struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx) DECLSPEC_HIDDEN
 
void context_alloc_fence (struct wined3d_context *context, struct wined3d_fence *fence) DECLSPEC_HIDDEN
 
void context_alloc_occlusion_query (struct wined3d_context *context, struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN
 
void context_apply_blit_state (struct wined3d_context *context, const struct wined3d_device *device) DECLSPEC_HIDDEN
 
BOOL context_apply_clear_state (struct wined3d_context *context, const struct wined3d_state *state, UINT rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN
 
void context_apply_fbo_state_blit (struct wined3d_context *context, GLenum target, struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location) DECLSPEC_HIDDEN
 
void context_active_texture (struct wined3d_context *context, const struct wined3d_gl_info *gl_info, unsigned int unit) DECLSPEC_HIDDEN
 
void context_bind_bo (struct wined3d_context *context, GLenum binding, GLuint name) DECLSPEC_HIDDEN
 
void context_bind_dummy_textures (const struct wined3d_device *device, const struct wined3d_context *context) DECLSPEC_HIDDEN
 
void context_bind_texture (struct wined3d_context *context, GLenum target, GLuint name) DECLSPEC_HIDDEN
 
void context_check_fbo_status (const struct wined3d_context *context, GLenum target) DECLSPEC_HIDDEN
 
void context_copy_bo_address (struct wined3d_context *context, const struct wined3d_bo_address *dst, GLenum dst_binding, const struct wined3d_bo_address *src, GLenum src_binding, size_t size) DECLSPEC_HIDDEN
 
struct wined3d_contextcontext_create (struct wined3d_swapchain *swapchain, struct wined3d_texture *target, const struct wined3d_format *ds_format) DECLSPEC_HIDDEN
 
HGLRC context_create_wgl_attribs (const struct wined3d_gl_info *gl_info, HDC hdc, HGLRC share_ctx) DECLSPEC_HIDDEN
 
void context_destroy (struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN
 
void context_enable_clip_distances (struct wined3d_context *context, unsigned int mask) DECLSPEC_HIDDEN
 
void context_end_transform_feedback (struct wined3d_context *context) DECLSPEC_HIDDEN
 
void context_free_fence (struct wined3d_fence *fence) DECLSPEC_HIDDEN
 
void context_free_occlusion_query (struct wined3d_occlusion_query *query) DECLSPEC_HIDDEN
 
struct wined3d_contextcontext_get_current (void) DECLSPEC_HIDDEN
 
GLenum context_get_offscreen_gl_buffer (const struct wined3d_context *context) DECLSPEC_HIDDEN
 
const DWORDcontext_get_tex_unit_mapping (const struct wined3d_context *context, const struct wined3d_shader_version *shader_version, unsigned int *base, unsigned int *count) DECLSPEC_HIDDEN
 
DWORD context_get_tls_idx (void) DECLSPEC_HIDDEN
 
void context_gl_resource_released (struct wined3d_device *device, GLuint name, BOOL rb_namespace) DECLSPEC_HIDDEN
 
void context_invalidate_compute_state (struct wined3d_context *context, DWORD state_id) DECLSPEC_HIDDEN
 
void context_invalidate_state (struct wined3d_context *context, DWORD state_id) DECLSPEC_HIDDEN
 
voidcontext_map_bo_address (struct wined3d_context *context, const struct wined3d_bo_address *data, size_t size, GLenum binding, DWORD flags) DECLSPEC_HIDDEN
 
struct wined3d_contextcontext_reacquire (const struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN
 
void context_release (struct wined3d_context *context) DECLSPEC_HIDDEN
 
void context_resource_released (const struct wined3d_device *device, struct wined3d_resource *resource, enum wined3d_resource_type type) DECLSPEC_HIDDEN
 
void context_restore (struct wined3d_context *context, struct wined3d_surface *restore) DECLSPEC_HIDDEN
 
BOOL context_set_current (struct wined3d_context *ctx) DECLSPEC_HIDDEN
 
void context_set_draw_buffer (struct wined3d_context *context, GLenum buffer) DECLSPEC_HIDDEN
 
void context_set_tls_idx (DWORD idx) DECLSPEC_HIDDEN
 
void context_state_drawbuf (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
void context_state_fb (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
void context_surface_update (struct wined3d_context *context, const struct wined3d_surface *surface) DECLSPEC_HIDDEN
 
void context_unmap_bo_address (struct wined3d_context *context, const struct wined3d_bo_address *data, GLenum binding) DECLSPEC_HIDDEN
 
void wined3d_gl_limits_get_texture_unit_range (const struct wined3d_gl_limits *gl_limits, enum wined3d_shader_type shader_type, unsigned int *base, unsigned int *count) DECLSPEC_HIDDEN
 
void wined3d_gl_limits_get_uniform_block_range (const struct wined3d_gl_limits *gl_limits, enum wined3d_shader_type shader_type, unsigned int *base, unsigned int *count) DECLSPEC_HIDDEN
 
BOOL wined3d_adapter_init_format_info (struct wined3d_adapter *adapter, struct wined3d_caps_gl_ctx *ctx) DECLSPEC_HIDDEN
 
UINT64 adapter_adjust_memory (struct wined3d_adapter *adapter, INT64 amount) DECLSPEC_HIDDEN
 
BOOL wined3d_caps_gl_ctx_test_viewport_subpixel_bits (struct wined3d_caps_gl_ctx *ctx) DECLSPEC_HIDDEN
 
void install_gl_compat_wrapper (struct wined3d_gl_info *gl_info, enum wined3d_gl_extension ext) DECLSPEC_HIDDEN
 
int wined3d_ffp_frag_program_key_compare (const void *key, const struct wine_rb_entry *entry) DECLSPEC_HIDDEN
 
int wined3d_ffp_vertex_program_key_compare (const void *key, const struct wine_rb_entry *entry) DECLSPEC_HIDDEN
 
unsigned int wined3d_max_compat_varyings (const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN
 
void gen_ffp_frag_op (const struct wined3d_context *context, const struct wined3d_state *state, struct ffp_frag_settings *settings, BOOL ignore_textype) DECLSPEC_HIDDEN
 
const struct ffp_frag_descfind_ffp_frag_shader (const struct wine_rb_tree *fragment_shaders, const struct ffp_frag_settings *settings) DECLSPEC_HIDDEN
 
void add_ffp_frag_shader (struct wine_rb_tree *shaders, struct ffp_frag_desc *desc) DECLSPEC_HIDDEN
 
void wined3d_ftoa (float value, char *s) DECLSPEC_HIDDEN
 
void wined3d_ffp_get_vs_settings (const struct wined3d_context *context, const struct wined3d_state *state, struct wined3d_ffp_vs_settings *settings) DECLSPEC_HIDDEN
 
HRESULT wined3d_init (struct wined3d *wined3d, DWORD flags) DECLSPEC_HIDDEN
 
BOOL wined3d_register_window (HWND window, struct wined3d_device *device) DECLSPEC_HIDDEN
 
void wined3d_unregister_window (HWND window) DECLSPEC_HIDDEN
 
static BOOL wined3d_dualblend_enabled (const struct wined3d_state *state, const struct wined3d_gl_info *gl_info)
 
void device_clear_render_targets (struct wined3d_device *device, UINT rt_count, const struct wined3d_fb_state *fb, UINT rect_count, const RECT *rects, const RECT *draw_rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN
 
BOOL device_context_add (struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN
 
void device_context_remove (struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN
 
HRESULT device_init (struct wined3d_device *device, struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, HWND focus_window, DWORD flags, BYTE surface_alignment, struct wined3d_device_parent *device_parent) DECLSPEC_HIDDEN
 
LRESULT device_process_message (struct wined3d_device *device, HWND window, BOOL unicode, UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN
 
void device_resource_add (struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN
 
void device_resource_released (struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN
 
void device_invalidate_state (const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN
 
static BOOL isStateDirty (const struct wined3d_context *context, DWORD state)
 
const charwined3d_debug_resource_access (DWORD access) DECLSPEC_HIDDEN
 
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 void wined3d_resource_acquire (struct wined3d_resource *resource)
 
static void wined3d_resource_release (struct wined3d_resource *resource)
 
void resource_cleanup (struct wined3d_resource *resource) DECLSPEC_HIDDEN
 
HRESULT resource_init (struct wined3d_resource *resource, struct wined3d_device *device, enum wined3d_resource_type type, const struct wined3d_format *format, enum wined3d_multisample_type multisample_type, unsigned int multisample_quality, unsigned int usage, unsigned int access, unsigned int width, unsigned int height, unsigned int depth, unsigned int size, void *parent, const struct wined3d_parent_ops *parent_ops, const struct wined3d_resource_ops *resource_ops) DECLSPEC_HIDDEN
 
void resource_unload (struct wined3d_resource *resource) DECLSPEC_HIDDEN
 
BOOL wined3d_resource_allocate_sysmem (struct wined3d_resource *resource) DECLSPEC_HIDDEN
 
void wined3d_resource_free_sysmem (struct wined3d_resource *resource) DECLSPEC_HIDDEN
 
GLbitfield wined3d_resource_gl_map_flags (DWORD d3d_flags) DECLSPEC_HIDDEN
 
GLenum wined3d_resource_gl_legacy_map_flags (DWORD d3d_flags) DECLSPEC_HIDDEN
 
BOOL wined3d_resource_is_offscreen (struct wined3d_resource *resource) DECLSPEC_HIDDEN
 
void wined3d_resource_update_draw_binding (struct wined3d_resource *resource) DECLSPEC_HIDDEN
 
static struct wined3d_texturetexture_from_resource (struct wined3d_resource *resource)
 
static GLenum wined3d_texture_get_sub_resource_target (const struct wined3d_texture *texture, unsigned int sub_resource_idx)
 
static struct gl_texturewined3d_texture_get_gl_texture (struct wined3d_texture *texture, BOOL srgb)
 
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 unsigned int wined3d_texture_get_level_pow2_width (const struct wined3d_texture *texture, unsigned int level)
 
static unsigned int wined3d_texture_get_level_pow2_height (const struct wined3d_texture *texture, unsigned int level)
 
void wined3d_texture_apply_sampler_desc (struct wined3d_texture *texture, const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_context *context) DECLSPEC_HIDDEN
 
void wined3d_texture_bind (struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN
 
void wined3d_texture_bind_and_dirtify (struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN
 
HRESULT wined3d_texture_check_box_dimensions (const struct wined3d_texture *texture, unsigned int level, const struct wined3d_box *box) DECLSPEC_HIDDEN
 
GLenum wined3d_texture_get_gl_buffer (const struct wined3d_texture *texture) DECLSPEC_HIDDEN
 
void wined3d_texture_get_memory (struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_bo_address *data, DWORD locations) DECLSPEC_HIDDEN
 
void wined3d_texture_invalidate_location (struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD location) DECLSPEC_HIDDEN
 
void wined3d_texture_load (struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN
 
BOOL wined3d_texture_load_location (struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN
 
BOOL wined3d_texture_prepare_location (struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN
 
void wined3d_texture_prepare_texture (struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN
 
void wined3d_texture_set_map_binding (struct wined3d_texture *texture, DWORD map_binding) DECLSPEC_HIDDEN
 
void wined3d_texture_set_swapchain (struct wined3d_texture *texture, struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN
 
void wined3d_texture_upload_data (struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_context *context, const struct wined3d_box *box, const struct wined3d_const_bo_address *data, unsigned int row_pitch, unsigned int slice_pitch) DECLSPEC_HIDDEN
 
void wined3d_texture_validate_location (struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD location) DECLSPEC_HIDDEN
 
const charwined3d_debug_location (DWORD location) DECLSPEC_HIDDEN
 
static unsigned int surface_get_sub_resource_idx (const struct wined3d_surface *surface)
 
static struct wined3d_texture_sub_resource * surface_get_sub_resource (struct wined3d_surface *surface)
 
HRESULT wined3d_surface_blt (struct wined3d_surface *dst_surface, const RECT *dst_rect, struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *blt_fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN
 
void surface_load_fb_texture (struct wined3d_surface *surface, BOOL srgb, struct wined3d_context *context) DECLSPEC_HIDDEN
 
BOOL surface_load_location (struct wined3d_surface *surface, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN
 
void surface_set_compatible_renderbuffer (struct wined3d_surface *surface, const struct wined3d_rendertarget_info *rt) DECLSPEC_HIDDEN
 
void surface_translate_drawable_coords (const struct wined3d_surface *surface, HWND window, RECT *rect) DECLSPEC_HIDDEN
 
void wined3d_surface_upload_data (struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info, const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point, BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN
 
void draw_textured_quad (struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN
 
void wined3d_sampler_bind (struct wined3d_sampler *sampler, unsigned int unit, struct wined3d_texture *texture, const struct wined3d_context *context) DECLSPEC_HIDDEN
 
void stateblock_init_contained_states (struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN
 
void state_cleanup (struct wined3d_state *state) DECLSPEC_HIDDEN
 
void wined3d_state_enable_light (struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info, struct wined3d_light_info *light_info, BOOL enable) DECLSPEC_HIDDEN
 
struct wined3d_light_infowined3d_state_get_light (const struct wined3d_state *state, unsigned int idx) DECLSPEC_HIDDEN
 
void state_init (struct wined3d_state *state, struct wined3d_fb_state *fb, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, DWORD flags) DECLSPEC_HIDDEN
 
void state_unbind_resources (struct wined3d_state *state) DECLSPEC_HIDDEN
 
struct wined3d_cswined3d_cs_create (struct wined3d_device *device) DECLSPEC_HIDDEN
 
void wined3d_cs_destroy (struct wined3d_cs *cs) DECLSPEC_HIDDEN
 
void wined3d_cs_destroy_object (struct wined3d_cs *cs, void(*callback)(void *object), void *object) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_add_dirty_texture_region (struct wined3d_cs *cs, struct wined3d_texture *texture, unsigned int layer) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_blt_sub_resource (struct wined3d_cs *cs, 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, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_clear (struct wined3d_cs *cs, DWORD rect_count, const RECT *rects, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_clear_rendertarget_view (struct wined3d_cs *cs, struct wined3d_rendertarget_view *view, const RECT *rect, DWORD flags, const struct wined3d_color *color, float depth, DWORD stencil) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_clear_unordered_access_view_uint (struct wined3d_cs *cs, struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_copy_uav_counter (struct wined3d_cs *cs, struct wined3d_buffer *dst_buffer, unsigned int offset, struct wined3d_unordered_access_view *uav) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_dispatch (struct wined3d_cs *cs, unsigned int group_count_x, unsigned int group_count_y, unsigned int group_count_z) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_dispatch_indirect (struct wined3d_cs *cs, struct wined3d_buffer *buffer, unsigned int offset) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_draw (struct wined3d_cs *cs, GLenum 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) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_draw_indirect (struct wined3d_cs *cs, GLenum primitive_type, unsigned int patch_vertex_count, struct wined3d_buffer *buffer, unsigned int offset, BOOL indexed) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_flush (struct wined3d_cs *cs) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_generate_mipmaps (struct wined3d_cs *cs, struct wined3d_shader_resource_view *view) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_preload_resource (struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN
 
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, DWORD swap_interval, DWORD flags) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_query_issue (struct wined3d_cs *cs, struct wined3d_query *query, DWORD flags) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_reset_state (struct wined3d_cs *cs) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_blend_state (struct wined3d_cs *cs, struct wined3d_blend_state *state) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_clip_plane (struct wined3d_cs *cs, UINT plane_idx, const struct wined3d_vec4 *plane) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_color_key (struct wined3d_cs *cs, struct wined3d_texture *texture, WORD flags, const struct wined3d_color_key *color_key) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_constant_buffer (struct wined3d_cs *cs, enum wined3d_shader_type type, UINT cb_idx, struct wined3d_buffer *buffer) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_depth_stencil_view (struct wined3d_cs *cs, struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_index_buffer (struct wined3d_cs *cs, struct wined3d_buffer *buffer, enum wined3d_format_id format_id, unsigned int offset) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_light (struct wined3d_cs *cs, const struct wined3d_light_info *light) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_light_enable (struct wined3d_cs *cs, unsigned int idx, BOOL enable) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_material (struct wined3d_cs *cs, const struct wined3d_material *material) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_predication (struct wined3d_cs *cs, struct wined3d_query *predicate, BOOL value) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_rasterizer_state (struct wined3d_cs *cs, struct wined3d_rasterizer_state *rasterizer_state) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_render_state (struct wined3d_cs *cs, enum wined3d_render_state state, DWORD value) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_rendertarget_view (struct wined3d_cs *cs, unsigned int view_idx, struct wined3d_rendertarget_view *view) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_shader_resource_view (struct wined3d_cs *cs, enum wined3d_shader_type type, UINT view_idx, struct wined3d_shader_resource_view *view) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_sampler (struct wined3d_cs *cs, enum wined3d_shader_type type, UINT sampler_idx, struct wined3d_sampler *sampler) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_sampler_state (struct wined3d_cs *cs, UINT sampler_idx, enum wined3d_sampler_state state, DWORD value) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_scissor_rect (struct wined3d_cs *cs, const RECT *rect) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_shader (struct wined3d_cs *cs, enum wined3d_shader_type type, struct wined3d_shader *shader) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_stream_output (struct wined3d_cs *cs, UINT stream_idx, struct wined3d_buffer *buffer, UINT offset) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_stream_source (struct wined3d_cs *cs, UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_stream_source_freq (struct wined3d_cs *cs, UINT stream_idx, UINT frequency, UINT flags) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_texture (struct wined3d_cs *cs, UINT stage, struct wined3d_texture *texture) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_texture_state (struct wined3d_cs *cs, UINT stage, enum wined3d_texture_stage_state state, DWORD value) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_transform (struct wined3d_cs *cs, enum wined3d_transform_state state, const struct wined3d_matrix *matrix) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_unordered_access_view (struct wined3d_cs *cs, enum wined3d_pipeline pipeline, unsigned int view_idx, struct wined3d_unordered_access_view *view, unsigned int initial_count) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_vertex_declaration (struct wined3d_cs *cs, struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_set_viewport (struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_unload_resource (struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN
 
void wined3d_cs_emit_update_sub_resource (struct wined3d_cs *cs, 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) DECLSPEC_HIDDEN
 
void wined3d_cs_init_object (struct wined3d_cs *cs, void(*callback)(void *object), void *object) DECLSPEC_HIDDEN
 
HRESULT wined3d_cs_map (struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, unsigned int flags) DECLSPEC_HIDDEN
 
HRESULT wined3d_cs_unmap (struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx) DECLSPEC_HIDDEN
 
static void wined3d_cs_push_constants (struct wined3d_cs *cs, enum wined3d_push_constants p, unsigned int start_idx, unsigned int count, const void *constants)
 
static void wined3d_resource_wait_idle (struct wined3d_resource *resource)
 
static struct wined3d_bufferbuffer_from_resource (struct wined3d_resource *resource)
 
DWORD wined3d_buffer_get_memory (struct wined3d_buffer *buffer, struct wined3d_bo_address *data, DWORD locations) DECLSPEC_HIDDEN
 
void wined3d_buffer_invalidate_location (struct wined3d_buffer *buffer, DWORD location) DECLSPEC_HIDDEN
 
void wined3d_buffer_load (struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state) DECLSPEC_HIDDEN
 
BOOL wined3d_buffer_load_location (struct wined3d_buffer *buffer, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN
 
BYTEwined3d_buffer_load_sysmem (struct wined3d_buffer *buffer, struct wined3d_context *context) DECLSPEC_HIDDEN
 
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) DECLSPEC_HIDDEN
 
void wined3d_buffer_upload_data (struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN
 
static struct wined3d_surfacewined3d_rendertarget_view_get_surface (const struct wined3d_rendertarget_view *view)
 
void wined3d_rendertarget_view_get_drawable_size (const struct wined3d_rendertarget_view *view, const struct wined3d_context *context, unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN
 
void wined3d_rendertarget_view_invalidate_location (struct wined3d_rendertarget_view *view, DWORD location) DECLSPEC_HIDDEN
 
void wined3d_rendertarget_view_load_location (struct wined3d_rendertarget_view *view, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN
 
void wined3d_rendertarget_view_prepare_location (struct wined3d_rendertarget_view *view, struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN
 
void wined3d_rendertarget_view_validate_location (struct wined3d_rendertarget_view *view, DWORD location) DECLSPEC_HIDDEN
 
void shader_resource_view_generate_mipmaps (struct wined3d_shader_resource_view *view) DECLSPEC_HIDDEN
 
void wined3d_shader_resource_view_bind (struct wined3d_shader_resource_view *view, unsigned int unit, struct wined3d_sampler *sampler, struct wined3d_context *context) DECLSPEC_HIDDEN
 
void wined3d_unordered_access_view_clear_uint (struct wined3d_unordered_access_view *view, const struct wined3d_uvec4 *clear_value, struct wined3d_context *context) DECLSPEC_HIDDEN
 
void wined3d_unordered_access_view_copy_counter (struct wined3d_unordered_access_view *view, struct wined3d_buffer *buffer, unsigned int offset, struct wined3d_context *context) DECLSPEC_HIDDEN
 
void wined3d_unordered_access_view_invalidate_location (struct wined3d_unordered_access_view *view, DWORD location) DECLSPEC_HIDDEN
 
void wined3d_unordered_access_view_set_counter (struct wined3d_unordered_access_view *view, unsigned int value) DECLSPEC_HIDDEN
 
void wined3d_swapchain_activate (struct wined3d_swapchain *swapchain, BOOL activate) DECLSPEC_HIDDEN
 
struct wined3d_contextswapchain_get_context (struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN
 
void swapchain_destroy_contexts (struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN
 
HDC swapchain_get_backup_dc (struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN
 
void swapchain_update_draw_bindings (struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN
 
void swapchain_update_swap_interval (struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN
 
const chardebug_box (const struct wined3d_box *box) DECLSPEC_HIDDEN
 
const chardebug_color (const struct wined3d_color *color) DECLSPEC_HIDDEN
 
const chardebug_d3dshaderinstructionhandler (enum WINED3D_SHADER_INSTRUCTION_HANDLER handler_idx) DECLSPEC_HIDDEN
 
const chardebug_d3dformat (enum wined3d_format_id format_id) DECLSPEC_HIDDEN
 
const chardebug_d3ddevicetype (enum wined3d_device_type device_type) DECLSPEC_HIDDEN
 
const chardebug_d3dresourcetype (enum wined3d_resource_type resource_type) DECLSPEC_HIDDEN
 
const chardebug_d3dusage (DWORD usage) DECLSPEC_HIDDEN
 
const chardebug_d3dusagequery (DWORD usagequery) DECLSPEC_HIDDEN
 
const chardebug_d3ddeclmethod (enum wined3d_decl_method method) DECLSPEC_HIDDEN
 
const chardebug_d3ddeclusage (enum wined3d_decl_usage usage) DECLSPEC_HIDDEN
 
const chardebug_d3dinput_classification (enum wined3d_input_classification classification) DECLSPEC_HIDDEN
 
const chardebug_d3dprimitivetype (enum wined3d_primitive_type primitive_type) DECLSPEC_HIDDEN
 
const chardebug_d3drenderstate (enum wined3d_render_state state) DECLSPEC_HIDDEN
 
const chardebug_d3dsamplerstate (enum wined3d_sampler_state state) DECLSPEC_HIDDEN
 
const chardebug_d3dstate (DWORD state) DECLSPEC_HIDDEN
 
const chardebug_d3dtexturefiltertype (enum wined3d_texture_filter_type filter_type) DECLSPEC_HIDDEN
 
const chardebug_d3dtexturestate (enum wined3d_texture_stage_state state) DECLSPEC_HIDDEN
 
const chardebug_d3dtop (enum wined3d_texture_op d3dtop) DECLSPEC_HIDDEN
 
const chardebug_d3dtstype (enum wined3d_transform_state tstype) DECLSPEC_HIDDEN
 
const chardebug_fboattachment (GLenum attachment) DECLSPEC_HIDDEN
 
const chardebug_fbostatus (GLenum status) DECLSPEC_HIDDEN
 
const chardebug_glerror (GLenum error) DECLSPEC_HIDDEN
 
const chardebug_ivec4 (const struct wined3d_ivec4 *v) DECLSPEC_HIDDEN
 
const chardebug_uvec4 (const struct wined3d_uvec4 *v) DECLSPEC_HIDDEN
 
const chardebug_shader_type (enum wined3d_shader_type shader_type) DECLSPEC_HIDDEN
 
const chardebug_vec4 (const struct wined3d_vec4 *v) DECLSPEC_HIDDEN
 
void dump_color_fixup_desc (struct color_fixup_desc fixup) DECLSPEC_HIDDEN
 
BOOL is_invalid_op (const struct wined3d_state *state, int stage, enum wined3d_texture_op op, DWORD arg1, DWORD arg2, DWORD arg3) DECLSPEC_HIDDEN
 
void set_tex_op_nvrc (const struct wined3d_gl_info *gl_info, const struct wined3d_state *state, BOOL is_alpha, int stage, enum wined3d_texture_op op, DWORD arg1, DWORD arg2, DWORD arg3, INT texture_idx, DWORD dst) DECLSPEC_HIDDEN
 
void texture_activate_dimensions (const struct wined3d_texture *texture, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN
 
void sampler_texdim (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
void tex_alphaop (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
void apply_pixelshader (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
void state_alpha_test (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
void state_fogcolor (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
void state_fogdensity (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
void state_fogstartend (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
void state_fog_fragpart (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
void state_nop (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
void state_srgbwrite (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
void state_clipping (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
void clipplane (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
void state_pointsprite_w (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
void state_pointsprite (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
void state_shademode (struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) DECLSPEC_HIDDEN
 
GLenum gl_primitive_type_from_d3d (enum wined3d_primitive_type primitive_type) DECLSPEC_HIDDEN
 
void multiply_matrix (struct wined3d_matrix *dest, const struct wined3d_matrix *src1, const struct wined3d_matrix *src2) DECLSPEC_HIDDEN
 
BOOL invert_matrix_3d (struct wined3d_matrix *out, const struct wined3d_matrix *in) DECLSPEC_HIDDEN
 
BOOL invert_matrix (struct wined3d_matrix *out, const struct wined3d_matrix *m) DECLSPEC_HIDDEN
 
void transpose_matrix (struct wined3d_matrix *out, const struct wined3d_matrix *m) DECLSPEC_HIDDEN
 
void wined3d_release_dc (HWND window, HDC dc) DECLSPEC_HIDDEN
 
struct wined3d_string_bufferstring_buffer_get (struct wined3d_string_buffer_list *list) DECLSPEC_HIDDEN
 
void string_buffer_sprintf (struct wined3d_string_buffer *buffer, const char *format,...) PRINTF_ATTR(2
 
void string_buffer_release (struct wined3d_string_buffer_list *list, struct wined3d_string_buffer *buffer) DECLSPEC_HIDDEN
 
void string_buffer_list_init (struct wined3d_string_buffer_list *list) DECLSPEC_HIDDEN
 
void string_buffer_list_cleanup (struct wined3d_string_buffer_list *list) DECLSPEC_HIDDEN
 
int shader_addline (struct wined3d_string_buffer *buffer, const char *fmt,...) PRINTF_ATTR(2
 
BOOL string_buffer_resize (struct wined3d_string_buffer *buffer, int rc) DECLSPEC_HIDDEN
 
int shader_vaddline (struct wined3d_string_buffer *buffer, const char *fmt, va_list args) DECLSPEC_HIDDEN
 
void pixelshader_update_resource_types (struct wined3d_shader *shader, WORD tex_types) DECLSPEC_HIDDEN
 
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) DECLSPEC_HIDDEN
 
BOOL vshader_get_input (const struct wined3d_shader *shader, BYTE usage_req, BYTE usage_idx_req, unsigned int *regnum) DECLSPEC_HIDDEN
 
void find_vs_compile_args (const struct wined3d_state *state, const struct wined3d_shader *shader, WORD swizzle_map, struct vs_compile_args *args, const struct wined3d_context *context) DECLSPEC_HIDDEN
 
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) DECLSPEC_HIDDEN
 
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) DECLSPEC_HIDDEN
 
void string_buffer_clear (struct wined3d_string_buffer *buffer) DECLSPEC_HIDDEN
 
BOOL string_buffer_init (struct wined3d_string_buffer *buffer) DECLSPEC_HIDDEN
 
void string_buffer_free (struct wined3d_string_buffer *buffer) DECLSPEC_HIDDEN
 
unsigned int shader_find_free_input_register (const struct wined3d_shader_reg_maps *reg_maps, unsigned int max) DECLSPEC_HIDDEN
 
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) DECLSPEC_HIDDEN
 
BOOL shader_match_semantic (const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN
 
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, float *position_fixup)
 
static BOOL shader_constant_is_local (const struct wined3d_shader *shader, DWORD reg)
 
void get_identity_matrix (struct wined3d_matrix *mat) DECLSPEC_HIDDEN
 
void get_modelview_matrix (const struct wined3d_context *context, const struct wined3d_state *state, unsigned int index, struct wined3d_matrix *mat) DECLSPEC_HIDDEN
 
void get_projection_matrix (const struct wined3d_context *context, const struct wined3d_state *state, struct wined3d_matrix *mat) DECLSPEC_HIDDEN
 
void get_texture_matrix (const struct wined3d_context *context, const struct wined3d_state *state, unsigned int tex, struct wined3d_matrix *mat) DECLSPEC_HIDDEN
 
void get_pointsize_minmax (const struct wined3d_context *context, const struct wined3d_state *state, float *out_min, float *out_max) DECLSPEC_HIDDEN
 
void get_pointsize (const struct wined3d_context *context, const struct wined3d_state *state, float *out_pointsize, float *out_att) DECLSPEC_HIDDEN
 
void get_fog_start_end (const struct wined3d_context *context, const struct wined3d_state *state, float *start, float *end) DECLSPEC_HIDDEN
 
void print_glsl_info_log (const struct wined3d_gl_info *gl_info, GLuint id, BOOL program) DECLSPEC_HIDDEN
 
void shader_glsl_validate_link (const struct wined3d_gl_info *gl_info, GLuint program) DECLSPEC_HIDDEN
 
enum wined3d_format_id pixelformat_for_depth (DWORD depth) DECLSPEC_HIDDEN
 
const struct wined3d_formatwined3d_get_format (const struct wined3d_gl_info *gl_info, enum wined3d_format_id format_id, unsigned int resource_usage) DECLSPEC_HIDDEN
 
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) DECLSPEC_HIDDEN
 
UINT wined3d_format_calculate_size (const struct wined3d_format *format, UINT alignment, UINT width, UINT height, UINT depth) DECLSPEC_HIDDEN
 
DWORD wined3d_format_convert_from_float (const struct wined3d_format *format, const struct wined3d_color *color) DECLSPEC_HIDDEN
 
void wined3d_format_get_float_color_key (const struct wined3d_format *format, const struct wined3d_color_key *key, struct wined3d_color *float_colors) DECLSPEC_HIDDEN
 
BOOL wined3d_format_is_depth_view (enum wined3d_format_id resource_format_id, enum wined3d_format_id view_format_id) DECLSPEC_HIDDEN
 
const struct wined3d_color_key_conversionwined3d_format_get_color_key_conversion (const struct wined3d_texture *texture, BOOL need_alpha_ck) DECLSPEC_HIDDEN
 
BOOL wined3d_formats_are_srgb_variants (enum wined3d_format_id format1, enum wined3d_format_id format2) DECLSPEC_HIDDEN
 
BOOL wined3d_array_reserve (void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T size) DECLSPEC_HIDDEN
 
static BOOL wined3d_format_is_typeless (const struct wined3d_format *format)
 
static BOOL use_indexed_vertex_blending (const struct wined3d_state *state, const struct wined3d_stream_info *si)
 
static BOOL use_software_vertex_processing (const struct wined3d_device *device)
 
static BOOL use_vs (const struct wined3d_state *state)
 
static BOOL use_ps (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_context *context, const struct wined3d_state *state, const struct wined3d_fb_state *fb)
 
static GLuint wined3d_texture_get_texture_name (const struct wined3d_texture *texture, const struct wined3d_context *context, BOOL srgb)
 
static BOOL can_use_texture_swizzle (const struct wined3d_gl_info *gl_info, const struct wined3d_format *format)
 
static BOOL needs_interpolation_qualifiers_for_shader_outputs (const struct wined3d_gl_info *gl_info)
 
static BOOL is_rasterization_disabled (const struct wined3d_shader *geometry_shader)
 
static int wined3d_bit_scan (unsigned int *x)
 
static DWORD wined3d_extract_bits (const DWORD *bitstream, unsigned int offset, unsigned int count)
 
static void wined3d_insert_bits (DWORD *bitstream, unsigned int offset, unsigned int count, DWORD bits)
 
static struct wined3d_surfacecontext_get_rt_surface (const struct wined3d_context *context)
 
static void wined3d_from_cs (const struct wined3d_cs *cs)
 
static void wined3d_not_from_cs (struct wined3d_cs *cs)
 
BOOL wined3d_dxtn_init (void) DECLSPEC_HIDDEN
 
void wined3d_dxtn_free (void) DECLSPEC_HIDDEN
 

Variables

wined3d_ffp_attrib_func specular_func_3ubv DECLSPEC_HIDDEN
 
static const struct color_fixup_desc COLOR_FIXUP_IDENTITY
 

Macro Definition Documentation

◆ ARG_UNUSED

#define ARG_UNUSED   0xff

Definition at line 2659 of file wined3d_private.h.

◆ ARRAY_SIZE

#define ARRAY_SIZE (   array)    (sizeof(array) / sizeof((array)[0]))

Definition at line 62 of file wined3d_private.h.

◆ checkGLcall

#define checkGLcall (   A)
Value:
do { \
if (__WINE_IS_DEBUG_ON(_ERR, &__wine_dbch_d3d) \
&& !gl_info->supported[ARB_DEBUG_OUTPUT]) \
wined3d_check_gl_call(gl_info, __FILE__, __LINE__, A); \
} while(0)
Definition: ehthrow.cxx:93
#define __WINE_IS_DEBUG_ON(dbcl, dbch)
Definition: debug.h:87
@ ARB_DEBUG_OUTPUT
Definition: wined3d_gl.h:56

Definition at line 1463 of file wined3d_private.h.

◆ COBJMACROS

#define COBJMACROS

Definition at line 42 of file wined3d_private.h.

◆ D3DCOLOR_B_A

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

Definition at line 1445 of file wined3d_private.h.

◆ D3DCOLOR_B_B

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

Definition at line 1444 of file wined3d_private.h.

◆ D3DCOLOR_B_G

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

Definition at line 1443 of file wined3d_private.h.

◆ D3DCOLOR_B_R

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

Definition at line 1442 of file wined3d_private.h.

◆ eps

#define eps   1e-8f

Definition at line 1567 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 1569 of file wined3d_private.h.

◆ GL_EXT_EMUL_ARB_MULTITEXTURE

#define GL_EXT_EMUL_ARB_MULTITEXTURE   0x00000001

Definition at line 2037 of file wined3d_private.h.

◆ GL_EXT_EMUL_EXT_FOG_COORD

#define GL_EXT_EMUL_EXT_FOG_COORD   0x00000002

Definition at line 2038 of file wined3d_private.h.

◆ GL_EXTCALL

#define GL_EXTCALL (   f)    (gl_info->gl_ops.ext.p_##f)

Definition at line 1440 of file wined3d_private.h.

◆ HIGHEST_TRANSFORMSTATE

#define HIGHEST_TRANSFORMSTATE   WINED3D_TS_WORLD_MATRIX(255) /* Highest value in wined3d_transform_state. */

Definition at line 1455 of file wined3d_private.h.

◆ IS_DUAL_SOURCE_BLEND

#define IS_DUAL_SOURCE_BLEND (   x)    ((x) >= WINED3D_BLEND_SRC1COLOR && (x) <= WINED3D_BLEND_INVSRC1ALPHA)

◆ LIGHTMAP_HASHFUNC

#define LIGHTMAP_HASHFUNC (   x)    ((x) % LIGHTMAP_SIZE)

Definition at line 2865 of file wined3d_private.h.

◆ LIGHTMAP_SIZE

#define LIGHTMAP_SIZE   43

Definition at line 2864 of file wined3d_private.h.

◆ MAKEDWORD_VERSION

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

Definition at line 65 of file wined3d_private.h.

◆ MAX_ACTIVE_LIGHTS

#define MAX_ACTIVE_LIGHTS   8

Definition at line 270 of file wined3d_private.h.

◆ MAX_ATTRIBS

#define MAX_ATTRIBS   16

Definition at line 662 of file wined3d_private.h.

◆ MAX_CLIP_DISTANCES

#define MAX_CLIP_DISTANCES   8

Definition at line 271 of file wined3d_private.h.

◆ MAX_COMBINED_SAMPLERS

#define MAX_COMBINED_SAMPLERS   (MAX_FRAGMENT_SAMPLERS + MAX_VERTEX_SAMPLERS)

Definition at line 269 of file wined3d_private.h.

◆ MAX_CONSTANT_BUFFERS

#define MAX_CONSTANT_BUFFERS   15

Definition at line 272 of file wined3d_private.h.

◆ MAX_FRAGMENT_SAMPLERS

#define MAX_FRAGMENT_SAMPLERS   16

Definition at line 267 of file wined3d_private.h.

◆ MAX_GL_FRAGMENT_SAMPLERS

#define MAX_GL_FRAGMENT_SAMPLERS   32

Definition at line 1860 of file wined3d_private.h.

◆ MAX_IMMEDIATE_CONSTANT_BUFFER_SIZE

#define MAX_IMMEDIATE_CONSTANT_BUFFER_SIZE   4096

Definition at line 677 of file wined3d_private.h.

◆ MAX_LABELS

#define MAX_LABELS   16

Definition at line 675 of file wined3d_private.h.

◆ MAX_MULTISAMPLE_TYPES

#define MAX_MULTISAMPLE_TYPES   8

Definition at line 280 of file wined3d_private.h.

◆ MAX_REG_ADDR

#define MAX_REG_ADDR   1

Definition at line 663 of file wined3d_private.h.

◆ MAX_REG_INPUT

#define MAX_REG_INPUT   32

Definition at line 665 of file wined3d_private.h.

◆ MAX_REG_OUTPUT

#define MAX_REG_OUTPUT   32

Definition at line 666 of file wined3d_private.h.

◆ MAX_REG_TEXCRD

#define MAX_REG_TEXCRD   8

Definition at line 664 of file wined3d_private.h.

◆ MAX_RENDER_TARGET_VIEWS

#define MAX_RENDER_TARGET_VIEWS   8

Definition at line 275 of file wined3d_private.h.

◆ MAX_RENDER_TARGETS

#define MAX_RENDER_TARGETS   8

Definition at line 281 of file wined3d_private.h.

◆ MAX_SAMPLER_OBJECTS

#define MAX_SAMPLER_OBJECTS   16

Definition at line 273 of file wined3d_private.h.

◆ MAX_SHADER_RESOURCE_VIEWS

#define MAX_SHADER_RESOURCE_VIEWS   128

Definition at line 274 of file wined3d_private.h.

◆ MAX_STREAMS

#define MAX_STREAMS   16

Definition at line 265 of file wined3d_private.h.

◆ MAX_TEXTURES

#define MAX_TEXTURES   8

Definition at line 266 of file wined3d_private.h.

◆ MAX_TGSM_REGISTERS

#define MAX_TGSM_REGISTERS   8192

Definition at line 277 of file wined3d_private.h.

◆ MAX_UNORDERED_ACCESS_VIEWS

#define MAX_UNORDERED_ACCESS_VIEWS   8

Definition at line 276 of file wined3d_private.h.

◆ MAX_VERTEX_BLENDS

#define MAX_VERTEX_BLENDS   4

Definition at line 278 of file wined3d_private.h.

◆ MAX_VERTEX_INDEX_BLENDS

#define MAX_VERTEX_INDEX_BLENDS   9

Definition at line 279 of file wined3d_private.h.

◆ MAX_VERTEX_SAMPLERS

#define MAX_VERTEX_SAMPLERS   4

Definition at line 268 of file wined3d_private.h.

◆ NONAMELESSSTRUCT

#define NONAMELESSSTRUCT

Definition at line 41 of file wined3d_private.h.

◆ NONAMELESSUNION

#define NONAMELESSUNION

Definition at line 40 of file wined3d_private.h.

◆ ORM_BACKBUFFER

#define ORM_BACKBUFFER   0

Definition at line 383 of file wined3d_private.h.

◆ ORM_FBO

#define ORM_FBO   1

Definition at line 384 of file wined3d_private.h.

◆ PCI_DEVICE_NONE

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

Definition at line 387 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 386 of file wined3d_private.h.

◆ PRINTF_ATTR

#define PRINTF_ATTR (   fmt,
  args 
)

Definition at line 3987 of file wined3d_private.h.

◆ RESOURCE_ALIGNMENT

#define RESOURCE_ALIGNMENT   16

Definition at line 3116 of file wined3d_private.h.

◆ STATE_ACTIVELIGHT

#define STATE_ACTIVELIGHT (   a)    (STATE_LIGHT_TYPE + 1 + (a))

Definition at line 1624 of file wined3d_private.h.

◆ STATE_BASEVERTEXINDEX

#define STATE_BASEVERTEXINDEX   (STATE_POINTSPRITECOORDORIGIN + 1)

Definition at line 1642 of file wined3d_private.h.

◆ STATE_BLEND

#define STATE_BLEND   (STATE_STREAM_OUTPUT + 1)

Definition at line 1657 of file wined3d_private.h.

◆ STATE_CLIPPLANE

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

Definition at line 1630 of file wined3d_private.h.

◆ STATE_COLOR_KEY

#define STATE_COLOR_KEY   (STATE_POINT_ENABLE + 1)

Definition at line 1651 of file wined3d_private.h.

◆ STATE_COMPUTE_CONSTANT_BUFFER

#define STATE_COMPUTE_CONSTANT_BUFFER   (STATE_COMPUTE_SHADER + 1)

Definition at line 1665 of file wined3d_private.h.

◆ STATE_COMPUTE_COUNT

#define STATE_COMPUTE_COUNT   (STATE_COMPUTE_HIGHEST - STATE_COMPUTE_OFFSET + 1)

Definition at line 1678 of file wined3d_private.h.

◆ STATE_COMPUTE_HIGHEST

#define STATE_COMPUTE_HIGHEST   (STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING)

Definition at line 1674 of file wined3d_private.h.

◆ STATE_COMPUTE_OFFSET

#define STATE_COMPUTE_OFFSET   (STATE_BLEND + 1)

Definition at line 1660 of file wined3d_private.h.

◆ STATE_COMPUTE_SHADER

#define STATE_COMPUTE_SHADER   (STATE_COMPUTE_OFFSET)

Definition at line 1662 of file wined3d_private.h.

◆ STATE_COMPUTE_SHADER_RESOURCE_BINDING

#define STATE_COMPUTE_SHADER_RESOURCE_BINDING   (STATE_COMPUTE_CONSTANT_BUFFER + 1)

Definition at line 1668 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 1671 of file wined3d_private.h.

◆ STATE_CONSTANT_BUFFER

Definition at line 1681 of file wined3d_private.h.

◆ STATE_FRAMEBUFFER

#define STATE_FRAMEBUFFER   (STATE_BASEVERTEXINDEX + 1)

Definition at line 1645 of file wined3d_private.h.

◆ STATE_FRONTFACE

#define STATE_FRONTFACE   (STATE_MATERIAL + 1)

Definition at line 1636 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 1597 of file wined3d_private.h.

◆ STATE_GRAPHICS_SHADER

#define STATE_GRAPHICS_SHADER (   a)    (STATE_SAMPLER(MAX_COMBINED_SAMPLERS) + (a))

Definition at line 1593 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 1602 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 1605 of file wined3d_private.h.

◆ STATE_HIGHEST

Definition at line 1675 of file wined3d_private.h.

◆ STATE_INDEXBUFFER

#define STATE_INDEXBUFFER   (STATE_STREAMSRC + 1)

Definition at line 1613 of file wined3d_private.h.

◆ STATE_IS_ACTIVELIGHT

#define STATE_IS_ACTIVELIGHT (   a)    ((a) >= STATE_ACTIVELIGHT(0) && (a) < STATE_ACTIVELIGHT(MAX_ACTIVE_LIGHTS))

Definition at line 1625 of file wined3d_private.h.

◆ STATE_IS_BASEVERTEXINDEX

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

Definition at line 1643 of file wined3d_private.h.

◆ STATE_IS_BLEND

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

Definition at line 1658 of file wined3d_private.h.

◆ STATE_IS_CLIPPLANE

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

Definition at line 1631 of file wined3d_private.h.

◆ STATE_IS_COLOR_KEY

#define STATE_IS_COLOR_KEY (   a)    ((a) == STATE_COLOR_KEY)

Definition at line 1652 of file wined3d_private.h.

◆ STATE_IS_COMPUTE

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

Definition at line 1677 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 1666 of file wined3d_private.h.

◆ STATE_IS_COMPUTE_SHADER

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

Definition at line 1663 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 1669 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 1672 of file wined3d_private.h.

◆ STATE_IS_FRAMEBUFFER

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

Definition at line 1646 of file wined3d_private.h.

◆ STATE_IS_FRONTFACE

#define STATE_IS_FRONTFACE (   a)    ((a) == STATE_FRONTFACE)

Definition at line 1637 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
#define STATE_GRAPHICS_CONSTANT_BUFFER(a)

Definition at line 1598 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 1594 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 1603 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 1606 of file wined3d_private.h.

◆ STATE_IS_INDEXBUFFER

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

Definition at line 1614 of file wined3d_private.h.

◆ STATE_IS_LIGHT_TYPE

#define STATE_IS_LIGHT_TYPE (   a)    ((a) == STATE_LIGHT_TYPE)

Definition at line 1623 of file wined3d_private.h.

◆ STATE_IS_MATERIAL

#define STATE_IS_MATERIAL (   a)    ((a) == STATE_MATERIAL)

Definition at line 1634 of file wined3d_private.h.

◆ STATE_IS_POINT_ENABLE

#define STATE_IS_POINT_ENABLE (   a)    ((a) == STATE_POINT_ENABLE)

Definition at line 1649 of file wined3d_private.h.

◆ STATE_IS_POINTSPRITECOORDORIGIN

#define STATE_IS_POINTSPRITECOORDORIGIN (   a)    ((a) == STATE_POINTSPRITECOORDORIGIN)

Definition at line 1640 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 1582 of file wined3d_private.h.

◆ STATE_IS_SAMPLER

#define STATE_IS_SAMPLER (   num)    ((num) >= STATE_SAMPLER(0) && (num) <= STATE_SAMPLER(MAX_COMBINED_SAMPLERS - 1))

Definition at line 1591 of file wined3d_private.h.

◆ STATE_IS_SCISSORRECT

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

Definition at line 1628 of file wined3d_private.h.

◆ STATE_IS_STREAM_OUTPUT

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

Definition at line 1655 of file wined3d_private.h.

◆ STATE_IS_STREAMSRC

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

Definition at line 1612 of file wined3d_private.h.

◆ STATE_IS_TEXTURESTAGE

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

Definition at line 1586 of file wined3d_private.h.

◆ STATE_IS_TRANSFORM

#define STATE_IS_TRANSFORM (   a)    ((a) >= STATE_TRANSFORM(1) && (a) <= STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(255)))

Definition at line 1609 of file wined3d_private.h.

◆ STATE_IS_VDECL

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

Definition at line 1617 of file wined3d_private.h.

◆ STATE_IS_VIEWPORT

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

Definition at line 1620 of file wined3d_private.h.

◆ STATE_LIGHT_TYPE

#define STATE_LIGHT_TYPE   (STATE_VIEWPORT + 1)

Definition at line 1622 of file wined3d_private.h.

◆ STATE_MATERIAL

#define STATE_MATERIAL   (STATE_CLIPPLANE(MAX_CLIP_DISTANCES))

Definition at line 1633 of file wined3d_private.h.

◆ STATE_POINT_ENABLE

#define STATE_POINT_ENABLE   (STATE_FRAMEBUFFER + 1)

Definition at line 1648 of file wined3d_private.h.

◆ STATE_POINTSPRITECOORDORIGIN

#define STATE_POINTSPRITECOORDORIGIN   (STATE_FRONTFACE + 1)

Definition at line 1639 of file wined3d_private.h.

◆ STATE_RENDER

#define STATE_RENDER (   a)    (a)

Definition at line 1581 of file wined3d_private.h.

◆ STATE_SAMPLER

#define STATE_SAMPLER (   num)    (STATE_TEXTURESTAGE(MAX_TEXTURES - 1, WINED3D_HIGHEST_TEXTURE_STATE) + 1 + (num))

Definition at line 1590 of file wined3d_private.h.

◆ STATE_SCISSORRECT

#define STATE_SCISSORRECT   (STATE_ACTIVELIGHT(MAX_ACTIVE_LIGHTS - 1) + 1)

Definition at line 1627 of file wined3d_private.h.

◆ STATE_SHADER

Definition at line 1680 of file wined3d_private.h.

◆ STATE_STREAM_OUTPUT

#define STATE_STREAM_OUTPUT   (STATE_COLOR_KEY + 1)

Definition at line 1654 of file wined3d_private.h.

◆ STATE_STREAMSRC

#define STATE_STREAMSRC   (STATE_TRANSFORM(WINED3D_TS_WORLD_MATRIX(255)) + 1)

Definition at line 1611 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 1584 of file wined3d_private.h.

◆ STATE_TRANSFORM

#define STATE_TRANSFORM (   a)    (STATE_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING + (a))

Definition at line 1608 of file wined3d_private.h.

◆ STATE_UNORDERED_ACCESS_VIEW_BINDING

#define STATE_UNORDERED_ACCESS_VIEW_BINDING (   a)
Value:

Definition at line 1683 of file wined3d_private.h.

◆ STATE_VDECL

#define STATE_VDECL   (STATE_INDEXBUFFER + 1)

Definition at line 1616 of file wined3d_private.h.

◆ STATE_VIEWPORT

#define STATE_VIEWPORT   (STATE_VDECL + 1)

Definition at line 1619 of file wined3d_private.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 39 of file wined3d_private.h.

◆ WINE_GLAPI

#define WINE_GLAPI

Definition at line 31 of file wined3d_private.h.

◆ WINED3D_CONST_NUM_UNUSED

#define WINED3D_CONST_NUM_UNUSED   ~0U

Definition at line 1318 of file wined3d_private.h.

◆ WINED3D_CONSTANT_BUFFER_ALIGNMENT

#define WINED3D_CONSTANT_BUFFER_ALIGNMENT   16

Definition at line 3117 of file wined3d_private.h.

◆ WINED3D_CS_QUERY_POLL_INTERVAL

#define WINED3D_CS_QUERY_POLL_INTERVAL   10u

Definition at line 3537 of file wined3d_private.h.

◆ WINED3D_CS_QUEUE_SIZE

#define WINED3D_CS_QUEUE_SIZE   0x100000u

Definition at line 3538 of file wined3d_private.h.

◆ WINED3D_CS_SPIN_COUNT

#define WINED3D_CS_SPIN_COUNT   10000000u

Definition at line 3542 of file wined3d_private.h.

◆ WINED3D_FBO_ENTRY_FLAG_ATTACHED

#define WINED3D_FBO_ENTRY_FLAG_ATTACHED   0x1

Definition at line 3343 of file wined3d_private.h.

◆ WINED3D_FBO_ENTRY_FLAG_DEPTH

#define WINED3D_FBO_ENTRY_FLAG_DEPTH   0x2

Definition at line 3344 of file wined3d_private.h.

◆ WINED3D_FBO_ENTRY_FLAG_STENCIL

#define WINED3D_FBO_ENTRY_FLAG_STENCIL   0x4

Definition at line 3345 of file wined3d_private.h.

◆ WINED3D_FFP_LIGHT_TYPE_MASK

#define WINED3D_FFP_LIGHT_TYPE_MASK   0x7u

Definition at line 2727 of file wined3d_private.h.

◆ WINED3D_FFP_LIGHT_TYPE_SHIFT

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

Definition at line 2726 of file wined3d_private.h.

◆ WINED3D_FFP_TCI_MASK

#define WINED3D_FFP_TCI_MASK   0xffu

Definition at line 2724 of file wined3d_private.h.

◆ WINED3D_FFP_TCI_SHIFT

#define WINED3D_FFP_TCI_SHIFT   16

Definition at line 2723 of file wined3d_private.h.

◆ WINED3D_FRAGMENT_CAP_COLOR_KEY

#define WINED3D_FRAGMENT_CAP_COLOR_KEY   0x00000004

Definition at line 2026 of file wined3d_private.h.

◆ WINED3D_FRAGMENT_CAP_PROJ_CONTROL

#define WINED3D_FRAGMENT_CAP_PROJ_CONTROL   0x00000001

Definition at line 2024 of file wined3d_private.h.

◆ WINED3D_FRAGMENT_CAP_SRGB_WRITE

#define WINED3D_FRAGMENT_CAP_SRGB_WRITE   0x00000002

Definition at line 2025 of file wined3d_private.h.

◆ WINED3D_LOCATION_BUFFER

#define WINED3D_LOCATION_BUFFER   0x00000008

Definition at line 3319 of file wined3d_private.h.

◆ WINED3D_LOCATION_DISCARDED

#define WINED3D_LOCATION_DISCARDED   0x00000001

Definition at line 3316 of file wined3d_private.h.

◆ WINED3D_LOCATION_DRAWABLE

#define WINED3D_LOCATION_DRAWABLE   0x00000040

Definition at line 3322 of file wined3d_private.h.

◆ WINED3D_LOCATION_RB_MULTISAMPLE

#define WINED3D_LOCATION_RB_MULTISAMPLE   0x00000080

Definition at line 3323 of file wined3d_private.h.

◆ WINED3D_LOCATION_RB_RESOLVED

#define WINED3D_LOCATION_RB_RESOLVED   0x00000100

Definition at line 3324 of file wined3d_private.h.

◆ WINED3D_LOCATION_SYSMEM

#define WINED3D_LOCATION_SYSMEM   0x00000002

Definition at line 3317 of file wined3d_private.h.

◆ WINED3D_LOCATION_TEXTURE_RGB

#define WINED3D_LOCATION_TEXTURE_RGB   0x00000010

Definition at line 3320 of file wined3d_private.h.

◆ WINED3D_LOCATION_TEXTURE_SRGB

#define WINED3D_LOCATION_TEXTURE_SRGB   0x00000020

Definition at line 3321 of file wined3d_private.h.

◆ WINED3D_LOCATION_USER_MEMORY

#define WINED3D_LOCATION_USER_MEMORY   0x00000004

Definition at line 3318 of file wined3d_private.h.

◆ WINED3D_MAX_CBS

#define WINED3D_MAX_CBS   15

Definition at line 667 of file wined3d_private.h.

◆ WINED3D_MAX_CONSTS_B

#define WINED3D_MAX_CONSTS_B   16

Definition at line 668 of file wined3d_private.h.

◆ WINED3D_MAX_CONSTS_I

#define WINED3D_MAX_CONSTS_I   16

Definition at line 669 of file wined3d_private.h.

◆ WINED3D_MAX_PS_CONSTS_F

#define WINED3D_MAX_PS_CONSTS_F   224

Definition at line 671 of file wined3d_private.h.

◆ WINED3D_MAX_VS_CONSTS_F

#define WINED3D_MAX_VS_CONSTS_F   256

Definition at line 670 of file wined3d_private.h.

◆ WINED3D_OPENGL_WINDOW_CLASS_NAME

#define WINED3D_OPENGL_WINDOW_CLASS_NAME   "WineD3D_OpenGL"

Definition at line 4546 of file wined3d_private.h.

◆ WINED3D_PACKED_INTERPOLATION_BIT_COUNT

#define WINED3D_PACKED_INTERPOLATION_BIT_COUNT   3

Definition at line 577 of file wined3d_private.h.

◆ WINED3D_PACKED_INTERPOLATION_SIZE

#define WINED3D_PACKED_INTERPOLATION_SIZE   3

Definition at line 576 of file wined3d_private.h.

◆ WINED3D_PSARGS_PROJECTED

#define WINED3D_PSARGS_PROJECTED   (1u << 3)

Definition at line 1332 of file wined3d_private.h.

◆ WINED3D_PSARGS_TEXTRANSFORM_MASK

#define WINED3D_PSARGS_TEXTRANSFORM_MASK   0xfu

Definition at line 1334 of file wined3d_private.h.

◆ WINED3D_PSARGS_TEXTRANSFORM_SHIFT

#define WINED3D_PSARGS_TEXTRANSFORM_SHIFT   4

Definition at line 1333 of file wined3d_private.h.

◆ WINED3D_PSARGS_TEXTYPE_MASK

#define WINED3D_PSARGS_TEXTYPE_MASK   0x3u

Definition at line 1336 of file wined3d_private.h.

◆ WINED3D_PSARGS_TEXTYPE_SHIFT

#define WINED3D_PSARGS_TEXTYPE_SHIFT   2

Definition at line 1335 of file wined3d_private.h.

◆ WINED3D_QUIRK_ALLOWS_SPECULAR_ALPHA

#define WINED3D_QUIRK_ALLOWS_SPECULAR_ALPHA   0x00000008

Definition at line 71 of file wined3d_private.h.

◆ WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT

#define WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT   0x00000001

Definition at line 68 of file wined3d_private.h.

◆ WINED3D_QUIRK_BROKEN_ARB_FOG

#define WINED3D_QUIRK_BROKEN_ARB_FOG   0x00000200

Definition at line 77 of file wined3d_private.h.

◆ WINED3D_QUIRK_BROKEN_RGBA16

#define WINED3D_QUIRK_BROKEN_RGBA16   0x00000040

Definition at line 74 of file wined3d_private.h.

◆ WINED3D_QUIRK_FBO_TEX_UPDATE

#define WINED3D_QUIRK_FBO_TEX_UPDATE   0x00000020

Definition at line 73 of file wined3d_private.h.

◆ WINED3D_QUIRK_GLSL_CLIP_VARYING

#define WINED3D_QUIRK_GLSL_CLIP_VARYING   0x00000004

Definition at line 70 of file wined3d_private.h.

◆ WINED3D_QUIRK_INFO_LOG_SPAM

#define WINED3D_QUIRK_INFO_LOG_SPAM   0x00000080

Definition at line 75 of file wined3d_private.h.

◆ WINED3D_QUIRK_LIMITED_TEX_FILTERING

#define WINED3D_QUIRK_LIMITED_TEX_FILTERING   0x00000100

Definition at line 76 of file wined3d_private.h.

◆ WINED3D_QUIRK_NV_CLIP_BROKEN

#define WINED3D_QUIRK_NV_CLIP_BROKEN   0x00000010

Definition at line 72 of file wined3d_private.h.

◆ WINED3D_QUIRK_SET_TEXCOORD_W

#define WINED3D_QUIRK_SET_TEXCOORD_W   0x00000002

Definition at line 69 of file wined3d_private.h.

◆ WINED3D_SAMPLER_DEFAULT

#define WINED3D_SAMPLER_DEFAULT   ~0x0u

Definition at line 958 of file wined3d_private.h.

◆ WINED3D_SHADER_CAP_DOUBLE_PRECISION

#define WINED3D_SHADER_CAP_DOUBLE_PRECISION   0x00000004

Definition at line 1281 of file wined3d_private.h.

◆ WINED3D_SHADER_CAP_SRGB_WRITE

#define WINED3D_SHADER_CAP_SRGB_WRITE   0x00000002

Definition at line 1280 of file wined3d_private.h.

◆ WINED3D_SHADER_CAP_VS_CLIPPING

#define WINED3D_SHADER_CAP_VS_CLIPPING   0x00000001

Definition at line 1279 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_COLOR_KEY

#define WINED3D_SHADER_CONST_FFP_COLOR_KEY   0x00200000

Definition at line 453 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_LIGHTS

#define WINED3D_SHADER_CONST_FFP_LIGHTS   0x00080000

Definition at line 451 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_MATERIAL

#define WINED3D_SHADER_CONST_FFP_MATERIAL   0x00040000

Definition at line 450 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_MODELVIEW

#define WINED3D_SHADER_CONST_FFP_MODELVIEW   0x00004000

Definition at line 447 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_PROJ

#define WINED3D_SHADER_CONST_FFP_PROJ   0x00010000

Definition at line 448 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_PS

#define WINED3D_SHADER_CONST_FFP_PS   0x00100000

Definition at line 452 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_TEXMATRIX

#define WINED3D_SHADER_CONST_FFP_TEXMATRIX   0x00020000

Definition at line 449 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_VERTEXBLEND

#define WINED3D_SHADER_CONST_FFP_VERTEXBLEND   0xff000000

Definition at line 454 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_FFP_VERTEXBLEND_INDEX

#define WINED3D_SHADER_CONST_FFP_VERTEXBLEND_INDEX (   i)    (0x01000000 << ((i) - 1))

Definition at line 455 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_POS_FIXUP

#define WINED3D_SHADER_CONST_POS_FIXUP   0x00000020

Definition at line 438 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_PS_ALPHA_TEST

#define WINED3D_SHADER_CONST_PS_ALPHA_TEST   0x00000800

Definition at line 444 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_PS_B

#define WINED3D_SHADER_CONST_PS_B   0x00000100

Definition at line 441 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_PS_BUMP_ENV

#define WINED3D_SHADER_CONST_PS_BUMP_ENV   0x00000200

Definition at line 442 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_PS_F

#define WINED3D_SHADER_CONST_PS_F   0x00000040

Definition at line 439 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_PS_FOG

#define WINED3D_SHADER_CONST_PS_FOG   0x00000400

Definition at line 443 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_PS_I

#define WINED3D_SHADER_CONST_PS_I   0x00000080

Definition at line 440 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_PS_NP2_FIXUP

#define WINED3D_SHADER_CONST_PS_NP2_FIXUP   0x00002000

Definition at line 446 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_PS_Y_CORR

#define WINED3D_SHADER_CONST_PS_Y_CORR   0x00001000

Definition at line 445 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_VS_B

#define WINED3D_SHADER_CONST_VS_B   0x00000004

Definition at line 435 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_VS_CLIP_PLANES

#define WINED3D_SHADER_CONST_VS_CLIP_PLANES   0x00000008

Definition at line 436 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_VS_F

#define WINED3D_SHADER_CONST_VS_F   0x00000001

Definition at line 433 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_VS_I

#define WINED3D_SHADER_CONST_VS_I   0x00000002

Definition at line 434 of file wined3d_private.h.

◆ WINED3D_SHADER_CONST_VS_POINTSIZE

#define WINED3D_SHADER_CONST_VS_POINTSIZE   0x00000010

Definition at line 437 of file wined3d_private.h.

◆ WINED3D_SHADER_VERSION

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

Definition at line 988 of file wined3d_private.h.

◆ WINED3D_SM1_PS

#define WINED3D_SM1_PS   0xffffu

Definition at line 647 of file wined3d_private.h.

◆ WINED3D_SM1_VS

#define WINED3D_SM1_VS   0xfffeu

Definition at line 646 of file wined3d_private.h.

◆ WINED3D_SM4_GS

#define WINED3D_SM4_GS   0x0002u

Definition at line 650 of file wined3d_private.h.

◆ WINED3D_SM4_PS

#define WINED3D_SM4_PS   0x0000u

Definition at line 648 of file wined3d_private.h.

◆ WINED3D_SM4_VS

#define WINED3D_SM4_VS   0x0001u

Definition at line 649 of file wined3d_private.h.

◆ WINED3D_SM5_CS

#define WINED3D_SM5_CS   0x0005u

Definition at line 653 of file wined3d_private.h.

◆ WINED3D_SM5_DS

#define WINED3D_SM5_DS   0x0004u

Definition at line 652 of file wined3d_private.h.

◆ WINED3D_SM5_HS

#define WINED3D_SM5_HS   0x0003u

Definition at line 651 of file wined3d_private.h.

◆ WINED3D_STATE_INIT_DEFAULT

#define WINED3D_STATE_INIT_DEFAULT   0x00000002

Definition at line 2819 of file wined3d_private.h.

◆ WINED3D_STATE_NO_REF

#define WINED3D_STATE_NO_REF   0x00000001

Definition at line 2818 of file wined3d_private.h.

◆ WINED3D_TEXTURE_ASYNC_COLOR_KEY

#define WINED3D_TEXTURE_ASYNC_COLOR_KEY   0x00000001

Definition at line 3155 of file wined3d_private.h.

◆ WINED3D_TEXTURE_COND_NP2

#define WINED3D_TEXTURE_COND_NP2   0x00000001

Definition at line 3138 of file wined3d_private.h.

◆ WINED3D_TEXTURE_COND_NP2_EMULATED

#define WINED3D_TEXTURE_COND_NP2_EMULATED   0x00000002

Definition at line 3139 of file wined3d_private.h.

◆ WINED3D_TEXTURE_CONVERTED

#define WINED3D_TEXTURE_CONVERTED   0x00000100

Definition at line 3146 of file wined3d_private.h.

◆ WINED3D_TEXTURE_DC_IN_USE

#define WINED3D_TEXTURE_DC_IN_USE   0x00001000

Definition at line 3150 of file wined3d_private.h.

◆ WINED3D_TEXTURE_DISCARD

#define WINED3D_TEXTURE_DISCARD   0x00002000

Definition at line 3151 of file wined3d_private.h.

◆ WINED3D_TEXTURE_GENERATE_MIPMAPS

#define WINED3D_TEXTURE_GENERATE_MIPMAPS   0x00008000

Definition at line 3153 of file wined3d_private.h.

◆ WINED3D_TEXTURE_GET_DC

#define WINED3D_TEXTURE_GET_DC   0x00004000

Definition at line 3152 of file wined3d_private.h.

◆ WINED3D_TEXTURE_GET_DC_LENIENT

#define WINED3D_TEXTURE_GET_DC_LENIENT   0x00000800

Definition at line 3149 of file wined3d_private.h.

◆ WINED3D_TEXTURE_IS_SRGB

#define WINED3D_TEXTURE_IS_SRGB   0x00000008

Definition at line 3141 of file wined3d_private.h.

◆ WINED3D_TEXTURE_NORMALIZED_COORDS

#define WINED3D_TEXTURE_NORMALIZED_COORDS   0x00000400

Definition at line 3148 of file wined3d_private.h.

◆ WINED3D_TEXTURE_PIN_SYSMEM

#define WINED3D_TEXTURE_PIN_SYSMEM   0x00000200

Definition at line 3147 of file wined3d_private.h.

◆ WINED3D_TEXTURE_POW2_MAT_IDENT

#define WINED3D_TEXTURE_POW2_MAT_IDENT   0x00000004

Definition at line 3140 of file wined3d_private.h.

◆ WINED3D_TEXTURE_RGB_ALLOCATED

#define WINED3D_TEXTURE_RGB_ALLOCATED   0x00000010

Definition at line 3142 of file wined3d_private.h.

◆ WINED3D_TEXTURE_RGB_VALID

#define WINED3D_TEXTURE_RGB_VALID   0x00000020

Definition at line 3143 of file wined3d_private.h.

◆ WINED3D_TEXTURE_SRGB_ALLOCATED

#define WINED3D_TEXTURE_SRGB_ALLOCATED   0x00000040

Definition at line 3144 of file wined3d_private.h.

◆ WINED3D_TEXTURE_SRGB_VALID

#define WINED3D_TEXTURE_SRGB_VALID   0x00000080

Definition at line 3145 of file wined3d_private.h.

◆ WINED3D_UNMAPPED_STAGE

#define WINED3D_UNMAPPED_STAGE   ~0u

Definition at line 2915 of file wined3d_private.h.

◆ WINED3DCREATE_MULTITHREADED

#define WINED3DCREATE_MULTITHREADED   0x00000004

Definition at line 2919 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_BLOCKS

#define WINED3DFMT_FLAG_BLOCKS   0x00020000

Definition at line 4287 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_BLOCKS_NO_VERIFY

#define WINED3DFMT_FLAG_BLOCKS_NO_VERIFY   0x00100000

Definition at line 4290 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_BROKEN_PITCH

#define WINED3DFMT_FLAG_BROKEN_PITCH   0x00010000

Definition at line 4286 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_BUMPMAP

#define WINED3DFMT_FLAG_BUMPMAP   0x00000400

Definition at line 4280 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_COMPRESSED

#define WINED3DFMT_FLAG_COMPRESSED   0x00008000

Definition at line 4285 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_DEPTH

#define WINED3DFMT_FLAG_DEPTH   0x00000004

Definition at line 4273 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_EXTENSION

#define WINED3DFMT_FLAG_EXTENSION   0x00000020

Definition at line 4276 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_FBO_ATTACHABLE

#define WINED3DFMT_FLAG_FBO_ATTACHABLE   0x00000040

Definition at line 4277 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB

#define WINED3DFMT_FLAG_FBO_ATTACHABLE_SRGB   0x00000080

Definition at line 4278 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_FILTERING

#define WINED3DFMT_FLAG_FILTERING   0x00000002

Definition at line 4272 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_FLOAT

#define WINED3DFMT_FLAG_FLOAT   0x00000200

Definition at line 4279 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_GEN_MIPMAP

#define WINED3DFMT_FLAG_GEN_MIPMAP   0x00400000

Definition at line 4292 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_HEIGHT_SCALE

#define WINED3DFMT_FLAG_HEIGHT_SCALE   0x00040000

Definition at line 4288 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_INTEGER

#define WINED3DFMT_FLAG_INTEGER   0x00200000

Definition at line 4291 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING

#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING   0x00000001

Definition at line 4271 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_RENDERTARGET

#define WINED3DFMT_FLAG_RENDERTARGET   0x00000010

Definition at line 4275 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_SHADOW

#define WINED3DFMT_FLAG_SHADOW   0x00004000

Definition at line 4284 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_SRGB_READ

#define WINED3DFMT_FLAG_SRGB_READ   0x00000800

Definition at line 4281 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_SRGB_WRITE

#define WINED3DFMT_FLAG_SRGB_WRITE   0x00001000

Definition at line 4282 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_STENCIL

#define WINED3DFMT_FLAG_STENCIL   0x00000008

Definition at line 4274 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_TEXTURE

#define WINED3DFMT_FLAG_TEXTURE   0x00080000

Definition at line 4289 of file wined3d_private.h.

◆ WINED3DFMT_FLAG_VTF

#define WINED3DFMT_FLAG_VTF   0x00002000

Definition at line 4283 of file wined3d_private.h.

◆ WINED3DPS_VERSION

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

Definition at line 656 of file wined3d_private.h.

◆ WINED3DSI_INDEXED_DYNAMIC

#define WINED3DSI_INDEXED_DYNAMIC   0x4

Definition at line 624 of file wined3d_private.h.

◆ WINED3DSI_RESINFO_RCP_FLOAT

#define WINED3DSI_RESINFO_RCP_FLOAT   0x1

Definition at line 625 of file wined3d_private.h.

◆ WINED3DSI_RESINFO_UINT

#define WINED3DSI_RESINFO_UINT   0x2

Definition at line 626 of file wined3d_private.h.

◆ WINED3DSI_SAMPLE_INFO_UINT

#define WINED3DSI_SAMPLE_INFO_UINT   0x1

Definition at line 627 of file wined3d_private.h.

◆ WINED3DSI_SAMPLER_COMPARISON_MODE

#define WINED3DSI_SAMPLER_COMPARISON_MODE   0x1

Definition at line 628 of file wined3d_private.h.

◆ WINED3DSI_TEXLD_BIAS

#define WINED3DSI_TEXLD_BIAS   0x2

Definition at line 623 of file wined3d_private.h.

◆ WINED3DSI_TEXLD_PROJECT

#define WINED3DSI_TEXLD_PROJECT   0x1

Definition at line 622 of file wined3d_private.h.

◆ WINED3DSP_NOSWIZZLE

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

Definition at line 530 of file wined3d_private.h.

◆ WINED3DSP_WRITEMASK_0

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

Definition at line 550 of file wined3d_private.h.

◆ WINED3DSP_WRITEMASK_1

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

Definition at line 551 of file wined3d_private.h.

◆ WINED3DSP_WRITEMASK_2

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

Definition at line 552 of file wined3d_private.h.

◆ WINED3DSP_WRITEMASK_3

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

Definition at line 553 of file wined3d_private.h.

◆ WINED3DSP_WRITEMASK_ALL

#define WINED3DSP_WRITEMASK_ALL   0xfu /* all */

Definition at line 554 of file wined3d_private.h.

◆ WINED3DVS_VERSION

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

Definition at line 657 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 2009 of file wined3d_private.h.

◆ SHADER_HANDLER

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

Definition at line 1277 of file wined3d_private.h.

◆ wined3d_ffp_attrib_func

typedef void(WINE_GLAPI * wined3d_ffp_attrib_func) (const void *data)

Definition at line 172 of file wined3d_private.h.

◆ wined3d_ffp_texcoord_func

typedef void(WINE_GLAPI * wined3d_ffp_texcoord_func) (GLenum unit, const void *data)

Definition at line 173 of file wined3d_private.h.

◆ wined3d_generic_attrib_func

typedef void(WINE_GLAPI * wined3d_generic_attrib_func) (GLuint idx, const void *data)

Definition at line 174 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 

Definition at line 136 of file wined3d_private.h.

137{
144};
@ COMPLEX_FIXUP_P8
@ COMPLEX_FIXUP_YUY2
@ COMPLEX_FIXUP_UYVY
@ COMPLEX_FIXUP_NV12
@ COMPLEX_FIXUP_YV12
@ COMPLEX_FIXUP_NONE

◆ dst_arg

Enumerator
resultreg 
tempreg 

Definition at line 2650 of file wined3d_private.h.

2651{
2652 resultreg = 0,
2653 tempreg = 1
2654};
@ tempreg
@ resultreg

◆ 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 124 of file wined3d_private.h.

125{
134};
@ 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 

Definition at line 1369 of file wined3d_private.h.

1370{
1371 VS_FOG_Z = 0,
1372 VS_FOG_COORD = 1
1373};
@ VS_FOG_COORD
@ VS_FOG_Z

◆ fogsource

Enumerator
FOGSOURCE_FFP 
FOGSOURCE_VS 
FOGSOURCE_COORD 

Definition at line 1686 of file wined3d_private.h.

1686 {
1690};
@ FOGSOURCE_VS
@ FOGSOURCE_COORD
@ FOGSOURCE_FFP

◆ projection_types

Enumerator
proj_none 
proj_count3 
proj_count4 

Definition at line 2643 of file wined3d_private.h.

2644{
2645 proj_none = 0,
2646 proj_count3 = 1,
2647 proj_count4 = 2
2648};
@ proj_none
@ proj_count3
@ proj_count4

◆ vertexprocessing_mode

Enumerator
fixedfunction 
vertexshader 
pretransformed 

Definition at line 1312 of file wined3d_private.h.

1312 {
1316};
@ pretransformed
@ vertexshader
@ fixedfunction

◆ wined3d_blit_op

Enumerator
WINED3D_BLIT_OP_COLOR_BLIT 
WINED3D_BLIT_OP_COLOR_BLIT_ALPHATEST 
WINED3D_BLIT_OP_COLOR_BLIT_CKEY 
WINED3D_BLIT_OP_COLOR_FILL 
WINED3D_BLIT_OP_DEPTH_FILL 
WINED3D_BLIT_OP_DEPTH_BLIT 
WINED3D_BLIT_OP_RAW_BLIT 

Definition at line 2098 of file wined3d_private.h.

2099{
2107};
@ WINED3D_BLIT_OP_COLOR_FILL
@ 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_DEPTH_FILL
@ WINED3D_BLIT_OP_COLOR_BLIT

◆ wined3d_buffer_conversion_type

Enumerator
CONV_NONE 
CONV_D3DCOLOR 
CONV_POSITIONT 

Definition at line 3696 of file wined3d_private.h.

3697{
3698 CONV_NONE,
3701};
@ CONV_NONE
@ CONV_POSITIONT
@ CONV_D3DCOLOR

◆ wined3d_cs_queue_id

Enumerator
WINED3D_CS_QUEUE_DEFAULT 
WINED3D_CS_QUEUE_MAP 
WINED3D_CS_QUEUE_COUNT 

Definition at line 3520 of file wined3d_private.h.

3521{
3525};
@ 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 511 of file wined3d_private.h.

512{
522};
@ 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_fence_result

Enumerator
WINED3D_FENCE_OK 
WINED3D_FENCE_WAITING 
WINED3D_FENCE_NOT_STARTED 
WINED3D_FENCE_WRONG_THREAD 
WINED3D_FENCE_ERROR 

Definition at line 1698 of file wined3d_private.h.

1699{
1705};
@ WINED3D_FENCE_WRONG_THREAD
@ WINED3D_FENCE_OK
@ WINED3D_FENCE_WAITING
@ WINED3D_FENCE_ERROR
@ WINED3D_FENCE_NOT_STARTED

◆ 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 99 of file wined3d_private.h.

100{
120};
@ 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 79 of file wined3d_private.h.

80{
97};
@ 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 1320 of file wined3d_private.h.

1321{
1326};
@ 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 2715 of file wined3d_private.h.

2716{
2721};
@ 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_TEX_RECT 
WINED3D_GL_RES_TYPE_BUFFER 
WINED3D_GL_RES_TYPE_RB 
WINED3D_GL_RES_TYPE_COUNT 

Definition at line 1300 of file wined3d_private.h.

1301{
1310};
@ 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_RECT
@ WINED3D_GL_RES_TYPE_TEX_1D
@ WINED3D_GL_RES_TYPE_COUNT

◆ wined3d_immconst_type

Enumerator
WINED3D_IMMCONST_SCALAR 
WINED3D_IMMCONST_VEC4 

Definition at line 524 of file wined3d_private.h.

525{
528};
@ 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_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_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_FURY 
CARD_AMD_RADEON_RX_460 
CARD_AMD_RADEON_RX_480 
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_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 
CARD_NVIDIA_GEFORCE_GTX680 
CARD_NVIDIA_GEFORCE_GTX690 
CARD_NVIDIA_GEFORCE_GT730 
CARD_NVIDIA_GEFORCE_GT730M 
CARD_NVIDIA_GEFORCE_GT740M 
CARD_NVIDIA_GEFORCE_GT750M 
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_GTX780 
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_GTX1050 
CARD_NVIDIA_GEFORCE_GTX1060 
CARD_NVIDIA_GEFORCE_GTX1070 
CARD_NVIDIA_GEFORCE_GTX1080 
CARD_NVIDIA_GEFORCE_GTX1080TI 
CARD_NVIDIA_TITANX_PASCAL 
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 
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_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 

Definition at line 2238 of file wined3d_private.h.

2239{
2240 CARD_WINE = 0x0000,
2241
2242 CARD_AMD_RAGE_128PRO = 0x5246,
2243 CARD_AMD_RADEON_7200 = 0x5144,
2244 CARD_AMD_RADEON_8500 = 0x514c,
2245 CARD_AMD_RADEON_9500 = 0x4144,
2247 CARD_AMD_RADEON_X700 = 0x5e4c,
2248 CARD_AMD_RADEON_X1600 = 0x71c2,
2249 CARD_AMD_RADEON_HD2350 = 0x94c7,
2250 CARD_AMD_RADEON_HD2600 = 0x9581,
2251 CARD_AMD_RADEON_HD2900 = 0x9400,
2252 CARD_AMD_RADEON_HD3200 = 0x9620,
2253 CARD_AMD_RADEON_HD3850 = 0x9515,
2254 CARD_AMD_RADEON_HD4200M = 0x9712,
2255 CARD_AMD_RADEON_HD4350 = 0x954f,
2256 CARD_AMD_RADEON_HD4600 = 0x9495,
2257 CARD_AMD_RADEON_HD4700 = 0x944e,
2258 CARD_AMD_RADEON_HD4800 = 0x944c,
2259 CARD_AMD_RADEON_HD5400 = 0x68f9,
2260 CARD_AMD_RADEON_HD5600 = 0x68d8,
2261 CARD_AMD_RADEON_HD5700 = 0x68be,
2262 CARD_AMD_RADEON_HD5800 = 0x6898,
2263 CARD_AMD_RADEON_HD5900 = 0x689c,
2264 CARD_AMD_RADEON_HD6300 = 0x9803,
2265 CARD_AMD_RADEON_HD6400 = 0x6770,
2266 CARD_AMD_RADEON_HD6410D = 0x9644,
2267 CARD_AMD_RADEON_HD6480G = 0x9648,
2268 CARD_AMD_RADEON_HD6550D = 0x9640,
2269 CARD_AMD_RADEON_HD6600 = 0x6758,
2270 CARD_AMD_RADEON_HD6600M = 0x6741,
2271 CARD_AMD_RADEON_HD6700 = 0x68ba,
2272 CARD_AMD_RADEON_HD6800 = 0x6739,
2273 CARD_AMD_RADEON_HD6900 = 0x6719,
2274 CARD_AMD_RADEON_HD7660D = 0x9901,
2275 CARD_AMD_RADEON_HD7700 = 0x683d,
2276 CARD_AMD_RADEON_HD7800 = 0x6819,
2277 CARD_AMD_RADEON_HD7900 = 0x679a,
2278 CARD_AMD_RADEON_HD8600M = 0x6660,
2279 CARD_AMD_RADEON_HD8670 = 0x6610,
2280 CARD_AMD_RADEON_HD8770 = 0x665c,
2281 CARD_AMD_RADEON_R3 = 0x9830,
2282 CARD_AMD_RADEON_R7 = 0x130f,
2283 CARD_AMD_RADEON_R9_285 = 0x6939,
2284 CARD_AMD_RADEON_R9_290 = 0x67b1,
2285 CARD_AMD_RADEON_R9_FURY = 0x7300,
2286 CARD_AMD_RADEON_RX_460 = 0x67ef,
2287 CARD_AMD_RADEON_RX_480 = 0x67df,
2288
2289 CARD_NVIDIA_RIVA_128 = 0x0018,
2290 CARD_NVIDIA_RIVA_TNT = 0x0020,
2291 CARD_NVIDIA_RIVA_TNT2 = 0x0028,
2292 CARD_NVIDIA_GEFORCE = 0x0100,
2293 CARD_NVIDIA_GEFORCE2_MX = 0x0110,
2294 CARD_NVIDIA_GEFORCE2 = 0x0150,
2295 CARD_NVIDIA_GEFORCE3 = 0x0200,
2296 CARD_NVIDIA_GEFORCE4_MX = 0x0170,
2301 CARD_NVIDIA_GEFORCE_6200 = 0x014f,
2303 CARD_NVIDIA_GEFORCE_6800 = 0x0041,
2304 CARD_NVIDIA_GEFORCE_7300 = 0x01d7, /* GeForce Go 7300 */
2305 CARD_NVIDIA_GEFORCE_7400 = 0x01d8,
2306 CARD_NVIDIA_GEFORCE_7600 = 0x0391,
2308 CARD_NVIDIA_GEFORCE_8200 = 0x0849, /* Other PCI ID 0x084b */
2316 CARD_NVIDIA_GEFORCE_9200 = 0x086d,
2317 CARD_NVIDIA_GEFORCE_9300 = 0x086c,
2324 CARD_NVIDIA_GEFORCE_210 = 0x0a23,
2331 CARD_NVIDIA_GEFORCE_315M = 0x0a7a,
2332 CARD_NVIDIA_GEFORCE_320M = 0x08a3,
2337 CARD_NVIDIA_GEFORCE_410M = 0x1055,
2390 CARD_NVIDIA_GEFORCE_820M = 0x0fed,
2391 CARD_NVIDIA_GEFORCE_830M = 0x1340,
2392 CARD_NVIDIA_GEFORCE_840M = 0x1341,
2393 CARD_NVIDIA_GEFORCE_845M = 0x1344,
2395 CARD_NVIDIA_GEFORCE_GTX860M = 0x1392, /* Other PCI ID 0x119a */
2398 CARD_NVIDIA_GEFORCE_940M = 0x1347,
2413
2414 CARD_VMWARE_SVGA3D = 0x0405,
2415
2416 CARD_INTEL_830M = 0x3577,
2417 CARD_INTEL_855GM = 0x3582,
2418 CARD_INTEL_845G = 0x2562,
2419 CARD_INTEL_865G = 0x2572,
2420 CARD_INTEL_915G = 0x2582,
2421 CARD_INTEL_E7221G = 0x258a,
2422 CARD_INTEL_915GM = 0x2592,
2423 CARD_INTEL_945G = 0x2772,
2424 CARD_INTEL_945GM = 0x27a2,
2425 CARD_INTEL_945GME = 0x27ae,
2426 CARD_INTEL_Q35 = 0x29b2,
2427 CARD_INTEL_G33 = 0x29c2,
2428 CARD_INTEL_Q33 = 0x29d2,
2429 CARD_INTEL_PNVG = 0xa001,
2430 CARD_INTEL_PNVM = 0xa011,
2431 CARD_INTEL_965Q = 0x2992,
2432 CARD_INTEL_965G = 0x2982,
2433 CARD_INTEL_946GZ = 0x2972,
2434 CARD_INTEL_965GM = 0x2a02,
2435 CARD_INTEL_965GME = 0x2a12,
2436 CARD_INTEL_GM45 = 0x2a42,
2437 CARD_INTEL_IGD = 0x2e02,
2438 CARD_INTEL_Q45 = 0x2e12,
2439 CARD_INTEL_G45 = 0x2e22,
2440 CARD_INTEL_G41 = 0x2e32,
2441 CARD_INTEL_B43 = 0x2e92,
2442 CARD_INTEL_ILKD = 0x0042,
2443 CARD_INTEL_ILKM = 0x0046,
2444 CARD_INTEL_SNBD = 0x0122,
2445 CARD_INTEL_SNBM = 0x0126,
2446 CARD_INTEL_SNBS = 0x010a,
2447 CARD_INTEL_IVBD = 0x0162,
2448 CARD_INTEL_IVBM = 0x0166,
2449 CARD_INTEL_IVBS = 0x015a,
2450 CARD_INTEL_HWD = 0x0412,
2451 CARD_INTEL_HWM = 0x0416,
2452 CARD_INTEL_HD5000 = 0x0a26,
2453 CARD_INTEL_I5100_1 = 0x0a22,
2454 CARD_INTEL_I5100_2 = 0x0a2a,
2455 CARD_INTEL_I5100_3 = 0x0a2b,
2456 CARD_INTEL_I5100_4 = 0x0a2e,
2457 CARD_INTEL_IP5200_1 = 0x0d22,
2458 CARD_INTEL_IP5200_2 = 0x0d26,
2459 CARD_INTEL_IP5200_3 = 0x0d2a,
2460 CARD_INTEL_IP5200_4 = 0x0d2b,
2461 CARD_INTEL_IP5200_5 = 0x0d2e,
2462 CARD_INTEL_HD5300 = 0x161e,
2463 CARD_INTEL_HD5500 = 0x1616,
2464 CARD_INTEL_HD5600 = 0x1612,
2465 CARD_INTEL_HD6000 = 0x1626,
2466 CARD_INTEL_I6100 = 0x162b,
2467 CARD_INTEL_IP6200 = 0x1622,
2468 CARD_INTEL_IPP6300 = 0x162a,
2469 CARD_INTEL_HD510_1 = 0x1902,
2470 CARD_INTEL_HD510_2 = 0x1906,
2471 CARD_INTEL_HD510_3 = 0x190b,
2472 CARD_INTEL_HD515 = 0x191e,
2473 CARD_INTEL_HD520_1 = 0x1916,
2474 CARD_INTEL_HD520_2 = 0x1921,
2475 CARD_INTEL_HD530_1 = 0x1912,
2476 CARD_INTEL_HD530_2 = 0x191b,
2477 CARD_INTEL_HDP530 = 0x191d,
2478 CARD_INTEL_I540 = 0x1926,
2479 CARD_INTEL_I550 = 0x1927,
2480 CARD_INTEL_I555 = 0x192b,
2481 CARD_INTEL_IP555 = 0x192d,
2482 CARD_INTEL_IP580_1 = 0x1932,
2483 CARD_INTEL_IP580_2 = 0x193b,
2484 CARD_INTEL_IPP580_1 = 0x193a,
2485 CARD_INTEL_IPP580_2 = 0x193d,
2486};
@ CARD_NVIDIA_GEFORCE_GTX780
@ CARD_INTEL_I5100_4
@ CARD_INTEL_I5100_3
@ CARD_NVIDIA_GEFORCE_GTX950M
@ CARD_INTEL_946GZ
@ CARD_NVIDIA_GEFORCE_GT325M
@ CARD_NVIDIA_GEFORCE_GTXTITANZ
@ CARD_INTEL_HD5500
@ CARD_AMD_RADEON_HD4800
@ CARD_NVIDIA_GEFORCE_GTX570
@ CARD_NVIDIA_GEFORCE_GTXTITAN
@ 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_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_940M
@ CARD_INTEL_915G
@ CARD_NVIDIA_GEFORCE_320M
@ CARD_INTEL_G41
@ CARD_NVIDIA_GEFORCE_GT650M
@ CARD_NVIDIA_GEFORCE_GTX460
@ CARD_INTEL_IP555
@ CARD_NVIDIA_GEFORCE_830M
@ CARD_AMD_RADEON_HD2900
@ CARD_NVIDIA_RIVA_128
@ CARD_INTEL_I555
@ CARD_NVIDIA_GEFORCE_7300
@ CARD_NVIDIA_GEFORCEFX_5200
@ 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_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_NVIDIA_GEFORCE_GTX690
@ CARD_NVIDIA_GEFORCE_GTX780TI
@ CARD_NVIDIA_GEFORCE_GTX770
@ CARD_NVIDIA_GEFORCE_GTX760
@ CARD_NVIDIA_GEFORCE_GTX880M
@ CARD_NVIDIA_GEFORCE4_TI4200
@ CARD_AMD_RADEON_HD4200M
@ CARD_INTEL_HD6000
@ 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_GTX465
@ CARD_INTEL_E7221G
@ CARD_INTEL_965GME
@ CARD_INTEL_IP580_2
@ CARD_AMD_RADEON_HD2600
@ CARD_INTEL_IP6200
@ CARD_NVIDIA_GEFORCE_GT240
@ CARD_NVIDIA_TITANX_PASCAL
@ CARD_AMD_RADEON_HD6550D
@ CARD_AMD_RADEON_HD4600
@ CARD_INTEL_HD520_1
@ CARD_NVIDIA_GEFORCE_GT520
@ CARD_INTEL_G33
@ CARD_INTEL_HD5600
@ CARD_NVIDIA_GEFORCE_GT730M
@ CARD_NVIDIA_GEFORCE_8800GTS
@ CARD_AMD_RADEON_HD6800
@ CARD_AMD_RADEON_HD3200
@ CARD_NVIDIA_GEFORCE_8400GS
@ CARD_AMD_RAGE_128PRO
@ CARD_NVIDIA_GEFORCE_8200
@ CARD_VMWARE_SVGA3D
@ CARD_AMD_RADEON_HD6600M
@ CARD_AMD_RADEON_HD7900
@ CARD_INTEL_HD5000
@ CARD_INTEL_845G
@ CARD_INTEL_HD510_2
@ 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_GTX550
@ CARD_NVIDIA_GEFORCE_9400M
@ CARD_NVIDIA_GEFORCE_GTX960
@ CARD_AMD_RADEON_9500
@ CARD_NVIDIA_GEFORCE_GTX680
@ CARD_INTEL_Q45
@ CARD_AMD_RADEON_HD8670
@ CARD_NVIDIA_GEFORCE2
@ CARD_NVIDIA_GEFORCE_8600MGT
@ CARD_INTEL_Q33
@ CARD_NVIDIA_GEFORCE_GTX650
@ CARD_NVIDIA_GEFORCE_GT555M
@ CARD_NVIDIA_GEFORCE_GTS350M
@ CARD_AMD_RADEON_HD7660D
@ CARD_NVIDIA_GEFORCE_GTX870M
@ CARD_NVIDIA_GEFORCE_9400GT
@ CARD_NVIDIA_GEFORCE_GTX850M
@ CARD_NVIDIA_GEFORCE_7800GT
@ CARD_INTEL_Q35
@ CARD_NVIDIA_GEFORCE
@ CARD_NVIDIA_GEFORCE_GTX670
@ CARD_AMD_RADEON_R9_290
@ CARD_NVIDIA_GEFORCE_GTX765M
@ CARD_AMD_RADEON_HD5900
@ CARD_INTEL_G45
@ CARD_AMD_RADEON_R9_FURY
@ CARD_INTEL_IVBS
@ CARD_INTEL_865G
@ CARD_INTEL_IP5200_5
@ 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_INTEL_GM45
@ CARD_NVIDIA_GEFORCE_GTX260
@ CARD_NVIDIA_GEFORCE_GTX980
@ CARD_NVIDIA_GEFORCE_8600GT
@ CARD_NVIDIA_GEFORCE_GTX970M
@ CARD_NVIDIA_GEFORCE_GTX560M
@ CARD_NVIDIA_GEFORCE_315M
@ 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_AMD_RADEON_HD5800
@ 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_HD520_2
@ CARD_NVIDIA_GEFORCE_GTXTITANB
@ CARD_NVIDIA_GEFORCE4_MX
@ CARD_NVIDIA_GEFORCE_GTX960M
@ CARD_AMD_RADEON_R3
@ CARD_NVIDIA_GEFORCE_GTX970
@ CARD_AMD_RADEON_HD6300
@ CARD_NVIDIA_GEFORCE_GT630M
@ CARD_INTEL_SNBM
@ CARD_NVIDIA_GEFORCE_GT740M
@ CARD_NVIDIA_GEFORCE_GTX675MX
@ CARD_AMD_RADEON_HD8770
@ CARD_INTEL_HD510_1
@ CARD_INTEL_830M
@ CARD_NVIDIA_GEFORCE_GT540M
@ CARD_NVIDIA_GEFORCE_GTX660
@ CARD_INTEL_IPP580_2
@ CARD_INTEL_IP5200_4
@ CARD_AMD_RADEON_RX_480
@ CARD_INTEL_HD530_1
@ CARD_INTEL_IP5200_3
@ CARD_INTEL_HD5300
@ CARD_NVIDIA_GEFORCE2_MX
@ CARD_INTEL_ILKM
@ CARD_NVIDIA_GEFORCE_GTX470
@ CARD_NVIDIA_GEFORCE_8500GT
@ CARD_NVIDIA_GEFORCE_GTX980TI
@ CARD_NVIDIA_GEFORCE_410M
@ CARD_NVIDIA_GEFORCE_GTS450
@ CARD_NVIDIA_GEFORCE_GT750M
@ CARD_AMD_RADEON_HD6480G
@ 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_AMD_RADEON_HD6410D

◆ wined3d_pci_vendor

Enumerator
HW_VENDOR_SOFTWARE 
HW_VENDOR_AMD 
HW_VENDOR_NVIDIA 
HW_VENDOR_VMWARE 
HW_VENDOR_INTEL 

Definition at line 2229 of file wined3d_private.h.

2230{
2231 HW_VENDOR_SOFTWARE = 0x0000,
2232 HW_VENDOR_AMD = 0x1002,
2233 HW_VENDOR_NVIDIA = 0x10de,
2234 HW_VENDOR_VMWARE = 0x15ad,
2235 HW_VENDOR_INTEL = 0x8086,
2236};
@ HW_VENDOR_INTEL
@ HW_VENDOR_NVIDIA
@ HW_VENDOR_AMD
@ HW_VENDOR_SOFTWARE
@ HW_VENDOR_VMWARE

◆ wined3d_pipeline

Enumerator
WINED3D_PIPELINE_GRAPHICS 
WINED3D_PIPELINE_COMPUTE 
WINED3D_PIPELINE_COUNT 

Definition at line 1572 of file wined3d_private.h.

1573{
1577};
@ WINED3D_PIPELINE_COMPUTE
@ WINED3D_PIPELINE_COUNT

◆ 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 

Definition at line 3527 of file wined3d_private.h.

3528{
3535};
@ WINED3D_PUSH_CONSTANTS_PS_B
@ WINED3D_PUSH_CONSTANTS_VS_B
@ WINED3D_PUSH_CONSTANTS_VS_I
@ WINED3D_PUSH_CONSTANTS_PS_F
@ WINED3D_PUSH_CONSTANTS_PS_I
@ WINED3D_PUSH_CONSTANTS_VS_F

◆ wined3d_query_state

Enumerator
QUERY_CREATED 
QUERY_SIGNALLED 
QUERY_BUILDING 

Definition at line 1723 of file wined3d_private.h.

1724{
1728};
@ QUERY_BUILDING
@ QUERY_SIGNALLED
@ QUERY_CREATED

◆ wined3d_shader_conditional_op

Enumerator
WINED3D_SHADER_CONDITIONAL_OP_NZ 
WINED3D_SHADER_CONDITIONAL_OP_Z 

Definition at line 640 of file wined3d_private.h.

641{
644};
@ 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 556 of file wined3d_private.h.

557{
562};
@ 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 579 of file wined3d_private.h.

580{
584};
@ 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 1129 of file wined3d_private.h.

1130{
1153};
@ 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_EVAL_SAMPLE_INDEX 
WINED3DSIH_ELSE 
WINED3DSIH_EMIT 
WINED3DSIH_EMIT_STREAM 
WINED3DSIH_ENDIF 
WINED3DSIH_ENDLOOP 
WINED3DSIH_ENDREP 
WINED3DSIH_ENDSWITCH 
WINED3DSIH_EQ 
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 687 of file wined3d_private.h.

688{
928};
@ 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_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 564 of file wined3d_private.h.

565{
566 WINED3DSIM_NONE = 0,
574};
@ 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 

Definition at line 457 of file wined3d_private.h.

458{
459 WINED3DSPR_TEMP = 0,
462 WINED3DSPR_ADDR = 3,
476 WINED3DSPR_LOOP = 15,
479 WINED3DSPR_LABEL = 18,
509};
@ WINED3DSPR_CONSTBOOL
@ WINED3DSPR_RESOURCE
@ WINED3DSPR_COLOROUT
@ 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_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 630 of file wined3d_private.h.

631{
638};
@ 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 418 of file wined3d_private.h.

419{
431};
@ 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 532 of file wined3d_private.h.

533{
535 WINED3DSPSM_NEG = 1,
541 WINED3DSPSM_X2 = 7,
543 WINED3DSPSM_DZ = 9,
544 WINED3DSPSM_DW = 10,
545 WINED3DSPSM_ABS = 11,
547 WINED3DSPSM_NOT = 13,
548};
@ 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 

Definition at line 586 of file wined3d_private.h.

587{
590};
@ WINED3DSSF_THREAD_GROUP
@ WINED3DSSF_GROUP_SHARED_MEMORY

◆ wined3d_shader_tex_types

Enumerator
WINED3D_SHADER_TEX_2D 
WINED3D_SHADER_TEX_3D 
WINED3D_SHADER_TEX_CUBE 

Definition at line 1340 of file wined3d_private.h.

1341{
1345};
@ WINED3D_SHADER_TEX_3D
@ WINED3D_SHADER_TEX_2D
@ WINED3D_SHADER_TEX_CUBE

◆ wined3d_shader_type

Enumerator
WINED3D_SHADER_TYPE_PIXEL 
WINED3D_SHADER_TYPE_VERTEX 
WINED3D_SHADER_TYPE_GEOMETRY 
WINED3D_SHADER_TYPE_HULL 
WINED3D_SHADER_TYPE_DOMAIN 
WINED3D_SHADER_TYPE_GRAPHICS_COUNT 
WINED3D_SHADER_TYPE_COMPUTE 
WINED3D_SHADER_TYPE_COUNT 

Definition at line 930 of file wined3d_private.h.

◆ wined3d_shader_uav_flags

Enumerator
WINED3DSUF_GLOBALLY_COHERENT 
WINED3DSUF_ORDER_PRESERVING_COUNTER 

Definition at line 592 of file wined3d_private.h.

593{
596};
@ WINED3DSUF_ORDER_PRESERVING_COUNTER
@ WINED3DSUF_GLOBALLY_COHERENT

◆ wined3d_tessellator_domain

Enumerator
WINED3D_TESSELLATOR_DOMAIN_LINE 
WINED3D_TESSELLATOR_DOMAIN_TRIANGLE 
WINED3D_TESSELLATOR_DOMAIN_QUAD 

Definition at line 598 of file wined3d_private.h.

599{
603};
@ 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 605 of file wined3d_private.h.

606{
611};
@ 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 613 of file wined3d_private.h.

Function Documentation

◆ adapter_adjust_memory()

UINT64 adapter_adjust_memory ( struct wined3d_adapter adapter,
INT64  amount 
)

Definition at line 441 of file directx.c.

442{
443 adapter->vram_bytes_used += amount;
444 TRACE("Adjusted used adapter memory by 0x%s to 0x%s.\n",
445 wine_dbgstr_longlong(amount),
446 wine_dbgstr_longlong(adapter->vram_bytes_used));
447 return adapter->vram_bytes_used;
448}
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:49
return adapter
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by resource_cleanup(), and resource_init().

◆ add_ffp_frag_shader()

void add_ffp_frag_shader ( struct wine_rb_tree shaders,
struct ffp_frag_desc desc 
)

Definition at line 6083 of file utils.c.

6084{
6085 /* Note that the key is the implementation independent part of the ffp_frag_desc structure,
6086 * whereas desc points to an extended structure with implementation specific parts. */
6087 if (wine_rb_put(shaders, &desc->settings, &desc->entry) == -1)
6088 {
6089 ERR("Failed to insert ffp frag shader.\n");
6090 }
6091}
#define ERR(fmt,...)
Definition: debug.h:110
const GLuint * shaders
Definition: glext.h:7538
static const WCHAR desc[]
Definition: protectdata.c:36
static int wine_rb_put(struct wine_rb_tree *tree, const void *key, struct wine_rb_entry *entry)
Definition: rbtree.h:215

Referenced by fragment_prog_arbfp(), set_tex_op_atifs(), and shader_glsl_find_ffp_fragment_shader().

◆ apply_pixelshader()

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

Definition at line 3759 of file state.c.

3760{
3761 unsigned int i;
3762
3763 if (use_ps(state))
3764 {
3765 if (!context->last_was_pshader)
3766 {
3767 /* Former draw without a pixel shader, some samplers may be
3768 * disabled because of WINED3D_TSS_COLOR_OP = WINED3DTOP_DISABLE
3769 * make sure to enable them. */
3770 for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i)
3771 {
3774 }
3775 context->last_was_pshader = TRUE;
3776 }
3777 else
3778 {
3779 /* Otherwise all samplers were activated by the code above in
3780 * earlier draws, or by sampler() if a different texture was
3781 * bound. I don't have to do anything. */
3782 }
3783 }
3784 else
3785 {
3786 /* Disabled the pixel shader - color ops weren't applied while it was
3787 * enabled, so re-apply them. */
3788 for (i = 0; i < context->d3d_info->limits.ffp_blend_stages; ++i)
3789 {
3792 }
3793 context->last_was_pshader = FALSE;
3794 }
3795
3796 context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_PIXEL;
3797}
static int state
Definition: maze.c:121
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GLuint sampler
Definition: glext.h:7283
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
Definition: http.c:7252
@ WINED3D_TSS_COLOR_OP
Definition: wined3d.h:575
static void context_apply_state(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
#define MAX_FRAGMENT_SAMPLERS
#define STATE_SAMPLER(num)
static BOOL use_ps(const struct wined3d_state *state)
#define STATE_TEXTURESTAGE(stage, num)
static BOOL isStateDirty(const struct wined3d_context *context, DWORD state)

◆ buffer_from_resource()

◆ can_use_texture_swizzle()

static BOOL can_use_texture_swizzle ( const struct wined3d_gl_info gl_info,
const struct wined3d_format format 
)
inlinestatic

Definition at line 4456 of file wined3d_private.h.

4457{
4458 return gl_info->supported[ARB_TEXTURE_SWIZZLE] && !is_complex_fixup(format->color_fixup)
4459 && !is_scaling_fixup(format->color_fixup);
4460}
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
BOOL supported[WINED3D_GL_EXT_COUNT]
@ ARB_TEXTURE_SWIZZLE
Definition: wined3d_gl.h:130
static BOOL is_scaling_fixup(struct color_fixup_desc fixup)
static BOOL is_complex_fixup(struct color_fixup_desc fixup)

Referenced by find_ps_compile_args(), gen_ffp_frag_op(), wined3d_cs_exec_set_texture(), and wined3d_texture_bind().

◆ clipplane()

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

Definition at line 3836 of file state.c.

3837{
3838 const struct wined3d_gl_info *gl_info = context->gl_info;
3839 UINT index = state_id - STATE_CLIPPLANE(0);
3840 GLdouble plane[4];
3841
3842 if (isStateDirty(context, STATE_TRANSFORM(WINED3D_TS_VIEW)) || index >= gl_info->limits.user_clip_distances)
3843 return;
3844
3845 gl_info->gl_ops.gl.p_glMatrixMode(GL_MODELVIEW);
3846 gl_info->gl_ops.gl.p_glPushMatrix();
3847
3848 /* Clip Plane settings are affected by the model view in OpenGL, the View transform in direct3d */
3849 if (!use_vs(state))
3850 gl_info->gl_ops.gl.p_glLoadMatrixf(&state->transforms[WINED3D_TS_VIEW]._11);
3851 else
3852 /* With vertex shaders, clip planes are not transformed in Direct3D,
3853 * while in OpenGL they are still transformed by the model view matrix. */
3854 gl_info->gl_ops.gl.p_glLoadIdentity();
3855
3856 plane[0] = state->clip_planes[index].x;
3857 plane[1] = state->clip_planes[index].y;
3858 plane[2] = state->clip_planes[index].z;
3859 plane[3] = state->clip_planes[index].w;
3860
3861 TRACE("Clipplane [%.8e, %.8e, %.8e, %.8e]\n",
3862 plane[0], plane[1], plane[2], plane[3]);
3863 gl_info->gl_ops.gl.p_glClipPlane(GL_CLIP_PLANE0 + index, plane);
3864 checkGLcall("glClipPlane");
3865
3866 gl_info->gl_ops.gl.p_glPopMatrix();
3867}
#define index(s, c)
Definition: various.h:29
#define GL_CLIP_PLANE0
Definition: gl.h:346
double GLdouble
Definition: gl.h:163
#define GL_MODELVIEW
Definition: gl.h:245
GLuint index
Definition: glext.h:6031
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
unsigned int UINT
Definition: ndis.h:50
struct opengl_funcs gl_ops
struct wined3d_gl_limits limits
@ WINED3D_TS_VIEW
Definition: wined3d.h:648
#define STATE_CLIPPLANE(a)
#define STATE_TRANSFORM(a)
static BOOL use_vs(const struct wined3d_state *state)
#define checkGLcall(A)

Referenced by glsl_vertex_pipe_vdecl(), glsl_vertex_pipe_view(), transform_view(), and vertexdeclaration().

◆ compile_state_table()

HRESULT compile_state_table ( struct StateEntry StateTable,
APPLYSTATEFUNC **  dev_multistate_funcs,
const struct wined3d_gl_info gl_info,
const struct wined3d_d3d_info d3d_info,
const struct wined3d_vertex_pipe_ops vertex,
const struct fragment_pipeline fragment,
const struct StateEntryTemplate misc 
)

Definition at line 6142 of file state.c.

6146{
6147 unsigned int i, type, handlers;
6148 APPLYSTATEFUNC multistate_funcs[STATE_HIGHEST + 1][3];
6149 const struct StateEntryTemplate *cur;
6150 BOOL set[STATE_HIGHEST + 1];
6151
6152 memset(multistate_funcs, 0, sizeof(multistate_funcs));
6153
6154 for(i = 0; i < STATE_HIGHEST + 1; i++) {
6155 StateTable[i].representative = 0;
6156 StateTable[i].apply = state_undefined;
6157 }
6158
6159 for(type = 0; type < 3; type++) {
6160 /* This switch decides the order in which the states are applied */
6161 switch(type) {
6162 case 0: cur = misc; break;
6163 case 1: cur = fragment->states; break;
6164 case 2: cur = vertex->vp_states; break;
6165 default: cur = NULL; /* Stupid compiler */
6166 }
6167 if(!cur) continue;
6168
6169 /* GL extension filtering should not prevent multiple handlers being applied from different
6170 * pipeline parts
6171 */
6172 memset(set, 0, sizeof(set));
6173
6174 for(i = 0; cur[i].state; i++) {
6175 APPLYSTATEFUNC *funcs_array;
6176
6177 /* Only use the first matching state with the available extension from one template.
6178 * e.g.
6179 * {D3DRS_FOOBAR, {D3DRS_FOOBAR, func1}, XYZ_FANCY},
6180 * {D3DRS_FOOBAR, {D3DRS_FOOBAR, func2}, 0 }
6181 *
6182 * if GL_XYZ_fancy is supported, ignore the 2nd line
6183 */
6184 if(set[cur[i].state]) continue;
6185 /* Skip state lines depending on unsupported extensions */
6186 if (!gl_info->supported[cur[i].extension]) continue;
6187 set[cur[i].state] = TRUE;
6188 /* In some cases having an extension means that nothing has to be
6189 * done for a state, e.g. if GL_ARB_texture_non_power_of_two is
6190 * supported, the texture coordinate fixup can be ignored. If the
6191 * apply function is used, mark the state set(done above) to prevent
6192 * applying later lines, but do not record anything in the state
6193 * table
6194 */
6195 if (!cur[i].content.representative) continue;
6196
6197 handlers = num_handlers(multistate_funcs[cur[i].state]);
6198 multistate_funcs[cur[i].state][handlers] = cur[i].content.apply;
6199 switch(handlers) {
6200 case 0:
6201 StateTable[cur[i].state].apply = cur[i].content.apply;
6202 break;
6203 case 1:
6204 StateTable[cur[i].state].apply = multistate_apply_2;
6205 if (!(dev_multistate_funcs[cur[i].state] = heap_calloc(2, sizeof(**dev_multistate_funcs))))
6206 goto out_of_mem;
6207
6208 dev_multistate_funcs[cur[i].state][0] = multistate_funcs[cur[i].state][0];
6209 dev_multistate_funcs[cur[i].state][1] = multistate_funcs[cur[i].state][1];
6210 break;
6211 case 2:
6212 StateTable[cur[i].state].apply = multistate_apply_3;
6213 if (!(funcs_array = heap_realloc(dev_multistate_funcs[cur[i].state],
6214 sizeof(**dev_multistate_funcs) * 3)))
6215 goto out_of_mem;
6216
6217 dev_multistate_funcs[cur[i].state] = funcs_array;
6218 dev_multistate_funcs[cur[i].state][2] = multistate_funcs[cur[i].state][2];
6219 break;
6220 default:
6221 ERR("Unexpected amount of state handlers for state %u: %u\n",
6222 cur[i].state, handlers + 1);
6223 }
6224
6225 if (StateTable[cur[i].state].representative
6226 && StateTable[cur[i].state].representative != cur[i].content.representative)
6227 {
6228 FIXME("State %s (%#x) has different representatives in different pipeline parts.\n",
6230 }
6231 StateTable[cur[i].state].representative = cur[i].content.representative;
6232 }
6233 }
6234
6235 prune_invalid_states(StateTable, gl_info, d3d_info);
6236 validate_state_table(StateTable);
6237
6238 return WINED3D_OK;
6239
6240out_of_mem:
6241 for (i = 0; i <= STATE_HIGHEST; ++i)
6242 {
6243 heap_free(dev_multistate_funcs[i]);
6244 }
6245
6246 memset(dev_multistate_funcs, 0, (STATE_HIGHEST + 1)*sizeof(*dev_multistate_funcs));
6247
6248 return E_OUTOFMEMORY;
6249}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:71
#define FIXME(fmt,...)
Definition: debug.h:111
Definition: _set.h:50
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define NULL
Definition: types.h:112
static void validate_state_table(struct StateEntry *state_table)
Definition: state.c:6040
static void multistate_apply_2(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: state.c:5997
static void state_undefined(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: state.c:168
static void multistate_apply_3(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: state.c:6003
static void prune_invalid_states(struct StateEntry *state_table, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info)
Definition: state.c:6010
static unsigned int num_handlers(const APPLYSTATEFUNC *funcs)
Definition: state.c:5990
const char * debug_d3dstate(DWORD state)
Definition: utils.c:4676
content
Definition: atl_ax.c:994
static xmlCharEncodingHandlerPtr * handlers
Definition: encoding.c:1317
unsigned int BOOL
Definition: ntddk_ex.h:94
FxCollectionEntry * cur
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static void * heap_calloc(SIZE_T count, SIZE_T size)
Definition: heap.h:49
#define memset(x, y, z)
Definition: compat.h:39
APPLYSTATEFUNC apply
DWORD representative
const struct StateEntryTemplate * states
Definition: mesh.c:4558
#define WINED3D_OK
Definition: wined3d.h:37
#define STATE_HIGHEST
void(* APPLYSTATEFUNC)(struct wined3d_context *ctx, const struct wined3d_state *state, DWORD state_id)

Referenced by device_init().

◆ context_acquire()

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

Definition at line 4242 of file context.c.

4244{
4245 struct wined3d_context *current_context = context_get_current();
4246 struct wined3d_context *context;
4247 BOOL swapchain_texture;
4248
4249 TRACE("device %p, texture %p, sub_resource_idx %u.\n", device, texture, sub_resource_idx);
4250
4252
4253 if (current_context && current_context->destroyed)
4254 current_context = NULL;
4255
4256 swapchain_texture = texture && texture->swapchain;
4257 if (!texture)
4258 {
4259 if (current_context
4260 && current_context->current_rt.texture
4261 && current_context->device == device)
4262 {
4263 texture = current_context->current_rt.texture;
4264 sub_resource_idx = current_context->current_rt.sub_resource_idx;
4265 }
4266 else
4267 {
4268 struct wined3d_swapchain *swapchain = device->swapchains[0];
4269
4270 if (swapchain->back_buffers)
4271 texture = swapchain->back_buffers[0];
4272 else
4273 texture = swapchain->front_buffer;
4274 sub_resource_idx = 0;
4275 }
4276 }
4277
4278 if (current_context && current_context->current_rt.texture == texture)
4279 {
4280 context = current_context;
4281 }
4282 else if (swapchain_texture)
4283 {
4284 TRACE("Rendering onscreen.\n");
4285
4287 }
4288 else
4289 {
4290 TRACE("Rendering offscreen.\n");
4291
4292 /* Stay with the current context if possible. Otherwise use the
4293 * context for the primary swapchain. */
4294 if (current_context && current_context->device == device)
4295 context = current_context;
4296 else
4297 context = swapchain_get_context(device->swapchains[0]);
4298 }
4299
4300 context_activate(context, texture, sub_resource_idx);
4301
4302 return context;
4303}
static void context_activate(struct wined3d_context *context, struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: context.c:4222
struct wined3d_context * context_get_current(void)
Definition: context.c:1507
GLenum GLuint texture
Definition: glext.h:6295
Definition: devices.h:37
struct wined3d_device * device
struct wined3d_context::@286 current_rt
unsigned int sub_resource_idx
struct wined3d_texture ** back_buffers
struct wined3d_context ** context
struct wined3d_texture * front_buffer
struct wined3d_context * swapchain_get_context(struct wined3d_swapchain *swapchain)
Definition: swapchain.c:1092
static void wined3d_from_cs(const struct wined3d_cs *cs)

Referenced by buffer_resource_preload(), buffer_unload(), context_reacquire(), context_restore(), create_texture_view(), device_clear_render_targets(), dispatch_compute(), draw_primitive(), fb_copy_to_texture_direct(), fb_copy_to_texture_hwstretch(), read_from_framebuffer(), shader_arb_destroy(), shader_glsl_destroy(), shader_glsl_precompile(), shader_resource_view_generate_mipmaps(), surface_blt_fbo(), surface_convert_format(), surface_cpu_blt(), surface_cpu_blt_colour_fill(), surface_depth_blt_fbo(), surface_load_drawable(), surface_load_fb_texture(), surface_upload_from_surface(), swapchain_gl_frontbuffer_updated(), swapchain_gl_present(), texture2d_cleanup_sub_resources(), texture2d_create_dc(), texture2d_destroy_dc(), texture_resource_preload(), texture_resource_sub_resource_map(), texture_resource_sub_resource_unmap(), wined3d_buffer_copy(), wined3d_buffer_destroy_object(), wined3d_buffer_map(), wined3d_buffer_unmap(), 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_update_sub_resource(), wined3d_device_create_primary_opengl_context_cs(), wined3d_device_delete_opengl_contexts_cs(), wined3d_fence_issue(), wined3d_fence_test(), wined3d_fence_wait(), wined3d_occlusion_query_ops_issue(), wined3d_pipeline_query_ops_issue(), wined3d_rendertarget_view_destroy_object(), wined3d_sampler_cs_init(), wined3d_sampler_destroy_object(), wined3d_shader_resource_view_cs_init(), wined3d_shader_resource_view_destroy_object(), wined3d_so_statistics_query_ops_issue(), wined3d_surface_blt(), wined3d_swapchain_update_swap_interval_cs(), wined3d_texture_cleanup(), wined3d_texture_copy_sysmem_location(), wined3d_texture_unload(), wined3d_texture_unload_gl_texture(), wined3d_texture_update_map_binding(), wined3d_timestamp_query_ops_issue(), wined3d_unordered_access_view_cs_init(), wined3d_unordered_access_view_destroy_object(), and wined3d_unordered_access_view_set_counter().

◆ context_active_texture()

void context_active_texture ( struct wined3d_context context,
const struct wined3d_gl_info gl_info,
unsigned int  unit 
)

Definition at line 2717 of file context.c.

2718{
2720 checkGLcall("glActiveTexture");
2721 context->active_texture = unit;
2722}
#define GL_TEXTURE0
Definition: gl.h:1750
GLAPI void GLAPIENTRY glActiveTexture(GLenum texture)
png_const_structrp png_const_inforp int * unit
Definition: png.h:2159
#define GL_EXTCALL(f)

Referenced by context_create(), create_dummy_textures(), nvrc_colorop(), nvts_bumpenvmat(), sampler(), set_tex_op_atifs(), SetupForBlit(), state_texfactor(), tex_alphaop(), tex_colorop(), tex_coordindex(), transform_texture(), upload_palette(), and wined3d_shader_resource_view_bind().

◆ context_alloc_fence()

void context_alloc_fence ( struct wined3d_context context,
struct wined3d_fence fence 
)

Definition at line 863 of file context.c.

864{
865 const struct wined3d_gl_info *gl_info = context->gl_info;
866
867 if (context->free_fence_count)
868 {
869 fence->object = context->free_fences[--context->free_fence_count];
870 }
871 else
872 {
873 if (gl_info->supported[ARB_SYNC])
874 {
875 /* Using ARB_sync, not much to do here. */
876 fence->object.sync = NULL;
877 TRACE("Allocated sync object in context %p.\n", context);
878 }
879 else if (gl_info->supported[APPLE_FENCE])
880 {
881 GL_EXTCALL(glGenFencesAPPLE(1, &fence->object.id));
882 checkGLcall("glGenFencesAPPLE");
883
884 TRACE("Allocated fence %u in context %p.\n", fence->object.id, context);
885 }
886 else if(gl_info->supported[NV_FENCE])
887 {
888 GL_EXTCALL(glGenFencesNV(1, &fence->object.id));
889 checkGLcall("glGenFencesNV");
890
891 TRACE("Allocated fence %u in context %p.\n", fence->object.id, context);
892 }
893 else
894 {
895 WARN("Fences not supported, not allocating fence.\n");
896 fence->object.id = 0;
897 }
898 }
899
900 fence->context = context;
901 list_add_head(&context->fences, &fence->entry);
902}
static void list_add_head(struct list_entry *head, struct list_entry *entry)
Definition: list.h:76
#define WARN(fmt,...)
Definition: debug.h:112
union wined3d_gl_fence_object object
struct list entry
struct wined3d_context * context
@ APPLE_FENCE
Definition: wined3d_gl.h:40
@ ARB_SYNC
Definition: wined3d_gl.h:105
@ NV_FENCE
Definition: wined3d_gl.h:186

Referenced by wined3d_fence_issue().

◆ context_alloc_occlusion_query()

void context_alloc_occlusion_query ( struct wined3d_context context,
struct wined3d_occlusion_query query 
)

Definition at line 816 of file context.c.

817{
818 const struct wined3d_gl_info *gl_info = context->gl_info;
819
820 if (context->free_occlusion_query_count)
821 {
822 query->id = context->free_occlusion_queries[--context->free_occlusion_query_count];
823 }
824 else
825 {
826 if (gl_info->supported[ARB_OCCLUSION_QUERY])
827 {
828 GL_EXTCALL(glGenQueries(1, &query->id));
829 checkGLcall("glGenQueries");
830
831 TRACE("Allocated occlusion query %u in context %p.\n", query->id, context);
832 }
833 else
834 {
835 WARN("Occlusion queries not supported, not allocating query id.\n");
836 query->id = 0;
837 }
838 }
839
840 query->context = context;
841 list_add_head(&context->occlusion_queries, &query->entry);
842}
@ ARB_OCCLUSION_QUERY
Definition: wined3d_gl.h:86

Referenced by wined3d_occlusion_query_ops_issue().

◆ context_alloc_pipeline_statistics_query()

void context_alloc_pipeline_statistics_query ( struct wined3d_context context,
struct wined3d_pipeline_statistics_query query 
)

Definition at line 1002 of file context.c.

1004{
1005 const struct wined3d_gl_info *gl_info = context->gl_info;
1006
1007 if (context->free_pipeline_statistics_query_count)
1008 {
1009 query->u = context->free_pipeline_statistics_queries[--context->free_pipeline_statistics_query_count];
1010 }
1011 else
1012 {
1013 GL_EXTCALL(glGenQueries(ARRAY_SIZE(query->u.id), query->u.id));
1014 checkGLcall("glGenQueries");
1015 }
1016
1017 query->context = context;
1018 list_add_head(&context->pipeline_statistics_queries, &query->entry);
1019}
#define ARRAY_SIZE(A)
Definition: main.h:33

Referenced by wined3d_pipeline_query_ops_issue().

◆ context_alloc_so_statistics_query()

void context_alloc_so_statistics_query ( struct wined3d_context context,
struct wined3d_so_statistics_query query 
)

Definition at line 961 of file context.c.

963{
964 const struct wined3d_gl_info *gl_info = context->gl_info;
965
966 if (context->free_so_statistics_query_count)
967 {
968 query->u = context->free_so_statistics_queries[--context->free_so_statistics_query_count];
969 }
970 else
971 {
972 GL_EXTCALL(glGenQueries(ARRAY_SIZE(query->u.id), query->u.id));
973 checkGLcall("glGenQueries");
974
975 TRACE("Allocated SO statistics queries %u, %u in context %p.\n",
976 query->u.id[0], query->u.id[1], context);
977 }
978
979 query->context = context;
980 list_add_head(&context->so_statistics_queries, &query->entry);
981}

Referenced by wined3d_so_statistics_query_ops_issue().

◆ context_alloc_timestamp_query()

void context_alloc_timestamp_query ( struct wined3d_context context,
struct wined3d_timestamp_query query 
)

Definition at line 923 of file context.c.

924{
925 const struct wined3d_gl_info *gl_info = context->gl_info;
926
927 if (context->free_timestamp_query_count)
928 {
929 query->id = context->free_timestamp_queries[--context->free_timestamp_query_count];
930 }
931 else
932 {
933 GL_EXTCALL(glGenQueries(1, &query->id));
934 checkGLcall("glGenQueries");
935
936 TRACE("Allocated timestamp query %u in context %p.\n", query->id, context);
937 }
938
939 query->context = context;
940 list_add_head(&context->timestamp_queries, &query->entry);
941}

Referenced by wined3d_timestamp_query_ops_issue().

◆ context_apply_blit_state()

void context_apply_blit_state ( struct wined3d_context context,
const struct wined3d_device device 
)

Definition at line 2981 of file context.c.

2982{
2983 struct wined3d_texture *rt = context->current_rt.texture;
2984 struct wined3d_surface *surface;
2985 DWORD rt_mask, *cur_mask;
2986
2988 {
2989 if (context->render_offscreen)
2990 {
2992
2993 surface = rt->sub_resources[context->current_rt.sub_resource_idx].u.surface;
2994 context_apply_fbo_state_blit(context, GL_FRAMEBUFFER, surface, NULL, rt->resource.draw_binding);
2995 if (rt->resource.format->id != WINED3DFMT_NULL)
2996 rt_mask = 1;
2997 else
2998 rt_mask = 0;
2999 }
3000 else
3001 {
3002 context->current_fbo = NULL;
3005 }
3006 }
3007 else
3008 {
3010 }
3011
3012 cur_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask;
3013
3014 if (rt_mask != *cur_mask)
3015 {
3017 *cur_mask = rt_mask;
3018 }
3019
3021 {
3023 }
3024
3027}
static void context_apply_draw_buffers(struct wined3d_context *context, DWORD rt_mask)
Definition: context.c:2652
void context_check_fbo_status(const struct wined3d_context *context, GLenum target)
Definition: context.c:381
void context_invalidate_state(struct wined3d_context *context, DWORD state)
Definition: context.c:1652
static DWORD context_generate_rt_mask_no_fbo(const struct wined3d_context *context, struct wined3d_texture *rt)
Definition: context.c:2970
static void context_bind_fbo(struct wined3d_context *context, GLenum target, GLuint fbo)
Definition: context.c:53
static void SetupForBlit(const struct wined3d_device *device, struct wined3d_context *context)
Definition: context.c:2458
static DWORD context_generate_rt_mask_from_resource(struct wined3d_resource *resource)
Definition: context.c:420
void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target, struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location)
Definition: context.c:802
void wined3d_texture_load(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
Definition: texture.c:1066
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GL_FRAMEBUFFER
Definition: glext.h:1732
struct wined3d_resource resource
struct wined3d_texture::wined3d_texture_sub_resource sub_resources[1]
@ WINED3DFMT_NULL
Definition: wined3d.h:255
#define ORM_FBO
#define STATE_FRAMEBUFFER

Referenced by arbfp_blitter_blit(), fb_copy_to_texture_direct(), fb_copy_to_texture_hwstretch(), ffp_blitter_blit(), and read_from_framebuffer().

◆ context_apply_clear_state()

BOOL context_apply_clear_state ( struct wined3d_context context,
const struct wined3d_state state,
UINT  rt_count,
const struct wined3d_fb_state fb 
)

Definition at line 3047 of file context.c.

3049{
3050 struct wined3d_rendertarget_view * const *rts = fb->render_targets;
3051 struct wined3d_rendertarget_view *dsv = fb->depth_stencil;
3052 const struct wined3d_gl_info *gl_info = context->gl_info;
3053 DWORD rt_mask = 0, *cur_mask;
3054 unsigned int i;
3055
3056 if (isStateDirty(context, STATE_FRAMEBUFFER) || fb != state->fb
3057 || rt_count != gl_info->limits.buffers)
3058 {
3059 if (!have_framebuffer_attachment(rt_count, rts, dsv))
3060 {
3061 WARN("Invalid render target config, need at least one attachment.\n");
3062 return FALSE;
3063 }
3064
3066 {
3068
3069 if (!rt_count || wined3d_resource_is_offscreen(rts[0]->resource))
3070 {
3071 memset(context->blit_targets, 0, sizeof(context->blit_targets));
3072 for (i = 0; i < rt_count; ++i)
3073 {
3074 if (rts[i])
3075 {
3076 context->blit_targets[i].gl_view = rts[i]->gl_view;
3077 context->blit_targets[i].resource = rts[i]->resource;
3078 context->blit_targets[i].sub_resource_idx = rts[i]->sub_resource_idx;
3079 context->blit_targets[i].layer_count = rts[i]->layer_count;
3080 }
3081 if (rts[i] && rts[i]->format->id != WINED3DFMT_NULL)
3082 rt_mask |= (1u << i);
3083 }
3086 rt_count ? rts[0]->resource->draw_binding : 0,
3087 dsv ? dsv->resource->draw_binding : 0);
3088 }
3089 else
3090 {
3094 }
3095
3096 /* If the framebuffer is not the device's fb the device's fb has to be reapplied
3097 * next draw. Otherwise we could mark the framebuffer state clean here, once the
3098 * state management allows this */
3100 }
3101 else
3102 {
3105 }
3106 }
3108 && (!rt_count || wined3d_resource_is_offscreen(rts[0]->resource)))
3109 {
3110 for (i = 0; i < rt_count; ++i)
3111 {
3112 if (rts[i] && rts[i]->format->id != WINED3DFMT_NULL)
3113 rt_mask |= (1u << i);
3114 }
3115 }
3116 else
3117 {
3120 }
3121
3122 cur_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask;
3123
3124 if (rt_mask != *cur_mask)
3125 {
3127 *cur_mask = rt_mask;
3129 }
3130
3132 {
3134 }
3135
3136 context->last_was_blit = FALSE;
3137
3138 /* Blending and clearing should be orthogonal, but tests on the nvidia
3139 * driver show that disabling blending when clearing improves the clearing
3140 * performance incredibly. */
3141 gl_info->gl_ops.gl.p_glDisable(GL_BLEND);
3142 gl_info->gl_ops.gl.p_glEnable(GL_SCISSOR_TEST);
3143 if (rt_count && gl_info->supported[ARB_FRAMEBUFFER_SRGB])
3144 {
3145 if (needs_srgb_write(context, state, fb))
3146 gl_info->gl_ops.gl.p_glEnable(GL_FRAMEBUFFER_SRGB);
3147 else
3148 gl_info->gl_ops.gl.p_glDisable(GL_FRAMEBUFFER_SRGB);
3150 }
3151 checkGLcall("setting up state for clear");
3152
3156
3157 return TRUE;
3158}
static void context_apply_fbo_state(struct wined3d_context *context, GLenum target, struct wined3d_rendertarget_info *render_targets, struct wined3d_surface *depth_stencil, DWORD color_location, DWORD ds_location)
Definition: context.c:763
static void context_validate_onscreen_formats(struct wined3d_context *context, const struct wined3d_rendertarget_view *depth_stencil)
Definition: context.c:2931
static BOOL have_framebuffer_attachment(unsigned int rt_count, struct wined3d_rendertarget_view *const *rts, const struct wined3d_rendertarget_view *ds)
Definition: context.c:3029
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource)
Definition: resource.c:547
#define GL_BLEND
Definition: gl.h:371
#define GL_SCISSOR_TEST
Definition: gl.h:589
#define GL_FRAMEBUFFER_SRGB
Definition: glext.h:1758
struct wined3d_rendertarget_view * depth_stencil
struct wined3d_rendertarget_view * render_targets[MAX_RENDER_TARGET_VIEWS]
struct wined3d_resource * resource
struct wined3d_gl_view gl_view
@ WINED3D_RS_SCISSORTESTENABLE
Definition: wined3d.h:358
@ WINED3D_RS_SRGBWRITEENABLE
Definition: wined3d.h:377
@ WINED3D_RS_ALPHABLENDENABLE
Definition: wined3d.h:286
@ ARB_FRAMEBUFFER_SRGB
Definition: wined3d_gl.h:74
static struct wined3d_surface * wined3d_rendertarget_view_get_surface(const struct wined3d_rendertarget_view *view)
#define STATE_SCISSORRECT
static BOOL needs_srgb_write(const struct wined3d_context *context, const struct wined3d_state *state, const struct wined3d_fb_state *fb)
#define WINED3D_LOCATION_DRAWABLE
#define STATE_RENDER(a)

Referenced by device_clear_render_targets().

◆ context_apply_fbo_state_blit()

void context_apply_fbo_state_blit ( struct wined3d_context context,
GLenum  target,
struct wined3d_surface render_target,
struct wined3d_surface depth_stencil,
DWORD  location 
)

Definition at line 802 of file context.c.

804{
805 memset(context->blit_targets, 0, sizeof(context->blit_targets));
806 if (render_target)
807 {
808 context->blit_targets[0].resource = &render_target->container->resource;
809 context->blit_targets[0].sub_resource_idx = surface_get_sub_resource_idx(render_target);
810 context->blit_targets[0].layer_count = 1;
811 }
812 context_apply_fbo_state(context, target, context->blit_targets, depth_stencil, location, location);
813}
GLenum target
Definition: glext.h:7315
struct wined3d_texture * container
static unsigned int surface_get_sub_resource_idx(const struct wined3d_surface *surface)

Referenced by arbfp_blitter_blit(), context_apply_blit_state(), ffp_blitter_blit(), read_from_framebuffer(), surface_blt_fbo(), and surface_depth_blt_fbo().

◆ context_apply_state()

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

Definition at line 4422 of file wined3d_private.h.

4424{
4425 const struct StateEntry *state_table = context->state_table;
4426 DWORD rep = state_table[state_id].representative;
4427 state_table[rep].apply(context, state, rep);
4428}
static const struct @249 state_table[]

Referenced by apply_pixelshader(), glsl_vertex_pipe_vs(), nvrc_resultarg(), state_alpha_test(), state_blend(), state_zenable(), and vertexdeclaration().

◆ context_bind_bo()

void context_bind_bo ( struct wined3d_context context,
GLenum  binding,
GLuint  name 
)

Definition at line 2724 of file context.c.

2725{
2726 const struct wined3d_gl_info *gl_info = context->gl_info;
2727
2728 if (binding == GL_ELEMENT_ARRAY_BUFFER)
2730
2731 GL_EXTCALL(glBindBuffer(binding, name));
2732}
#define GL_ELEMENT_ARRAY_BUFFER
Definition: glext.h:337
Definition: name.c:39
#define STATE_INDEXBUFFER

Referenced by buffer_bind(), context_copy_bo_address(), context_map_bo_address(), context_unmap_bo_address(), and wined3d_unordered_access_view_clear_uint().

◆ context_bind_dummy_textures()

void context_bind_dummy_textures ( const struct wined3d_device device,
const struct wined3d_context context 
)

Definition at line 1764 of file context.c.

1765{
1766 const struct wined3d_dummy_textures *textures = &context->device->dummy_textures;
1767 const struct wined3d_gl_info *gl_info = context->gl_info;
1768 unsigned int i;
1769
1770 for (i = 0; i < gl_info->limits.combined_samplers; ++i)
1771 {
1773
1774 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, textures->tex_1d);
1775 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, textures->tex_2d);
1776
1777 if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
1778 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_RECTANGLE_ARB, textures->tex_rect);
1779
1780 if (gl_info->supported[EXT_TEXTURE3D])
1781 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_3D, textures->tex_3d);
1782
1783 if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
1784 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP, textures->tex_cube);
1785
1787 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, textures->tex_cube_array);
1788
1789 if (gl_info->supported[EXT_TEXTURE_ARRAY])
1790 {
1791 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, textures->tex_1d_array);
1792 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, textures->tex_2d_array);
1793 }
1795 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, textures->tex_buffer);
1796
1797 if (gl_info->supported[ARB_TEXTURE_MULTISAMPLE])
1798 {
1799 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, textures->tex_2d_ms);
1800 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, textures->tex_2d_ms_array);
1801 }
1802 }
1803
1804 checkGLcall("bind dummy textures");
1805}
#define GL_TEXTURE_CUBE_MAP
Definition: gl.h:1788
#define GL_TEXTURE_3D
Definition: gl.h:1515
#define GL_TEXTURE_2D
Definition: gl.h:645
#define GL_TEXTURE_1D
Definition: gl.h:644
const GLuint * textures
Definition: glext.h:8098
#define GL_TEXTURE_BUFFER
Definition: glext.h:748
#define GL_TEXTURE_1D_ARRAY
Definition: glext.h:533
#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY
Definition: glext.h:1941
#define GL_TEXTURE_2D_MULTISAMPLE
Definition: glext.h:1939
#define GL_TEXTURE_RECTANGLE_ARB
Definition: glext.h:1614
#define GL_TEXTURE_CUBE_MAP_ARRAY
Definition: glext.h:920
#define GL_TEXTURE_2D_ARRAY
Definition: glext.h:535
@ ARB_TEXTURE_BUFFER_OBJECT
Definition: wined3d_gl.h:108
@ ARB_TEXTURE_CUBE_MAP
Definition: wined3d_gl.h:113
@ EXT_TEXTURE3D
Definition: wined3d_gl.h:171
@ ARB_TEXTURE_MULTISAMPLE
Definition: wined3d_gl.h:122
@ ARB_TEXTURE_RECTANGLE
Definition: wined3d_gl.h:125
@ EXT_TEXTURE_ARRAY
Definition: wined3d_gl.h:172
@ ARB_TEXTURE_CUBE_MAP_ARRAY
Definition: wined3d_gl.h:114

Referenced by context_create(), and create_dummy_textures().

◆ context_bind_texture()

void context_bind_texture ( struct wined3d_context context,
GLenum  target,
GLuint  name 
)

Definition at line 2734 of file context.c.

2735{
2736 const struct wined3d_dummy_textures *textures = &context->device->dummy_textures;
2737 const struct wined3d_gl_info *gl_info = context->gl_info;
2738 DWORD unit = context->active_texture;
2739 DWORD old_texture_type = context->texture_type[unit];
2740
2741 if (name)
2742 {
2743 gl_info->gl_ops.gl.p_glBindTexture(target, name);
2744 }
2745 else
2746 {
2747 target = GL_NONE;
2748 }
2749
2750 if (old_texture_type != target)
2751 {
2752 switch (old_texture_type)
2753 {
2754 case GL_NONE:
2755 /* nothing to do */
2756 break;
2757 case GL_TEXTURE_1D:
2758 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D, textures->tex_1d);
2759 checkGLcall("glBindTexture");
2760 break;
2762 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_1D_ARRAY, textures->tex_1d_array);
2763 checkGLcall("glBindTexture");
2764 break;
2765 case GL_TEXTURE_2D:
2766 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, textures->tex_2d);
2767 break;
2769 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_ARRAY, textures->tex_2d_array);
2770 break;
2772 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_RECTANGLE_ARB, textures->tex_rect);
2773 break;
2775 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP, textures->tex_cube);
2776 break;
2778 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_CUBE_MAP_ARRAY, textures->tex_cube_array);
2779 break;
2780 case GL_TEXTURE_3D:
2781 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_3D, textures->tex_3d);
2782 break;
2783 case GL_TEXTURE_BUFFER:
2784 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_BUFFER, textures->tex_buffer);
2785 break;
2787 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, textures->tex_2d_ms);
2788 break;
2790 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, textures->tex_2d_ms_array);
2791 break;
2792 default:
2793 ERR("Unexpected texture target %#x.\n", old_texture_type);
2794 }
2795
2796 context->texture_type[unit] = target;
2797 }
2798
2799 checkGLcall("bind texture");
2800}
#define GL_NONE
Definition: gl.h:465

Referenced by create_buffer_texture(), create_texture_view(), draw_textured_quad(), fb_copy_to_texture_direct(), fb_copy_to_texture_hwstretch(), sampler(), shader_resource_view_bind_and_dirtify(), wined3d_shader_resource_view_bind(), and wined3d_texture_bind().

◆ context_check_fbo_status()

void context_check_fbo_status ( const struct wined3d_context context,
GLenum  target 
)

Definition at line 381 of file context.c.

382{
383 const struct wined3d_gl_info *gl_info = context->gl_info;
385
386 if (!FIXME_ON(d3d))
387 return;
388
389 status = gl_info->fbo_ops.glCheckFramebufferStatus(target);
391 {
392 TRACE("FBO complete.\n");
393 }
394 else
395 {
396 unsigned int i;
397
398 FIXME("FBO status %s (%#x).\n", debug_fbostatus(status), status);
399
400 if (!context->current_fbo)
401 {
402 ERR("FBO 0 is incomplete, driver bug?\n");
403 return;
404 }
405
408
409 for (i = 0; i < gl_info->limits.buffers; ++i)
411 }
412}
static void context_dump_fbo_attachment(const struct wined3d_gl_info *gl_info, GLenum target, GLenum attachment)
Definition: context.c:244
const char * debug_fbostatus(GLenum status)
Definition: utils.c:4774
unsigned int GLenum
Definition: gl.h:150
#define GL_COLOR_ATTACHMENT0
Definition: glext.h:1714
#define GL_FRAMEBUFFER_COMPLETE
Definition: glext.h:1707
#define GL_DEPTH_ATTACHMENT
Definition: glext.h:1730
#define GL_STENCIL_ATTACHMENT
Definition: glext.h:1731
#define FIXME_ON(ch)
Definition: debug.h:407
Definition: ps.c:97
struct wined3d_fbo_ops fbo_ops

Referenced by arbfp_blitter_blit(), context_apply_blit_state(), context_apply_clear_state(), context_apply_draw_state(), ffp_blitter_blit(), read_from_framebuffer(), surface_blt_fbo(), and surface_depth_blt_fbo().

◆ context_copy_bo_address()

void context_copy_bo_address ( struct wined3d_context context,
const struct wined3d_bo_address dst,
GLenum  dst_binding,
const struct wined3d_bo_address src,
GLenum  src_binding,
size_t  size 
)

Definition at line 2846 of file context.c.

2849{
2850 const struct wined3d_gl_info *gl_info;
2851 BYTE *dst_ptr, *src_ptr;
2852
2853 gl_info = context->gl_info;
2854
2855 if (dst->buffer_object && src->buffer_object)
2856 {
2857 if (gl_info->supported[ARB_COPY_BUFFER])
2858 {
2859 GL_EXTCALL(glBindBuffer(GL_COPY_READ_BUFFER, src->buffer_object));
2860 GL_EXTCALL(glBindBuffer(GL_COPY_WRITE_BUFFER, dst->buffer_object));
2862 (GLintptr)src->addr, (GLintptr)dst->addr, size));
2863 checkGLcall("direct buffer copy");
2864 }
2865 else
2866 {
2867 src_ptr = context_map_bo_address(context, src, size, src_binding, WINED3D_MAP_READ);
2868 dst_ptr = context_map_bo_address(context, dst, size, dst_binding, WINED3D_MAP_WRITE);
2869
2870 memcpy(dst_ptr, src_ptr, size);
2871
2872 context_unmap_bo_address(context, dst, dst_binding);
2873 context_unmap_bo_address(context, src, src_binding);
2874 }
2875 }
2876 else if (!dst->buffer_object && src->buffer_object)
2877 {
2878 context_bind_bo(context, src_binding, src->buffer_object);
2879 GL_EXTCALL(glGetBufferSubData(src_binding, (GLintptr)src->addr, size, dst->addr));
2880 checkGLcall("buffer download");
2881 }
2882 else if (dst->buffer_object && !src->buffer_object)
2883 {
2884 context_bind_bo(context, dst_binding, dst->buffer_object);
2885 GL_EXTCALL(glBufferSubData(dst_binding, (GLintptr)dst->addr, size, src->addr));
2886 checkGLcall("buffer upload");
2887 }
2888 else
2889 {
2890 memcpy(dst->addr, src->addr, size);
2891 }
2892}
void context_bind_bo(struct wined3d_context *context, GLenum binding, GLuint name)
Definition: context.c:2724
void context_unmap_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *data, GLenum binding)
Definition: context.c:2831
void * context_map_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *data, size_t size, GLenum binding, DWORD flags)
Definition: context.c:2802
GLsizeiptr size
Definition: glext.h:5919
#define GL_COPY_WRITE_BUFFER
Definition: glext.h:1889
GLenum src
Definition: glext.h:6340
ptrdiff_t GLintptr
Definition: glext.h:5498
GLenum GLenum dst
Definition: glext.h:6340
#define GL_COPY_READ_BUFFER
Definition: glext.h:1887
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define WINED3D_MAP_READ
Definition: wined3d.h:939
#define WINED3D_MAP_WRITE
Definition: wined3d.h:938
@ ARB_COPY_BUFFER
Definition: wined3d_gl.h:53
unsigned char BYTE
Definition: xxhash.c:193

Referenced by wined3d_buffer_copy(), and wined3d_unordered_access_view_copy_counter().

◆ context_create()

struct wined3d_context * context_create ( struct wined3d_swapchain swapchain,
struct wined3d_texture target,
const struct wined3d_format ds_format 
)

Definition at line 1891 of file context.c.

1893{
1894 struct wined3d_device *device = swapchain->device;
1895 const struct wined3d_d3d_info *d3d_info = &device->adapter->d3d_info;
1896 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
1897 const struct wined3d_format *color_format;
1898 struct wined3d_context *ret;
1899 BOOL auxBuffers = FALSE;
1900 HGLRC ctx, share_ctx;
1901 DWORD target_usage;
1902 unsigned int i;
1903 DWORD state;
1904
1905 TRACE("swapchain %p, target %p, window %p.\n", swapchain, target, swapchain->win_handle);
1906
1908
1909 if (!(ret = heap_alloc_zero(sizeof(*ret))))
1910 return NULL;
1911
1912 ret->free_timestamp_query_size = 4;
1913 if (!(ret->free_timestamp_queries = heap_calloc(ret->free_timestamp_query_size,
1914 sizeof(*ret->free_timestamp_queries))))
1915 goto out;
1916 list_init(&ret->timestamp_queries);
1917
1918 ret->free_occlusion_query_size = 4;
1919 if (!(ret->free_occlusion_queries = heap_calloc(ret->free_occlusion_query_size,
1920 sizeof(*ret->free_occlusion_queries))))
1921 goto out;
1922 list_init(&ret->occlusion_queries);
1923
1924 ret->free_fence_size = 4;
1925 if (!(ret->free_fences = heap_calloc(ret->free_fence_size, sizeof(*ret->free_fences))))
1926 goto out;
1927 list_init(&ret->fences);
1928
1929 list_init(&ret->so_statistics_queries);
1930
1931 list_init(&ret->pipeline_statistics_queries);
1932
1933 list_init(&ret->fbo_list);
1934 list_init(&ret->fbo_destroy_list);
1935
1936 if (!device->shader_backend->shader_allocate_context_data(ret))
1937 {
1938 ERR("Failed to allocate shader backend context data.\n");
1939 goto out;
1940 }
1941 if (!device->adapter->fragment_pipe->allocate_context_data(ret))
1942 {
1943 ERR("Failed to allocate fragment pipeline context data.\n");
1944 goto out;
1945 }
1946
1947 for (i = 0; i < ARRAY_SIZE(ret->tex_unit_map); ++i)
1948 ret->tex_unit_map[i] = WINED3D_UNMAPPED_STAGE;
1949 for (i = 0; i < ARRAY_SIZE(ret->rev_tex_unit_map); ++i)
1950 ret->rev_tex_unit_map[i] = WINED3D_UNMAPPED_STAGE;
1951 if (gl_info->limits.graphics_samplers >= MAX_COMBINED_SAMPLERS)
1952 {
1953 /* Initialize the texture unit mapping to a 1:1 mapping. */
1954 unsigned int base, count;
1955
1957 if (base + MAX_FRAGMENT_SAMPLERS > ARRAY_SIZE(ret->rev_tex_unit_map))
1958 {
1959 ERR("Unexpected texture unit base index %u.\n", base);
1960 goto out;
1961 }
1962 for (i = 0; i < min(count, MAX_FRAGMENT_SAMPLERS); ++i)
1963 {
1964 ret->tex_unit_map[i] = base + i;
1965 ret->rev_tex_unit_map[base + i] = i;
1966 }
1967
1969 if (base + MAX_VERTEX_SAMPLERS > ARRAY_SIZE(ret->rev_tex_unit_map))
1970 {
1971 ERR("Unexpected texture unit base index %u.\n", base);
1972 goto out;
1973 }
1974 for (i = 0; i < min(count, MAX_VERTEX_SAMPLERS); ++i)
1975 {
1976 ret->tex_unit_map[MAX_FRAGMENT_SAMPLERS + i] = base + i;
1977 ret->rev_tex_unit_map[base + i] = MAX_FRAGMENT_SAMPLERS + i;
1978 }
1979 }
1980
1981 if (!(ret->texture_type = heap_calloc(gl_info->limits.combined_samplers,
1982 sizeof(*ret->texture_type))))
1983 goto out;
1984
1985 if (!(ret->hdc = GetDCEx(swapchain->win_handle, 0, DCX_USESTYLE | DCX_CACHE)))
1986 {
1987 WARN("Failed to retrieve device context, trying swapchain backup.\n");
1988
1990 ret->hdc_is_private = TRUE;
1991 else
1992 {
1993 ERR("Failed to retrieve a device context.\n");
1994 goto out;
1995 }
1996 }
1997
1998 color_format = target->resource.format;
1999 target_usage = target->resource.usage;
2000
2001 /* In case of ORM_BACKBUFFER, make sure to request an alpha component for
2002 * X4R4G4B4/X8R8G8B8 as we might need it for the backbuffer. */
2004 {
2005 auxBuffers = TRUE;
2006
2007 if (color_format->id == WINED3DFMT_B4G4R4X4_UNORM)
2008 color_format = wined3d_get_format(gl_info, WINED3DFMT_B4G4R4A4_UNORM, target_usage);
2009 else if (color_format->id == WINED3DFMT_B8G8R8X8_UNORM)
2010 color_format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM, target_usage);
2011 }
2012
2013 /* DirectDraw supports 8bit paletted render targets and these are used by
2014 * old games like StarCraft and C&C. Most modern hardware doesn't support
2015 * 8bit natively so we perform some form of 8bit -> 32bit conversion. The
2016 * conversion (ab)uses the alpha component for storing the palette index.
2017 * For this reason we require a format with 8bit alpha, so request
2018 * A8R8G8B8. */
2019 if (color_format->id == WINED3DFMT_P8_UINT)
2020 color_format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM, target_usage);
2021
2022 /* When using FBOs for off-screen rendering, we only use the drawable for
2023 * presentation blits, and don't do any rendering to it. That means we
2024 * don't need depth or stencil buffers, and can mostly ignore the render
2025 * target format. This wouldn't necessarily be quite correct for 10bpc
2026 * display modes, but we don't currently support those.
2027 * Using the same format regardless of the color/depth/stencil targets
2028 * makes it much less likely that different wined3d instances will set
2029 * conflicting pixel formats. */
2031 {
2032 color_format = wined3d_get_format(gl_info, WINED3DFMT_B8G8R8A8_UNORM, target_usage);
2034 }
2035
2036 /* Try to find a pixel format which matches our requirements. */
2037 if (!(ret->pixel_format = context_choose_pixel_format(device, ret->hdc, color_format, ds_format, auxBuffers)))
2038 goto out;
2039
2040 ret->gl_info = gl_info;
2041 ret->win_handle = swapchain->win_handle;
2042
2044
2046 {
2047 ERR("Failed to set pixel format %d on device context %p.\n", ret->pixel_format, ret->hdc);
2049 goto out;
2050 }
2051
2052 share_ctx = device->context_count ? device->contexts[0]->glCtx : NULL;
2053 if (gl_info->p_wglCreateContextAttribsARB)
2054 {
2055 if (!(ctx = context_create_wgl_attribs(gl_info, ret->hdc, share_ctx)))
2056 goto out;
2057 }
2058 else
2059 {
2060 if (!(ctx = wglCreateContext(ret->hdc)))
2061 {
2062 ERR("Failed to create a WGL context.\n");
2064 goto out;
2065 }
2066
2067 if (share_ctx && !wglShareLists(share_ctx, ctx))
2068 {
2069 ERR("wglShareLists(%p, %p) failed, last error %#x.\n", share_ctx, ctx, GetLastError());
2071 if (!wglDeleteContext(ctx))
2072 ERR("wglDeleteContext(%p) failed, last error %#x.\n", ctx, GetLastError());
2073 goto out;
2074 }
2075 }
2076
2078 {
2079 ERR("Failed to add the newly created context to the context list\n");
2081 if (!wglDeleteContext(ctx))
2082 ERR("wglDeleteContext(%p) failed, last error %#x.\n", ctx, GetLastError());
2083 goto out;
2084 }
2085
2086 ret->d3d_info = d3d_info;
2087 ret->state_table = device->StateTable;
2088
2089 /* Mark all states dirty to force a proper initialization of the states on
2090 * the first use of the context. Compute states do not need initialization. */
2091 for (state = 0; state <= STATE_HIGHEST; ++state)
2092 {
2093 if (ret->state_table[state].representative && !STATE_IS_COMPUTE(state))
2095 }
2096
2097 ret->device = device;
2098 ret->swapchain = swapchain;
2099 ret->current_rt.texture = target;
2100 ret->current_rt.sub_resource_idx = 0;
2101 ret->tid = GetCurrentThreadId();
2102
2103 ret->render_offscreen = wined3d_resource_is_offscreen(&target->resource);
2104 ret->draw_buffers_mask = context_generate_rt_mask(GL_BACK);
2105 ret->valid = 1;
2106
2107 ret->glCtx = ctx;
2108 ret->hdc_has_format = TRUE;
2109 ret->needs_set = 1;
2110
2111 /* Set up the context defaults */
2113 {
2114 ERR("Cannot activate context to set up defaults.\n");
2117 if (!wglDeleteContext(ctx))
2118 ERR("wglDeleteContext(%p) failed, last error %#x.\n", ctx, GetLastError());
2119 goto out;
2120 }
2121
2123 {
2124 GL_EXTCALL(glDebugMessageCallback(wined3d_debug_callback, ret));
2125 if (TRACE_ON(d3d_synchronous))
2126 gl_info->gl_ops.gl.p_glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
2127 GL_EXTCALL(glDebugMessageControl(GL_DONT_CARE, GL_DONT_CARE, GL_DONT_CARE, 0, NULL, GL_FALSE));
2128 if (ERR_ON(d3d))
2129 {
2130 GL_EXTCALL(glDebugMessageControl(GL_DONT_CARE, GL_DEBUG_TYPE_ERROR,
2131 GL_DONT_CARE, 0, NULL, GL_TRUE));
2132 }
2133 if (FIXME_ON(d3d))
2134 {
2136 GL_DONT_CARE, 0, NULL, GL_TRUE));
2138 GL_DONT_CARE, 0, NULL, GL_TRUE));
2139 GL_EXTCALL(glDebugMessageControl(GL_DONT_CARE, GL_DEBUG_TYPE_PORTABILITY,
2140 GL_DONT_CARE, 0, NULL, GL_TRUE));
2141 }
2142 if (WARN_ON(d3d_perf))
2143 {
2144 GL_EXTCALL(glDebugMessageControl(GL_DONT_CARE, GL_DEBUG_TYPE_PERFORMANCE,
2145 GL_DONT_CARE, 0, NULL, GL_TRUE));
2146 }
2147 }
2148
2149 if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
2150 gl_info->gl_ops.gl.p_glGetIntegerv(GL_AUX_BUFFERS, &ret->aux_buffers);
2151
2152 TRACE("Setting up the screen\n");
2153
2154 if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
2155 {
2156 gl_info->gl_ops.gl.p_glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);
2157 checkGLcall("glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);");
2158
2159 gl_info->gl_ops.gl.p_glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
2160 checkGLcall("glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);");
2161
2163 checkGLcall("glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);");
2164 }
2165 else
2166 {
2167 GLuint vao;
2168
2169 GL_EXTCALL(glGenVertexArrays(1, &vao));
2170 GL_EXTCALL(glBindVertexArray(vao));
2171 checkGLcall("creating VAO");
2172 }
2173
2174 gl_info->gl_ops.gl.p_glPixelStorei(GL_PACK_ALIGNMENT, device->surface_alignment);
2175 checkGLcall("glPixelStorei(GL_PACK_ALIGNMENT, device->surface_alignment);");
2176 gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
2177 checkGLcall("glPixelStorei(GL_UNPACK_ALIGNMENT, 1);");
2178
2179 if (gl_info->supported[ARB_VERTEX_BLEND])
2180 {
2181 /* Direct3D always uses n-1 weights for n world matrices and uses
2182 * 1 - sum for the last one this is equal to GL_WEIGHT_SUM_UNITY_ARB.
2183 * Enabling it doesn't do anything unless GL_VERTEX_BLEND_ARB isn't
2184 * enabled as well. */
2185 gl_info->gl_ops.gl.p_glEnable(GL_WEIGHT_SUM_UNITY_ARB);
2186 checkGLcall("glEnable(GL_WEIGHT_SUM_UNITY_ARB)");
2187 }
2188 if (gl_info->supported[NV_TEXTURE_SHADER2])
2189 {
2190 /* Set up the previous texture input for all shader units. This applies to bump mapping, and in d3d
2191 * the previous texture where to source the offset from is always unit - 1.
2192 */
2193 for (i = 1; i < gl_info->limits.textures; ++i)
2194 {
2196 gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_SHADER_NV,
2198 checkGLcall("glTexEnvi(GL_TEXTURE_SHADER_NV, GL_PREVIOUS_TEXTURE_INPUT_NV, ...");
2199 }
2200 }
2201 if (gl_info->supported[ARB_FRAGMENT_PROGRAM])
2202 {
2203 /* MacOS(radeon X1600 at least, but most likely others too) refuses to draw if GLSL and ARBFP are
2204 * enabled, but the currently bound arbfp program is 0. Enabling ARBFP with prog 0 is invalid, but
2205 * GLSL should bypass this. This causes problems in programs that never use the fixed function pipeline,
2206 * because the ARBFP extension is enabled by the ARBFP pipeline at context creation, but no program
2207 * is ever assigned.
2208 *
2209 * So make sure a program is assigned to each context. The first real ARBFP use will set a different
2210 * program and the dummy program is destroyed when the context is destroyed.
2211 */
2212 static const char dummy_program[] =
2213 "!!ARBfp1.0\n"
2214 "MOV result.color, fragment.color.primary;\n"
2215 "END\n";
2216 GL_EXTCALL(glGenProgramsARB(1, &ret->dummy_arbfp_prog));
2217 GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, ret->dummy_arbfp_prog));
2218 GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(dummy_program), dummy_program));
2219 }
2220
2221 if (gl_info->supported[ARB_POINT_SPRITE])
2222 {
2223 for (i = 0; i < gl_info->limits.textures; ++i)
2224 {
2226 gl_info->gl_ops.gl.p_glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE);
2227 checkGLcall("glTexEnvi(GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE)");
2228 }
2229 }
2230
2231 if (gl_info->supported[ARB_PROVOKING_VERTEX])
2232 {
2233 GL_EXTCALL(glProvokingVertex(GL_FIRST_VERTEX_CONVENTION));
2234 }
2235 else if (gl_info->supported[EXT_PROVOKING_VERTEX])
2236 {
2237 GL_EXTCALL(glProvokingVertexEXT(GL_FIRST_VERTEX_CONVENTION_EXT));
2238 }
2239 if (!(d3d_info->wined3d_creation_flags & WINED3D_NO_PRIMITIVE_RESTART))
2240 {
2241 if (gl_info->supported[ARB_ES3_COMPATIBILITY])
2242 {
2243 gl_info->gl_ops.gl.p_glEnable(GL_PRIMITIVE_RESTART_FIXED_INDEX);
2244 checkGLcall("enable GL_PRIMITIVE_RESTART_FIXED_INDEX");
2245 }
2246 else
2247 {
2248 FIXME("OpenGL implementation does not support GL_PRIMITIVE_RESTART_FIXED_INDEX.\n");
2249 }
2250 }
2251 if (!(d3d_info->wined3d_creation_flags & WINED3D_LEGACY_CUBEMAP_FILTERING)
2252 && gl_info->supported[ARB_SEAMLESS_CUBE_MAP])
2253 {
2254 gl_info->gl_ops.gl.p_glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
2255 checkGLcall("enable seamless cube map filtering");
2256 }
2257 if (gl_info->supported[ARB_CLIP_CONTROL])
2259 device->shader_backend->shader_init_context_state(ret);
2260 ret->shader_update_mask = (1u << WINED3D_SHADER_TYPE_PIXEL)
2263 | (1u << WINED3D_SHADER_TYPE_HULL)
2266
2267 /* If this happens to be the first context for the device, dummy textures
2268 * are not created yet. In that case, they will be created (and bound) by
2269 * create_dummy_textures right after this context is initialized. */
2270 if (device->dummy_textures.tex_2d)
2272
2273 TRACE("Created context %p.\n", ret);
2274
2275 return ret;
2276
2277out:
2278 if (ret->hdc)
2279 wined3d_release_dc(swapchain->win_handle, ret->hdc);
2280 device->shader_backend->shader_free_context_data(ret);
2281 device->adapter->fragment_pipe->free_context_data(ret);
2282 heap_free(ret->texture_type);
2283 heap_free(ret->free_fences);
2284 heap_free(ret->free_occlusion_queries);
2285 heap_free(ret->free_timestamp_queries);
2286 heap_free(ret);
2287 return NULL;
2288}
#define DCX_USESTYLE
Definition: GetDCEx.c:10
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static void list_init(struct list_entry *head)
Definition: list.h:51
static int context_choose_pixel_format(const struct wined3d_device *device, HDC hdc, const struct wined3d_format *color_format, const struct wined3d_format *ds_format, BOOL auxBuffers)
Definition: context.c:1667
static void context_enter(struct wined3d_context *context)
Definition: context.c:1619
void context_active_texture(struct wined3d_context *context, const struct wined3d_gl_info *gl_info, unsigned int unit)
Definition: context.c:2717
static BOOL context_set_pixel_format(struct wined3d_context *context)
Definition: context.c:1161
BOOL context_set_current(struct wined3d_context *ctx)
Definition: context.c:1512
static BOOL context_debug_output_enabled(const struct wined3d_gl_info *gl_info)
Definition: context.c:1826
static void WINE_GLAPI wined3d_debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char *message, void *ctx)
Definition: context.c:1832
static DWORD context_generate_rt_mask(GLenum buffer)
Definition: context.c:414
void context_bind_dummy_textures(const struct wined3d_device *device, const struct wined3d_context *context)
Definition: context.c:1764
HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, HGLRC share_ctx)
Definition: context.c:1857
void context_release(struct wined3d_context *context)
Definition: context.c:1571
BOOL device_context_add(struct wined3d_device *device, struct wined3d_context *context)
Definition: device.c:146
void device_context_remove(struct wined3d_device *device, struct wined3d_context *context)
Definition: device.c:163
void wined3d_release_dc(HWND window, HDC dc)
Definition: utils.c:6444
const struct wined3d_format * wined3d_get_format(const struct wined3d_gl_info *gl_info, enum wined3d_format_id format_id, unsigned int resource_usage)
Definition: utils.c:3831
void wined3d_gl_limits_get_texture_unit_range(const struct wined3d_gl_limits *gl_limits, enum wined3d_shader_type shader_type, unsigned int *base, unsigned int *count)
Definition: utils.c:6498
#define TRACE_ON(x)
Definition: compat.h:75
#define GL_TRUE
Definition: gl.h:174
#define GL_AUX_BUFFERS
Definition: gl.h:492
#define GL_PACK_ALIGNMENT
Definition: gl.h:626
#define GL_TEXTURE0_ARB
Definition: gl.h:1966
#define GL_BACK
Definition: gl.h:271
unsigned int GLuint
Definition: gl.h:159
#define GL_TEXTURE_ENV
Definition: gl.h:642
#define GL_LIGHT_MODEL_LOCAL_VIEWER
Definition: gl.h:334
#define GL_UNPACK_ALIGNMENT
Definition: gl.h:632
#define GL_TEXTURE_ENV_MODE
Definition: gl.h:643
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define GL_DONT_CARE
Definition: gl.h:583
#define GL_FALSE
Definition: gl.h:173
#define GL_LIGHT_MODEL_COLOR_CONTROL
Definition: gl.h:1498
#define GL_SEPARATE_SPECULAR_COLOR
Definition: gl.h:1500
#define GL_POINT_SPRITE_ARB
Definition: glext.h:1586
#define GL_COMBINE_EXT
Definition: glext.h:3229
#define GL_PROGRAM_FORMAT_ASCII_ARB
Definition: glext.h:1405
#define GL_FRAGMENT_PROGRAM_ARB
Definition: glext.h:1466
#define GL_TEXTURE_SHADER_NV
Definition: glext.h:3685
#define GL_TEXTURE_CUBE_MAP_SEAMLESS
Definition: glext.h:1913
#define GL_FIRST_VERTEX_CONVENTION_EXT
Definition: glext.h:4920
#define GL_WEIGHT_SUM_UNITY_ARB
Definition: glext.h:1270
#define GL_PREVIOUS_TEXTURE_INPUT_NV
Definition: glext.h:3694
#define GL_FIRST_VERTEX_CONVENTION
Definition: glext.h:1907
#define GL_COORD_REPLACE_ARB
Definition: glext.h:1587
#define GL_LOWER_LEFT
Definition: glext.h:461
#define GL_POINT_SPRITE_COORD_ORIGIN
Definition: glext.h:460
if(dx< 0)
Definition: linetemp.h:194
#define WARN_ON(c)
Definition: module.h:257
#define for
Definition: utility.h:88
#define min(a, b)
Definition: monoChain.cc:55
static HGLRC(WINAPI *pwglCreateContextAttribsARB)(HDC hDC
static FILE * out
Definition: regtests2xml.c:44
#define ERR_ON(ch)
Definition: debug.h:412
const struct wined3d_gl_info * gl_info
struct wined3d_swapchain * swapchain
const struct wined3d_d3d_info * d3d_info
enum wined3d_format_id id
struct wined3d_device * device
int ret
BOOL WINAPI wglDeleteContext(HGLRC hglrc)
Definition: wgl.c:514
HGLRC WINAPI wglCreateContext(HDC hdc)
Definition: wgl.c:383
BOOL WINAPI wglShareLists(HGLRC hglrcSrc, HGLRC hglrcDst)
Definition: wgl.c:872
#define GL_DEBUG_TYPE_PORTABILITY
Definition: wgl.h:944
#define GL_PRIMITIVE_RESTART_FIXED_INDEX
Definition: wgl.h:3178
#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR
Definition: wgl.h:928
#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR
Definition: wgl.h:949
#define GL_DEBUG_TYPE_ERROR
Definition: wgl.h:931
#define GL_DEBUG_OUTPUT_SYNCHRONOUS
Definition: wgl.h:893
#define GL_DEBUG_TYPE_PERFORMANCE
Definition: wgl.h:939
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
DWORD WINAPI GetCurrentThreadId(void)
Definition: thread.c:459
HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain)
Definition: swapchain.c:1107
#define WINED3D_NO_PRIMITIVE_RESTART
Definition: wined3d.h:1326
@ WINED3DFMT_B4G4R4A4_UNORM
Definition: wined3d.h:110
@ WINED3DFMT_B8G8R8A8_UNORM
Definition: wined3d.h:223
@ WINED3DFMT_B8G8R8X8_UNORM
Definition: wined3d.h:224
@ WINED3DFMT_UNKNOWN
Definition: wined3d.h:107
@ WINED3DFMT_P8_UINT
Definition: wined3d.h:117
@ WINED3DFMT_B4G4R4X4_UNORM
Definition: wined3d.h:113
#define WINED3D_LEGACY_CUBEMAP_FILTERING
Definition: wined3d.h:1327
#define WINED3DUSAGE_DEPTHSTENCIL
Definition: wined3d.h:900
@ NV_TEXTURE_SHADER2
Definition: wined3d_gl.h:199
@ ARB_SEAMLESS_CUBE_MAP
Definition: wined3d_gl.h:93
@ ARB_FRAGMENT_PROGRAM
Definition: wined3d_gl.h:70
@ ARB_PROVOKING_VERTEX
Definition: wined3d_gl.h:91
@ ARB_VERTEX_BLEND
Definition: wined3d_gl.h:137
@ ARB_ES3_COMPATIBILITY
Definition: wined3d_gl.h:66
@ WINED3D_GL_LEGACY_CONTEXT
Definition: wined3d_gl.h:213
@ ARB_CLIP_CONTROL
Definition: wined3d_gl.h:49
@ ARB_POINT_SPRITE
Definition: wined3d_gl.h:90
@ EXT_PROVOKING_VERTEX
Definition: wined3d_gl.h:167
#define MAX_VERTEX_SAMPLERS
#define STATE_IS_COMPUTE(a)
#define ORM_BACKBUFFER
#define MAX_COMBINED_SAMPLERS
#define WINED3D_UNMAPPED_STAGE
#define DCX_CACHE
Definition: winuser.h:2114
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)

Referenced by swapchain_create_context(), and wined3d_swapchain_cs_init().

◆ context_create_wgl_attribs()

HGLRC context_create_wgl_attribs ( const struct wined3d_gl_info gl_info,
HDC  hdc,
HGLRC  share_ctx 
)

Definition at line 1857 of file context.c.

1858{
1859 HGLRC ctx;
1860 unsigned int ctx_attrib_idx = 0;
1861 GLint ctx_attribs[7], ctx_flags = 0;
1862
1863 if (context_debug_output_enabled(gl_info))
1864 ctx_flags = WGL_CONTEXT_DEBUG_BIT_ARB;
1865 ctx_attribs[ctx_attrib_idx++] = WGL_CONTEXT_MAJOR_VERSION_ARB;
1866 ctx_attribs[ctx_attrib_idx++] = gl_info->selected_gl_version >> 16;
1867 ctx_attribs[ctx_attrib_idx++] = WGL_CONTEXT_MINOR_VERSION_ARB;
1868 ctx_attribs[ctx_attrib_idx++] = gl_info->selected_gl_version & 0xffff;
1869 if (gl_info->selected_gl_version >= MAKEDWORD_VERSION(3, 2))
1871 if (ctx_flags)
1872 {
1873 ctx_attribs[ctx_attrib_idx++] = WGL_CONTEXT_FLAGS_ARB;
1874 ctx_attribs[ctx_attrib_idx++] = ctx_flags;
1875 }
1876 ctx_attribs[ctx_attrib_idx] = 0;
1877
1878 if (!(ctx = gl_info->p_wglCreateContextAttribsARB(hdc, share_ctx, ctx_attribs)))
1879 {
1881 {
1882 ctx_attribs[ctx_attrib_idx - 1] &= ~WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
1883 if (!(ctx = gl_info->p_wglCreateContextAttribsARB(hdc, share_ctx, ctx_attribs)))
1884 WARN("Failed to create a WGL context with wglCreateContextAttribsARB, last error %#x.\n",
1885 GetLastError());
1886 }
1887 }
1888 return ctx;
1889}
int GLint
Definition: gl.h:156
HDC hdc
Definition: main.c:9
#define WGL_CONTEXT_MINOR_VERSION_ARB
Definition: wgl.h:5009
#define WGL_CONTEXT_MAJOR_VERSION_ARB
Definition: wgl.h:5008
#define WGL_CONTEXT_DEBUG_BIT_ARB
Definition: wgl.h:5003
#define WGL_CONTEXT_FLAGS_ARB
Definition: wgl.h:5005
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
Definition: wgl.h:5006
#define MAKEDWORD_VERSION(maj, min)

Referenced by context_create(), and wined3d_caps_gl_ctx_create_attribs().

◆ context_destroy()

void context_destroy ( struct wined3d_device device,
struct wined3d_context context 
)

Definition at line 2290 of file context.c.

2291{
2292 BOOL destroy;
2293
2294 TRACE("Destroying ctx %p\n", context);
2295
2297
2298 /* We delay destroying a context when it is active. The context_release()
2299 * function invokes context_destroy() again while leaving the last level. */
2300 if (context->level)
2301 {
2302 TRACE("Delaying destruction of context %p.\n", context);
2303 context->destroy_delayed = 1;
2304 /* FIXME: Get rid of a pointer to swapchain from wined3d_context. */
2305 context->swapchain = NULL;
2306 return;
2307 }
2308
2309 if (context->tid == GetCurrentThreadId() || !context->current)
2310 {
2313 destroy = TRUE;
2314 }
2315 else
2316 {
2317 /* Make a copy of gl_info for context_destroy_gl_resources use, the one
2318 in wined3d_adapter may go away in the meantime */
2319 struct wined3d_gl_info *gl_info = heap_alloc(sizeof(*gl_info));
2320 *gl_info = *context->gl_info;
2321 context->gl_info = gl_info;
2322 context->destroyed = 1;
2323 destroy = FALSE;
2324 }
2325
2326 device->shader_backend->shader_free_context_data(context);
2327 device->adapter->fragment_pipe->free_context_data(context);
2328 heap_free(context->texture_type);
2330 if (destroy)
2332}
void destroy(_Tp *__pointer)
Definition: _construct.h:278
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static DWORD wined3d_context_tls_idx
Definition: context.c:48
static void context_destroy_gl_resources(struct wined3d_context *context)
Definition: context.c:1332
BOOL WINAPI TlsSetValue(IN DWORD Index, IN LPVOID Value)
Definition: thread.c:1276

Referenced by context_release(), swapchain_create_context(), swapchain_destroy_contexts(), and wined3d_device_delete_opengl_contexts_cs().

◆ context_enable_clip_distances()

void context_enable_clip_distances ( struct wined3d_context context,
unsigned int  mask 
)

Definition at line 2414 of file context.c.

2415{
2416 const struct wined3d_gl_info *gl_info = context->gl_info;
2417 unsigned int clip_distance_count = gl_info->limits.user_clip_distances;
2418 unsigned int i, disable_mask, current_mask;
2419
2420 disable_mask = ~enable_mask;
2421 enable_mask &= (1u << clip_distance_count) - 1;
2422 disable_mask &= (1u << clip_distance_count) - 1;
2423 current_mask = context->clip_distance_mask;
2424 context->clip_distance_mask = enable_mask;
2425
2426 enable_mask &= ~current_mask;
2427 while (enable_mask)
2428 {
2429 i = wined3d_bit_scan(&enable_mask);
2430 gl_info->gl_ops.gl.p_glEnable(GL_CLIP_DISTANCE0 + i);
2431 }
2432 disable_mask &= current_mask;
2433 while (disable_mask)
2434 {
2435 i = wined3d_bit_scan(&disable_mask);
2436 gl_info->gl_ops.gl.p_glDisable(GL_CLIP_DISTANCE0 + i);
2437 }
2438 checkGLcall("toggle clip distances");
2439}
#define GL_CLIP_DISTANCE0
Definition: glext.h:506
static int wined3d_bit_scan(unsigned int *x)

Referenced by SetupForBlit(), shader_glsl_select(), state_clipping(), and vertexdeclaration().

◆ context_end_transform_feedback()

void context_end_transform_feedback ( struct wined3d_context context)

Definition at line 4127 of file context.c.

4128{
4129 const struct wined3d_gl_info *gl_info = context->gl_info;
4130 if (context->transform_feedback_active)
4131 {
4132 GL_EXTCALL(glEndTransformFeedback());
4133 checkGLcall("glEndTransformFeedback");
4134 context->transform_feedback_active = 0;
4135 context->transform_feedback_paused = 0;
4136 }
4137}

Referenced by buffer_destroy_buffer_object(), context_pause_transform_feedback(), and state_so().

◆ context_free_fence()

void context_free_fence ( struct wined3d_fence fence)

Definition at line 904 of file context.c.

905{
906 struct wined3d_context *context = fence->context;
907
908 list_remove(&fence->entry);
909 fence->context = NULL;
910
911 if (!wined3d_array_reserve((void **)&context->free_fences,
912 &context->free_fence_size, context->free_fence_count + 1,
913 sizeof(*context->free_fences)))
914 {
915 ERR("Failed to grow free list, leaking fence %u in context %p.\n", fence->object.id, context);
916 return;
917 }
918
919 context->free_fences[context->free_fence_count++] = fence->object;
920}
static void list_remove(struct list_entry *entry)
Definition: list.h:90
BOOL wined3d_array_reserve(void **elements, SIZE_T *capacity, SIZE_T count, SIZE_T size)
Definition: utils.c:6526

Referenced by wined3d_fence_free(), and wined3d_fence_issue().

◆ context_free_occlusion_query()

void context_free_occlusion_query ( struct wined3d_occlusion_query query)

Definition at line 844 of file context.c.

845{
846 struct wined3d_context *context = query->context;
847
848 list_remove(&query->entry);
849 query->context = NULL;
850
851 if (!wined3d_array_reserve((void **)&context->free_occlusion_queries,
852 &context->free_occlusion_query_size, context->free_occlusion_query_count + 1,
853 sizeof(*context->free_occlusion_queries)))
854 {
855 ERR("Failed to grow free list, leaking query %u in context %p.\n", query->id, context);
856 return;
857 }
858
859 context->free_occlusion_queries[context->free_occlusion_query_count++] = query->id;
860}

Referenced by wined3d_occlusion_query_ops_destroy(), and wined3d_occlusion_query_ops_issue().

◆ context_free_pipeline_statistics_query()

void context_free_pipeline_statistics_query ( struct wined3d_pipeline_statistics_query query)

Definition at line 1021 of file context.c.

1022{
1023 struct wined3d_context *context = query->context;
1024
1025 list_remove(&query->entry);
1026 query->context = NULL;
1027
1028 if (!wined3d_array_reserve((void **)&context->free_pipeline_statistics_queries,
1029 &context->free_pipeline_statistics_query_size, context->free_pipeline_statistics_query_count + 1,
1030 sizeof(*context->free_pipeline_statistics_queries)))
1031 {
1032 ERR("Failed to grow free list, leaking GL queries in context %p.\n", context);
1033 return;
1034 }
1035
1036 context->free_pipeline_statistics_queries[context->free_pipeline_statistics_query_count++] = query->u;
1037}

Referenced by wined3d_pipeline_query_ops_destroy(), and wined3d_pipeline_query_ops_issue().

◆ context_free_so_statistics_query()

void context_free_so_statistics_query ( struct wined3d_so_statistics_query query)

Definition at line 983 of file context.c.

984{
985 struct wined3d_context *context = query->context;
986
987 list_remove(&query->entry);
988 query->context = NULL;
989
990 if (!wined3d_array_reserve((void **)&context->free_so_statistics_queries,
991 &context->free_so_statistics_query_size, context->free_so_statistics_query_count + 1,
992 sizeof(*context->free_so_statistics_queries)))
993 {
994 ERR("Failed to grow free list, leaking GL queries %u, %u in context %p.\n",
995 query->u.id[0], query->u.id[1], context);
996 return;
997 }
998
999 context->free_so_statistics_queries[context->free_so_statistics_query_count++] = query->u;
1000}

Referenced by wined3d_so_statistics_query_ops_destroy(), and wined3d_so_statistics_query_ops_issue().

◆ context_free_timestamp_query()

void context_free_timestamp_query ( struct wined3d_timestamp_query query)

Definition at line 943 of file context.c.

944{
945 struct wined3d_context *context = query->context;
946
947 list_remove(&query->entry);
948 query->context = NULL;
949
950 if (!wined3d_array_reserve((void **)&context->free_timestamp_queries,
951 &context->free_timestamp_query_size, context->free_timestamp_query_count + 1,
952 sizeof(*context->free_timestamp_queries)))
953 {
954 ERR("Failed to grow free list, leaking query %u in context %p.\n", query->id, context);
955 return;
956 }
957
958 context->free_timestamp_queries[context->free_timestamp_query_count++] = query->id;
959}

Referenced by wined3d_timestamp_query_ops_destroy(), and wined3d_timestamp_query_ops_issue().

◆ context_get_current()

◆ context_get_offscreen_gl_buffer()

GLenum context_get_offscreen_gl_buffer ( const struct wined3d_context context)

Definition at line 2954 of file context.c.

2955{
2957 {
2958 case ORM_FBO:
2959 return GL_COLOR_ATTACHMENT0;
2960
2961 case ORM_BACKBUFFER:
2962 return context->aux_buffers > 0 ? GL_AUX0 : GL_BACK;
2963
2964 default:
2965 FIXME("Unhandled offscreen rendering mode %#x.\n", wined3d_settings.offscreen_rendering_mode);
2966 return GL_BACK;
2967 }
2968}
#define GL_AUX0
Definition: gl.h:475

Referenced by context_generate_rt_mask_no_fbo(), fb_copy_to_texture_direct(), fb_copy_to_texture_hwstretch(), read_from_framebuffer(), and surface_load_fb_texture().

◆ context_get_rt_surface()

static struct wined3d_surface * context_get_rt_surface ( const struct wined3d_context context)
inlinestatic

Definition at line 4522 of file wined3d_private.h.

4523{
4524 struct wined3d_texture *texture = context->current_rt.texture;
4525
4526 if (!texture)
4527 return NULL;
4528 return texture->sub_resources[context->current_rt.sub_resource_idx].u.surface;
4529}

Referenced by read_from_framebuffer(), surface_blt_fbo(), surface_load_drawable(), and surface_load_fb_texture().

◆ context_get_tex_unit_mapping()

const DWORD * context_get_tex_unit_mapping ( const struct wined3d_context context,
const struct wined3d_shader_version shader_version,
unsigned int base,
unsigned int count 
)

Definition at line 2334 of file context.c.

2336{
2337 const struct wined3d_gl_info *gl_info = context->gl_info;
2338
2339 if (!shader_version)
2340 {
2341 *base = 0;
2343 return context->tex_unit_map;
2344 }
2345
2346 if (shader_version->major >= 4)
2347 {
2348 wined3d_gl_limits_get_texture_unit_range(&gl_info->limits, shader_version->type, base, count);
2349 return NULL;
2350 }
2351
2352 switch (shader_version->type)
2353 {
2355 *base = 0;
2357 break;
2361 break;
2362 default:
2363 ERR("Unhandled shader type %#x.\n", shader_version->type);
2364 *base = 0;
2365 *count = 0;
2366 }
2367
2368 return context->tex_unit_map;
2369}
enum wined3d_shader_type type
#define MAX_TEXTURES

Referenced by context_bind_shader_resources(), shader_glsl_load_samplers(), and shader_glsl_map_tex_unit().

◆ context_get_tls_idx()

DWORD context_get_tls_idx ( void  )

Definition at line 1497 of file context.c.

1498{
1500}

Referenced by wined3d_dll_destroy().

◆ context_gl_resource_released()

void context_gl_resource_released ( struct wined3d_device device,
GLuint  name,
BOOL  rb_namespace 
)

Definition at line 1104 of file context.c.

1106{
1108}
static void context_queue_fbo_entry_destruction(struct wined3d_context *context, struct fbo_entry *entry)
Definition: context.c:1067
static void context_enum_fbo_entries(const struct wined3d_device *device, GLuint name, BOOL rb_namespace, context_fbo_entry_func_t *callback)
Definition: context.c:1041

Referenced by gltexture_delete(), texture2d_cleanup_sub_resources(), wined3d_rendertarget_view_destroy_object(), wined3d_texture_unload(), and wined3d_texture_unload_gl_texture().

◆ context_invalidate_compute_state()

void context_invalidate_compute_state ( struct wined3d_context context,
DWORD  state_id 
)

Definition at line 1642 of file context.c.

1643{
1644 DWORD representative = context->state_table[state_id].representative - STATE_COMPUTE_OFFSET;
1645 unsigned int index, shift;
1646
1647 index = representative / (sizeof(*context->dirty_compute_states) * CHAR_BIT);
1648 shift = representative & (sizeof(*context->dirty_compute_states) * CHAR_BIT - 1);
1649 context->dirty_compute_states[index] |= (1u << shift);
1650}
#define CHAR_BIT
Definition: urlcache.c:62
#define shift
Definition: input.c:1755
#define STATE_COMPUTE_OFFSET

Referenced by create_buffer_texture(), create_texture_view(), device_invalidate_state(), shader_resource_view_bind_and_dirtify(), and wined3d_texture_bind_and_dirtify().

◆ context_invalidate_state()

◆ context_map_bo_address()

void * context_map_bo_address ( struct wined3d_context context,
const struct wined3d_bo_address data,
size_t  size,
GLenum  binding,
DWORD  flags 
)

Definition at line 2802 of file context.c.

2804{
2805 const struct wined3d_gl_info *gl_info;
2806 BYTE *memory;
2807
2808 if (!data->buffer_object)
2809 return data->addr;
2810
2811 gl_info = context->gl_info;
2812 context_bind_bo(context, binding, data->buffer_object);
2813
2814 if (gl_info->supported[ARB_MAP_BUFFER_RANGE])
2815 {
2816 GLbitfield map_flags = wined3d_resource_gl_map_flags(flags) & ~GL_MAP_FLUSH_EXPLICIT_BIT;
2817 memory = GL_EXTCALL(glMapBufferRange(binding, (INT_PTR)data->addr, size, map_flags));
2818 }
2819 else
2820 {
2822 memory += (INT_PTR)data->addr;
2823 }
2824
2825 context_bind_bo(context, binding, 0);
2826 checkGLcall("Map buffer object");
2827
2828 return memory;
2829}
GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags)
Definition: resource.c:532
GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags)
Definition: resource.c:515
unsigned int GLbitfield
Definition: gl.h:152
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLbitfield flags
Definition: glext.h:7161
static char memory[1024 *256]
Definition: process.c:116
int32_t INT_PTR
Definition: typedefs.h:64
@ ARB_MAP_BUFFER_RANGE
Definition: wined3d_gl.h:83

Referenced by context_copy_bo_address(), surface_convert_format(), surface_cpu_blt(), surface_cpu_blt_colour_fill(), surface_load_texture(), texture2d_create_dc(), and texture_resource_sub_resource_map().

◆ context_reacquire()

struct wined3d_context * context_reacquire ( const struct wined3d_device device,
struct wined3d_context context 
)

Definition at line 4305 of file context.c.

4307{
4308 struct wined3d_context *acquired_context;
4309
4311
4312 if (!context || context->tid != GetCurrentThreadId())
4313 return NULL;
4314
4315 if (context->current_rt.texture)
4316 {
4317 context_activate(context, context->current_rt.texture, context->current_rt.sub_resource_idx);
4318 return context;
4319 }
4320
4321 acquired_context = context_acquire(device, NULL, 0);
4322 if (acquired_context != context)
4323 ERR("Acquired context %p instead of %p.\n", acquired_context, context);
4324 return acquired_context;
4325}
struct wined3d_context * context_acquire(const struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: context.c:4242

Referenced by 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_so_statistics_query_ops_issue(), wined3d_so_statistics_query_ops_poll(), and wined3d_timestamp_query_ops_poll().

◆ context_release()

void context_release ( struct wined3d_context context)

Definition at line 1571 of file context.c.

1572{
1573 TRACE("Releasing context %p, level %u.\n", context, context->level);
1574
1575 if (WARN_ON(d3d))
1576 {
1577 if (!context->level)
1578 WARN("Context %p is not active.\n", context);
1579 else if (context != context_get_current())
1580 WARN("Context %p is not the current context.\n", context);
1581 }
1582
1583 if (!--context->level)
1584 {
1586 context->needs_set = 1;
1587 if (context->restore_ctx)
1588 {
1589 TRACE("Restoring GL context %p on device context %p.\n", context->restore_ctx, context->restore_dc);
1590 context_restore_gl_context(context->gl_info, context->restore_dc, context->restore_ctx);
1591 context->restore_ctx = NULL;
1592 context->restore_dc = NULL;
1593 }
1594
1595 if (context->destroy_delayed)
1596 {
1597 TRACE("Destroying context %p.\n", context);
1599 }
1600 }
1601}
void context_destroy(struct wined3d_device *device, struct wined3d_context *context)
Definition: context.c:2290
static void context_restore_gl_context(const struct wined3d_gl_info *gl_info, HDC dc, HGLRC gl_ctx)
Definition: context.c:1295
static BOOL context_restore_pixel_format(struct wined3d_context *ctx)
Definition: context.c:1130

Referenced by buffer_resource_preload(), buffer_unload(), context_create(), context_restore(), create_texture_view(), device_clear_render_targets(), dispatch_compute(), draw_primitive(), fb_copy_to_texture_direct(), fb_copy_to_texture_hwstretch(), shader_arb_destroy(), shader_glsl_destroy(), shader_glsl_precompile(), shader_resource_view_generate_mipmaps(), surface_blt_fbo(), surface_convert_format(), surface_cpu_blt(), surface_cpu_blt_colour_fill(), surface_depth_blt_fbo(), surface_load_texture(), surface_upload_from_surface(), swapchain_create_context(), swapchain_gl_frontbuffer_updated(), swapchain_gl_present(), texture2d_cleanup_sub_resources(), texture2d_create_dc(), texture2d_destroy_dc(), texture_resource_preload(), texture_resource_sub_resource_map(), texture_resource_sub_resource_unmap(), wined3d_buffer_copy(), wined3d_buffer_destroy_object(), wined3d_buffer_map(), wined3d_buffer_unmap(), 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_update_sub_resource(), wined3d_device_create_primary_opengl_context_cs(), wined3d_device_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_rendertarget_view_destroy_object(), wined3d_sampler_cs_init(), wined3d_sampler_destroy_object(), wined3d_shader_resource_view_cs_init(), wined3d_shader_resource_view_destroy_object(), wined3d_so_statistics_query_ops_issue(), wined3d_so_statistics_query_ops_poll(), wined3d_surface_blt(), wined3d_swapchain_cs_init(), wined3d_swapchain_update_swap_interval_cs(), wined3d_texture_cleanup(), wined3d_texture_copy_sysmem_location(), wined3d_texture_unload(), wined3d_texture_unload_gl_texture(), wined3d_texture_update_map_binding(), wined3d_timestamp_query_ops_issue(), wined3d_timestamp_query_ops_poll(), wined3d_unordered_access_view_cs_init(), wined3d_unordered_access_view_destroy_object(), and wined3d_unordered_access_view_set_counter().

◆ context_resource_released()

void context_resource_released ( const struct wined3d_device device,
struct wined3d_resource resource,
enum wined3d_resource_type  type 
)

Definition at line 1073 of file context.c.

1075{
1076 struct wined3d_texture *texture;
1077 UINT i;
1078
1079 if (!device->d3d_initialized)
1080 return;
1081
1082 switch (type)
1083 {
1087
1088 for (i = 0; i < device->context_count; ++i)
1089 {
1090 struct wined3d_context *context = device->contexts[i];
1091 if (context->current_rt.texture == texture)
1092 {
1093 context->current_rt.texture = NULL;
1094 context->current_rt.sub_resource_idx = 0;
1095 }
1096 }
1097 break;
1098
1099 default:
1100 break;
1101 }
1102}
@ WINED3D_RTYPE_TEXTURE_2D
Definition: wined3d.h:700
@ WINED3D_RTYPE_TEXTURE_3D
Definition: wined3d.h:701
static struct wined3d_texture * texture_from_resource(struct wined3d_resource *resource)

Referenced by wined3d_resource_destroy_object().

◆ context_restore()

void context_restore ( struct wined3d_context context,
struct wined3d_surface restore 
)

Definition at line 1606 of file context.c.

1607{
1608 if (context->current_rt.texture != restore->container
1609 || context->current_rt.sub_resource_idx != surface_get_sub_resource_idx(restore))
1610 {
1612 context = context_acquire(restore->container->resource.device,
1613 restore->container, surface_get_sub_resource_idx(restore));
1614 }
1615
1617}

Referenced by read_from_framebuffer(), surface_blt_fbo(), surface_load_drawable(), and surface_load_fb_texture().

◆ context_set_current()

BOOL context_set_current ( struct wined3d_context ctx)

Definition at line 1512 of file context.c.

1513{
1514 struct wined3d_context *old = context_get_current();
1515
1516 if (old == ctx)
1517 {
1518 TRACE("Already using D3D context %p.\n", ctx);
1519 return TRUE;
1520 }
1521
1522 if (old)
1523 {
1524 if (old->destroyed)
1525 {
1526 TRACE("Switching away from destroyed context %p.\n", old);
1528 heap_free((void *)old->gl_info);
1529 heap_free(old);
1530 }
1531 else
1532 {
1534 {
1535 const struct wined3d_gl_info *gl_info = old->gl_info;
1536 TRACE("Flushing context %p before switching to %p.\n", old, ctx);
1537 gl_info->gl_ops.gl.p_glFlush();
1538 }
1539 old->current = 0;
1540 }
1541 }
1542
1543 if (ctx)
1544 {
1545 if (!ctx->valid)
1546 {
1547 ERR("Trying to make invalid context %p current\n", ctx);
1548 return FALSE;
1549 }
1550
1551 TRACE("Switching to D3D context %p, GL context %p, device context %p.\n", ctx, ctx->glCtx, ctx->hdc);
1553 return FALSE;
1554 ctx->current = 1;
1555 }
1556 else if (wglGetCurrentContext())
1557 {
1558 TRACE("Clearing current D3D context.\n");
1559 if (!wglMakeCurrent(NULL, NULL))
1560 {
1562 ERR("Failed to clear current GL context, last error %#x.\n", err);
1564 return FALSE;
1565 }
1566 }
1567
1569}
static BOOL context_set_gl_context(struct wined3d_context *ctx)
Definition: context.c:1234
#define err(...)
HGLRC WINAPI wglGetCurrentContext(void)
Definition: wgl.c:574
BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
Definition: wgl.c:650

Referenced by context_activate(), context_create(), context_restore_gl_context(), context_set_gl_context(), DllMain(), and wined3d_device_uninit_3d().

◆ context_set_draw_buffer()

void context_set_draw_buffer ( struct wined3d_context context,
GLenum  buffer 
)

Definition at line 2701 of file context.c.

2702{
2703 const struct wined3d_gl_info *gl_info = context->gl_info;
2704 DWORD *current_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask;
2706
2707 if (new_mask == *current_mask)
2708 return;
2709
2710 gl_info->gl_ops.gl.p_glDrawBuffer(buffer);
2711 checkGLcall("glDrawBuffer()");
2712
2713 *current_mask = new_mask;
2714}
GLuint buffer
Definition: glext.h:5915

Referenced by arbfp_blitter_blit(), context_apply_fbo_entry(), fb_copy_to_texture_hwstretch(), ffp_blitter_blit(), surface_blt_fbo(), and surface_depth_blt_fbo().

◆ context_set_tls_idx()

void context_set_tls_idx ( DWORD  idx)

Definition at line 1502 of file context.c.

1503{
1505}

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 3479 of file context.c.

3480{
3481 DWORD rt_mask, *cur_mask;
3482
3484
3485 cur_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask;
3487 if (rt_mask != *cur_mask)
3488 {
3490 *cur_mask = rt_mask;
3491 }
3492}
static DWORD find_draw_buffers_mask(const struct wined3d_context *context, const struct wined3d_state *state)
Definition: context.c:3160

◆ context_state_fb()

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

Definition at line 3196 of file context.c.

3197{
3199 const struct wined3d_fb_state *fb = state->fb;
3200 DWORD color_location = 0;
3201 DWORD *cur_mask;
3202
3204 {
3205 if (!context->render_offscreen)
3206 {
3209 }
3210 else
3211 {
3212 unsigned int i;
3213
3214 memset(context->blit_targets, 0, sizeof(context->blit_targets));
3215 for (i = 0; i < context->gl_info->limits.buffers; ++i)
3216 {
3217 if (!fb->render_targets[i])
3218 continue;
3219
3220 context->blit_targets[i].gl_view = fb->render_targets[i]->gl_view;
3221 context->blit_targets[i].resource = fb->render_targets[i]->resource;
3222 context->blit_targets[i].sub_resource_idx = fb->render_targets[i]->sub_resource_idx;
3223 context->blit_targets[i].layer_count = fb->render_targets[i]->layer_count;
3224
3225 if (!color_location)
3226 color_location = fb->render_targets[i]->resource->draw_binding;
3227 }
3230 color_location, fb->depth_stencil ? fb->depth_stencil->resource->draw_binding : 0);
3231 }
3232 }
3233
3234 cur_mask = context->current_fbo ? &context->current_fbo->rt_mask : &context->draw_buffers_mask;
3235 if (rt_mask != *cur_mask)
3236 {
3238 *cur_mask = rt_mask;
3239 }
3240 context->constant_update_mask |= WINED3D_SHADER_CONST_PS_Y_CORR;
3241}
#define WINED3D_SHADER_CONST_PS_Y_CORR

◆ context_surface_update()

void context_surface_update ( struct wined3d_context context,
const struct wined3d_surface surface 
)

Definition at line 1110 of file context.c.

1111{
1112 const struct wined3d_gl_info *gl_info = context->gl_info;
1113 struct fbo_entry *entry = context->current_fbo;
1114 unsigned int i;
1115
1116 if (!entry || context->rebind_fbo) return;
1117
1118 for (i = 0; i < gl_info->limits.buffers + 1; ++i)
1119 {
1120 if (surface->container->texture_rgb.name == entry->key.objects[i].object
1121 || surface->container->texture_srgb.name == entry->key.objects[i].object)
1122 {
1123 TRACE("Updated surface %p is bound as attachment %u to the current FBO.\n", surface, i);
1124 context->rebind_fbo = TRUE;
1125 return;
1126 }
1127 }
1128}
uint32_t entry
Definition: isohybrid.c:63

Referenced by wined3d_surface_upload_data().

◆ context_unmap_bo_address()

void context_unmap_bo_address ( struct wined3d_context context,
const struct wined3d_bo_address data,
GLenum  binding 
)

Definition at line 2831 of file context.c.

2833{
2834 const struct wined3d_gl_info *gl_info;
2835
2836 if (!data->buffer_object)
2837 return;
2838
2839 gl_info = context->gl_info;
2840 context_bind_bo(context, binding, data->buffer_object);
2841 GL_EXTCALL(glUnmapBuffer(binding));
2842 context_bind_bo(context, binding, 0);
2843 checkGLcall("Unmap buffer object");
2844}

Referenced by context_copy_bo_address(), surface_convert_format(), surface_cpu_blt(), surface_cpu_blt_colour_fill(), surface_load_texture(), texture2d_destroy_dc(), and texture_resource_sub_resource_unmap().

◆ create_color_fixup_desc()

static struct color_fixup_desc create_color_fixup_desc ( int  sign0,
enum fixup_channel_source  src0,
int  sign1,
enum fixup_channel_source  src1,
int  sign2,
enum fixup_channel_source  src2,
int  sign3,
enum fixup_channel_source  src3 
)
inlinestatic

Definition at line 205 of file wined3d_private.h.

208{
209 struct color_fixup_desc fixup =
210 {
211 sign0, src0,
212 sign1, src1,
213 sign2, src2,
214 sign3, src3,
215 };
216 return fixup;
217}

Referenced by apply_format_fixups().

◆ create_complex_fixup_desc()

static struct color_fixup_desc create_complex_fixup_desc ( enum complex_fixup  complex_fixup)
inlinestatic

Definition at line 219 of file wined3d_private.h.

220{
221 struct color_fixup_desc fixup =
222 {
227 };
228 return fixup;
229}
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_box()

const char * debug_box ( const struct wined3d_box box)

Definition at line 3939 of file utils.c.

3940{
3941 if (!box)
3942 return "(null)";
3943 return wine_dbg_sprintf("(%u, %u, %u)-(%u, %u, %u)",
3944 box->left, box->top, box->front,
3945 box->right, box->bottom, box->back);
3946}
const char * wine_dbg_sprintf(const char *format,...)
Definition: compat.c:296
Definition: palette.c:468

Referenced by surface_cpu_blt(), surface_cpu_blt_colour_fill(), texture3d_upload_data(), texture_resource_sub_resource_map(), wined3d_cs_exec_blt_sub_resource(), wined3d_device_copy_sub_resource_region(), wined3d_device_update_sub_resource(), wined3d_resource_map(), wined3d_resource_update_info(), wined3d_texture_add_dirty_region(), and wined3d_texture_check_box_dimensions().

◆ debug_color()

const char * debug_color ( const struct wined3d_color color)

Definition at line 3948 of file utils.c.

3949{
3950 if (!color)
3951 return "(null)";
3952 return wine_dbg_sprintf("{%.8e, %.8e, %.8e, %.8e}",
3953 color->r, color->g, color->b, color->a);
3954}
GLuint color
Definition: glext.h:6243

Referenced by state_ambient(), state_specularenable(), surface_cpu_blt_colour_fill(), wined3d_device_clear(), wined3d_device_clear_rendertarget_view(), wined3d_device_get_material(), wined3d_device_set_light(), and wined3d_format_convert_from_float().

◆ debug_d3ddeclmethod()

const char * debug_d3ddeclmethod ( enum wined3d_decl_method  method)

Definition at line 4270 of file utils.c.

4271{
4272 switch (method)
4273 {
4274#define WINED3DDECLMETHOD_TO_STR(u) case u: return #u
4282#undef WINED3DDECLMETHOD_TO_STR
4283 default:
4284 FIXME("Unrecognized declaration method %#x.\n", method);
4285 return "unrecognized";
4286 }
4287}
#define WINED3DDECLMETHOD_TO_STR(u)
method
Definition: dragdrop.c:54
@ WINED3D_DECL_METHOD_LOOKUP
Definition: wined3d.h:780
@ WINED3D_DECL_METHOD_LOOKUP_PRESAMPLED
Definition: wined3d.h:781
@ WINED3D_DECL_METHOD_PARTIAL_V
Definition: wined3d.h:777
@ WINED3D_DECL_METHOD_CROSS_UV
Definition: wined3d.h:778
@ WINED3D_DECL_METHOD_UV
Definition: wined3d.h:779
@ WINED3D_DECL_METHOD_PARTIAL_U
Definition: wined3d.h:776
@ WINED3D_DECL_METHOD_DEFAULT
Definition: wined3d.h:775

Referenced by dump_wined3d_vertex_element().

◆ debug_d3ddeclusage()

const char * debug_d3ddeclusage ( enum wined3d_decl_usage  usage)

Definition at line 4289 of file utils.c.

4290{
4291 switch (usage)
4292 {
4293#define WINED3DDECLUSAGE_TO_STR(u) case u: return #u
4308#undef WINED3DDECLUSAGE_TO_STR
4309 default:
4310 FIXME("Unrecognized %u declaration usage!\n", usage);
4311 return "unrecognized";
4312 }
4313}
#define WINED3DDECLUSAGE_TO_STR(u)
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
@ WINED3D_DECL_USAGE_DEPTH
Definition: wined3d.h:798
@ WINED3D_DECL_USAGE_BLEND_INDICES
Definition: wined3d.h:788
@ WINED3D_DECL_USAGE_TESS_FACTOR
Definition: wined3d.h:794
@ WINED3D_DECL_USAGE_NORMAL
Definition: wined3d.h:789
@ WINED3D_DECL_USAGE_PSIZE
Definition: wined3d.h:790
@ WINED3D_DECL_USAGE_BLEND_WEIGHT
Definition: wined3d.h:787
@ WINED3D_DECL_USAGE_SAMPLE
Definition: wined3d.h:799
@ WINED3D_DECL_USAGE_POSITION
Definition: wined3d.h:786
@ WINED3D_DECL_USAGE_BINORMAL
Definition: wined3d.h:793
@ WINED3D_DECL_USAGE_COLOR
Definition: wined3d.h:796
@ WINED3D_DECL_USAGE_POSITIONT
Definition: wined3d.h:795
@ WINED3D_DECL_USAGE_TEXCOORD
Definition: wined3d.h:791
@ WINED3D_DECL_USAGE_TANGENT
Definition: wined3d.h:792
@ WINED3D_DECL_USAGE_FOG
Definition: wined3d.h:797

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 4153 of file utils.c.

4154{
4155 switch (device_type)
4156 {
4157#define DEVTYPE_TO_STR(dev) case dev: return #dev
4161#undef DEVTYPE_TO_STR
4162 default:
4163 FIXME("Unrecognized device type %#x.\n", device_type);
4164 return "unrecognized";
4165 }
4166}
device_type
#define DEVTYPE_TO_STR(dev)
@ WINED3D_DEVICE_TYPE_SW
Definition: wined3d.h:89
@ WINED3D_DEVICE_TYPE_HAL
Definition: wined3d.h:87
@ WINED3D_DEVICE_TYPE_REF
Definition: wined3d.h:88

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 3980 of file utils.c.

3981{
3982 switch (format_id)
3983 {
3984#define FMT_TO_STR(format_id) case format_id: return #format_id
4135#undef FMT_TO_STR
4136 default:
4137 {
4138 char fourcc[5];
4139 fourcc[0] = (char)(format_id);
4140 fourcc[1] = (char)(format_id >> 8);
4141 fourcc[2] = (char)(format_id >> 16);
4142 fourcc[3] = (char)(format_id >> 24);
4143 fourcc[4] = 0;
4144 if (isprint(fourcc[0]) && isprint(fourcc[1]) && isprint(fourcc[2]) && isprint(fourcc[3]))
4145 FIXME("Unrecognized %#x (as fourcc: %s) WINED3DFORMAT!\n", format_id, fourcc);
4146 else
4147 FIXME("Unrecognized %#x WINED3DFORMAT!\n", format_id);
4148 }
4149 return "unrecognized";
4150 }
4151}
#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:1343
@ WINED3DFMT_R32G32B32_TYPELESS
Definition: wined3d.h:139
@ WINED3DFMT_RESZ
Definition: wined3d.h:254
@ WINED3DFMT_R8_TYPELESS
Definition: wined3d.h:196
@ WINED3DFMT_B2G3R3_UNORM
Definition: wined3d.h:111
@ WINED3DFMT_BC5_UNORM
Definition: wined3d.h:219
@ WINED3DFMT_R32G32B32_SINT
Definition: wined3d.h:142
@ WINED3DFMT_R8G8_UNORM
Definition: wined3d.h:185
@ WINED3DFMT_BC7_TYPELESS
Definition: wined3d.h:232
@ WINED3DFMT_BC7_UNORM_SRGB
Definition: wined3d.h:234
@ WINED3DFMT_R32G32_SINT
Definition: wined3d.h:152
@ WINED3DFMT_X24_TYPELESS_G8_UINT
Definition: wined3d.h:183
@ WINED3DFMT_BC2_UNORM_SRGB
Definition: wined3d.h:211
@ WINED3DFMT_INTZ
Definition: wined3d.h:253
@ WINED3DFMT_R16G16_UINT
Definition: wined3d.h:172
@ WINED3DFMT_R16G16_UNORM
Definition: wined3d.h:171
@ WINED3DFMT_R8G8_TYPELESS
Definition: wined3d.h:184
@ WINED3DFMT_R10G10B10X2_UINT
Definition: wined3d.h:124
@ WINED3DFMT_X8D24_UNORM
Definition: wined3d.h:130
@ WINED3DFMT_BC5_SNORM
Definition: wined3d.h:220
@ WINED3DFMT_R32_SINT
Definition: wined3d.h:179
@ WINED3DFMT_DXT2
Definition: wined3d.h:240
@ WINED3DFMT_D32_FLOAT
Definition: wined3d.h:176
@ WINED3DFMT_R10G10B10A2_UNORM
Definition: wined3d.h:158
@ WINED3DFMT_R8_UINT
Definition: wined3d.h:198
@ WINED3DFMT_R8G8_SNORM_Cx
Definition: wined3d.h:134
@ WINED3DFMT_R32G32_FLOAT
Definition: wined3d.h:150
@ WINED3DFMT_R16G16_SNORM
Definition: wined3d.h:173
@ WINED3DFMT_R16_UNORM
Definition: wined3d.h:192
@ WINED3DFMT_R24G8_TYPELESS
Definition: wined3d.h:180
@ WINED3DFMT_R10G10B10A2_TYPELESS
Definition: wined3d.h:157
@ WINED3DFMT_R32G32_UINT
Definition: wined3d.h:151
@ WINED3DFMT_R32G32B32_UINT
Definition: wined3d.h:141
@ WINED3DFMT_BC4_TYPELESS
Definition: wined3d.h:215
@ WINED3DFMT_ATI1N
Definition: wined3d.h:247
@ WINED3DFMT_BC2_UNORM
Definition: wined3d.h:210
@ WINED3DFMT_R8_UNORM
Definition: wined3d.h:197
@ WINED3DFMT_R8G8B8A8_SNORM
Definition: wined3d.h:167
@ WINED3DFMT_NV12
Definition: wined3d.h:258
@ WINED3DFMT_S8_UINT_D24_FLOAT
Definition: wined3d.h:133
@ WINED3DFMT_R10G10B10_XR_BIAS_A2_UNORM
Definition: wined3d.h:161
@ WINED3DFMT_R16_TYPELESS
Definition: wined3d.h:189
@ WINED3DFMT_R16G16B16A16_SINT
Definition: wined3d.h:148
@ WINED3DFMT_D16_LOCKABLE
Definition: wined3d.h:127
@ WINED3DFMT_R10G11B11_SNORM
Definition: wined3d.h:123
@ WINED3DFMT_S1_UINT_D15_UNORM
Definition: wined3d.h:129
@ WINED3DFMT_R16_SINT
Definition: wined3d.h:195
@ WINED3DFMT_B2G3R3A8_UNORM
Definition: wined3d.h:112
@ WINED3DFMT_R8G8_B8G8_UNORM
Definition: wined3d.h:204
@ WINED3DFMT_L8A8_UNORM
Definition: wined3d.h:119
@ WINED3DFMT_R32G32B32_FLOAT
Definition: wined3d.h:140
@ WINED3DFMT_L4A4_UNORM
Definition: wined3d.h:120
@ WINED3DFMT_R32_FLOAT_X8X24_TYPELESS
Definition: wined3d.h:155
@ WINED3DFMT_R8G8B8X8_UNORM
Definition: wined3d.h:114
@ WINED3DFMT_BC1_UNORM_SRGB
Definition: wined3d.h:208
@ WINED3DFMT_B5G5R5X1_UNORM
Definition: wined3d.h:109
@ WINED3DFMT_B10G10R10A2_UNORM
Definition: wined3d.h:115
@ WINED3DFMT_R16G16B16A16_FLOAT
Definition: wined3d.h:144
@ WINED3DFMT_D16_UNORM
Definition: wined3d.h:191
@ WINED3DFMT_L8_UNORM
Definition: wined3d.h:118
@ WINED3DFMT_NVHS
Definition: wined3d.h:252
@ WINED3DFMT_R8G8_SNORM
Definition: wined3d.h:187
@ WINED3DFMT_R5G5_SNORM_L6_UNORM
Definition: wined3d.h:121
@ WINED3DFMT_R8G8B8A8_TYPELESS
Definition: wined3d.h:163
@ WINED3DFMT_R8G8_UINT
Definition: wined3d.h:186
@ WINED3DFMT_BC7_UNORM
Definition: wined3d.h:233
@ WINED3DFMT_B8G8R8_UNORM
Definition: wined3d.h:108
@ WINED3DFMT_DXT1
Definition: wined3d.h:239
@ WINED3DFMT_R8G8B8A8_UNORM_SRGB
Definition: wined3d.h:165
@ WINED3DFMT_R9G9B9E5_SHAREDEXP
Definition: wined3d.h:203
@ WINED3DFMT_NVDB
Definition: wined3d.h:250
@ WINED3DFMT_B8G8R8X8_TYPELESS
Definition: wined3d.h:227
@ WINED3DFMT_R32_UINT
Definition: wined3d.h:178
@ WINED3DFMT_B5G5R5A1_UNORM
Definition: wined3d.h:222
@ WINED3DFMT_R10G10B10_SNORM_A2_UNORM
Definition: wined3d.h:126
@ WINED3DFMT_R16_FLOAT
Definition: wined3d.h:190
@ WINED3DFMT_DXT3
Definition: wined3d.h:241
@ WINED3DFMT_DXT4
Definition: wined3d.h:242
@ WINED3DFMT_D32_UNORM
Definition: wined3d.h:128
@ WINED3DFMT_R8G8B8A8_UNORM
Definition: wined3d.h:164
@ WINED3DFMT_R10G10B10A2_UINT
Definition: wined3d.h:159
@ WINED3DFMT_G8R8_G8B8_UNORM
Definition: wined3d.h:205
@ WINED3DFMT_R32G32B32A32_UINT
Definition: wined3d.h:137
@ WINED3DFMT_R16G16B16A16_UNORM
Definition: wined3d.h:145
@ WINED3DFMT_BC3_UNORM
Definition: wined3d.h:213
@ WINED3DFMT_BC6H_UF16
Definition: wined3d.h:230
@ WINED3DFMT_R16G16B16A16_TYPELESS
Definition: wined3d.h:143
@ WINED3DFMT_R10G10B10A2_SNORM
Definition: wined3d.h:160
@ WINED3DFMT_R24_UNORM_X8_TYPELESS
Definition: wined3d.h:182
@ WINED3DFMT_R16
Definition: wined3d.h:256
@ WINED3DFMT_D32_FLOAT_S8X24_UINT
Definition: wined3d.h:154
@ WINED3DFMT_NVHU
Definition: wined3d.h:251
@ WINED3DFMT_R32_FLOAT
Definition: wined3d.h:177
@ WINED3DFMT_R8G8_SNORM_L8X8_UNORM
Definition: wined3d.h:122
@ WINED3DFMT_X32_TYPELESS_G8X24_UINT
Definition: wined3d.h:156
@ WINED3DFMT_YV12
Definition: wined3d.h:238
@ WINED3DFMT_B5G6R5_UNORM
Definition: wined3d.h:221
@ WINED3DFMT_R16G16B16A16_UINT
Definition: wined3d.h:146
@ WINED3DFMT_S4X4_UINT_D24_UNORM
Definition: wined3d.h:131
@ WINED3DFMT_BC1_TYPELESS
Definition: wined3d.h:206
@ WINED3DFMT_B8G8R8X8_UNORM_SRGB
Definition: wined3d.h:228
@ WINED3DFMT_DXT5
Definition: wined3d.h:243
@ WINED3DFMT_BC4_UNORM
Definition: wined3d.h:216
@ WINED3DFMT_B8G8R8A8_TYPELESS
Definition: wined3d.h:225
@ WINED3DFMT_BC3_TYPELESS
Definition: wined3d.h:212
@ WINED3DFMT_R16G16_TYPELESS
Definition: wined3d.h:169
@ WINED3DFMT_R8_SNORM
Definition: wined3d.h:199
@ WINED3DFMT_YUY2
Definition: wined3d.h:237
@ WINED3DFMT_R16G16_FLOAT
Definition: wined3d.h:170
@ WINED3DFMT_G8R8_G8B8
Definition: wined3d.h:245
@ WINED3DFMT_R8G8B8A8_UINT
Definition: wined3d.h:166
@ WINED3DFMT_L16_UNORM
Definition: wined3d.h:132
@ WINED3DFMT_R16_SNORM
Definition: wined3d.h:194
@ WINED3DFMT_BC6H_TYPELESS
Definition: wined3d.h:229
@ WINED3DFMT_BC1_UNORM
Definition: wined3d.h:207
@ WINED3DFMT_R32G32B32A32_TYPELESS
Definition: wined3d.h:135
@ WINED3DFMT_R32_TYPELESS
Definition: wined3d.h:175
@ WINED3DFMT_R32G8X24_TYPELESS
Definition: wined3d.h:153
@ WINED3DFMT_R16_UINT
Definition: wined3d.h:193
@ WINED3DFMT_R8_SINT
Definition: wined3d.h:200
@ WINED3DFMT_UYVY
Definition: wined3d.h:236
@ WINED3DFMT_BC5_TYPELESS
Definition: wined3d.h:218
@ WINED3DFMT_R8G8_SINT
Definition: wined3d.h:188
@ WINED3DFMT_R32G32B32A32_SINT
Definition: wined3d.h:138
@ WINED3DFMT_R8G8B8A8_SINT
Definition: wined3d.h:168
@ WINED3DFMT_R10G10B10X2_SNORM
Definition: wined3d.h:125
@ WINED3DFMT_R1_UNORM
Definition: wined3d.h:202
@ WINED3DFMT_R11G11B10_FLOAT
Definition: wined3d.h:162
@ WINED3DFMT_B8G8R8A8_UNORM_SRGB
Definition: wined3d.h:226
@ WINED3DFMT_BC3_UNORM_SRGB
Definition: wined3d.h:214
@ WINED3DFMT_A8_UNORM
Definition: wined3d.h:201
@ WINED3DFMT_R32G32B32A32_FLOAT
Definition: wined3d.h:136
@ WINED3DFMT_BC2_TYPELESS
Definition: wined3d.h:209
@ WINED3DFMT_R8G8_B8G8
Definition: wined3d.h:246
@ WINED3DFMT_BC6H_SF16
Definition: wined3d.h:231
@ WINED3DFMT_ATI2N
Definition: wined3d.h:248
@ WINED3DFMT_MULTI2_ARGB8
Definition: wined3d.h:244
@ WINED3DFMT_AL16
Definition: wined3d.h:257
@ WINED3DFMT_D24_UNORM_S8_UINT
Definition: wined3d.h:181
@ WINED3DFMT_P8_UINT_A8_UNORM
Definition: wined3d.h:116
@ WINED3DFMT_R16G16B16A16_SNORM
Definition: wined3d.h:147
@ WINED3DFMT_BC4_SNORM
Definition: wined3d.h:217
@ WINED3DFMT_R16G16_SINT
Definition: wined3d.h:174
@ WINED3DFMT_R32G32_TYPELESS
Definition: wined3d.h:149

Referenced by buffer_check_attribute(), buffer_init(), buffer_process_converted_attribute(), check_fbo_compat(), CheckRenderTargetCapability(), context_choose_pixel_format(), context_find_fbo_entry(), cpu_blitter_clear(), draw_primitive_immediate_mode(), dump_wined3d_vertex_element(), get_format_internal(), init_format_depth_bias_scale(), init_format_fbo_compat_info(), init_format_filter_info(), init_format_vertex_info(), query_format_flag(), query_view_class(), resource_init(), state_depthbias(), surface_convert_format(), surface_cpu_blt(), surface_cpu_blt_colour_fill(), surface_cpu_blt_compressed(), surface_depth_blt_fbo(), surface_download_data(), swapchain_init(), texture1d_download_data(), texture2d_create_dc(), texture2d_prepare_texture(), texture3d_download_data(), 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_device_copy_resource(), wined3d_device_copy_sub_resource_region(), wined3d_device_reset(), wined3d_device_resolve_sub_resource(), wined3d_device_set_cursor_properties(), wined3d_device_set_index_buffer(), wined3d_dxt1_decode(), wined3d_dxt1_encode(), wined3d_dxt3_decode(), wined3d_dxt3_encode(), wined3d_dxt5_decode(), wined3d_dxt5_encode(), wined3d_enum_adapter_modes(), wined3d_find_closest_matching_adapter_mode(), wined3d_format_convert_from_float(), wined3d_format_get_color_key_conversion(), wined3d_format_get_float_color_key(), wined3d_get_adapter_display_mode(), wined3d_get_adapter_mode_count(), wined3d_get_format(), wined3d_render_target_view_cs_init(), wined3d_set_adapter_display_mode(), wined3d_shader_resource_view_cs_init(), wined3d_stream_info_from_declaration(), wined3d_surface_upload_data(), wined3d_swapchain_cs_init(), wined3d_swapchain_get_display_mode(), wined3d_swapchain_resize_buffers(), wined3d_texture_init(), wined3d_texture_update_desc(), and wined3d_unordered_access_view_clear_uint().

◆ debug_d3dinput_classification()

const char * debug_d3dinput_classification ( enum wined3d_input_classification  classification)

Definition at line 4315 of file utils.c.

4316{
4317 switch (classification)
4318 {
4319#define WINED3D_TO_STR(x) case x: return #x
4322#undef WINED3D_TO_STR
4323 default:
4324 FIXME("Unrecognized input classification %#x.\n", classification);
4325 return "unrecognized";
4326 }
4327}
#define WINED3D_TO_STR(x)
@ WINED3D_INPUT_PER_INSTANCE_DATA
Definition: wined3d.h:1786
@ WINED3D_INPUT_PER_VERTEX_DATA
Definition: wined3d.h:1785

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 4346 of file utils.c.

4347{
4348 switch (primitive_type)
4349 {
4350#define PRIM_TO_STR(prim) case prim: return #prim
4363#undef PRIM_TO_STR
4364 default:
4365 FIXME("Unrecognized primitive type %#x.\n", primitive_type);
4366 return "unrecognized";
4367 }
4368}
#define PRIM_TO_STR(prim)
@ WINED3D_PT_LINESTRIP_ADJ
Definition: wined3d.h:79
@ WINED3D_PT_LINELIST
Definition: wined3d.h:73
@ WINED3D_PT_UNDEFINED
Definition: wined3d.h:71
@ WINED3D_PT_PATCH
Definition: wined3d.h:82
@ WINED3D_PT_POINTLIST
Definition: wined3d.h:72
@ WINED3D_PT_TRIANGLELIST_ADJ
Definition: wined3d.h:80
@ WINED3D_PT_LINELIST_ADJ
Definition: wined3d.h:78
@ WINED3D_PT_TRIANGLESTRIP_ADJ
Definition: wined3d.h:81
@ WINED3D_PT_TRIANGLESTRIP
Definition: wined3d.h:76
@ WINED3D_PT_LINESTRIP
Definition: wined3d.h:74
@ WINED3D_PT_TRIANGLELIST
Definition: wined3d.h:75
@ WINED3D_PT_TRIANGLEFAN
Definition: wined3d.h:77

Referenced by d3d_primitive_type_from_gl(), gl_primitive_type_from_d3d(), glsl_primitive_type_from_d3d(), wined3d_device_get_primitive_type(), and wined3d_device_set_primitive_type().

◆ debug_d3drenderstate()

const char * debug_d3drenderstate ( enum wined3d_render_state  state)

Definition at line 4370 of file utils.c.

4371{
4372 switch (state)
4373 {
4374#define D3DSTATE_TO_STR(u) case u: return #u
4507#undef D3DSTATE_TO_STR
4508 default:
4509 FIXME("Unrecognized %u render state!\n", state);
4510 return "unrecognized";
4511 }
4512}
#define D3DSTATE_TO_STR(u)
@ WINED3D_RS_TEXTUREFACTOR
Definition: wined3d.h:314
@ WINED3D_RS_COLORKEYENABLE
Definition: wined3d.h:300
@ WINED3D_RS_STENCILFAIL
Definition: wined3d.h:307
@ WINED3D_RS_NORMALDEGREE
Definition: wined3d.h:357
@ WINED3D_RS_WRAP8
Definition: wined3d.h:379
@ WINED3D_RS_LIGHTING
Definition: wined3d.h:324
@ WINED3D_RS_SOFTWAREVERTEXPROCESSING
Definition: wined3d.h:338
@ WINED3D_RS_COLORWRITEENABLE7
Definition: wined3d.h:396
@ WINED3D_RS_STIPPLEDALPHA
Definition: wined3d.h:292
@ WINED3D_RS_COLORWRITEENABLE1
Definition: wined3d.h:373
@ WINED3D_RS_STENCILENABLE
Definition: wined3d.h:306
@ WINED3D_RS_COLORVERTEX
Definition: wined3d.h:328
@ WINED3D_RS_TWEENFACTOR
Definition: wined3d.h:354
@ WINED3D_RS_FOGCOLOR
Definition: wined3d.h:293
@ WINED3D_RS_WRAP4
Definition: wined3d.h:319
@ WINED3D_RS_WRAP15
Definition: wined3d.h:386
@ WINED3D_RS_COLORWRITEENABLE5
Definition: wined3d.h:394
@ WINED3D_RS_ZENABLE
Definition: wined3d.h:269
@ WINED3D_RS_ANTIALIASEDLINEENABLE
Definition: wined3d.h:360
@ WINED3D_RS_SPECULARMATERIALSOURCE
Definition: wined3d.h:333
@ WINED3D_RS_STENCILPASS
Definition: wined3d.h:309
@ WINED3D_RS_WRAP13
Definition: wined3d.h:384
@ WINED3D_RS_DEBUGMONITORTOKEN
Definition: wined3d.h:350
@ WINED3D_RS_WRAP1
Definition: wined3d.h:316
@ WINED3D_RS_WRAP3
Definition: wined3d.h:318
@ WINED3D_RS_DEPTHBIAS
Definition: wined3d.h:378
@ WINED3D_RS_MAXTESSELLATIONLEVEL
Definition: wined3d.h:362
@ WINED3D_RS_DITHERENABLE
Definition: wined3d.h:285
@ WINED3D_RS_SHADEMODE
Definition: wined3d.h:271
@ WINED3D_RS_CULLMODE
Definition: wined3d.h:281
@ WINED3D_RS_BACK_STENCILPASS
Definition: wined3d.h:371
@ WINED3D_RS_WRAPV
Definition: wined3d.h:268
@ WINED3D_RS_COLORWRITEENABLE4
Definition: wined3d.h:393
@ WINED3D_RS_PATCHEDGESTYLE
Definition: wined3d.h:348
@ WINED3D_RS_LASTPIXEL
Definition: wined3d.h:278
@ WINED3D_RS_VERTEXBLEND
Definition: wined3d.h:336
@ WINED3D_RS_FOGEND
Definition: wined3d.h:296
@ WINED3D_RS_MINTESSELLATIONLEVEL
Definition: wined3d.h:361
@ WINED3D_RS_POINTSCALE_A
Definition: wined3d.h:343
@ WINED3D_RS_MULTISAMPLEMASK
Definition: wined3d.h:347
@ WINED3D_RS_BACK_STENCILFUNC
Definition: wined3d.h:372
@ WINED3D_RS_SRCBLEND
Definition: wined3d.h:279
@ WINED3D_RS_RANGEFOGENABLE
Definition: wined3d.h:302
@ WINED3D_RS_POINTSIZE_MIN
Definition: wined3d.h:340
@ WINED3D_RS_TEXTUREPERSPECTIVE
Definition: wined3d.h:266
@ WINED3D_RS_DEPTHCLIP
Definition: wined3d.h:391
@ WINED3D_RS_ENABLEADAPTIVETESSELLATION
Definition: wined3d.h:367
@ WINED3D_RS_COLORWRITEENABLE3
Definition: wined3d.h:375
@ WINED3D_RS_WRAPU
Definition: wined3d.h:267
@ WINED3D_RS_ADAPTIVETESS_X
Definition: wined3d.h:363
@ WINED3D_RS_MONOENABLE
Definition: wined3d.h:273
@ WINED3D_RS_LOCALVIEWER
Definition: wined3d.h:329
@ WINED3D_RS_ADAPTIVETESS_Z
Definition: wined3d.h:365
@ WINED3D_RS_WRAP0
Definition: wined3d.h:315
@ WINED3D_RS_STENCILMASK
Definition: wined3d.h:312
@ WINED3D_RS_COLORWRITEENABLE6
Definition: wined3d.h:395
@ WINED3D_RS_BLENDOP
Definition: wined3d.h:355
@ WINED3D_RS_POINTSCALE_C
Definition: wined3d.h:345
@ WINED3D_RS_FOGSTART
Definition: wined3d.h:295
@ WINED3D_RS_STENCILFUNC
Definition: wined3d.h:310
@ WINED3D_RS_WRAP7
Definition: wined3d.h:322
@ WINED3D_RS_FOGTABLEMODE
Definition: wined3d.h:294
@ WINED3D_RS_POINTSIZE
Definition: wined3d.h:339
@ WINED3D_RS_POINTSIZE_MAX
Definition: wined3d.h:351
@ WINED3D_RS_ZWRITEENABLE
Definition: wined3d.h:276
@ WINED3D_RS_PLANEMASK
Definition: wined3d.h:275
@ WINED3D_RS_SUBPIXELX
Definition: wined3d.h:291
@ WINED3D_RS_CLIPPLANEENABLE
Definition: wined3d.h:337
@ WINED3D_RS_DESTBLEND
Definition: wined3d.h:280
@ WINED3D_RS_AMBIENTMATERIALSOURCE
Definition: wined3d.h:334
@ WINED3D_RS_WRAP6
Definition: wined3d.h:321
@ WINED3D_RS_STENCILREF
Definition: wined3d.h:311
@ WINED3D_RS_FOGENABLE
Definition: wined3d.h:287
@ WINED3D_RS_POINTSPRITEENABLE
Definition: wined3d.h:341
@ WINED3D_RS_FLUSHBATCH
Definition: wined3d.h:304
@ WINED3D_RS_BACK_STENCILZFAIL
Definition: wined3d.h:370
@ WINED3D_RS_ZFUNC
Definition: wined3d.h:282
@ WINED3D_RS_ROP2
Definition: wined3d.h:274
@ WINED3D_RS_POSITIONDEGREE
Definition: wined3d.h:356
@ WINED3D_RS_MULTISAMPLEANTIALIAS
Definition: wined3d.h:346
@ WINED3D_RS_ANTIALIAS
Definition: wined3d.h:265
@ WINED3D_RS_BACK_STENCILFAIL
Definition: wined3d.h:369
@ WINED3D_RS_COLORWRITEENABLE
Definition: wined3d.h:353
@ WINED3D_RS_SLOPESCALEDEPTHBIAS
Definition: wined3d.h:359
@ WINED3D_RS_DIFFUSEMATERIALSOURCE
Definition: wined3d.h:332
@ WINED3D_RS_DEPTHBIASCLAMP
Definition: wined3d.h:392
@ WINED3D_RS_ALPHAREF
Definition: wined3d.h:283
@ WINED3D_RS_NORMALIZENORMALS
Definition: wined3d.h:330
@ WINED3D_RS_ANISOTROPY
Definition: wined3d.h:303
@ WINED3D_RS_TWOSIDEDSTENCILMODE
Definition: wined3d.h:368
@ WINED3D_RS_TRANSLUCENTSORTINDEPENDENT
Definition: wined3d.h:305
@ WINED3D_RS_EMISSIVEMATERIALSOURCE
Definition: wined3d.h:335
@ WINED3D_RS_PATCHSEGMENTS
Definition: wined3d.h:349
@ WINED3D_RS_SPECULARENABLE
Definition: wined3d.h:288
@ WINED3D_RS_WRAP2
Definition: wined3d.h:317
@ WINED3D_RS_ADAPTIVETESS_W
Definition: wined3d.h:366
@ WINED3D_RS_FILLMODE
Definition: wined3d.h:270
@ WINED3D_RS_CLIPPING
Definition: wined3d.h:323
@ WINED3D_RS_WRAP10
Definition: wined3d.h:381
@ WINED3D_RS_SRCBLENDALPHA
Definition: wined3d.h:388
@ WINED3D_RS_COLORKEYBLENDENABLE
Definition: wined3d.h:331
@ WINED3D_RS_COLORWRITEENABLE2
Definition: wined3d.h:374
@ WINED3D_RS_POINTSCALEENABLE
Definition: wined3d.h:342
@ WINED3D_RS_WRAP14
Definition: wined3d.h:385
@ WINED3D_RS_FOGVERTEXMODE
Definition: wined3d.h:327
@ WINED3D_RS_STENCILWRITEMASK
Definition: wined3d.h:313
@ WINED3D_RS_AMBIENT
Definition: wined3d.h:326
@ WINED3D_RS_WRAP11
Definition: wined3d.h:382
@ WINED3D_RS_LINEPATTERN
Definition: wined3d.h:272
@ WINED3D_RS_ZVISIBLE
Definition: wined3d.h:289
@ WINED3D_RS_BLENDFACTOR
Definition: wined3d.h:376
@ WINED3D_RS_EXTENTS
Definition: wined3d.h:325
@ WINED3D_RS_BLENDOPALPHA
Definition: wined3d.h:390
@ WINED3D_RS_DESTBLENDALPHA
Definition: wined3d.h:389
@ WINED3D_RS_FOGDENSITY
Definition: wined3d.h:297
@ WINED3D_RS_STENCILZFAIL
Definition: wined3d.h:308
@ WINED3D_RS_SUBPIXEL
Definition: wined3d.h:290
@ WINED3D_RS_POINTSCALE_B
Definition: wined3d.h:344
@ WINED3D_RS_INDEXEDVERTEXBLENDENABLE
Definition: wined3d.h:352
@ WINED3D_RS_MIPMAPLODBIAS
Definition: wined3d.h:301
@ WINED3D_RS_WRAP9
Definition: wined3d.h:380
@ WINED3D_RS_SEPARATEALPHABLENDENABLE
Definition: wined3d.h:387
@ WINED3D_RS_STIPPLEENABLE
Definition: wined3d.h:298
@ WINED3D_RS_WRAP5
Definition: wined3d.h:320
@ WINED3D_RS_ADAPTIVETESS_Y
Definition: wined3d.h:364
@ WINED3D_RS_ALPHATESTENABLE
Definition: wined3d.h:277
@ WINED3D_RS_ALPHAFUNC
Definition: wined3d.h:284
@ WINED3D_RS_WRAP12
Definition: wined3d.h:383
@ WINED3D_RS_EDGEANTIALIAS
Definition: wined3d.h:299

Referenced by debug_d3dstate(), wined3d_device_get_render_state(), and wined3d_device_set_render_state().

◆ debug_d3dresourcetype()

const char * debug_d3dresourcetype ( enum wined3d_resource_type  resource_type)

Definition at line 4329 of file utils.c.

4330{
4331 switch (resource_type)
4332 {
4333#define WINED3D_TO_STR(x) case x: return #x
4339#undef WINED3D_TO_STR
4340 default:
4341 FIXME("Unrecognized resource type %#x.\n", resource_type);
4342 return "unrecognized";
4343 }
4344}
@ WINED3D_RTYPE_TEXTURE_1D
Definition: wined3d.h:699
@ WINED3D_RTYPE_NONE
Definition: wined3d.h:697
@ WINED3D_RTYPE_BUFFER
Definition: wined3d.h:698

Referenced by context_generate_rt_mask_from_resource(), context_set_fbo_key_for_render_target(), device_resource_released(), resource_init(), surface_set_compatible_renderbuffer(), wined3d_check_device_format(), wined3d_cs_exec_blt_sub_resource(), wined3d_device_clear_rendertarget_view(), wined3d_device_copy_resource(), wined3d_device_copy_sub_resource_region(), wined3d_device_decref(), wined3d_device_resolve_sub_resource(), wined3d_device_update_sub_resource(), wined3d_render_target_view_cs_init(), wined3d_rendertarget_view_prepare_location(), wined3d_rendertarget_view_validate_location(), wined3d_resource_update_info(), wined3d_texture_create(), wined3d_texture_get_dc(), wined3d_texture_init(), wined3d_texture_release_dc(), wined3d_texture_unload(), wined3d_texture_update_desc(), and wined3d_unordered_access_view_clear_uint().

◆ debug_d3dsamplerstate()

const char * debug_d3dsamplerstate ( enum wined3d_sampler_state  state)

Definition at line 4514 of file utils.c.

4515{
4516 switch (state)
4517 {
4518#define D3DSTATE_TO_STR(u) case u: return #u
4532#undef D3DSTATE_TO_STR
4533 default:
4534 FIXME("Unrecognized %u sampler state!\n", state);
4535 return "unrecognized";
4536 }
4537}
@ WINED3D_SAMP_ELEMENT_INDEX
Definition: wined3d.h:547
@ WINED3D_SAMP_MAX_ANISOTROPY
Definition: wined3d.h:545
@ WINED3D_SAMP_MIPMAP_LOD_BIAS
Definition: wined3d.h:543
@ WINED3D_SAMP_MIN_FILTER
Definition: wined3d.h:541
@ WINED3D_SAMP_SRGB_TEXTURE
Definition: wined3d.h:546
@ WINED3D_SAMP_DMAP_OFFSET
Definition: wined3d.h:548
@ WINED3D_SAMP_MIP_FILTER
Definition: wined3d.h:542
@ WINED3D_SAMP_MAG_FILTER
Definition: wined3d.h:540
@ WINED3D_SAMP_BORDER_COLOR
Definition: wined3d.h:539
@ WINED3D_SAMP_ADDRESS_V
Definition: wined3d.h:537
@ WINED3D_SAMP_ADDRESS_U
Definition: wined3d.h:536
@ WINED3D_SAMP_ADDRESS_W
Definition: wined3d.h:538
@ WINED3D_SAMP_MAX_MIP_LEVEL
Definition: wined3d.h:544

Referenced by wined3d_device_get_sampler_state(), and wined3d_device_set_sampler_state().

◆ debug_d3dshaderinstructionhandler()

◆ debug_d3dstate()

const char * debug_d3dstate ( DWORD  state)

Definition at line 4676 of file utils.c.

4677{
4679 return wine_dbg_sprintf("STATE_RENDER(%s)", debug_d3drenderstate(state - STATE_RENDER(0)));
4681 {
4682 DWORD texture_stage = (state - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
4683 DWORD texture_state = state - STATE_TEXTURESTAGE(texture_stage, 0);
4684 return wine_dbg_sprintf("STATE_TEXTURESTAGE(%#x, %s)",
4685 texture_stage, debug_d3dtexturestate(texture_state));
4686 }
4688 return wine_dbg_sprintf("STATE_SAMPLER(%#x)", state - STATE_SAMPLER(0));
4692 return wine_dbg_sprintf("STATE_SHADER(%s)", debug_shader_type(state - STATE_SHADER(0)));
4694 return wine_dbg_sprintf("STATE_CONSTANT_BUFFER(%s)", debug_shader_type(WINED3D_SHADER_TYPE_COMPUTE));
4696 return wine_dbg_sprintf("STATE_CONSTANT_BUFFER(%s)", debug_shader_type(state - STATE_CONSTANT_BUFFER(0)));
4698 return "STATE_COMPUTE_SHADER_RESOURCE_BINDING";
4700 return "STATE_GRAPHICS_SHADER_RESOURCE_BINDING";
4702 return "STATE_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING";
4704 return "STATE_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING";
4706 return wine_dbg_sprintf("STATE_TRANSFORM(%s)", debug_d3dtstype(state - STATE_TRANSFORM(0)));
4708 return "STATE_STREAMSRC";
4710 return "STATE_INDEXBUFFER";
4711 if (STATE_IS_VDECL(state))
4712 return "STATE_VDECL";
4714 return "STATE_VIEWPORT";
4716 return "STATE_LIGHT_TYPE";
4718 return wine_dbg_sprintf("STATE_ACTIVELIGHT(%#x)", state - STATE_ACTIVELIGHT(0));
4720 return "STATE_SCISSORRECT";
4722 return wine_dbg_sprintf("STATE_CLIPPLANE(%#x)", state - STATE_CLIPPLANE(0));
4724 return "STATE_MATERIAL";
4726 return "STATE_FRONTFACE";
4728 return "STATE_POINTSPRITECOORDORIGIN";
4730 return "STATE_BASEVERTEXINDEX";
4732 return "STATE_FRAMEBUFFER";
4734 return "STATE_POINT_ENABLE";
4736 return "STATE_COLOR_KEY";
4738 return "STATE_STREAM_OUTPUT";
4739 if (STATE_IS_BLEND(state))
4740 return "STATE_BLEND";
4741
4742 return wine_dbg_sprintf("UNKNOWN_STATE(%#x)", state);
4743}
const char * debug_d3dtexturestate(enum wined3d_texture_stage_state state)
Definition: utils.c:4559
const char * debug_shader_type(enum wined3d_shader_type type)
Definition: utils.c:4658
const char * debug_d3dtstype(enum wined3d_transform_state tstype)
Definition: utils.c:4627
const char * debug_d3drenderstate(enum wined3d_render_state state)
Definition: utils.c:4370
#define WINED3D_HIGHEST_TEXTURE_STATE
Definition: wined3d.h:595
#define STATE_IS_GRAPHICS_CONSTANT_BUFFER(a)
#define STATE_IS_MATERIAL(a)
#define STATE_CONSTANT_BUFFER(a)
#define STATE_IS_SAMPLER(num)
#define STATE_IS_GRAPHICS_UNORDERED_ACCESS_VIEW_BINDING(a)
#define STATE_IS_ACTIVELIGHT(a)
#define STATE_IS_STREAM_OUTPUT(a)
#define STATE_IS_POINTSPRITECOORDORIGIN(a)
#define STATE_IS_VDECL(a)
#define STATE_IS_COMPUTE_UNORDERED_ACCESS_VIEW_BINDING(a)
#define STATE_IS_POINT_ENABLE(a)
#define STATE_IS_STREAMSRC(a)
#define STATE_IS_BLEND(a)
#define STATE_SHADER(a)
#define STATE_ACTIVELIGHT(a)
#define STATE_IS_TEXTURESTAGE(a)
#define STATE_IS_COLOR_KEY(a)
#define STATE_IS_CLIPPLANE(a)
#define STATE_IS_VIEWPORT(a)
#define STATE_IS_RENDER(a)
#define STATE_IS_COMPUTE_SHADER_RESOURCE_BINDING(a)
#define STATE_IS_COMPUTE_SHADER(a)
#define STATE_IS_FRONTFACE(a)
#define STATE_IS_LIGHT_TYPE(a)
#define STATE_IS_COMPUTE_CONSTANT_BUFFER(a)
#define STATE_IS_SCISSORRECT(a)
#define STATE_IS_FRAMEBUFFER(a)
#define STATE_IS_GRAPHICS_SHADER_RESOURCE_BINDING(a)
#define STATE_IS_TRANSFORM(a)
#define STATE_IS_INDEXBUFFER(a)
#define STATE_IS_GRAPHICS_SHADER(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 4539 of file utils.c.

4540{
4541 switch (filter_type)
4542 {
4543#define D3DTEXTUREFILTERTYPE_TO_STR(u) case u: return #u
4552#undef D3DTEXTUREFILTERTYPE_TO_STR
4553 default:
4554 FIXME("Unrecognized texture filter type 0x%08x.\n", filter_type);
4555 return "unrecognized";
4556 }
4557}
#define D3DTEXTUREFILTERTYPE_TO_STR(u)
@ WINED3D_TEXF_GAUSSIAN_CUBIC
Definition: wined3d.h:690
@ WINED3D_TEXF_NONE
Definition: wined3d.h:685
@ WINED3D_TEXF_PYRAMIDAL_QUAD
Definition: wined3d.h:691
@ WINED3D_TEXF_FLAT_CUBIC
Definition: wined3d.h:689
@ WINED3D_TEXF_GAUSSIAN_QUAD
Definition: wined3d.h:692
@ WINED3D_TEXF_POINT
Definition: wined3d.h:686
@ WINED3D_TEXF_ANISOTROPIC
Definition: wined3d.h:688
@ WINED3D_TEXF_LINEAR
Definition: wined3d.h:687

Referenced by surface_blt_fbo(), surface_blt_special(), surface_cpu_blt(), wined3d_surface_blt(), and wined3d_texture_blt().

◆ debug_d3dtexturestate()

const char * debug_d3dtexturestate ( enum wined3d_texture_stage_state  state)

Definition at line 4559 of file utils.c.

4560{
4561 switch (state)
4562 {
4563#define D3DSTATE_TO_STR(u) case u: return #u
4582#undef D3DSTATE_TO_STR
4583 default:
4584 FIXME("Unrecognized %u texture state!\n", state);
4585 return "unrecognized";
4586 }
4587}
@ WINED3D_TSS_COLOR_ARG2
Definition: wined3d.h:577
@ WINED3D_TSS_BUMPENV_LOFFSET
Definition: wined3d.h:587
@ WINED3D_TSS_ALPHA_OP
Definition: wined3d.h:578
@ WINED3D_TSS_BUMPENV_MAT11
Definition: wined3d.h:584
@ WINED3D_TSS_BUMPENV_MAT10
Definition: wined3d.h:583
@ WINED3D_TSS_TEXCOORD_INDEX
Definition: wined3d.h:585
@ WINED3D_TSS_ALPHA_ARG2
Definition: wined3d.h:580
@ WINED3D_TSS_CONSTANT
Definition: wined3d.h:592
@ WINED3D_TSS_BUMPENV_MAT01
Definition: wined3d.h:582
@ WINED3D_TSS_ALPHA_ARG0
Definition: wined3d.h:590
@ WINED3D_TSS_BUMPENV_LSCALE
Definition: wined3d.h:586
@ WINED3D_TSS_COLOR_ARG0
Definition: wined3d.h:589
@ WINED3D_TSS_COLOR_ARG1
Definition: wined3d.h:576
@ WINED3D_TSS_ALPHA_ARG1
Definition: wined3d.h:579
@ WINED3D_TSS_RESULT_ARG
Definition: wined3d.h:591
@ WINED3D_TSS_BUMPENV_MAT00
Definition: wined3d.h:581
@ WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
Definition: wined3d.h:588

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

◆ debug_d3dtop()

const char * debug_d3dtop ( enum wined3d_texture_op  d3dtop)

Definition at line 4589 of file utils.c.

4590{
4591 switch (d3dtop)
4592 {
4593#define D3DTOP_TO_STR(u) case u: return #u
4620#undef D3DTOP_TO_STR
4621 default:
4622 FIXME("Unrecognized texture op %#x.\n", d3dtop);
4623 return "unrecognized";
4624 }
4625}
#define D3DTOP_TO_STR(u)
@ WINED3D_TOP_SELECT_ARG1
Definition: wined3d.h:610
@ WINED3D_TOP_DISABLE
Definition: wined3d.h:609
@ WINED3D_TOP_BLEND_DIFFUSE_ALPHA
Definition: wined3d.h:620
@ WINED3D_TOP_ADD
Definition: wined3d.h:615
@ WINED3D_TOP_BLEND_TEXTURE_ALPHA_PM
Definition: wined3d.h:623
@ WINED3D_TOP_BLEND_CURRENT_ALPHA
Definition: wined3d.h:624
@ WINED3D_TOP_ADD_SIGNED_2X
Definition: wined3d.h:617
@ WINED3D_TOP_MODULATE_INVCOLOR_ADD_ALPHA
Definition: wined3d.h:629
@ WINED3D_TOP_MULTIPLY_ADD
Definition: wined3d.h:633
@ WINED3D_TOP_MODULATE_INVALPHA_ADD_COLOR
Definition: wined3d.h:628
@ WINED3D_TOP_SUBTRACT
Definition: wined3d.h:618
@ WINED3D_TOP_BUMPENVMAP_LUMINANCE
Definition: wined3d.h:631
@ WINED3D_TOP_MODULATE_COLOR_ADD_ALPHA
Definition: wined3d.h:627
@ WINED3D_TOP_MODULATE
Definition: wined3d.h:612
@ WINED3D_TOP_BUMPENVMAP
Definition: wined3d.h:630
@ WINED3D_TOP_MODULATE_4X
Definition: wined3d.h:614
@ WINED3D_TOP_SELECT_ARG2
Definition: wined3d.h:611
@ WINED3D_TOP_LERP
Definition: wined3d.h:634
@ WINED3D_TOP_MODULATE_ALPHA_ADD_COLOR
Definition: wined3d.h:626
@ WINED3D_TOP_BLEND_TEXTURE_ALPHA
Definition: wined3d.h:621
@ WINED3D_TOP_ADD_SIGNED
Definition: wined3d.h:616
@ WINED3D_TOP_DOTPRODUCT3
Definition: wined3d.h:632
@ WINED3D_TOP_PREMODULATE
Definition: wined3d.h:625
@ WINED3D_TOP_ADD_SMOOTH
Definition: wined3d.h:619
@ WINED3D_TOP_MODULATE_2X
Definition: wined3d.h:613
@ WINED3D_TOP_BLEND_FACTOR_ALPHA
Definition: wined3d.h:622

Referenced by set_tex_op(), and set_tex_op_nvrc().

◆ debug_d3dtstype()

const char * debug_d3dtstype ( enum wined3d_transform_state  tstype)

Definition at line 4627 of file utils.c.

4628{
4629 switch (tstype)
4630 {
4631#define TSTYPE_TO_STR(tstype) case tstype: return #tstype
4646#undef TSTYPE_TO_STR
4647 default:
4648 if (tstype > 256 && tstype < 512)
4649 {
4650 FIXME("WINED3D_TS_WORLD_MATRIX(%u). 1..255 not currently supported.\n", tstype);
4651 return ("WINED3D_TS_WORLD_MATRIX > 0");
4652 }
4653 FIXME("Unrecognized transform state %#x.\n", tstype);
4654 return "unrecognized";
4655 }
4656}
#define TSTYPE_TO_STR(tstype)
#define WINED3D_TS_WORLD_MATRIX(index)
Definition: wined3d.h:664
@ WINED3D_TS_TEXTURE1
Definition: wined3d.h:651
@ WINED3D_TS_TEXTURE0
Definition: wined3d.h:650
@ WINED3D_TS_TEXTURE2
Definition: wined3d.h:652
@ WINED3D_TS_PROJECTION
Definition: wined3d.h:649
@ WINED3D_TS_TEXTURE7
Definition: wined3d.h:657
@ WINED3D_TS_TEXTURE6
Definition: wined3d.h:656
@ WINED3D_TS_TEXTURE4
Definition: wined3d.h:654
@ WINED3D_TS_TEXTURE3
Definition: wined3d.h:653
@ WINED3D_TS_TEXTURE5
Definition: wined3d.h:655

Referenced by debug_d3dstate(), wined3d_device_get_transform(), wined3d_device_multiply_transform(), and wined3d_device_set_transform().

◆ debug_d3dusage()

const char * debug_d3dusage ( DWORD  usage)

Definition at line 4217 of file utils.c.

4218{
4219 struct debug_buffer buffer;
4220
4222#define WINED3DUSAGE_TO_STR(x) if (usage & x) { debug_append(&buffer, #x, " | "); usage &= ~x; }
4242#undef WINED3DUSAGE_TO_STR
4243 if (usage)
4244 FIXME("Unrecognized usage flag(s) %#x.\n", usage);
4245
4246 return wine_dbg_sprintf("%s", buffer.str);
4247}
static void init_debug_buffer(struct debug_buffer *buffer, const char *default_string)
Definition: utils.c:4175
#define WINED3DUSAGE_TO_STR(x)
#define WINED3DUSAGE_WRITEONLY
Definition: wined3d.h:901
#define WINED3DUSAGE_POINTS
Definition: wined3d.h:904
#define WINED3DUSAGE_DONOTCLIP
Definition: wined3d.h:903
#define WINED3DUSAGE_DMAP
Definition: wined3d.h:911
#define WINED3DUSAGE_OWNDC
Definition: wined3d.h:919
#define WINED3DUSAGE_LEGACY_CUBEMAP
Definition: wined3d.h:917
#define WINED3DUSAGE_RESTRICTED_CONTENT
Definition: wined3d.h:908
#define WINED3DUSAGE_OVERLAY
Definition: wined3d.h:921
#define WINED3DUSAGE_NPATCHES
Definition: wined3d.h:906
#define WINED3DUSAGE_TEXTAPI
Definition: wined3d.h:912
#define WINED3DUSAGE_RENDERTARGET
Definition: wined3d.h:899
#define WINED3DUSAGE_RTPATCHES
Definition: wined3d.h:905
#define WINED3DUSAGE_DYNAMIC
Definition: wined3d.h:907
#define WINED3DUSAGE_RESTRICT_SHARED_RESOURCE_DRIVER
Definition: wined3d.h:909
#define WINED3DUSAGE_STATICDECL
Definition: wined3d.h:920
#define WINED3DUSAGE_TEXTURE
Definition: wined3d.h:918
#define WINED3DUSAGE_SOFTWAREPROCESSING
Definition: wined3d.h:902
#define WINED3DUSAGE_RESTRICT_SHARED_RESOURCE
Definition: wined3d.h:910

Referenced by buffer_create_buffer_object(), wined3d_check_device_format(), wined3d_surface_blt(), and wined3d_texture_init().

◆ debug_d3dusagequery()

const char * debug_d3dusagequery ( DWORD  usagequery)

Definition at line 4249 of file utils.c.

4250{
4251 struct debug_buffer buffer;
4252
4254#define WINED3DUSAGEQUERY_TO_STR(x) if (usage & x) { debug_append(&buffer, #x, " | "); usage &= ~x; }
4263#undef WINED3DUSAGEQUERY_TO_STR
4264 if (usage)
4265 FIXME("Unrecognized usage query flag(s) %#x.\n", usage);
4266
4267 return wine_dbg_sprintf("%s", buffer.str);
4268}
#define WINED3DUSAGEQUERY_TO_STR(x)
#define WINED3DUSAGE_QUERY_LEGACYBUMPMAP
Definition: wined3d.h:924
#define WINED3DUSAGE_QUERY_SRGBREAD
Definition: wined3d.h:927
#define WINED3DUSAGE_QUERY_FILTER
Definition: wined3d.h:925
#define WINED3DUSAGE_QUERY_WRAPANDMIP
Definition: wined3d.h:930
#define WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING
Definition: wined3d.h:926
#define WINED3DUSAGE_QUERY_VERTEXTEXTURE
Definition: wined3d.h:929
#define WINED3DUSAGE_QUERY_GENMIPMAP
Definition: wined3d.h:923
#define WINED3DUSAGE_QUERY_SRGBWRITE
Definition: wined3d.h:928

Referenced by wined3d_check_device_format().

◆ debug_fboattachment()

const char * debug_fboattachment ( GLenum  attachment)

Definition at line 4745 of file utils.c.

4746{
4747 switch(attachment)
4748 {
4749#define WINED3D_TO_STR(x) case x: return #x
4768#undef WINED3D_TO_STR
4769 default:
4770 return wine_dbg_sprintf("Unknown FBO attachment %#x", attachment);
4771 }
4772}
#define GL_COLOR_ATTACHMENT5
Definition: glext.h:1719
#define GL_COLOR_ATTACHMENT13
Definition: glext.h:1727
#define GL_COLOR_ATTACHMENT7
Definition: glext.h:1721
#define GL_COLOR_ATTACHMENT9
Definition: glext.h:1723
#define GL_COLOR_ATTACHMENT11
Definition: glext.h:1725
#define GL_COLOR_ATTACHMENT2
Definition: glext.h:1716
#define GL_COLOR_ATTACHMENT1
Definition: glext.h:1715
#define GL_COLOR_ATTACHMENT3
Definition: glext.h:1717
#define GL_COLOR_ATTACHMENT8
Definition: glext.h:1722
#define GL_COLOR_ATTACHMENT10
Definition: glext.h:1724
#define GL_COLOR_ATTACHMENT15
Definition: glext.h:1729
#define GL_COLOR_ATTACHMENT4
Definition: glext.h:1718
#define GL_COLOR_ATTACHMENT12
Definition: glext.h:1726
#define GL_COLOR_ATTACHMENT6
Definition: glext.h:1720
#define GL_COLOR_ATTACHMENT14
Definition: glext.h:1728
GLenum attachment
Definition: glext.h:6295

Referenced by context_dump_fbo_attachment().

◆ debug_fbostatus()

const char * debug_fbostatus ( GLenum  status)

Definition at line 4774 of file utils.c.

4774 {
4775 switch(status) {
4776#define FBOSTATUS_TO_STR(u) case u: return #u
4789#undef FBOSTATUS_TO_STR
4790 default:
4791 FIXME("Unrecognized FBO status 0x%08x.\n", status);
4792 return "unrecognized";
4793 }
4794}
#define FBOSTATUS_TO_STR(u)
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE
Definition: glext.h:1747
#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB
Definition: glext.h:1770
#define GL_FRAMEBUFFER_UNDEFINED
Definition: glext.h:1682
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT
Definition: glext.h:4442
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
Definition: glext.h:1708
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
Definition: glext.h:1709
#define GL_FRAMEBUFFER_UNSUPPORTED
Definition: glext.h:1712
#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER
Definition: glext.h:1711
#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER
Definition: glext.h:1710
#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS
Definition: glext.h:819
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT
Definition: glext.h:4443

Referenced by context_check_fbo_status().

◆ debug_glerror()

const char * debug_glerror ( GLenum  error)

Definition at line 4796 of file utils.c.

4796 {
4797 switch(error) {
4798#define GLERROR_TO_STR(u) case u: return #u
4807#undef GLERROR_TO_STR
4808 default:
4809 FIXME("Unrecognized GL error 0x%08x.\n", error);
4810 return "unrecognized";
4811 }
4812}
#define GLERROR_TO_STR(u)
#define GL_INVALID_VALUE
Definition: gl.h:695
#define GL_INVALID_OPERATION
Definition: gl.h:696
#define GL_STACK_OVERFLOW
Definition: gl.h:697
#define GL_NO_ERROR
Definition: gl.h:693
#define GL_OUT_OF_MEMORY
Definition: gl.h:699
#define GL_INVALID_ENUM
Definition: gl.h:694
#define GL_STACK_UNDERFLOW
Definition: gl.h:698
#define GL_INVALID_FRAMEBUFFER_OPERATION
Definition: glext.h:1672
#define error(str)
Definition: mkdosfs.c:1605

Referenced by buffer_create_buffer_object(), match_allows_spec_alpha(), and wined3d_check_gl_call().

◆ debug_ivec4()

const char * debug_ivec4 ( const struct wined3d_ivec4 v)

Definition at line 3956 of file utils.c.

3957{
3958 if (!v)
3959 return "(null)";
3960 return wine_dbg_sprintf("{%d, %d, %d, %d}",
3961 v->x, v->y, v->z, v->w);
3962}
const GLdouble * v
Definition: gl.h:2040

Referenced by wined3d_device_set_ps_consts_i(), wined3d_device_set_vs_consts_i(), and wined3d_stateblock_capture().

◆ debug_shader_type()

const char * debug_shader_type ( enum wined3d_shader_type  shader_type)

Definition at line 4658 of file utils.c.

4659{
4660 switch(type)
4661 {
4662#define WINED3D_TO_STR(type) case type: return #type
4669#undef WINED3D_TO_STR
4670 default:
4671 FIXME("Unrecognized shader type %#x.\n", type);
4672 return "unrecognized";
4673 }
4674}

Referenced by arb_get_helper_value(), and debug_d3dstate().

◆ debug_uvec4()

const char * debug_uvec4 ( const struct wined3d_uvec4 v)

Definition at line 3964 of file utils.c.

3965{
3966 if (!v)
3967 return "(null)";
3968 return wine_dbg_sprintf("{%u, %u, %u, %u}",
3969 v->x, v->y, v->z, v->w);
3970}

Referenced by wined3d_device_clear_unordered_access_view_uint().

◆ debug_vec4()

const char * debug_vec4 ( const struct wined3d_vec4 v)

Definition at line 3972 of file utils.c.

3973{
3974 if (!v)
3975 return "(null)";
3976 return wine_dbg_sprintf("{%.8e, %.8e, %.8e, %.8e}",
3977 v->x, v->y, v->z, v->w);
3978}

Referenced by shader_arb_load_constants_f(), wined3d_device_set_ps_consts_f(), wined3d_device_set_vs_consts_f(), and wined3d_stateblock_capture().

◆ device_clear_render_targets()

void device_clear_render_targets ( struct wined3d_device device,
UINT  rt_count,
const struct wined3d_fb_state fb,
UINT  rect_count,
const RECT rects,
const RECT draw_rect,
DWORD  flags,
const struct wined3d_color color,
float  depth,
DWORD  stencil 
)

Definition at line 224 of file device.c.

227{
228 struct wined3d_rendertarget_view *rtv = rt_count ? fb->render_targets[0] : NULL;
231 struct wined3d_surface *depth_stencil = dsv ? wined3d_rendertarget_view_get_surface(dsv) : NULL;
232 const struct wined3d_state *state = &device->cs->state;
233 const struct wined3d_gl_info *gl_info;
234 UINT drawable_width, drawable_height;
235 struct wined3d_color corrected_color;
236 struct wined3d_context *context;
237 GLbitfield clear_mask = 0;
239 unsigned int i;
240
241 if (target)
243 else
245 if (!context->valid)
246 {
248 WARN("Invalid context, skipping clear.\n");
249 return;
250 }
251 gl_info = context->gl_info;
252
253 /* When we're clearing parts of the drawable, make sure that the target surface is well up to date in the
254 * drawable. After the clear we'll mark the drawable up to date, so we have to make sure that this is true
255 * for the cleared parts, and the untouched parts.
256 *
257 * If we're clearing the whole target there is no need to copy it into the drawable, it will be overwritten
258 * anyway. If we're not clearing the color buffer we don't have to copy either since we're not going to set
259 * the drawable up to date. We have to check all settings that limit the clear area though. Do not bother
260 * checking all this if the dest surface is in the drawable anyway. */
261 for (i = 0; i < rt_count; ++i)
262 {
263 struct wined3d_rendertarget_view *rtv = fb->render_targets[i];
264
265 if (rtv && rtv->format->id != WINED3DFMT_NULL)
266 {
268
270 draw_rect, rect_count ? clear_rect : NULL))
271 wined3d_texture_load_location(rt, rtv->sub_resource_idx, context, rtv->resource->draw_binding);
272 else
274 }
275 }
276
277 if (target)
278 {
279 render_offscreen = context->render_offscreen;
280 wined3d_rendertarget_view_get_drawable_size(rtv, context, &drawable_width, &drawable_height);
281 }
282 else
283 {
284 unsigned int ds_level = dsv->sub_resource_idx % depth_stencil->container->level_count;
285
286 render_offscreen = TRUE;
287 drawable_width = wined3d_texture_get_level_pow2_width(depth_stencil->container, ds_level);
288 drawable_height = wined3d_texture_get_level_pow2_height(depth_stencil->container, ds_level);
289 }
290
291 if (depth_stencil)
292 {
293 DWORD ds_location = render_offscreen ? dsv->resource->draw_binding : WINED3D_LOCATION_DRAWABLE;
295
297 && !is_full_clear(ds, dsv->sub_resource_idx, draw_rect, rect_count ? clear_rect : NULL))
299 else
301
303 {
306 }
307 }
308
309 if (!context_apply_clear_state(context, state, rt_count, fb))
310 {
312 WARN("Failed to apply clear state, skipping clear.\n");
313 return;
314 }
315
316 /* Only set the values up once, as they are not changing. */
318 {
319 if (gl_info->supported[EXT_STENCIL_TWO_SIDE])
320 {
321 gl_info->gl_ops.gl.p_glDisable(GL_STENCIL_TEST_TWO_SIDE_EXT);
323 }
324 gl_info->gl_ops.gl.p_glStencilMask(~0U);
326 gl_info->gl_ops.gl.p_glClearStencil(stencil);
327 checkGLcall("glClearStencil");
328 clear_mask = clear_mask | GL_STENCIL_BUFFER_BIT;
329 }
330
332 {
333 gl_info->gl_ops.gl.p_glDepthMask(GL_TRUE);
335 gl_info->gl_ops.gl.p_glClearDepth(depth);
336 checkGLcall("glClearDepth");
337 clear_mask = clear_mask | GL_DEPTH_BUFFER_BIT;
338 }
339
341 {
342 for (i = 0; i < rt_count; ++i)
343 {
344 struct wined3d_rendertarget_view *rtv = fb->render_targets[i];
345 struct wined3d_texture *texture;
346
347 if (!rtv)
348 continue;
349
350 if (rtv->resource->type == WINED3D_RTYPE_BUFFER)
351 {
352 FIXME("Not supported on buffer resources.\n");
353 continue;
354 }
355
359 }
360
362 {
363 if (rt_count > 1)
364 WARN("Clearing multiple sRGB render targets with no GL_ARB_framebuffer_sRGB "
365 "support, this might cause graphical issues.\n");
366
367 corrected_color.r = color->r < wined3d_srgb_const1[0]
368 ? color->r * wined3d_srgb_const0[3]
371 corrected_color.r = min(max(corrected_color.r, 0.0f), 1.0f);
372 corrected_color.g = color->g < wined3d_srgb_const1[0]
373 ? color->g * wined3d_srgb_const0[3]
376 corrected_color.g = min(max(corrected_color.g, 0.0f), 1.0f);
377 corrected_color.b = color->b < wined3d_srgb_const1[0]
378 ? color->b * wined3d_srgb_const0[3]
381 corrected_color.b = min(max(corrected_color.b, 0.0f), 1.0f);
382 color = &corrected_color;
383 }
384
385 gl_info->gl_ops.gl.p_glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
386 for (i = 0; i < MAX_RENDER_TARGETS; ++i)
388 gl_info->gl_ops.gl.p_glClearColor(color->r, color->g, color->b, color->a);
389 checkGLcall("glClearColor");
390 clear_mask = clear_mask | GL_COLOR_BUFFER_BIT;
391 }
392
393 if (!rect_count)
394 {
395 if (render_offscreen)
396 {
397 gl_info->gl_ops.gl.p_glScissor(draw_rect->left, draw_rect->top,
398 draw_rect->right - draw_rect->left, draw_rect->bottom - draw_rect->top);
399 }
400 else
401 {
402 gl_info->gl_ops.gl.p_glScissor(draw_rect->left, drawable_height - draw_rect->bottom,
403 draw_rect->right - draw_rect->left, draw_rect->bottom - draw_rect->top);
404 }
405 checkGLcall("glScissor");
406 gl_info->gl_ops.gl.p_glClear(clear_mask);
407 checkGLcall("glClear");
408 }
409 else
410 {
411 RECT current_rect;
412
413 /* Now process each rect in turn. */
414 for (i = 0; i < rect_count; ++i)
415 {
416 /* Note that GL uses lower left, width/height. */
417 IntersectRect(&current_rect, draw_rect, &clear_rect[i]);
418
419 TRACE("clear_rect[%u] %s, current_rect %s.\n", i,
420 wine_dbgstr_rect(&clear_rect[i]),
421 wine_dbgstr_rect(&current_rect));
422
423 /* Tests show that rectangles where x1 > x2 or y1 > y2 are ignored silently.
424 * The rectangle is not cleared, no error is returned, but further rectangles are
425 * still cleared if they are valid. */
426 if (current_rect.left > current_rect.right || current_rect.top > current_rect.bottom)
427 {
428 TRACE("Rectangle with negative dimensions, ignoring.\n");
429 continue;
430 }
431
432 if (render_offscreen)
433 {
434 gl_info->gl_ops.gl.p_glScissor(current_rect.left, current_rect.top,
435 current_rect.right - current_rect.left, current_rect.bottom - current_rect.top);
436 }
437 else
438 {
439 gl_info->gl_ops.gl.p_glScissor(current_rect.left, drawable_height - current_rect.bottom,
440 current_rect.right - current_rect.left, current_rect.bottom - current_rect.top);
441 }
442 checkGLcall("glScissor");
443
444 gl_info->gl_ops.gl.p_glClear(clear_mask);
445 checkGLcall("glClear");
446 }
447 }
448
450 && target->container->swapchain && target->container->swapchain->front_buffer == target->container))
451 gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */
452
454}
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define U(x)
Definition: wordpad.c:45
BOOL context_apply_clear_state(struct wined3d_context *context, const struct wined3d_state *state, UINT rt_count, const struct wined3d_fb_state *fb)
Definition: context.c:3047
static BOOL is_full_clear(const struct wined3d_texture *texture, unsigned int sub_resource_idx, const RECT *draw_rect, const RECT *clear_rect)
Definition: device.c:203
const float wined3d_srgb_const0[]
Definition: shader.c:36
const float wined3d_srgb_const1[]
Definition: shader.c:38
BOOL wined3d_texture_load_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location)
Definition: texture.c:229
void wined3d_texture_invalidate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD location)
Definition: texture.c:159
struct wined3d_texture *__cdecl wined3d_texture_from_resource(struct wined3d_resource *resource)
Definition: texture.c:2210
BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location)
Definition: texture.c:1605
void wined3d_texture_validate_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, DWORD location)
Definition: texture.c:135
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: view.c:404
double pow(double x, double y)
Definition: freeldr.c:112
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
#define GL_COLOR_BUFFER_BIT
Definition: gl.h:716
#define GL_STENCIL_BUFFER_BIT
Definition: gl.h:712
#define GL_DEPTH_BUFFER_BIT
Definition: gl.h:710
#define GL_STENCIL_TEST_TWO_SIDE_EXT
Definition: glext.h:4210
GLint GLfloat GLint stencil
Definition: glext.h:6260
#define ds
Definition: i386-dis.c:443
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
const struct wined3d_format * format
#define max(a, b)
Definition: svc.c:63
#define WINED3DCLEAR_TARGET
Definition: wined3d.h:997
#define WINED3DCLEAR_STENCIL
Definition: wined3d.h:999
#define WINED3DCLEAR_ZBUFFER
Definition: wined3d.h:998
static enum wined3d_render_state WINED3D_RS_COLORWRITE(int index)
Definition: wined3d.h:400
@ EXT_STENCIL_TWO_SIDE
Definition: wined3d_gl.h:169
static unsigned int wined3d_texture_get_level_pow2_height(const struct wined3d_texture *texture, unsigned int level)
static unsigned int wined3d_texture_get_level_pow2_width(const struct wined3d_texture *texture, unsigned int level)
#define MAX_RENDER_TARGETS
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)

Referenced by ffp_blitter_clear().

◆ device_context_add()

BOOL device_context_add ( struct wined3d_device device,
struct wined3d_context context 
)

Definition at line 146 of file device.c.

147{
148 struct wined3d_context **new_array;
149
150 TRACE("Adding context %p.\n", context);
151
152 if (!(new_array = heap_realloc(device->contexts, sizeof(*new_array) * (device->context_count + 1))))
153 {
154 ERR("Failed to grow the context array.\n");
155 return FALSE;
156 }
157
158 new_array[device->context_count++] = context;
159 device->contexts = new_array;
160 return TRUE;
161}

Referenced by context_create().

◆ device_context_remove()

void device_context_remove ( struct wined3d_device device,
struct wined3d_context context 
)

Definition at line 163 of file device.c.

164{
165 struct wined3d_context **new_array;
166 BOOL found = FALSE;
167 UINT i;
168
169 TRACE("Removing context %p.\n", context);
170
171 for (i = 0; i < device->context_count; ++i)
172 {
173 if (device->contexts[i] == context)
174 {
175 found = TRUE;
176 break;
177 }
178 }
179
180 if (!found)
181 {
182 ERR("Context %p doesn't exist in context array.\n", context);
183 return;
184 }
185
186 if (!--device->context_count)
187 {
188 heap_free(device->contexts);
189 device->contexts = NULL;
190 return;
191 }
192
193 memmove(&device->contexts[i], &device->contexts[i + 1], (device->context_count - i) * sizeof(*device->contexts));
194 if (!(new_array = heap_realloc(device->contexts, device->context_count * sizeof(*device->contexts))))
195 {
196 ERR("Failed to shrink context array. Oh well.\n");
197 return;
198 }
199
200 device->contexts = new_array;
201}
#define memmove(s1, s2, n)
Definition: mkisofs.h:881

Referenced by context_create(), and context_destroy().

◆ device_init()

HRESULT device_init ( struct wined3d_device device,
struct wined3d wined3d,
UINT  adapter_idx,
enum wined3d_device_type  device_type,
HWND  focus_window,
DWORD  flags,
BYTE  surface_alignment,
struct wined3d_device_parent device_parent 
)

Definition at line 5195 of file device.c.

5198{
5199 struct wined3d_adapter *adapter = &wined3d->adapters[adapter_idx];
5201 const struct wined3d_vertex_pipe_ops *vertex_pipeline;
5202 unsigned int i;
5203 HRESULT hr;
5204
5205 device->ref = 1;
5206 device->wined3d = wined3d;
5207 wined3d_incref(device->wined3d);
5208 device->adapter = wined3d->adapter_count ? adapter : NULL;
5209 device->device_parent = device_parent;
5210 list_init(&device->resources);
5211 list_init(&device->shaders);
5212 device->surface_alignment = surface_alignment;
5213
5214 /* Save the creation parameters. */
5215 device->create_parms.adapter_idx = adapter_idx;
5216 device->create_parms.device_type = device_type;
5217 device->create_parms.focus_window = focus_window;
5218 device->create_parms.flags = flags;
5219
5220 device->shader_backend = adapter->shader_backend;
5221
5222 vertex_pipeline = adapter->vertex_pipe;
5223
5224 fragment_pipeline = adapter->fragment_pipe;
5225
5227
5228 if (vertex_pipeline->vp_states && fragment_pipeline->states
5229 && FAILED(hr = compile_state_table(device->StateTable, device->multistate_funcs,
5230 &adapter->gl_info, &adapter->d3d_info, vertex_pipeline,
5232 {
5233 ERR("Failed to compile state table, hr %#x.\n", hr);
5234 wine_rb_destroy(&device->samplers, NULL, NULL);
5235 wined3d_decref(device->wined3d);
5236 return hr;
5237 }
5238
5239 state_init(&device->state, &device->fb, &adapter->gl_info,
5241 device->update_state = &device->state;
5242
5243 if (!(device->cs = wined3d_cs_create(device)))
5244 {
5245 WARN("Failed to create command stream.\n");
5246 state_cleanup(&device->state);
5247 hr = E_FAIL;
5248 goto err;
5249 }
5250
5251 return WINED3D_OK;
5252
5253err:
5254 for (i = 0; i < ARRAY_SIZE(device->multistate_funcs); ++i)
5255 {
5256 heap_free(device->multistate_funcs[i]);
5257 }
5258 wine_rb_destroy(&device->samplers, NULL, NULL);
5259 wined3d_decref(device->wined3d);
5260 return hr;
5261}
struct wined3d_cs * wined3d_cs_create(struct wined3d_device *device)
Definition: cs.c:2828
#define E_FAIL
Definition: ddrawi.h:102
void state_init(void *ipp)
Definition: dhclient.c:210
static int wined3d_sampler_compare(const void *key, const struct wine_rb_entry *entry)
Definition: device.c:5188
const struct StateEntryTemplate misc_state_template[]
Definition: state.c:5100
HRESULT compile_state_table(struct StateEntry *StateTable, APPLYSTATEFUNC **dev_multistate_funcs, const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info, const struct wined3d_vertex_pipe_ops *vertex, const struct fragment_pipeline *fragment, const struct StateEntryTemplate *misc)
Definition: state.c:6142
#define FAILED(hr)
Definition: intsafe.h:51
static void wine_rb_destroy(struct wine_rb_tree *tree, wine_rb_traverse_func_t *callback, void *context)
Definition: rbtree.h:198
static void wine_rb_init(struct wine_rb_tree *tree, wine_rb_compare_func_t compare)
Definition: rbtree.h:179
HRESULT hr
Definition: shlfolder.c:183
const struct StateEntryTemplate * vp_states
UINT adapter_count
struct wined3d_adapter adapters[1]
ULONG CDECL wined3d_decref(struct wined3d *wined3d)
Definition: directx.c:465
ULONG CDECL wined3d_incref(struct wined3d *wined3d)
Definition: directx.c:456
void state_cleanup(struct wined3d_state *state)
Definition: stateblock.c:528
#define WINED3D_STATE_INIT_DEFAULT

◆ device_invalidate_state()

void device_invalidate_state ( const struct wined3d_device device,
DWORD  state 
)

Definition at line 5263 of file device.c.

5264{
5265 DWORD rep = device->StateTable[state].representative;
5266 struct wined3d_context *context;
5267 DWORD idx;
5268 BYTE shift;
5269 UINT i;
5270
5272
5274 {
5275 for (i = 0; i < device->context_count; ++i)
5277 return;
5278 }
5279
5280 for (i = 0; i < device->context_count; ++i)
5281 {
5282 context = device->contexts[i];
5283 if(isStateDirty(context, rep)) continue;
5284
5285 context->dirtyArray[context->numDirtyEntries++] = rep;
5286 idx = rep / (sizeof(*context->isStateDirty) * CHAR_BIT);
5287 shift = rep & ((sizeof(*context->isStateDirty) * CHAR_BIT) - 1);
5288 context->isStateDirty[idx] |= (1u << shift);
5289 }
5290}
void context_invalidate_compute_state(struct wined3d_context *context, DWORD state_id)
Definition: context.c:1642

Referenced by buffer_destroy_buffer_object(), surface_load_fb_texture(), wined3d_cs_exec_draw(), wined3d_cs_exec_set_blend_state(), wined3d_cs_exec_set_clip_plane(), wined3d_cs_exec_set_color_key(), wined3d_cs_exec_set_constant_buffer(), wined3d_cs_exec_set_depth_stencil_view(), wined3d_cs_exec_set_index_buffer(), wined3d_cs_exec_set_light(), wined3d_cs_exec_set_light_enable(), wined3d_cs_exec_set_material(), wined3d_cs_exec_set_rasterizer_state(), wined3d_cs_exec_set_render_state(), wined3d_cs_exec_set_rendertarget_view(), wined3d_cs_exec_set_sampler(), wined3d_cs_exec_set_sampler_state(), wined3d_cs_exec_set_scissor_rect(), wined3d_cs_exec_set_shader(), wined3d_cs_exec_set_shader_resource_view(), wined3d_cs_exec_set_stream_output(), wined3d_cs_exec_set_stream_source(), wined3d_cs_exec_set_stream_source_freq(), wined3d_cs_exec_set_texture(), wined3d_cs_exec_set_texture_state(), wined3d_cs_exec_set_transform(), wined3d_cs_exec_set_unordered_access_view(), wined3d_cs_exec_set_vertex_declaration(), wined3d_cs_exec_set_viewport(), and wined3d_swapchain_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 5292 of file device.c.

5294{
5295 if (device->filter_messages && message != WM_DISPLAYCHANGE)
5296 {
5297 TRACE("Filtering message: window %p, message %#x, wparam %#lx, lparam %#lx.\n",
5299 if (unicode)
5301 else
5303 }
5304
5305 if (message == WM_DESTROY)
5306 {
5307 TRACE("unregister window %p.\n", window);
5309
5310 if (InterlockedCompareExchangePointer((void **)&device->focus_window, NULL, window) != window)
5311 ERR("Window %p is not the focus window for device %p.\n", window, device);
5312 }
5313 else if (message == WM_DISPLAYCHANGE)
5314 {
5315 device->device_parent->ops->mode_changed(device->device_parent);
5316 }
5317 else if (message == WM_ACTIVATEAPP)
5318 {
5319 UINT i;
5320
5321 for (i = 0; i < device->swapchain_count; i++)
5323
5324 device->device_parent->ops->activate(device->device_parent, wparam);
5325 }
5326 else if (message == WM_SYSCOMMAND)
5327 {
5328 if (wparam == SC_RESTORE && device->wined3d->flags & WINED3D_HANDLE_RESTORE)
5329 {
5330 if (unicode)
5332 else
5334 }
5335 }
5336
5337 if (unicode)
5339 else
5341}
@ lparam
Definition: SystemMenu.c:31
@ wparam
Definition: SystemMenu.c:30
#define InterlockedCompareExchangePointer
Definition: interlocked.h:129
static IHTMLWindow2 * window
Definition: events.c:77
static HANDLE proc()
Definition: pdb.c:34
Definition: tftpd.h:60
void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activate)
Definition: swapchain.c:1149
#define WINED3D_HANDLE_RESTORE
Definition: wined3d.h:1321
void wined3d_unregister_window(HWND window)
Definition: wined3d_main.c:470
#define WM_SYSCOMMAND
Definition: winuser.h:1741
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:1632
#define WM_DESTROY
Definition: winuser.h:1609
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SC_RESTORE
Definition: winuser.h:2598
LRESULT WINAPI CallWindowProcA(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by wined3d_wndproc().

◆ device_resource_add()

void device_resource_add ( struct wined3d_device device,
struct wined3d_resource resource 
)

Definition at line 5081 of file device.c.

5082{
5083 TRACE("device %p, resource %p.\n", device, resource);
5084
5086
5087 list_add_head(&device->resources, &resource->resource_list_entry);
5088}
static void wined3d_not_from_cs(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 5099 of file device.c.

5100{
5101 enum wined3d_resource_type type = resource->type;
5102 struct wined3d_rendertarget_view *rtv;
5103 unsigned int i;
5104
5105 TRACE("device %p, resource %p, type %s.\n", device, resource, debug_d3dresourcetype(type));
5106
5107 if (device->d3d_initialized)
5108 {
5109 for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
5110 {
5111 if ((rtv = device->fb.render_targets[i]) && rtv->resource == resource)
5112 ERR("Resource %p is still in use as render target %u.\n", resource, i);
5113 }
5114
5115 if ((rtv = device->fb.depth_stencil) && rtv->resource == resource)
5116 ERR("Resource %p is still in use as depth/stencil buffer.\n", resource);
5117 }
5118
5119 switch (type)
5120 {
5124 for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i)
5125 {
5127
5128 if (device->state.textures[i] == texture)
5129 {
5130 ERR("Texture %p is still in use, stage %u.\n", texture, i);
5131 device->state.textures[i] = NULL;
5132 }
5133
5134 if (device->recording && device->update_state->textures[i] == texture)
5135 {
5136 ERR("Texture %p is still in use by recording stateblock %p, stage %u.\n",
5137 texture, device->recording, i);
5138 device->update_state->textures[i] = NULL;
5139 }
5140 }
5141 break;
5142
5144 {
5146
5147 for (i = 0; i < MAX_STREAMS; ++i)
5148 {
5149 if (device->state.streams[i].buffer == buffer)
5150 {
5151 ERR("Buffer %p is still in use, stream %u.\n", buffer, i);
5152 device->state.streams[i].buffer = NULL;
5153 }
5154
5155 if (device->recording && device->update_state->streams[i].buffer == buffer)
5156 {
5157 ERR("Buffer %p is still in use by stateblock %p, stream %u.\n",
5158 buffer, device->recording, i);
5159 device->update_state->streams[i].buffer = NULL;
5160 }
5161 }
5162
5163 if (device->state.index_buffer == buffer)
5164 {
5165 ERR("Buffer %p is still in use as index buffer.\n", buffer);
5166 device->state.index_buffer = NULL;
5167 }
5168
5169 if (device->recording && device->update_state->index_buffer == buffer)
5170 {
5171 ERR("Buffer %p is still in use by stateblock %p as index buffer.\n",
5172 buffer, device->recording);
5173 device->update_state->index_buffer = NULL;
5174 }
5175 }
5176 break;
5177
5178 default:
5179 break;
5180 }
5181
5182 /* Remove the resource from the resourceStore */
5184
5185 TRACE("Resource released.\n");
5186}
static void device_resource_remove(struct wined3d_device *device, struct wined3d_resource *resource)
Definition: device.c:5090
const char * debug_d3dresourcetype(enum wined3d_resource_type resource_type)
Definition: utils.c:4329
wined3d_resource_type
Definition: wined3d.h:696
#define MAX_STREAMS
static struct wined3d_buffer * buffer_from_resource(struct wined3d_resource *resource)

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 4327 of file context.c.

4329{
4330 const struct wined3d_gl_info *gl_info;
4331 struct wined3d_context *context;
4332
4334 if (!context->valid)
4335 {
4337 WARN("Invalid context, skipping dispatch.\n");
4338 return;
4339 }
4340 gl_info = context->gl_info;
4341
4342 if (!gl_info->supported[ARB_COMPUTE_SHADER])
4343 {
4345 FIXME("OpenGL implementation does not support compute shaders.\n");
4346 return;
4347 }
4348
4349 if (parameters->indirect)
4350 wined3d_buffer_load(parameters->u.indirect.buffer, context, state);
4351
4353
4354 if (!state->shader[WINED3D_SHADER_TYPE_COMPUTE])
4355 {
4357 WARN("No compute shader bound, skipping dispatch.\n");
4358 return;
4359 }
4360
4361 if (parameters->indirect)
4362 {
4363 const struct wined3d_indirect_dispatch_parameters *indirect = &parameters->u.indirect;
4364 struct wined3d_buffer *buffer = indirect->buffer;
4365
4366 GL_EXTCALL(glBindBuffer(GL_DISPATCH_INDIRECT_BUFFER, buffer->buffer_object));
4367 GL_EXTCALL(glDispatchComputeIndirect((GLintptr)indirect->offset));
4368 GL_EXTCALL(glBindBuffer(GL_DISPATCH_INDIRECT_BUFFER, 0));
4369 }
4370 else
4371 {
4372 const struct wined3d_direct_dispatch_parameters *direct = &parameters->u.direct;
4373 GL_EXTCALL(glDispatchCompute(direct->group_count_x, direct->group_count_y, direct->group_count_z));
4374 }
4375 checkGLcall("dispatch compute");
4376
4377 GL_EXTCALL(glMemoryBarrier(GL_ALL_BARRIER_BITS));
4378 checkGLcall("glMemoryBarrier");
4379
4381 gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */
4382
4384}
void wined3d_buffer_load(struct wined3d_buffer *buffer, struct wined3d_context *context, const struct wined3d_state *state)
Definition: buffer.c:887
static void context_apply_compute_state(struct wined3d_context *context, const struct wined3d_device *device, const struct wined3d_state *state)
Definition: context.c:4060
#define GL_ALL_BARRIER_BITS
Definition: glext.h:2341
#define GL_DISPATCH_INDIRECT_BUFFER
Definition: wgl.h:1027
@ ARB_COMPUTE_SHADER
Definition: wined3d_gl.h:51

Referenced by wined3d_cs_exec_dispatch().

◆ draw_primitive()

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

Definition at line 4924 of file context.c.

4926{
4927 BOOL emulation = FALSE, rasterizer_discard = FALSE;
4928 const struct wined3d_fb_state *fb = state->fb;
4929 const struct wined3d_stream_info *stream_info;
4930 struct wined3d_rendertarget_view *dsv, *rtv;
4931 struct wined3d_stream_info si_emulated;
4932 struct wined3d_fence *ib_fence = NULL;
4933 const struct wined3d_gl_info *gl_info;
4934 struct wined3d_context *context;
4935 unsigned int i, idx_size = 0;
4936 const void *idx_data = NULL;
4937
4938 if (!parameters->indirect && !parameters->u.direct.index_count)
4939 return;
4940
4941 if (!(rtv = fb->render_targets[0]))
4942 rtv = fb->depth_stencil;
4943 if (rtv)
4945 else
4947 if (!context->valid)
4948 {
4950 WARN("Invalid context, skipping draw.\n");
4951 return;
4952 }
4953 gl_info = context->gl_info;
4954
4957
4958 for (i = 0; i < gl_info->limits.buffers; ++i)
4959 {
4960 if (!(rtv = fb->render_targets[i]) || rtv->format->id == WINED3DFMT_NULL)
4961 continue;
4962
4963 if (state->render_states[WINED3D_RS_COLORWRITE(i)])
4964 {
4967 }
4968 else
4969 {
4971 }
4972 }
4973
4974 if ((dsv = fb->depth_stencil))
4975 {
4976 /* Note that this depends on the context_acquire() call above to set
4977 * context->render_offscreen properly. We don't currently take the
4978 * Z-compare function into account, but we could skip loading the
4979 * depthstencil for D3DCMP_NEVER and D3DCMP_ALWAYS as well. Also note
4980 * that we never copy the stencil data.*/
4981 DWORD location = context->render_offscreen ? dsv->resource->draw_binding : WINED3D_LOCATION_DRAWABLE;
4982
4983 if (state->render_states[WINED3D_RS_ZWRITEENABLE] || state->render_states[WINED3D_RS_ZENABLE])
4985 else
4987 }
4988
4989 if (parameters->indirect)
4990 wined3d_buffer_load(parameters->u.indirect.buffer, context, state);
4991
4993 {
4995 WARN("Unable to apply draw state, skipping draw.\n");
4996 return;
4997 }
4998
4999 if (dsv && state->render_states[WINED3D_RS_ZWRITEENABLE])
5000 {
5001 DWORD location = context->render_offscreen ? dsv->resource->draw_binding : WINED3D_LOCATION_DRAWABLE;
5002
5005 }
5006
5007 stream_info = &context->stream_info;
5008
5009 if (parameters->indexed)
5010 {
5011 struct wined3d_buffer *index_buffer = state->index_buffer;
5012 if (!index_buffer->buffer_object || !stream_info->all_vbo)
5013 {
5014 idx_data = index_buffer->resource.heap_memory;
5015 }
5016 else
5017 {
5018 ib_fence = index_buffer->fence;
5019 idx_data = NULL;
5020 }
5021 idx_data = (const BYTE *)idx_data + state->index_offset;
5022
5023 if (state->index_format == WINED3DFMT_R16_UINT)
5024 idx_size = 2;
5025 else
5026 idx_size = 4;
5027 }
5028
5029 if (!use_vs(state))
5030 {
5031 if (!stream_info->position_transformed && context->num_untracked_materials
5032 && state->render_states[WINED3D_RS_LIGHTING])
5033 {
5034 static BOOL warned;
5035
5036 if (!warned++)
5037 FIXME("Using software emulation because not all material properties could be tracked.\n");
5038 else
5039 WARN_(d3d_perf)("Using software emulation because not all material properties could be tracked.\n");
5040 emulation = TRUE;
5041 }
5042 else if (context->fog_coord && state->render_states[WINED3D_RS_FOGENABLE])
5043 {
5044 static BOOL warned;
5045
5046 /* Either write a pipeline replacement shader or convert the
5047 * specular alpha from unsigned byte to a float in the vertex
5048 * buffer. */
5049 if (!warned++)
5050 FIXME("Using software emulation because manual fog coordinates are provided.\n");
5051 else
5052 WARN_(d3d_perf)("Using software emulation because manual fog coordinates are provided.\n");
5053 emulation = TRUE;
5054 }
5056 {
5057 WARN_(d3d_perf)("Using software emulation because application requested SVP.\n");
5058 emulation = TRUE;
5059 }
5060
5061
5062 if (emulation)
5063 {
5064 si_emulated = context->stream_info;
5065 remove_vbos(context, state, &si_emulated);
5066 stream_info = &si_emulated;
5067 }
5068 }
5069
5071 {
5073
5075 {
5077 checkGLcall("enable rasterizer discard");
5078 rasterizer_discard = TRUE;
5079 }
5080
5081 if (context->transform_feedback_paused)
5082 {
5083 GL_EXTCALL(glResumeTransformFeedback());
5084 checkGLcall("glResumeTransformFeedback");
5085 context->transform_feedback_paused = 0;
5086 }
5087 else if (!context->transform_feedback_active)
5088 {
5089 GLenum mode = gl_tfb_primitive_type_from_d3d(shader->u.gs.output_type);
5090 GL_EXTCALL(glBeginTransformFeedback(mode));
5091 checkGLcall("glBeginTransformFeedback");
5092 context->transform_feedback_active = 1;
5093 }
5094 }
5095
5096 if (state->gl_primitive_type == GL_PATCHES)
5097 {
5098 GL_EXTCALL(glPatchParameteri(GL_PATCH_VERTICES, state->gl_patch_vertices));
5099 checkGLcall("glPatchParameteri");
5100 }
5101
5102 if (parameters->indirect)
5103 {
5104 if (!context->use_immediate_mode_draw && !emulation)
5105 draw_indirect(context, state, &parameters->u.indirect, idx_size);
5106 else
5107 FIXME("Indirect draws with immediate mode/emulation are not supported.\n");
5108 }
5109 else
5110 {
5111 unsigned int instance_count = parameters->u.direct.instance_count;
5112 if (context->instance_count)
5113 instance_count = context->instance_count;
5114
5115 if (context->use_immediate_mode_draw || emulation)
5117 idx_size, parameters->u.direct.base_vertex_idx,
5118 parameters->u.direct.start_idx, parameters->u.direct.index_count, instance_count);
5119 else
5120 draw_primitive_arrays(context, state, idx_data, idx_size, parameters->u.direct.base_vertex_idx,
5121 parameters->u.direct.start_idx, parameters->u.direct.index_count,
5122 parameters->u.direct.start_instance, instance_count);
5123 }
5124
5125 if (context->uses_uavs)
5126 {
5127 GL_EXTCALL(glMemoryBarrier(GL_ALL_BARRIER_BITS));
5128 checkGLcall("glMemoryBarrier");
5129 }
5130
5132
5133 if (rasterizer_discard)
5134 {
5136 checkGLcall("disable rasterizer discard");
5137 }
5138
5139 if (ib_fence)
5140 wined3d_fence_issue(ib_fence, device);
5141 for (i = 0; i < context->buffer_fence_count; ++i)
5142 wined3d_fence_issue(context->buffer_fences[i], device);
5143
5145 gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */
5146
5148}
static BOOL use_transform_feedback(const struct wined3d_state *state)
Definition: context.c:4119
static void remove_vbos(struct wined3d_context *context, const struct wined3d_state *state, struct wined3d_stream_info *s)
Definition: context.c:4875
static GLenum gl_tfb_primitive_type_from_d3d(enum wined3d_primitive_type primitive_type)
Definition: context.c:4897
static void draw_primitive_immediate_mode(struct wined3d_context *context, const struct wined3d_state *state, const struct wined3d_stream_info *si, const void *idx_data, unsigned int idx_size, int base_vertex_idx, unsigned int start_idx, unsigned int vertex_count, unsigned int instance_count)
Definition: context.c:4622
static BOOL context_apply_draw_state(struct wined3d_context *context, const struct wined3d_device *device, const struct wined3d_state *state)
Definition: context.c:3947
static void context_pause_transform_feedback(struct wined3d_context *context, BOOL force)
Definition: context.c:4139
static void draw_indirect(struct wined3d_context *context, const struct wined3d_state *state, const struct wined3d_indirect_draw_parameters *parameters, unsigned int idx_size)
Definition: context.c:4842
static void draw_primitive_arrays(struct wined3d_context *context, 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.c:4387
void wined3d_fence_issue(struct wined3d_fence *fence, const struct wined3d_device *device)
Definition: query.c:244
void wined3d_rendertarget_view_prepare_location(struct wined3d_rendertarget_view *view, struct wined3d_context *context, DWORD location)
Definition: view.c:446
void wined3d_rendertarget_view_invalidate_location(struct wined3d_rendertarget_view *view, DWORD location)
Definition: view.c:505
void wined3d_rendertarget_view_load_location(struct wined3d_rendertarget_view *view, struct wined3d_context *context, DWORD location)
Definition: view.c:466
void wined3d_rendertarget_view_validate_location(struct wined3d_rendertarget_view *view, DWORD location)
Definition: view.c:486
GLAPI void GLAPIENTRY glEnable(GLenum cap)
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
#define GL_PATCHES
Definition: glext.h:2090
static void stream_info(IStream *stream, HGLOBAL *hmem, int *size, int *pos)
#define WARN_(ch,...)
Definition: debug.h:157
struct wined3d_fence * fence
struct wined3d_resource resource
static BOOL use_indexed_vertex_blending(const struct wined3d_state *state, const struct wined3d_stream_info *si)
static BOOL use_software_vertex_processing(const struct wined3d_device *device)
static BOOL is_rasterization_disabled(const struct wined3d_shader *geometry_shader)

Referenced by wined3d_cs_exec_draw().

◆ draw_textured_quad()

void draw_textured_quad ( struct wined3d_texture texture,
unsigned int  sub_resource_idx,
struct wined3d_context context,
const RECT src_rect,
const RECT dst_rect,
enum wined3d_texture_filter_type  filter 
)

Definition at line 188 of file surface.c.

191{
192 const struct wined3d_gl_info *gl_info = context->gl_info;
193 struct blt_info info;
194
195 texture2d_get_blt_info(texture, sub_resource_idx, src_rect, &info);
196
197 gl_info->gl_ops.gl.p_glEnable(info.bind_target);
198 checkGLcall("glEnable(bind_target)");
199
200 context_bind_texture(context, info.bind_target, texture->texture_rgb.name);
201
202 /* Filtering for StretchRect */
203 gl_info->gl_ops.gl.p_glTexParameteri(info.bind_target, GL_TEXTURE_MAG_FILTER, wined3d_gl_mag_filter(filter));
204 checkGLcall("glTexParameteri");
205 gl_info->gl_ops.gl.p_glTexParameteri(info.bind_target, GL_TEXTURE_MIN_FILTER,
207 checkGLcall("glTexParameteri");
208 gl_info->gl_ops.gl.p_glTexParameteri(info.bind_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
209 gl_info->gl_ops.gl.p_glTexParameteri(info.bind_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
210 if (context->gl_info->supported[EXT_TEXTURE_SRGB_DECODE])
211 gl_info->gl_ops.gl.p_glTexParameteri(info.bind_target, GL_TEXTURE_SRGB_DECODE_EXT, GL_SKIP_DECODE_EXT);
212 gl_info->gl_ops.gl.p_glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
213 checkGLcall("glTexEnvi");
214
215 /* Draw a quad */
216 gl_info->gl_ops.gl.p_glBegin(GL_TRIANGLE_STRIP);
217 gl_info->gl_ops.gl.p_glTexCoord3fv(&info.texcoords[0].x);
218 gl_info->gl_ops.gl.p_glVertex2i(dst_rect->left, dst_rect->top);
219
220 gl_info->gl_ops.gl.p_glTexCoord3fv(&info.texcoords[1].x);
221 gl_info->gl_ops.gl.p_glVertex2i(dst_rect->right, dst_rect->top);
222
223 gl_info->gl_ops.gl.p_glTexCoord3fv(&info.texcoords[2].x);
224 gl_info->gl_ops.gl.p_glVertex2i(dst_rect->left, dst_rect->bottom);
225
226 gl_info->gl_ops.gl.p_glTexCoord3fv(&info.texcoords[3].x);
227 gl_info->gl_ops.gl.p_glVertex2i(dst_rect->right, dst_rect->bottom);
228 gl_info->gl_ops.gl.p_glEnd();
229
230 /* Unbind the texture */
231 context_bind_texture(context, info.bind_target, 0);
232
233 /* We changed the filtering settings on the texture. Inform the
234 * container about this to get the filters reset properly next draw. */
235 texture->texture_rgb.sampler_desc.mag_filter = WINED3D_TEXF_POINT;
236 texture->texture_rgb.sampler_desc.min_filter = WINED3D_TEXF_POINT;
237 texture->texture_rgb.sampler_desc.mip_filter = WINED3D_TEXF_NONE;
238 texture->texture_rgb.sampler_desc.srgb_decode = FALSE;
239}
void context_bind_texture(struct wined3d_context *context, GLenum target, GLuint name)
Definition: context.c:2734
static void texture2d_get_blt_info(const struct wined3d_texture *texture, unsigned int sub_resource_idx, const RECT *rect, struct blt_info *info)
Definition: surface.c:63
#define GL_TEXTURE_MIN_FILTER
Definition: gl.h:649
#define GL_TEXTURE_WRAP_S
Definition: gl.h:646
#define GL_TEXTURE_WRAP_T
Definition: gl.h:647
#define GL_TEXTURE_MAG_FILTER
Definition: gl.h:648
#define GL_TRIANGLE_STRIP
Definition: gl.h:195
#define GL_CLAMP_TO_EDGE
Definition: gl.h:1481
#define GL_REPLACE
Definition: gl.h:460
#define GL_SKIP_DECODE_EXT
Definition: glext.h:5291
#define GL_TEXTURE_SRGB_DECODE_EXT
Definition: glext.h:5289
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
@ EXT_TEXTURE_SRGB_DECODE
Definition: wined3d_gl.h:183
static GLenum wined3d_gl_mag_filter(enum wined3d_texture_filter_type mag_filter)
static GLenum wined3d_gl_min_mip_filter(enum wined3d_texture_filter_type min_filter, enum wined3d_texture_filter_type mip_filter)

Referenced by arbfp_blitter_blit(), and ffp_blitter_blit().

◆ dump_color_fixup_desc()

void dump_color_fixup_desc ( struct color_fixup_desc  fixup)

Definition at line 4851 of file utils.c.

4852{
4853 if (is_complex_fixup(fixup))
4854 {
4855 TRACE("\tComplex: %s\n", debug_complex_fixup(get_complex_fixup(fixup)));
4856 return;
4857 }
4858
4859 TRACE("\tX: %s%s\n", debug_fixup_channel_source(fixup.x_source), fixup.x_sign_fixup ? ", SIGN_FIXUP" : "");
4860 TRACE("\tY: %s%s\n", debug_fixup_channel_source(fixup.y_source), fixup.y_sign_fixup ? ", SIGN_FIXUP" : "");
4861 TRACE("\tZ: %s%s\n", debug_fixup_channel_source(fixup.z_source), fixup.z_sign_fixup ? ", SIGN_FIXUP" : "");
4862 TRACE("\tW: %s%s\n", debug_fixup_channel_source(fixup.w_source), fixup.w_sign_fixup ? ", SIGN_FIXUP" : "");
4863}
static const char * debug_fixup_channel_source(enum fixup_channel_source source)
Definition: utils.c:4814
static const char * debug_complex_fixup(enum complex_fixup fixup)
Definition: utils.c:4834
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(), arbfp_blit_supported(), and ffp_blit_supported().

◆ 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 3748 of file shader.c.

3750{
3751 const struct wined3d_shader *geometry_shader = state->shader[WINED3D_SHADER_TYPE_GEOMETRY];
3752 const struct wined3d_shader *pixel_shader = state->shader[WINED3D_SHADER_TYPE_PIXEL];
3753 const struct wined3d_shader *hull_shader = state->shader[WINED3D_SHADER_TYPE_HULL];
3754 const struct wined3d_gl_info *gl_info = context->gl_info;
3755
3756 args->tessellator_output_primitive = hull_shader->u.hs.tessellator_output_primitive;
3757 args->tessellator_partitioning = hull_shader->u.hs.tessellator_partitioning;
3758
3759 args->output_count = geometry_shader ? geometry_shader->limits->packed_input
3760 : pixel_shader ? pixel_shader->limits->packed_input : shader->limits->packed_output;
3761 args->next_shader_type = geometry_shader ? WINED3D_SHADER_TYPE_GEOMETRY : WINED3D_SHADER_TYPE_PIXEL;
3762
3763 args->render_offscreen = context->render_offscreen;
3764
3765 init_interpolation_compile_args(args->interpolation_mode,
3766 args->next_shader_type == WINED3D_SHADER_TYPE_PIXEL ? pixel_shader : NULL, gl_info);
3767
3768 args->padding = 0;
3769}
static void init_interpolation_compile_args(DWORD *interpolation_args, const struct wined3d_shader *pixel_shader, const struct wined3d_gl_info *gl_info)
Definition: shader.c:3449
Definition: match.c:390
union wined3d_shader::@289 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 6076 of file utils.c.

6078{
6079 struct wine_rb_entry *entry = wine_rb_get(fragment_shaders, settings);
6081}
struct mke2fs_defaults settings[]
#define WINE_RB_ENTRY_VALUE(element, type, field)
Definition: rbtree.h:31
static struct wine_rb_entry * wine_rb_get(const struct wine_rb_tree *tree, const void *key)
Definition: rbtree.h:203
Definition: rbtree.h:36

Referenced by fragment_prog_arbfp(), set_tex_op_atifs(), 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 3771 of file shader.c.

3773{
3774 const struct wined3d_shader *pixel_shader = state->shader[WINED3D_SHADER_TYPE_PIXEL];
3775 const struct wined3d_gl_info *gl_info = context->gl_info;
3776
3777 args->output_count = pixel_shader ? pixel_shader->limits->packed_input : shader->limits->packed_output;
3778
3779 init_interpolation_compile_args(args->interpolation_mode, pixel_shader, gl_info);
3780}

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 3782 of file shader.c.

3784{
3785 const struct wined3d_d3d_info *d3d_info = context->d3d_info;
3786 const struct wined3d_gl_info *gl_info = context->gl_info;
3787 const struct wined3d_texture *texture;
3788 unsigned int i;
3789
3790 memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */
3792 {
3793 static unsigned int warned = 0;
3794
3795 args->srgb_correction = 1;
3796 if (state->render_states[WINED3D_RS_ALPHABLENDENABLE] && !warned++)
3797 WARN("Blending into a sRGB render target with no GL_ARB_framebuffer_sRGB "
3798 "support, expect rendering artifacts.\n");
3799 }
3800
3801 if (shader->reg_maps.shader_version.major == 1
3802 && shader->reg_maps.shader_version.minor <= 3)
3803 {
3804 for (i = 0; i < shader->limits->sampler; ++i)
3805 {
3807
3809 {
3810 DWORD tex_transform = flags & ~WINED3D_TTFF_PROJECTED;
3811
3812 if (!state->shader[WINED3D_SHADER_TYPE_VERTEX])
3813 {
3814 enum wined3d_shader_resource_type resource_type = shader->reg_maps.resource_info[i].type;
3815 unsigned int j;
3816 unsigned int index = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
3817 DWORD max_valid = WINED3D_TTFF_COUNT4;
3818
3819 for (j = 0; j < state->vertex_declaration->element_count; ++j)
3820 {
3822 &state->vertex_declaration->elements[j];
3823
3825 && element->usage_idx == index)
3826 {
3827 max_valid = element->format->component_count;
3828 break;
3829 }
3830 }
3831 if (!tex_transform || tex_transform > max_valid)
3832 {
3833 WARN("Fixing up projected texture transform flags from %#x to %#x.\n",
3834 tex_transform, max_valid);
3835 tex_transform = max_valid;
3836 }
3837 if ((resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_1D && tex_transform > WINED3D_TTFF_COUNT1)
3838 || (resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_2D
3839 && tex_transform > WINED3D_TTFF_COUNT2)
3840 || (resource_type == WINED3D_SHADER_RESOURCE_TEXTURE_3D
3841 && tex_transform > WINED3D_TTFF_COUNT3))
3842 tex_transform |= WINED3D_PSARGS_PROJECTED;
3843 else
3844 {
3845 WARN("Application requested projected texture with unsuitable texture coordinates.\n");
3846 WARN("(texture unit %u, transform flags %#x, sampler type %u).\n",
3847 i, tex_transform, resource_type);
3848 }
3849 }
3850 else
3852
3853 args->tex_transform |= tex_transform << i * WINED3D_PSARGS_TEXTRANSFORM_SHIFT;
3854 }
3855 }
3856 }
3857 if (shader->reg_maps.shader_version.major == 1
3858 && shader->reg_maps.shader_version.minor <= 4)
3859 {
3860 for (i = 0; i < shader->limits->sampler; ++i)
3861 {
3862 const struct wined3d_texture *texture = state->textures[i];
3863
3864 if (!shader->reg_maps.resource_info[i].type)
3865 continue;
3866
3867 /* Treat unbound textures as 2D. The dummy texture will provide
3868 * the proper sample value. The tex_types bitmap defaults to
3869 * 2D because of the memset. */
3870 if (!texture)
3871 continue;
3872
3873 switch (texture->target)
3874 {
3875 /* RECT textures are distinguished from 2D textures via np2_fixup */
3877 case GL_TEXTURE_2D:
3878 break;
3879
3880 case GL_TEXTURE_3D:
3882 break;
3883
3886 break;
3887 }
3888 }
3889 }
3890
3891 if (shader->reg_maps.shader_version.major >= 4)
3892 {
3893 /* In SM4+ we use dcl_sampler in order to determine if we should use shadow sampler. */
3894 args->shadow = 0;
3895 for (i = 0 ; i < MAX_FRAGMENT_SAMPLERS; ++i)
3896 args->color_fixup[i] = COLOR_FIXUP_IDENTITY;
3897 args->np2_fixup = 0;
3898 }
3899 else
3900 {
3901 for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i)
3902 {
3903 if (!shader->reg_maps.resource_info[i].type)
3904 continue;
3905
3906 texture = state->textures[i];
3907 if (!texture)
3908 {
3909 args->color_fixup[i] = COLOR_FIXUP_IDENTITY;
3910 continue;
3911 }
3912 if (can_use_texture_swizzle(gl_info, texture->resource.format))
3913 args->color_fixup[i] = COLOR_FIXUP_IDENTITY;
3914 else
3915 args->color_fixup[i] = texture->resource.format->color_fixup;
3916
3917 if (texture->resource.format_flags & WINED3DFMT_FLAG_SHADOW)
3918 args->shadow |= 1u << i;
3919
3920 /* Flag samplers that need NP2 texcoord fixup. */
3922 args->np2_fixup |= (1u << i);
3923 }
3924 }
3925
3926 if (shader->reg_maps.shader_version.major >= 3)
3927 {
3928 if (position_transformed)
3929 args->vp_mode = pretransformed;
3930 else if (use_vs(state))
3931 args->vp_mode = vertexshader;
3932 else
3933 args->vp_mode = fixedfunction;
3935 }
3936 else
3937 {
3938 args->vp_mode = vertexshader;
3939 if (state->render_states[WINED3D_RS_FOGENABLE])
3940 {
3941 switch (state->render_states[WINED3D_RS_FOGTABLEMODE])
3942 {
3943 case WINED3D_FOG_NONE:
3944 if (position_transformed || use_vs(state))
3945 {
3947 break;
3948 }
3949
3950 switch (state->render_states[WINED3D_RS_FOGVERTEXMODE])
3951 {
3952 case WINED3D_FOG_NONE: /* Fall through. */
3954 case WINED3D_FOG_EXP: args->fog = WINED3D_FFP_PS_FOG_EXP; break;
3955 case WINED3D_FOG_EXP2: args->fog = WINED3D_FFP_PS_FOG_EXP2; break;
3956 }
3957 break;
3958
3960 case WINED3D_FOG_EXP: args->fog = WINED3D_FFP_PS_FOG_EXP; break;
3961 case WINED3D_FOG_EXP2: args->fog = WINED3D_FFP_PS_FOG_EXP2; break;
3962 }
3963 }
3964 else
3965 {
3967 }
3968 }
3969
3970 if (context->d3d_info->limits.varying_count < wined3d_max_compat_varyings(context->gl_info))
3971 {
3972 const struct wined3d_shader *vs = state->shader[WINED3D_SHADER_TYPE_VERTEX];
3973
3974 args->texcoords_initialized = 0;
3975 for (i = 0; i < MAX_TEXTURES; ++i)
3976 {
3977 if (vs)
3978 {
3979 if (state->shader[WINED3D_SHADER_TYPE_VERTEX]->reg_maps.output_registers & (1u << i))
3980 args->texcoords_initialized |= 1u << i;
3981 }
3982 else
3983 {
3984 const struct wined3d_stream_info *si = &context->stream_info;
3985 unsigned int coord_idx = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
3986
3987 if ((state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX] >> WINED3D_FFP_TCI_SHIFT)
3989 || (coord_idx < MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx)))))
3990 args->texcoords_initialized |= 1u << i;
3991 }
3992 }
3993 }
3994 else
3995 {
3996 args->texcoords_initialized = (1u << MAX_TEXTURES) - 1;
3997 }
3998
3999 args->pointsprite = state->render_states[WINED3D_RS_POINTSPRITEENABLE]
4000 && state->gl_primitive_type == GL_POINTS;
4001
4003 args->alpha_test_func = WINED3D_CMP_ALWAYS - 1;
4004 else
4005 args->alpha_test_func = (state->render_states[WINED3D_RS_ALPHATESTENABLE]
4007 : WINED3D_CMP_ALWAYS) - 1;
4008
4009 if (d3d_info->emulated_flatshading)
4010 args->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT;
4011
4012 args->render_offscreen = shader->reg_maps.vpos && gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS]
4013 ? context->render_offscreen : 0;
4014
4015 args->dual_source_blend = wined3d_dualblend_enabled(state, gl_info);
4016}
unsigned int wined3d_max_compat_varyings(const struct wined3d_gl_info *gl_info)
Definition: utils.c:5744
#define GL_POINTS
Definition: gl.h:190
#define GL_TEXTURE_CUBE_MAP_ARB
Definition: glext.h:1230
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 vector_t * vs
Definition: server.c:127
@ WINED3D_SHADE_FLAT
Definition: wined3d.h:479
@ WINED3D_FOG_LINEAR
Definition: wined3d.h:474
@ WINED3D_FOG_EXP
Definition: wined3d.h:472
@ WINED3D_FOG_NONE
Definition: wined3d.h:471
@ WINED3D_FOG_EXP2
Definition: wined3d.h:473
@ WINED3D_CMP_ALWAYS
Definition: wined3d.h:459
@ WINED3D_TTFF_COUNT2
Definition: wined3d.h:601
@ WINED3D_TTFF_COUNT4
Definition: wined3d.h:603
@ WINED3D_TTFF_COUNT3
Definition: wined3d.h:602
@ WINED3D_TTFF_COUNT1
Definition: wined3d.h:600
@ WINED3D_TTFF_PROJECTED
Definition: wined3d.h:604
@ ARB_FRAGMENT_COORD_CONVENTIONS
Definition: wined3d_gl.h:68
#define WINED3D_PSARGS_PROJECTED
#define WINED3D_FFP_TCI_SHIFT
#define WINED3DFMT_FLAG_SHADOW
#define WINED3D_PSARGS_TEXTRANSFORM_SHIFT
#define WINED3D_TEXTURE_POW2_MAT_IDENT
static BOOL wined3d_dualblend_enabled(const struct wined3d_state *state, const struct wined3d_gl_info *gl_info)
#define WINED3D_FFP_TCI_MASK
wined3d_shader_resource_type
static enum wined3d_cmp_func wined3d_sanitize_cmp_func(enum wined3d_cmp_func func)
static const struct color_fixup_desc COLOR_FIXUP_IDENTITY
#define WINED3D_PSARGS_TEXTYPE_SHIFT
static BOOL can_use_texture_swizzle(const struct wined3d_gl_info *gl_info, const struct wined3d_format *format)

Referenced by find_arb_ps_compile_args(), and set_glsl_shader_program().

◆ find_vs_compile_args()

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

Definition at line 3463 of file shader.c.

3465{
3466 const struct wined3d_shader *geometry_shader = state->shader[WINED3D_SHADER_TYPE_GEOMETRY];
3467 const struct wined3d_shader *pixel_shader = state->shader[WINED3D_SHADER_TYPE_PIXEL];
3468 const struct wined3d_shader *hull_shader = state->shader[WINED3D_SHADER_TYPE_HULL];
3469 const struct wined3d_d3d_info *d3d_info = context->d3d_info;
3470 const struct wined3d_gl_info *gl_info = context->gl_info;
3471
3472 args->fog_src = state->render_states[WINED3D_RS_FOGTABLEMODE]
3474 args->clip_enabled = state->render_states[WINED3D_RS_CLIPPING]
3475 && state->render_states[WINED3D_RS_CLIPPLANEENABLE];
3476 args->point_size = state->gl_primitive_type == GL_POINTS;
3477 args->per_vertex_point_size = shader->reg_maps.point_size;
3478 args->next_shader_type = hull_shader? WINED3D_SHADER_TYPE_HULL
3480 if (shader->reg_maps.shader_version.major >= 4)
3481 args->next_shader_input_count = hull_shader ? hull_shader->limits->packed_input
3482 : geometry_shader ? geometry_shader->limits->packed_input
3483 : pixel_shader ? pixel_shader->limits->packed_input : 0;
3484 else
3485 args->next_shader_input_count = 0;
3486 args->swizzle_map = swizzle_map;
3487 if (d3d_info->emulated_flatshading)
3488 args->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT;
3489 else
3490 args->flatshading = 0;
3491
3492 init_interpolation_compile_args(args->interpolation_mode,
3493 args->next_shader_type == WINED3D_SHADER_TYPE_PIXEL ? pixel_shader : NULL, gl_info);
3494}

Referenced by find_arb_vs_compile_args(), and set_glsl_shader_program().

◆ float_16_to_32()

static float float_16_to_32 ( const unsigned short in)
inlinestatic

Definition at line 321 of file wined3d_private.h.

322{
323 const unsigned short s = ((*in) & 0x8000u);
324 const unsigned short e = ((*in) & 0x7c00u) >> 10;
325 const unsigned short m = (*in) & 0x3ffu;
326 const float sgn = (s ? -1.0f : 1.0f);
327
328 if(e == 0) {
329 if(m == 0) return sgn * 0.0f; /* +0.0 or -0.0 */
330 else return sgn * powf(2, -14.0f) * ((float)m / 1024.0f);
331 } else if(e < 31) {
332 return sgn * powf(2, (float)e - 15.0f) * (1.0f + ((float)m / 1024.0f));
333 } else {
334 if(m == 0) return sgn * INFINITY;
335 else return NAN;
336 }
337}
GLdouble s
Definition: gl.h:2039
const GLfloat * m
Definition: glext.h:10848
_Check_return_ float __cdecl powf(_In_ float b, _In_ float e)
Definition: math.h:232
#define e
Definition: ke_i.h:82
#define NAN
Definition: mesh.c:39
#define INFINITY
Definition: misc.c:36
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 339 of file wined3d_private.h.

340{
341 const float sgn = in & 0x800000u ? -1.0f : 1.0f;
342 const unsigned short e = (in & 0x780000u) >> 19;
343 const unsigned int m = in & 0x7ffffu;
344
345 if (e == 0)
346 {
347 if (m == 0) return sgn * 0.0f; /* +0.0 or -0.0 */
348 else return sgn * powf(2, -6.0f) * ((float)m / 524288.0f);
349 }
350 else if (e < 15)
351 {
352 return sgn * powf(2, (float)e - 7.0f) * (1.0f + ((float)m / 524288.0f));
353 }
354 else
355 {
356 if (m == 0) return sgn * INFINITY;
357 else return NAN;
358 }
359}
GLuint in
Definition: glext.h:9616

Referenced by convert_s8_uint_d24_float().

◆ gen_ffp_frag_op()

void gen_ffp_frag_op ( const struct wined3d_context context,
const struct wined3d_state state,
struct ffp_frag_settings settings,
BOOL  ignore_textype 
)

Definition at line 5751 of file utils.c.

5753{
5754#define ARG1 0x01
5755#define ARG2 0x02
5756#define ARG0 0x04
5757 static const unsigned char args[WINED3D_TOP_LERP + 1] =
5758 {
5759 /* undefined */ 0,
5760 /* D3DTOP_DISABLE */ 0,
5761 /* D3DTOP_SELECTARG1 */ ARG1,
5762 /* D3DTOP_SELECTARG2 */ ARG2,
5763 /* D3DTOP_MODULATE */ ARG1 | ARG2,
5764 /* D3DTOP_MODULATE2X */ ARG1 | ARG2,
5765 /* D3DTOP_MODULATE4X */ ARG1 | ARG2,
5766 /* D3DTOP_ADD */ ARG1 | ARG2,
5767 /* D3DTOP_ADDSIGNED */ ARG1 | ARG2,
5768 /* D3DTOP_ADDSIGNED2X */ ARG1 | ARG2,
5769 /* D3DTOP_SUBTRACT */ ARG1 | ARG2,
5770 /* D3DTOP_ADDSMOOTH */ ARG1 | ARG2,
5771 /* D3DTOP_BLENDDIFFUSEALPHA */ ARG1 | ARG2,
5772 /* D3DTOP_BLENDTEXTUREALPHA */ ARG1 | ARG2,
5773 /* D3DTOP_BLENDFACTORALPHA */ ARG1 | ARG2,
5774 /* D3DTOP_BLENDTEXTUREALPHAPM */ ARG1 | ARG2,
5775 /* D3DTOP_BLENDCURRENTALPHA */ ARG1 | ARG2,
5776 /* D3DTOP_PREMODULATE */ ARG1 | ARG2,
5777 /* D3DTOP_MODULATEALPHA_ADDCOLOR */ ARG1 | ARG2,
5778 /* D3DTOP_MODULATECOLOR_ADDALPHA */ ARG1 | ARG2,
5779 /* D3DTOP_MODULATEINVALPHA_ADDCOLOR */ ARG1 | ARG2,
5780 /* D3DTOP_MODULATEINVCOLOR_ADDALPHA */ ARG1 | ARG2,
5781 /* D3DTOP_BUMPENVMAP */ ARG1 | ARG2,
5782 /* D3DTOP_BUMPENVMAPLUMINANCE */ ARG1 | ARG2,
5783 /* D3DTOP_DOTPRODUCT3 */ ARG1 | ARG2,
5784 /* D3DTOP_MULTIPLYADD */ ARG1 | ARG2 | ARG0,
5785 /* D3DTOP_LERP */ ARG1 | ARG2 | ARG0
5786 };
5787 unsigned int i;
5788 DWORD ttff;
5789 DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2;
5790 const struct wined3d_gl_info *gl_info = context->gl_info;
5791 const struct wined3d_d3d_info *d3d_info = context->d3d_info;
5792
5793 settings->padding = 0;
5794
5795 for (i = 0; i < d3d_info->limits.ffp_blend_stages; ++i)
5796 {
5797 const struct wined3d_texture *texture;
5798
5799 settings->op[i].padding = 0;
5800 if (state->texture_states[i][WINED3D_TSS_COLOR_OP] == WINED3D_TOP_DISABLE)
5801 {
5802 settings->op[i].cop = WINED3D_TOP_DISABLE;
5803 settings->op[i].aop = WINED3D_TOP_DISABLE;
5804 settings->op[i].carg0 = settings->op[i].carg1 = settings->op[i].carg2 = ARG_UNUSED;
5805 settings->op[i].aarg0 = settings->op[i].aarg1 = settings->op[i].aarg2 = ARG_UNUSED;
5806 settings->op[i].color_fixup = COLOR_FIXUP_IDENTITY;
5807 settings->op[i].dst = resultreg;
5808 settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_1D;
5809 settings->op[i].projected = proj_none;
5810 i++;
5811 break;
5812 }
5813
5814 if ((texture = state->textures[i]))
5815 {
5816 if (can_use_texture_swizzle(gl_info, texture->resource.format))
5817 settings->op[i].color_fixup = COLOR_FIXUP_IDENTITY;
5818 else
5819 settings->op[i].color_fixup = texture->resource.format->color_fixup;
5820 if (ignore_textype)
5821 {
5822 settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_1D;
5823 }
5824 else
5825 {
5826 switch (texture->target)
5827 {
5828 case GL_TEXTURE_1D:
5829 settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_1D;
5830 break;
5831 case GL_TEXTURE_2D:
5832 settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_2D;
5833 break;
5834 case GL_TEXTURE_3D:
5835 settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_3D;
5836 break;
5838 settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_CUBE;
5839 break;
5841 settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_RECT;
5842 break;
5843 }
5844 }
5845 } else {
5846 settings->op[i].color_fixup = COLOR_FIXUP_IDENTITY;
5847 settings->op[i].tex_type = WINED3D_GL_RES_TYPE_TEX_1D;
5848 }
5849
5850 cop = state->texture_states[i][WINED3D_TSS_COLOR_OP];
5851 aop = state->texture_states[i][WINED3D_TSS_ALPHA_OP];
5852
5853 carg1 = (args[cop] & ARG1) ? state->texture_states[i][WINED3D_TSS_COLOR_ARG1] : ARG_UNUSED;
5854 carg2 = (args[cop] & ARG2) ? state->texture_states[i][WINED3D_TSS_COLOR_ARG2] : ARG_UNUSED;
5855 carg0 = (args[cop] & ARG0) ? state->texture_states[i][WINED3D_TSS_COLOR_ARG0] : ARG_UNUSED;
5856
5857 if (is_invalid_op(state, i, cop, carg1, carg2, carg0))
5858 {
5859 carg0 = ARG_UNUSED;
5860 carg2 = ARG_UNUSED;
5861 carg1 = WINED3DTA_CURRENT;
5863 }
5864
5865 if (cop == WINED3D_TOP_DOTPRODUCT3)
5866 {
5867 /* A dotproduct3 on the colorop overwrites the alphaop operation and replicates
5868 * the color result to the alpha component of the destination
5869 */
5870 aop = cop;
5871 aarg1 = carg1;
5872 aarg2 = carg2;
5873 aarg0 = carg0;
5874 }
5875 else
5876 {
5877 aarg1 = (args[aop] & ARG1) ? state->texture_states[i][WINED3D_TSS_ALPHA_ARG1] : ARG_UNUSED;
5878 aarg2 = (args[aop] & ARG2) ? state->texture_states[i][WINED3D_TSS_ALPHA_ARG2] : ARG_UNUSED;
5879 aarg0 = (args[aop] & ARG0) ? state->texture_states[i][WINED3D_TSS_ALPHA_ARG0] : ARG_UNUSED;
5880 }
5881
5882 if (!i && state->textures[0] && state->render_states[WINED3D_RS_COLORKEYENABLE])
5883 {
5884 GLenum texture_dimensions;
5885
5886 texture = state->textures[0];
5887 texture_dimensions = texture->target;
5888
5889 if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB)
5890 {
5891 if (texture->async.color_key_flags & WINED3D_CKEY_SRC_BLT && !texture->resource.format->alpha_size)
5892 {
5893 if (aop == WINED3D_TOP_DISABLE)
5894 {
5895 aarg1 = WINED3DTA_TEXTURE;
5897 }
5898 else if (aop == WINED3D_TOP_SELECT_ARG1 && aarg1 != WINED3DTA_TEXTURE)
5899 {
5900 if (state->render_states[WINED3D_RS_ALPHABLENDENABLE])
5901 {
5902 aarg2 = WINED3DTA_TEXTURE;
5904 }
5905 else aarg1 = WINED3DTA_TEXTURE;
5906 }
5907 else if (aop == WINED3D_TOP_SELECT_ARG2 && aarg2 != WINED3DTA_TEXTURE)
5908 {
5909 if (state->render_states[WINED3D_RS_ALPHABLENDENABLE])
5910 {
5911 aarg1 = WINED3DTA_TEXTURE;
5913 }
5914 else aarg2 = WINED3DTA_TEXTURE;
5915 }
5916 }
5917 }
5918 }
5919
5920 if (is_invalid_op(state, i, aop, aarg1, aarg2, aarg0))
5921 {
5922 aarg0 = ARG_UNUSED;
5923 aarg2 = ARG_UNUSED;
5924 aarg1 = WINED3DTA_CURRENT;
5926 }
5927
5928 if (carg1 == WINED3DTA_TEXTURE || carg2 == WINED3DTA_TEXTURE || carg0 == WINED3DTA_TEXTURE
5929 || aarg1 == WINED3DTA_TEXTURE || aarg2 == WINED3DTA_TEXTURE || aarg0 == WINED3DTA_TEXTURE)
5930 {
5931 ttff = state->texture_states[i][WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS];
5933 settings->op[i].projected = proj_count3;
5934 else if (ttff & WINED3D_TTFF_PROJECTED)
5935 settings->op[i].projected = proj_count4;
5936 else
5937 settings->op[i].projected = proj_none;
5938 }
5939 else
5940 {
5941 settings->op[i].projected = proj_none;
5942 }
5943
5944 settings->op[i].cop = cop;
5945 settings->op[i].aop = aop;
5946 settings->op[i].carg0 = carg0;
5947 settings->op[i].carg1 = carg1;
5948 settings->op[i].carg2 = carg2;
5949 settings->op[i].aarg0 = aarg0;
5950 settings->op[i].aarg1 = aarg1;
5951 settings->op[i].aarg2 = aarg2;
5952
5953 if (state->texture_states[i][WINED3D_TSS_RESULT_ARG] == WINED3DTA_TEMP)
5954 settings->op[i].dst = tempreg;
5955 else
5956 settings->op[i].dst = resultreg;
5957 }
5958
5959 /* Clear unsupported stages */
5960 for(; i < MAX_TEXTURES; i++) {
5961 memset(&settings->op[i], 0xff, sizeof(settings->op[i]));
5962 }
5963
5964 if (!state->render_states[WINED3D_RS_FOGENABLE])
5965 {
5967 }
5968 else if (state->render_states[WINED3D_RS_FOGTABLEMODE] == WINED3D_FOG_NONE)
5969 {
5970 if (use_vs(state) || state->vertex_declaration->position_transformed)
5971 {
5973 }
5974 else
5975 {
5976 switch (state->render_states[WINED3D_RS_FOGVERTEXMODE])
5977 {
5978 case WINED3D_FOG_NONE:
5979 case WINED3D_FOG_LINEAR:
5981 break;
5982 case WINED3D_FOG_EXP:
5984 break;
5985 case WINED3D_FOG_EXP2:
5987 break;
5988 }
5989 }
5990 }
5991 else
5992 {
5993 switch (state->render_states[WINED3D_RS_FOGTABLEMODE])
5994 {
5995 case WINED3D_FOG_LINEAR:
5997 break;
5998 case WINED3D_FOG_EXP:
6000 break;
6001 case WINED3D_FOG_EXP2:
6003 break;
6004 }
6005 }
6006 settings->sRGB_write = !gl_info->supported[ARB_FRAMEBUFFER_SRGB] && needs_srgb_write(context, state, state->fb);
6007 if (d3d_info->vs_clipping || !use_vs(state) || !state->render_states[WINED3D_RS_CLIPPING]
6008 || !state->render_states[WINED3D_RS_CLIPPLANEENABLE])
6009 {
6010 /* No need to emulate clipplanes if GL supports native vertex shader clipping or if
6011 * the fixed function vertex pipeline is used(which always supports clipplanes), or
6012 * if no clipplane is enabled
6013 */
6014 settings->emul_clipplanes = 0;
6015 } else {
6016 settings->emul_clipplanes = 1;
6017 }
6018
6019 if (state->render_states[WINED3D_RS_COLORKEYENABLE] && state->textures[0]
6020 && state->textures[0]->async.color_key_flags & WINED3D_CKEY_SRC_BLT
6021 && settings->op[0].cop != WINED3D_TOP_DISABLE)
6022 settings->color_key_enabled = 1;
6023 else
6024 settings->color_key_enabled = 0;
6025
6026 /* texcoords_initialized is set to meaningful values only when GL doesn't
6027 * support enough varyings to always pass around all the possible texture
6028 * coordinates.
6029 * This is used to avoid reading a varying not written by the vertex shader.
6030 * Reading uninitialized varyings on core profile contexts results in an
6031 * error while with builtin varyings on legacy contexts you get undefined
6032 * behavior. */
6033 if (d3d_info->limits.varying_count
6034 && d3d_info->limits.varying_count < wined3d_max_compat_varyings(gl_info))
6035 {
6036 settings->texcoords_initialized = 0;
6037 for (i = 0; i < MAX_TEXTURES; ++i)
6038 {
6039 if (use_vs(state))
6040 {
6041 if (state->shader[WINED3D_SHADER_TYPE_VERTEX]->reg_maps.output_registers & (1u << i))
6042 settings->texcoords_initialized |= 1u << i;
6043 }
6044 else
6045 {
6046 const struct wined3d_stream_info *si = &context->stream_info;
6047 unsigned int coord_idx = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
6048 if ((state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX] >> WINED3D_FFP_TCI_SHIFT)
6050 || (coord_idx < MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx)))))
6051 settings->texcoords_initialized |= 1u << i;
6052 }
6053 }
6054 }
6055 else
6056 {
6057 settings->texcoords_initialized = (1u << MAX_TEXTURES) - 1;
6058 }
6059
6060 settings->pointsprite = state->render_states[WINED3D_RS_POINTSPRITEENABLE]
6061 && state->gl_primitive_type == GL_POINTS;
6062
6064 settings->alpha_test_func = WINED3D_CMP_ALWAYS - 1;
6065 else
6066 settings->alpha_test_func = (state->render_states[WINED3D_RS_ALPHATESTENABLE]
6068 : WINED3D_CMP_ALWAYS) - 1;
6069
6070 if (d3d_info->emulated_flatshading)
6071 settings->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT;
6072 else
6073 settings->flatshading = FALSE;
6074}
#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:4865
#define ARG1
#define ARG0
struct wined3d_d3d_limits limits
#define WINED3DTA_TEMP
Definition: wined3d.h:872
#define WINED3D_CKEY_SRC_BLT
Definition: wined3d.h:1336
#define WINED3DTA_CURRENT
Definition: wined3d.h:868
#define WINED3DTA_TEXTURE
Definition: wined3d.h:869
#define ARG_UNUSED

Referenced by fragment_prog_arbfp(), set_glsl_shader_program(), and set_tex_op_atifs().

◆ get_complex_fixup()

static enum complex_fixup get_complex_fixup ( struct color_fixup_desc  fixup)
inlinestatic

Definition at line 254 of file wined3d_private.h.

255{
257 if (fixup.x_source == CHANNEL_SOURCE_COMPLEX1) complex_fixup |= (1u << 0);
258 if (fixup.y_source == CHANNEL_SOURCE_COMPLEX1) complex_fixup |= (1u << 1);
259 if (fixup.z_source == CHANNEL_SOURCE_COMPLEX1) complex_fixup |= (1u << 2);
260 if (fixup.w_source == CHANNEL_SOURCE_COMPLEX1) complex_fixup |= (1u << 3);
261 return complex_fixup;
262}

Referenced by arbfp_blit_set(), arbfp_blit_supported(), calc_color_correction(), dump_color_fixup_desc(), and shader_glsl_color_correction_ext().

◆ get_flexible_vertex_size()

DWORD get_flexible_vertex_size ( DWORD  d3dvtVertexType)

Definition at line 923 of file utils.c.

924{
925 DWORD size = 0;
926 DWORD i;
927
928 if (d3dvtVertexType & D3DFVF_NORMAL) size += 3 * sizeof(D3DVALUE);
929 if (d3dvtVertexType & D3DFVF_DIFFUSE) size += sizeof(DWORD);
930 if (d3dvtVertexType & D3DFVF_SPECULAR) size += sizeof(DWORD);
931 if (d3dvtVertexType & D3DFVF_RESERVED1) size += sizeof(DWORD);
932 switch (d3dvtVertexType & D3DFVF_POSITION_MASK)
933 {
934 case D3DFVF_XYZ: size += 3 * sizeof(D3DVALUE); break;
935 case D3DFVF_XYZRHW: size += 4 * sizeof(D3DVALUE); break;
936 case D3DFVF_XYZB1: size += 4 * sizeof(D3DVALUE); break;
937 case D3DFVF_XYZB2: size += 5 * sizeof(D3DVALUE); break;
938 case D3DFVF_XYZB3: size += 6 * sizeof(D3DVALUE); break;
939 case D3DFVF_XYZB4: size += 7 * sizeof(D3DVALUE); break;
940 case D3DFVF_XYZB5: size += 8 * sizeof(D3DVALUE); break;
941 default: ERR("Unexpected position mask\n");
942 }
943 for (i = 0; i < GET_TEXCOUNT_FROM_FVF(d3dvtVertexType); i++)
944 {
945 size += GET_TEXCOORD_SIZE_FROM_FVF(d3dvtVertexType, i) * sizeof(D3DVALUE);
946 }
947
948 return size;
949}
#define D3DFVF_DIFFUSE
Definition: d3d8types.h:122
#define D3DFVF_XYZ
Definition: d3d8types.h:113
#define D3DFVF_XYZB1
Definition: d3d8types.h:115
#define D3DFVF_XYZB5
Definition: d3d8types.h:119
#define D3DFVF_XYZRHW
Definition: d3d8types.h:114
#define D3DFVF_XYZB4
Definition: d3d8types.h:118
#define D3DFVF_NORMAL
Definition: d3d8types.h:120
#define D3DFVF_XYZB3
Definition: d3d8types.h:117
#define D3DFVF_XYZB2
Definition: d3d8types.h:116
#define D3DFVF_SPECULAR
Definition: d3d8types.h:123
#define D3DFVF_POSITION_MASK
Definition: d3d8types.h:112
float D3DVALUE
Definition: d3dtypes.h:89
#define D3DFVF_RESERVED1
Definition: d3dtypes.h:1309
#define GET_TEXCOORD_SIZE_FROM_FVF(d3dvtVertexType, tex_num)
#define GET_TEXCOUNT_FROM_FVF(d3dvtVertexType)
#define DWORD
Definition: nt_native.h:44

◆ 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 5179 of file utils.c.

5181{
5182 union
5183 {
5184 DWORD d;
5185 float f;
5186 } tmpvalue;
5187
5188 switch (context->fog_source)
5189 {
5190 case FOGSOURCE_VS:
5191 *start = 1.0f;
5192 *end = 0.0f;
5193 break;
5194
5195 case FOGSOURCE_COORD:
5196 *start = 255.0f;
5197 *end = 0.0f;
5198 break;
5199
5200 case FOGSOURCE_FFP:
5201 tmpvalue.d = state->render_states[WINED3D_RS_FOGSTART];
5202 *start = tmpvalue.f;
5203 tmpvalue.d = state->render_states[WINED3D_RS_FOGEND];
5204 *end = tmpvalue.f;
5205 /* Special handling for fog_start == fog_end. In d3d with vertex
5206 * fog, everything is fogged. With table fog, everything with
5207 * fog_coord < fog_start is unfogged, and fog_coord > fog_start
5208 * is fogged. Windows drivers disagree when fog_coord == fog_start. */
5209 if (state->render_states[WINED3D_RS_FOGTABLEMODE] == WINED3D_FOG_NONE && *start == *end)
5210 {
5211 *start = -INFINITY;
5212 *end = 0.0f;
5213 }
5214 break;
5215
5216 default:
5217 /* This should not happen, context->fog_source is set in wined3d, not the app. */
5218 ERR("Unexpected fog coordinate source.\n");
5219 *start = 0.0f;
5220 *end = 0.0f;
5221 }
5222}
GLuint start
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
#define d
Definition: ke_i.h:81
#define f
Definition: ke_i.h:83

Referenced by shader_glsl_load_fog_uniform(), and state_fogstartend().

◆ get_identity_matrix()

void get_identity_matrix ( struct wined3d_matrix mat)

Definition at line 4886 of file utils.c.

4887{
4888 static const struct wined3d_matrix identity =
4889 {
4890 1.0f, 0.0f, 0.0f, 0.0f,
4891 0.0f, 1.0f, 0.0f, 0.0f,
4892 0.0f, 0.0f, 1.0f, 0.0f,
4893 0.0f, 0.0f, 0.0f, 1.0f,
4894 };
4895
4896 *mat = identity;
4897}
static const MAT2 mat
Definition: font.c:66

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

◆ get_modelview_matrix()

void get_modelview_matrix ( const struct wined3d_context context,
const struct wined3d_state state,
unsigned int  index,
struct wined3d_matrix mat 
)

Definition at line 4899 of file utils.c.

4901{
4902 if (context->last_was_rhw)
4904 else
4906}
void multiply_matrix(struct wined3d_matrix *dst, const struct wined3d_matrix *src1, const struct wined3d_matrix *src2)
Definition: utils.c:5401
void get_identity_matrix(struct wined3d_matrix *mat)
Definition: utils.c:4886

Referenced by shader_glsl_load_constants(), software_vertex_blending(), and transform_world().

◆ get_pointsize()

void get_pointsize ( const struct wined3d_context context,
const struct wined3d_state state,
float out_pointsize,
float out_att 
)

Definition at line 5147 of file utils.c.

5149{
5150 /* POINTSCALEENABLE controls how point size value is treated. If set to
5151 * true, the point size is scaled with respect to height of viewport.
5152 * When set to false point size is in pixels. */
5153 union
5154 {
5155 DWORD d;
5156 float f;
5157 } pointsize, a, b, c;
5158
5159 out_att[0] = 1.0f;
5160 out_att[1] = 0.0f;
5161 out_att[2] = 0.0f;
5162
5163 pointsize.d = state->render_states[WINED3D_RS_POINTSIZE];
5164 a.d = state->render_states[WINED3D_RS_POINTSCALE_A];
5165 b.d = state->render_states[WINED3D_RS_POINTSCALE_B];
5166 c.d = state->render_states[WINED3D_RS_POINTSCALE_C];
5167
5168 if (state->render_states[WINED3D_RS_POINTSCALEENABLE])
5169 {
5170 float scale_factor = state->viewport.height * state->viewport.height;
5171
5172 out_att[0] = a.f / scale_factor;
5173 out_att[1] = b.f / scale_factor;
5174 out_att[2] = c.f / scale_factor;
5175 }
5176 *out_pointsize = pointsize.f;
5177}
const GLubyte * c
Definition: glext.h:8905
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
int scale_factor
Definition: jpeglib.h:995
#define c
Definition: ke_i.h:80
#define b
Definition: ke_i.h:79

Referenced by shader_glsl_pointsize_uniform(), and state_pscale().

◆ 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 5128 of file utils.c.

5130{
5131 union
5132 {
5133 DWORD d;
5134 float f;
5135 } min, max;
5136
5137 min.d = state->render_states[WINED3D_RS_POINTSIZE_MIN];
5138 max.d = state->render_states[WINED3D_RS_POINTSIZE_MAX];
5139
5140 if (min.f > max.f)
5141 min.f = max.f;
5142
5143 *out_min = min.f;
5144 *out_max = max.f;
5145}

Referenced by shader_glsl_pointsize_uniform(), state_psizemin_arb(), state_psizemin_ext(), and state_psizemin_w().

◆ get_projection_matrix()

void get_projection_matrix ( const struct wined3d_context context,
const struct wined3d_state state,
struct wined3d_matrix mat 
)

Definition at line 4908 of file utils.c.

4910{
4911 BOOL clip_control = context->gl_info->supported[ARB_CLIP_CONTROL];
4912 BOOL flip = !clip_control && context->render_offscreen;
4913 float center_offset;
4914
4915 /* There are a couple of additional things we have to take into account
4916 * here besides the projection transformation itself:
4917 * - We need to flip along the y-axis in case of offscreen rendering.
4918 * - OpenGL Z range is {-Wc,...,Wc} while D3D Z range is {0,...,Wc}.
4919 * - <= D3D9 coordinates refer to pixel centers while GL coordinates
4920 * refer to pixel corners.
4921 * - D3D has a top-left filling convention. We need to maintain this
4922 * even after the y-flip mentioned above.
4923 * In order to handle the last two points, we translate by
4924 * (63.0 / 128.0) / VPw and (63.0 / 128.0) / VPh. This is equivalent to
4925 * translating slightly less than half a pixel. We want the difference to
4926 * be large enough that it doesn't get lost due to rounding inside the
4927 * driver, but small enough to prevent it from interfering with any
4928 * anti-aliasing. */
4929
4930 if (!clip_control && context->d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER)
4931 center_offset = 63.0f / 64.0f;
4932 else
4933 center_offset = -1.0f / 64.0f;
4934
4935 if (context->last_was_rhw)
4936 {
4937 /* Transform D3D RHW coordinates to OpenGL clip coordinates. */
4938 float x = state->viewport.x;
4939 float y = state->viewport.y;
4940 float w = state->viewport.width;
4941 float h = state->viewport.height;
4942 float x_scale = 2.0f / w;
4943 float x_offset = (center_offset - (2.0f * x) - w) / w;
4944 float y_scale = flip ? 2.0f / h : 2.0f / -h;
4945 float y_offset = flip
4946 ? (center_offset - (2.0f * y) - h) / h
4947 : (center_offset - (2.0f * y) - h) / -h;
4948 enum wined3d_depth_buffer_type zenable = state->fb->depth_stencil ?
4949 state->render_states[WINED3D_RS_ZENABLE] : WINED3D_ZB_FALSE;
4950 float z_scale = zenable ? clip_control ? 1.0f : 2.0f : 0.0f;
4951 float z_offset = zenable ? clip_control ? 0.0f : -1.0f : 0.0f;
4952 const struct wined3d_matrix projection =
4953 {
4954 x_scale, 0.0f, 0.0f, 0.0f,
4955 0.0f, y_scale, 0.0f, 0.0f,
4956 0.0f, 0.0f, z_scale, 0.0f,
4957 x_offset, y_offset, z_offset, 1.0f,
4958 };
4959
4960 *mat = projection;
4961 }
4962 else
4963 {
4964 float y_scale = flip ? -1.0f : 1.0f;
4965 float x_offset = center_offset / state->viewport.width;
4966 float y_offset = flip
4967 ? center_offset / state->viewport.height
4968 : -center_offset / state->viewport.height;
4969 float z_scale = clip_control ? 1.0f : 2.0f;
4970 float z_offset = clip_control ? 0.0f : -1.0f;
4971 const struct wined3d_matrix projection =
4972 {
4973 1.0f, 0.0f, 0.0f, 0.0f,
4974 0.0f, y_scale, 0.0f, 0.0f,
4975 0.0f, 0.0f, z_scale, 0.0f,
4976 x_offset, y_offset, z_offset, 1.0f,
4977 };
4978
4979 multiply_matrix(mat, &projection, &state->transforms[WINED3D_TS_PROJECTION]);
4980 }
4981}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
wined3d_depth_buffer_type
Definition: wined3d.h:463
@ WINED3D_ZB_FALSE
Definition: wined3d.h:464
#define WINED3D_PIXEL_CENTER_INTEGER
Definition: wined3d.h:1322

Referenced by shader_glsl_load_constants(), and transform_projection().

◆ get_texture_matrix()

void get_texture_matrix ( const struct wined3d_context context,
const struct wined3d_state state,
unsigned int  tex,
struct wined3d_matrix mat 
)

Definition at line 5096 of file utils.c.

5098{
5099 const struct wined3d_device *device = context->device;
5100 const struct wined3d_gl_info *gl_info = context->gl_info;
5101 BOOL generated = (state->texture_states[tex][WINED3D_TSS_TEXCOORD_INDEX] & 0xffff0000)
5103 unsigned int coord_idx = min(state->texture_states[tex][WINED3D_TSS_TEXCOORD_INDEX & 0x0000ffff],
5104 MAX_TEXTURES - 1);
5105
5106 compute_texture_matrix(gl_info, &state->transforms[WINED3D_TS_TEXTURE0 + tex],
5107 state->texture_states[tex][WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS],
5108 generated, context->last_was_rhw,
5109 context->stream_info.use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx))
5110 ? context->stream_info.elements[WINED3D_FFP_TEXCOORD0 + coord_idx].format->id
5112 device->shader_backend->shader_has_ffp_proj_control(device->shader_priv), mat);
5113
5114 if ((context->lastWasPow2Texture & (1u << tex)) && state->textures[tex])
5115 {
5116 if (generated)
5117 FIXME("Non-power-of-two texture being used with generated texture coords.\n");
5118 /* NP2 texcoord fixup is implemented for pixelshaders so only enable the
5119 * fixed-function-pipeline fixup via pow2Matrix when no PS is used. */
5120 if (!use_ps(state))
5121 {
5122 TRACE("Non-power-of-two texture matrix multiply fixup.\n");
5123 multiply_matrix(mat, mat, (struct wined3d_matrix *)state->textures[tex]->pow2_matrix);
5124 }
5125 }
5126}
static void compute_texture_matrix(const struct wined3d_gl_info *gl_info, const struct wined3d_matrix *matrix, DWORD flags, BOOL calculated_coords, BOOL transformed, enum wined3d_format_id format_id, BOOL ffp_proj_control, struct wined3d_matrix *out_matrix)
Definition: utils.c:4984
#define WINED3DTSS_TCI_PASSTHRU
Definition: wined3d.h:860

Referenced by shader_glsl_ffp_vertex_texmatrix_uniform(), and transform_texture().

◆ gl_primitive_type_from_d3d()

GLenum gl_primitive_type_from_d3d ( enum wined3d_primitive_type  primitive_type)

Definition at line 58 of file device.c.

59{
60 switch (primitive_type)
61 {
63 return GL_POINTS;
64
66 return GL_LINES;
67
69 return GL_LINE_STRIP;
70
72 return GL_TRIANGLES;
73
75 return GL_TRIANGLE_STRIP;
76
78 return GL_TRIANGLE_FAN;
79
82
85
88
91
93 return GL_PATCHES;
94
95 default:
96 FIXME("Unhandled primitive type %s.\n", debug_d3dprimitivetype(primitive_type));
98 return ~0u;
99 }
100}
const char * debug_d3dprimitivetype(enum wined3d_primitive_type primitive_type)
Definition: utils.c:4346
#define GL_TRIANGLE_FAN
Definition: gl.h:196
#define GL_LINE_STRIP
Definition: gl.h:193
#define GL_LINES
Definition: gl.h:191
#define GL_TRIANGLES
Definition: gl.h:194
#define GL_TRIANGLE_STRIP_ADJACENCY_ARB
Definition: glext.h:1765
#define GL_LINE_STRIP_ADJACENCY_ARB
Definition: glext.h:1763
#define GL_LINES_ADJACENCY_ARB
Definition: glext.h:1762
#define GL_TRIANGLES_ADJACENCY_ARB
Definition: glext.h:1764

Referenced by gl_tfb_primitive_type_from_d3d(), and wined3d_device_set_primitive_type().

◆ install_gl_compat_wrapper()

void install_gl_compat_wrapper ( struct wined3d_gl_info gl_info,
enum wined3d_gl_extension  ext 
)

Definition at line 355 of file gl_compat.c.

356{
357 switch (ext)
358 {
359 case ARB_MULTITEXTURE:
360 if (gl_info->supported[ARB_MULTITEXTURE])
361 return;
362 if (gl_info->gl_ops.ext.p_glActiveTexture == wine_glActiveTexture)
363 {
364 FIXME("ARB_multitexture emulation hooks already applied.\n");
365 return;
366 }
367 TRACE("Applying GL_ARB_multitexture emulation hooks.\n");
368 gl_info->gl_ops.ext.p_glActiveTexture = wine_glActiveTexture;
369 gl_info->gl_ops.ext.p_glClientActiveTextureARB = wine_glClientActiveTextureARB;
370 gl_info->gl_ops.ext.p_glMultiTexCoord1fARB = wine_glMultiTexCoord1fARB;
371 gl_info->gl_ops.ext.p_glMultiTexCoord1fvARB = wine_glMultiTexCoord1fvARB;
372 gl_info->gl_ops.ext.p_glMultiTexCoord2fARB = wine_glMultiTexCoord2fARB;
373 gl_info->gl_ops.ext.p_glMultiTexCoord2fvARB = wine_glMultiTexCoord2fvARB;
374 gl_info->gl_ops.ext.p_glMultiTexCoord3fARB = wine_glMultiTexCoord3fARB;
375 gl_info->gl_ops.ext.p_glMultiTexCoord3fvARB = wine_glMultiTexCoord3fvARB;
376 gl_info->gl_ops.ext.p_glMultiTexCoord4fARB = wine_glMultiTexCoord4fARB;
377 gl_info->gl_ops.ext.p_glMultiTexCoord4fvARB = wine_glMultiTexCoord4fvARB;
378 gl_info->gl_ops.ext.p_glMultiTexCoord2svARB = wine_glMultiTexCoord2svARB;
379 gl_info->gl_ops.ext.p_glMultiTexCoord4svARB = wine_glMultiTexCoord4svARB;
380 old_multitex_glGetIntegerv = gl_info->gl_ops.gl.p_glGetIntegerv;
381 gl_info->gl_ops.gl.p_glGetIntegerv = wine_glGetIntegerv;
382 old_multitex_glGetFloatv = gl_info->gl_ops.gl.p_glGetFloatv;
383 gl_info->gl_ops.gl.p_glGetFloatv = wine_glGetFloatv;
384 old_multitex_glGetDoublev = gl_info->gl_ops.gl.p_glGetDoublev;
385 gl_info->gl_ops.gl.p_glGetDoublev = wine_glGetDoublev;
386 gl_info->supported[ARB_MULTITEXTURE] = TRUE;
387 return;
388
389 case EXT_FOG_COORD:
390 /* This emulation isn't perfect. There are a number of potential problems, but they should
391 * not matter in practise:
392 *
393 * Fog vs fragment shader: If we are using GL_ARB_fragment_program with the fog option, the
394 * glDisable(GL_FOG) here won't matter. However, if we have GL_ARB_fragment_program, it is pretty
395 * unlikely that we don't have GL_EXT_fog_coord. Besides, we probably have GL_ARB_vertex_program
396 * too, which would allow fog coord emulation in a fixed function vertex pipeline replacement.
397 *
398 * Fog vs texture: We apply the fog in the vertex color. An app could set up texturing settings which
399 * ignore the vertex color, thus effectively disabling our fog. However, in D3D this type of fog is
400 * a per-vertex fog too, so the apps shouldn't do that.
401 *
402 * Fog vs lighting: The app could in theory use D3DFOG_NONE table and D3DFOG_NONE vertex fog with
403 * untransformed vertices. That enables lighting and fog coords at the same time, and the lighting
404 * calculations could affect the already blended in fog color. There's nothing we can do against that,
405 * but most apps using fog color do their own lighting too and often even use RHW vertices. So live
406 * with it.
407 */
408 if (gl_info->supported[EXT_FOG_COORD])
409 return;
410 if (gl_info->gl_ops.gl.p_glFogi == wine_glFogi)
411 {
412 FIXME("EXT_fog_coord emulation hooks already applied.\n");
413 return;
414 }
415 TRACE("Applying GL_ARB_fog_coord emulation hooks\n");
416
417 /* This probably means that the implementation doesn't advertise the extension, but implicitly supports
418 * it via the GL core version, or someone messed around in the extension table in directx.c. Add version-
419 * dependent loading for this extension if we ever hit this situation
420 */
421 if (gl_info->supported[ARB_FRAGMENT_PROGRAM])
422 {
423 FIXME("GL implementation supports GL_ARB_fragment_program but not GL_EXT_fog_coord\n");
424 FIXME("The fog coord emulation will most likely fail\n");
425 }
426 else if (gl_info->supported[ARB_FRAGMENT_SHADER])
427 {
428 FIXME("GL implementation supports GL_ARB_fragment_shader but not GL_EXT_fog_coord\n");
429 FIXME("The fog coord emulation will most likely fail\n");
430 }
431
432 old_fogcoord_glFogi = gl_info->gl_ops.gl.p_glFogi;
433 gl_info->gl_ops.gl.p_glFogi = wine_glFogi;
434 old_fogcoord_glFogiv = gl_info->gl_ops.gl.p_glFogiv;
435 gl_info->gl_ops.gl.p_glFogiv = wine_glFogiv;
436 old_fogcoord_glFogf = gl_info->gl_ops.gl.p_glFogf;
437 gl_info->gl_ops.gl.p_glFogf = wine_glFogf;
438 old_fogcoord_glFogfv = gl_info->gl_ops.gl.p_glFogfv;
439 gl_info->gl_ops.gl.p_glFogfv = wine_glFogfv;
440 old_fogcoord_glEnable = glEnableWINE;
441 glEnableWINE = wine_glEnable;
442 old_fogcoord_glDisable = glDisableWINE;
443 glDisableWINE = wine_glDisable;
444
445 old_fogcoord_glVertex4f = gl_info->gl_ops.gl.p_glVertex4f;
446 gl_info->gl_ops.gl.p_glVertex4f = wine_glVertex4f;
447 gl_info->gl_ops.gl.p_glVertex4fv = wine_glVertex4fv;
448 gl_info->gl_ops.gl.p_glVertex3f = wine_glVertex3f;
449 gl_info->gl_ops.gl.p_glVertex3fv = wine_glVertex3fv;
450
451 old_fogcoord_glColor4f = gl_info->gl_ops.gl.p_glColor4f;
452 gl_info->gl_ops.gl.p_glColor4f = wine_glColor4f;
453 gl_info->gl_ops.gl.p_glColor4fv = wine_glColor4fv;
454 gl_info->gl_ops.gl.p_glColor3f = wine_glColor3f;
455 gl_info->gl_ops.gl.p_glColor3fv = wine_glColor3fv;
456 gl_info->gl_ops.gl.p_glColor4ub = wine_glColor4ub;
457
458 gl_info->gl_ops.ext.p_glFogCoordfEXT = wine_glFogCoordfEXT;
459 gl_info->gl_ops.ext.p_glFogCoordfvEXT = wine_glFogCoordfvEXT;
460 gl_info->gl_ops.ext.p_glFogCoorddEXT = wine_glFogCoorddEXT;
461 gl_info->gl_ops.ext.p_glFogCoorddvEXT = wine_glFogCoorddvEXT;
462 gl_info->supported[EXT_FOG_COORD] = TRUE;
463 return;
464
465 default:
466 FIXME("Extension %u emulation not supported.\n", ext);
467 }
468}
static const WCHAR *const ext[]
Definition: module.c:53
static void WINE_GLAPI wine_glFogCoordfEXT(GLfloat f)
Definition: gl_compat.c:339
static void WINE_GLAPI wine_glMultiTexCoord2fvARB(GLenum target, const GLfloat *v)
Definition: gl_compat.c:59
static void WINE_GLAPI wine_glFogiv(GLenum pname, const GLint *param)
Definition: gl_compat.c:195
static void WINE_GLAPI wine_glColor4ub(GLubyte r, GLubyte g, GLubyte b, GLubyte a)
Definition: gl_compat.c:332
static void WINE_GLAPI wine_glGetFloatv(GLenum pname, GLfloat *params)
Definition: gl_compat.c:140
static void WINE_GLAPI wine_glFogfv(GLenum pname, const GLfloat *param)
Definition: gl_compat.c:237
static void WINE_GLAPI wine_glFogf(GLenum pname, GLfloat param)
Definition: gl_compat.c:216
static void WINE_GLAPI wine_glActiveTexture(GLenum texture)
Definition: gl_compat.c:115
static void WINE_GLAPI wine_glMultiTexCoord4fvARB(GLenum target, const GLfloat *v)
Definition: gl_compat.c:91
static void WINE_GLAPI wine_glMultiTexCoord1fvARB(GLenum target, const GLfloat *v)
Definition: gl_compat.c:43
static void WINE_GLAPI wine_glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r)
Definition: gl_compat.c:67
static void WINE_GLAPI wine_glMultiTexCoord2svARB(GLenum target, const GLshort *v)
Definition: gl_compat.c:99
static void WINE_GLAPI wine_glVertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
Definition: gl_compat.c:265
static void WINE_GLAPI wine_glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t)
Definition: gl_compat.c:51
static void WINE_GLAPI wine_glVertex3fv(const GLfloat *pos)
Definition: gl_compat.c:299
static void WINE_GLAPI wine_glColor3f(GLfloat r, GLfloat g, GLfloat b)
Definition: gl_compat.c:324
static void WINE_GLAPI wine_glColor3fv(const GLfloat *c)
Definition: gl_compat.c:328
static void WINE_GLAPI wine_glFogCoordfvEXT(const GLfloat *f)
Definition: gl_compat.c:346
static void WINE_GLAPI wine_glEnable(GLenum cap)
Definition: gl_compat.c:153
static void WINE_GLAPI wine_glGetIntegerv(GLenum pname, GLint *params)
Definition: gl_compat.c:131
static void WINE_GLAPI wine_glColor4fv(const GLfloat *c)
Definition: gl_compat.c:320
static void WINE_GLAPI wine_glFogi(GLenum pname, GLint param)
Definition: gl_compat.c:173
static void WINE_GLAPI wine_glVertex4fv(const GLfloat *pos)
Definition: gl_compat.c:291
static void WINE_GLAPI wine_glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a)
Definition: gl_compat.c:303
static void WINE_GLAPI wine_glFogCoorddEXT(GLdouble f)
Definition: gl_compat.c:343
static void WINE_GLAPI wine_glMultiTexCoord3fvARB(GLenum target, const GLfloat *v)
Definition: gl_compat.c:75
static void WINE_GLAPI wine_glDisable(GLenum cap)
Definition: gl_compat.c:163
static void WINE_GLAPI wine_glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
Definition: gl_compat.c:83
static void WINE_GLAPI wine_glVertex3f(GLfloat x, GLfloat y, GLfloat z)
Definition: gl_compat.c:295
static void WINE_GLAPI wine_glFogCoorddvEXT(const GLdouble *f)
Definition: gl_compat.c:349
static void WINE_GLAPI wine_glGetDoublev(GLenum pname, GLdouble *params)
Definition: gl_compat.c:146
static void WINE_GLAPI wine_glMultiTexCoord1fARB(GLenum target, GLfloat s)
Definition: gl_compat.c:35
static void WINE_GLAPI wine_glClientActiveTextureARB(GLenum texture)
Definition: gl_compat.c:123
static void WINE_GLAPI wine_glMultiTexCoord4svARB(GLenum target, const GLshort *v)
Definition: gl_compat.c:107
@ EXT_FOG_COORD
Definition: wined3d_gl.h:157
@ ARB_FRAGMENT_SHADER
Definition: wined3d_gl.h:71
@ ARB_MULTITEXTURE
Definition: wined3d_gl.h:85

Referenced by wined3d_adapter_init_gl_caps().

◆ invert_matrix()

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

Definition at line 5501 of file utils.c.

5502{
5503 float wtmp[4][8];
5504 float m0, m1, m2, m3, s;
5505 float *r0, *r1, *r2, *r3;
5506
5507 r0 = wtmp[0];
5508 r1 = wtmp[1];
5509 r2 = wtmp[2];
5510 r3 = wtmp[3];
5511
5512 r0[0] = m->_11;
5513 r0[1] = m->_12;
5514 r0[2] = m->_13;
5515 r0[3] = m->_14;
5516 r0[4] = 1.0f;
5517 r0[5] = r0[6] = r0[7] = 0.0f;
5518
5519 r1[0] = m->_21;
5520 r1[1] = m->_22;
5521 r1[2] = m->_23;
5522 r1[3] = m->_24;
5523 r1[5] = 1.0f;
5524 r1[4] = r1[6] = r1[7] = 0.0f;
5525
5526 r2[0] = m->_31;
5527 r2[1] = m->_32;
5528 r2[2] = m->_33;
5529 r2[3] = m->_34;
5530 r2[6] = 1.0f;
5531 r2[4] = r2[5] = r2[7] = 0.0f;
5532
5533 r3[0] = m->_41;
5534 r3[1] = m->_42;
5535 r3[2] = m->_43;
5536 r3[3] = m->_44;
5537 r3[7] = 1.0f;
5538 r3[4] = r3[5] = r3[6] = 0.0f;
5539
5540 /* Choose pivot - or die. */
5541 if (fabsf(r3[0]) > fabsf(r2[0]))
5542 swap_rows(&r3, &r2);
5543 if (fabsf(r2[0]) > fabsf(r1[0]))
5544 swap_rows(&r2, &r1);
5545 if (fabsf(r1[0]) > fabsf(r0[0]))
5546 swap_rows(&r1, &r0);
5547 if (r0[0] == 0.0f)
5548 return FALSE;
5549
5550 /* Eliminate first variable. */
5551 m1 = r1[0] / r0[0]; m2 = r2[0] / r0[0]; m3 = r3[0] / r0[0];
5552 s = r0[1]; r1[1] -= m1 * s; r2[1] -= m2 * s; r3[1] -= m3 * s;
5553 s = r0[2]; r1[2] -= m1 * s; r2[2] -= m2 * s; r3[2] -= m3 * s;
5554 s = r0[3]; r1[3] -= m1 * s; r2[3] -= m2 * s; r3[3] -= m3 * s;
5555 s = r0[4];
5556 if (s != 0.0f)
5557 {
5558 r1[4] -= m1 * s;
5559 r2[4] -= m2 * s;
5560 r3[4] -= m3 * s;
5561 }
5562 s = r0[5];
5563 if (s != 0.0f)
5564 {
5565 r1[5] -= m1 * s;
5566 r2[5] -= m2 * s;
5567 r3[5] -= m3 * s;
5568 }
5569 s = r0[6];
5570 if (s != 0.0f)
5571 {
5572 r1[6] -= m1 * s;
5573 r2[6] -= m2 * s;
5574 r3[6] -= m3 * s;
5575 }
5576 s = r0[7];
5577 if (s != 0.0f)
5578 {
5579 r1[7] -= m1 * s;
5580 r2[7] -= m2 * s;
5581 r3[7] -= m3 * s;
5582 }
5583
5584 /* Choose pivot - or die. */
5585 if (fabsf(r3[1]) > fabsf(r2[1]))
5586 swap_rows(&r3, &r2);
5587 if (fabsf(r2[1]) > fabsf(r1[1]))
5588 swap_rows(&r2, &r1);
5589 if (r1[1] == 0.0f)
5590 return FALSE;
5591
5592 /* Eliminate second variable. */
5593 m2 = r2[1] / r1[1]; m3 = r3[1] / r1[1];
5594 r2[2] -= m2 * r1[2]; r3[2] -= m3 * r1[2];
5595 r2[3] -= m2 * r1[3]; r3[3] -= m3 * r1[3];
5596 s = r1[4];
5597 if (s != 0.0f)
5598 {
5599 r2[4] -= m2 * s;
5600 r3[4] -= m3 * s;
5601 }
5602 s = r1[5];
5603 if (s != 0.0f)
5604 {
5605 r2[5] -= m2 * s;
5606 r3[5] -= m3 * s;
5607 }
5608 s = r1[6];
5609 if (s != 0.0f)
5610 {
5611 r2[6] -= m2 * s;
5612 r3[6] -= m3 * s;
5613 }
5614 s = r1[7];
5615 if (s != 0.0f)
5616 {
5617 r2[7] -= m2 * s;
5618 r3[7] -= m3 * s;
5619 }
5620
5621 /* Choose pivot - or die. */
5622 if (fabsf(r3[2]) > fabsf(r2[2]))
5623 swap_rows(&r3, &r2);
5624 if (r2[2] == 0.0f)
5625 return FALSE;
5626
5627 /* Eliminate third variable. */
5628 m3 = r3[2] / r2[2];
5629 r3[3] -= m3 * r2[3];
5630 r3[4] -= m3 * r2[4];
5631 r3[5] -= m3 * r2[5];
5632 r3[6] -= m3 * r2[6];
5633 r3[7] -= m3 * r2[7];
5634
5635 /* Last check. */
5636 if (r3[3] == 0.0f)
5637 return FALSE;
5638
5639 /* Back substitute row 3. */
5640 s = 1.0f / r3[3];
5641 r3[4] *= s;
5642 r3[5] *= s;
5643 r3[6] *= s;
5644 r3[7] *= s;
5645
5646 /* Back substitute row 2. */
5647 m2 = r2[3];
5648 s = 1.0f / r2[2];
5649 r2[4] = s * (r2[4] - r3[4] * m2);
5650 r2[5] = s * (r2[5] - r3[5] * m2);
5651 r2[6] = s * (r2[6] - r3[6] * m2);
5652 r2[7] = s * (r2[7] - r3[7] * m2);
5653 m1 = r1[3];
5654 r1[4] -= r3[4] * m1;
5655 r1[5] -= r3[5] * m1;
5656 r1[6] -= r3[6] * m1;
5657 r1[7] -= r3[7] * m1;
5658 m0 = r0[3];
5659 r0[4] -= r3[4] * m0;
5660 r0[5] -= r3[5] * m0;
5661 r0[6] -= r3[6] * m0;
5662 r0[7] -= r3[7] * m0;
5663
5664 /* Back substitute row 1. */
5665 m1 = r1[2];
5666 s = 1.0f / r1[1];
5667 r1[4] = s * (r1[4] - r2[4] * m1);
5668 r1[5] = s * (r1[5] - r2[5] * m1);
5669 r1[6] = s * (r1[6] - r2[6] * m1);
5670 r1[7] = s * (r1[7] - r2[7] * m1);
5671 m0 = r0[2];
5672 r0[4] -= r2[4] * m0;
5673 r0[5] -= r2[5] * m0;
5674 r0[6] -= r2[6] * m0;
5675 r0[7] -= r2[7] * m0;
5676
5677 /* Back substitute row 0. */
5678 m0 = r0[1];
5679 s = 1.0f / r0[0];
5680 r0[4] = s * (r0[4] - r1[4] * m0);
5681 r0[5] = s * (r0[5] - r1[5] * m0);
5682 r0[6] = s * (r0[6] - r1[6] * m0);
5683 r0[7] = s * (r0[7] - r1[7] * m0);
5684
5685 out->_11 = r0[4];
5686 out->_12 = r0[5];
5687 out->_13 = r0[6];
5688 out->_14 = r0[7];
5689 out->_21 = r1[4];
5690 out->_22 = r1[5];
5691 out->_23 = r1[6];
5692 out->_24 = r1[7];
5693 out->_31 = r2[4];
5694 out->_32 = r2[5];
5695 out->_33 = r2[6];
5696 out->_34 = r2[7];
5697 out->_41 = r3[4];
5698 out->_42 = r3[5];
5699 out->_43 = r3[6];
5700 out->_44 = r3[7];
5701
5702 return TRUE;
5703}
static void swap_rows(float **a, float **b)
Definition: utils.c:5493
_Check_return_ __CRT_INLINE float __CRTDECL fabsf(_In_ float x)
Definition: math.h:179
static DNS_RECORDW r3
Definition: record.c:39
static DNS_RECORDW r1
Definition: record.c:37
static DNS_RECORDW r2
Definition: record.c:38

Referenced by get_normal_matrix(), shader_glsl_clip_plane_uniform(), and software_vertex_blending().

◆ invert_matrix_3d()

BOOL invert_matrix_3d ( struct wined3d_matrix out,
const struct wined3d_matrix in 
)

Definition at line 5431 of file utils.c.

5432{
5433 float pos, neg, t, det;
5434 struct wined3d_matrix temp;
5435
5436 /* Calculate the determinant of upper left 3x3 submatrix and
5437 * determine if the matrix is singular. */
5438 pos = neg = 0.0f;
5439 t = in->_11 * in->_22 * in->_33;
5440 if (t >= 0.0f)
5441 pos += t;
5442 else
5443 neg += t;
5444
5445 t = in->_21 * in->_32 * in->_13;
5446 if (t >= 0.0f)
5447 pos += t;
5448 else
5449 neg += t;
5450 t = in->_31 * in->_12 * in->_23;
5451 if (t >= 0.0f)
5452 pos += t;
5453 else
5454 neg += t;
5455
5456 t = -in->_31 * in->_22 * in->_13;
5457 if (t >= 0.0f)
5458 pos += t;
5459 else
5460 neg += t;
5461 t = -in->_21 * in->_12 * in->_33;
5462 if (t >= 0.0f)
5463 pos += t;
5464 else
5465 neg += t;
5466
5467 t = -in->_11 * in->_32 * in->_23;
5468 if (t >= 0.0f)
5469 pos += t;
5470 else
5471 neg += t;
5472
5473 det = pos + neg;
5474
5475 if (fabsf(det) < 1e-25f)
5476 return FALSE;
5477
5478 det = 1.0f / det;
5479 temp._11 = (in->_22 * in->_33 - in->_32 * in->_23) * det;
5480 temp._12 = -(in->_12 * in->_33 - in->_32 * in->_13) * det;
5481 temp._13 = (in->_12 * in->_23 - in->_22 * in->_13) * det;
5482 temp._21 = -(in->_21 * in->_33 - in->_31 * in->_23) * det;
5483 temp._22 = (in->_11 * in->_33 - in->_31 * in->_13) * det;
5484 temp._23 = -(in->_11 * in->_23 - in->_21 * in->_13) * det;
5485 temp._31 = (in->_21 * in->_32 - in->_31 * in->_22) * det;
5486 temp._32 = -(in->_11 * in->_32 - in->_31 * in->_12) * det;
5487 temp._33 = (in->_11 * in->_22 - in->_21 * in->_12) * det;
5488
5489 *out = temp;
5490 return TRUE;
5491}
GLdouble GLdouble t
Definition: gl.h:2047
static calc_node_t temp
Definition: rpn_ieee.c:38

Referenced by get_normal_matrix(), and software_vertex_blending().

◆ 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 4865 of file utils.c.

4867{
4868 if (op == WINED3D_TOP_DISABLE)
4869 return FALSE;
4870 if (state->textures[stage])
4871 return FALSE;
4872
4875 return TRUE;
4878 return TRUE;
4881 return TRUE;
4882
4883 return FALSE;
4884}
UINT op
Definition: effect.c:236
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:866

Referenced by gen_ffp_frag_op(), set_tex_op(), and set_tex_op_nvrc().

◆ is_rasterization_disabled()

static BOOL is_rasterization_disabled ( const struct wined3d_shader geometry_shader)
inlinestatic

Definition at line 4471 of file wined3d_private.h.

4472{
4473 return geometry_shader
4474 && geometry_shader->u.gs.so_desc.rasterizer_stream_idx == WINED3D_NO_RASTERIZER_STREAM;
4475}
struct wined3d_geometry_shader gs
#define WINED3D_NO_RASTERIZER_STREAM
Definition: wined3d.h:1571

Referenced by draw_primitive(), glsl_vertex_pipe_geometry_shader(), 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 246 of file wined3d_private.h.

247{
248 return f1.x_sign_fixup == f2.x_sign_fixup && f1.x_source == f2.x_source
249 && f1.y_sign_fixup == f2.y_sign_fixup && f1.y_source == f2.y_source
250 && f1.z_sign_fixup == f2.z_sign_fixup && f1.z_source == f2.z_source
251 && f1.w_sign_fixup == f2.w_sign_fixup && f1.w_source == f2.w_source;
252}
#define f2(x, y, z)
Definition: sha1.c:31
#define f1(x, y, z)
Definition: sha1.c:30

Referenced by atifs_color_fixup(), atifs_color_fixup_supported(), and wined3d_cs_exec_set_texture().

◆ is_scaling_fixup()

static BOOL is_scaling_fixup ( struct color_fixup_desc  fixup)
inlinestatic

Definition at line 241 of file wined3d_private.h.

242{
243 return fixup.x_sign_fixup || fixup.y_sign_fixup || fixup.z_sign_fixup || fixup.w_sign_fixup;
244}

Referenced by can_use_texture_swizzle(), and fbo_blitter_supported().

◆ isStateDirty()

◆ multiply_matrix()

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

Definition at line 5401 of file utils.c.

5402{
5403 struct wined3d_matrix tmp;
5404
5405 /* Now do the multiplication 'by hand'.
5406 I know that all this could be optimised, but this will be done later :-) */
5407 tmp._11 = (src1->_11 * src2->_11) + (src1->_21 * src2->_12) + (src1->_31 * src2->_13) + (src1->_41 * src2->_14);
5408 tmp._21 = (src1->_11 * src2->_21) + (src1->_21 * src2->_22) + (src1->_31 * src2->_23) + (src1->_41 * src2->_24);
5409 tmp._31 = (src1->_11 * src2->_31) + (src1->_21 * src2->_32) + (src1->_31 * src2->_33) + (src1->_41 * src2->_34);
5410 tmp._41 = (src1->_11 * src2->_41) + (src1->_21 * src2->_42) + (src1->_31 * src2->_43) + (src1->_41 * src2->_44);
5411
5412 tmp._12 = (src1->_12 * src2->_11) + (src1->_22 * src2->_12) + (src1->_32 * src2->_13) + (src1->_42 * src2->_14);
5413 tmp._22 = (src1->_12 * src2->_21) + (src1->_22 * src2->_22) + (src1->_32 * src2->_23) + (src1->_42 * src2->_24);
5414 tmp._32 = (src1->_12 * src2->_31) + (src1->_22 * src2->_32) + (src1->_32 * src2->_33) + (src1->_42 * src2->_34);
5415 tmp._42 = (src1->_12 * src2->_41) + (src1->_22 * src2->_42) + (src1->_32 * src2->_43) + (src1->_42 * src2->_44);
5416
5417 tmp._13 = (src1->_13 * src2->_11) + (src1->_23 * src2->_12) + (src1->_33 * src2->_13) + (src1->_43 * src2->_14);
5418 tmp._23 = (src1->_13 * src2->_21) + (src1->_23 * src2->_22) + (src1->_33 * src2->_23) + (src1->_43 * src2->_24);
5419 tmp._33 = (src1->_13 * src2->_31) + (src1->_23 * src2->_32) + (src1->_33 * src2->_33) + (src1->_43 * src2->_34);
5420 tmp._43 = (src1->_13 * src2->_41) + (src1->_23 * src2->_42) + (src1->_33 * src2->_43) + (src1->_43 * src2->_44);
5421
5422 tmp._14 = (src1->_14 * src2->_11) + (src1->_24 * src2->_12) + (src1->_34 * src2->_13) + (src1->_44 * src2->_14);
5423 tmp._24 = (src1->_14 * src2->_21) + (src1->_24 * src2->_22) + (src1->_34 * src2->_23) + (src1->_44 * src2->_24);
5424 tmp._34 = (src1->_14 * src2->_31) + (src1->_24 * src2->_32) + (src1->_34 * src2->_33) + (src1->_44 * src2->_34);
5425 tmp._44 = (src1->_14 * src2->_41) + (src1->_24 * src2->_42) + (src1->_34 * src2->_43) + (src1->_44 * src2->_44);
5426
5427 *dst = tmp;
5428}

◆ needs_interpolation_qualifiers_for_shader_outputs()

static BOOL needs_interpolation_qualifiers_for_shader_outputs ( const struct wined3d_gl_info gl_info)
inlinestatic

Definition at line 4462 of file wined3d_private.h.

4463{
4464 /* In GLSL 4.40+ it is fine to specify interpolation qualifiers only in
4465 * fragment shaders. In older GLSL versions interpolation qualifiers must
4466 * match between shader stages.
4467 */
4468 return gl_info->glsl_version < MAKEDWORD_VERSION(4, 40);
4469}

Referenced by init_interpolation_compile_args(), and shader_glsl_declare_shader_outputs().

◆ 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 4430 of file wined3d_private.h.

4432{
4433 unsigned int flags = texture->resource.format_flags
4435
4436 return (!context->gl_info->supported[EXT_TEXTURE_SRGB_DECODE]
4438 && context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL;
4439}
#define WINED3D_SRGB_READ_WRITE_CONTROL
Definition: wined3d.h:1324
#define WINED3DFMT_FLAG_SRGB_WRITE
#define WINED3DFMT_FLAG_SRGB_READ

Referenced by wined3d_texture_bind(), wined3d_texture_get_texture_name(), and wined3d_texture_load().

◆ needs_srgb_write()

static BOOL needs_srgb_write ( const struct wined3d_context context,
const struct wined3d_state state,
const struct wined3d_fb_state fb 
)
inlinestatic

Definition at line 4441 of file wined3d_private.h.

4443{
4444 return (!(context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL)
4445 || state->render_states[WINED3D_RS_SRGBWRITEENABLE])
4446 && fb->render_targets[0] && fb->render_targets[0]->format_flags & WINED3DFMT_FLAG_SRGB_WRITE;
4447}

Referenced by context_apply_clear_state(), device_clear_render_targets(), find_ps_compile_args(), gen_ffp_frag_op(), and state_srgbwrite().

◆ pixelformat_for_depth()

enum wined3d_format_id pixelformat_for_depth ( DWORD  depth)

Definition at line 5388 of file utils.c.

5389{
5390 switch (depth)
5391 {
5392 case 8: return WINED3DFMT_P8_UINT;
5393 case 15: return WINED3DFMT_B5G5R5X1_UNORM;
5394 case 16: return WINED3DFMT_B5G6R5_UNORM;
5395 case 24: return WINED3DFMT_B8G8R8X8_UNORM; /* Robots needs 24bit to be WINED3DFMT_B8G8R8X8_UNORM */
5396 case 32: return WINED3DFMT_B8G8R8X8_UNORM; /* EVE online and the Fur demo need 32bit AdapterDisplayMode to return WINED3DFMT_B8G8R8X8_UNORM */
5397 default: return WINED3DFMT_UNKNOWN;
5398 }
5399}

Referenced by wined3d_enum_adapter_modes(), wined3d_get_adapter_display_mode(), and wined3d_set_adapter_display_mode().

◆ pixelshader_update_resource_types()

void pixelshader_update_resource_types ( struct wined3d_shader shader,
WORD  tex_types 
)

Definition at line 4073 of file shader.c.

4074{
4075 struct wined3d_shader_reg_maps *reg_maps = &shader->reg_maps;
4076 struct wined3d_shader_resource_info *resource_info = reg_maps->resource_info;
4077 unsigned int i;
4078
4079 if (reg_maps->shader_version.major != 1) return;
4080
4081 for (i = 0; i < shader->limits->sampler; ++i)
4082 {
4083 /* We don't sample from this sampler. */
4084 if (!resource_info[i].type)
4085 continue;
4086
4088 {
4090 resource_info[i].type = WINED3D_SHADER_RESOURCE_TEXTURE_2D;
4091 break;
4092
4094 resource_info[i].type = WINED3D_SHADER_RESOURCE_TEXTURE_3D;
4095 break;
4096
4099 break;
4100 }
4101 }
4102}
struct wined3d_shader_version shader_version
struct wined3d_shader_resource_info resource_info[MAX_SHADER_RESOURCE_VIEWS]
enum wined3d_shader_resource_type type
#define WINED3D_PSARGS_TEXTYPE_MASK

Referenced by find_arb_pshader(), and find_glsl_pshader().

◆ print_glsl_info_log()

void print_glsl_info_log ( const struct wined3d_gl_info gl_info,
GLuint  id,
BOOL  program 
)

Definition at line 459 of file glsl_shader.c.

460{
461 int length = 0;
462 char *log;
463
464 if (!WARN_ON(d3d_shader) && !FIXME_ON(d3d_shader))
465 return;
466
467 if (program)
468 GL_EXTCALL(glGetProgramiv(id, GL_INFO_LOG_LENGTH, &length));
469 else
470 GL_EXTCALL(glGetShaderiv(id, GL_INFO_LOG_LENGTH, &length));
471
472 /* A size of 1 is just a null-terminated string, so the log should be bigger than
473 * that if there are errors. */
474 if (length > 1)
475 {
476 const char *ptr, *line;
477
479 /* The info log is supposed to be zero-terminated, but at least some
480 * versions of fglrx don't terminate the string properly. The reported
481 * length does include the terminator, so explicitly set it to zero
482 * here. */
483 log[length - 1] = 0;
484 if (program)
485 GL_EXTCALL(glGetProgramInfoLog(id, length, NULL, log));
486 else
487 GL_EXTCALL(glGetShaderInfoLog(id, length, NULL, log));
488
489 ptr = log;
490 if (gl_info->quirks & WINED3D_QUIRK_INFO_LOG_SPAM)
491 {
492 WARN("Info log received from GLSL shader #%u:\n", id);
493 while ((line = get_info_log_line(&ptr))) WARN(" %.*s", (int)(ptr - line), line);
494 }
495 else
496 {
497 FIXME("Info log received from GLSL shader #%u:\n", id);
498 while ((line = get_info_log_line(&ptr))) FIXME(" %.*s", (int)(ptr - line), line);
499 }
500 heap_free(log);
501 }
502}
GLuint program
Definition: glext.h:6723
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
#define GL_INFO_LOG_LENGTH
Definition: glext.h:450
static const char * get_info_log_line(const char **ptr)
Definition: glsl_shader.c:442
static PVOID ptr
Definition: dispmode.c:27
#define log(outFile, fmt,...)
Definition: util.h:15
Definition: parser.c:49
#define WINED3D_QUIRK_INFO_LOG_SPAM

Referenced by draw_test_quad(), shader_glsl_compile(), and shader_glsl_validate_link().

◆ resource_cleanup()

void resource_cleanup ( struct wined3d_resource resource)

Definition at line 237 of file resource.c.

238{
239 const struct wined3d *d3d = resource->device->wined3d;
240
241 TRACE("Cleaning up resource %p.\n", resource);
242
243 if (!(resource->usage & WINED3DUSAGE_PRIVATE))
244 {
246 {
247 TRACE("Decrementing device memory pool by %u.\n", resource->size);
248 adapter_adjust_memory(resource->device->adapter, (INT64)0 - resource->size);
249 }
250
252 }
255}
signed long long INT64
void wined3d_cs_destroy_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
Definition: cs.c:1885
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource)
Definition: device.c:5099
static void wined3d_resource_destroy_object(void *object)
Definition: resource.c:228
size_t size
Definition: utils.c:259
UINT64 adapter_adjust_memory(struct wined3d_adapter *adapter, INT64 amount)
Definition: directx.c:441
#define WINED3D_VIDMEM_ACCOUNTING
Definition: wined3d.h:1317
#define WINED3D_RESOURCE_ACCESS_CPU
Definition: wined3d.h:56
#define WINED3DUSAGE_PRIVATE
Definition: wined3d.h:916
static void wined3d_resource_acquire(struct wined3d_resource *resource)

Referenced by buffer_init(), wined3d_buffer_decref(), wined3d_texture_cleanup_sync(), and wined3d_texture_decref().

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

Definition at line 59 of file resource.c.

65{
68 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
69 BOOL tex_2d_ok = FALSE;
70 unsigned int i;
71
72 static const struct
73 {
75 DWORD cube_usage;
76 enum wined3d_gl_resource_type gl_type;
77 }
78 resource_types[] =
79 {
87 };
88
90
92 {
93 ERR("Trying to create a scratch resource with access flags %s.\n",
96 }
97
98 for (i = 0; i < ARRAY_SIZE(resource_types); ++i)
99 {
100 if (resource_types[i].type != type
101 || resource_types[i].cube_usage != (usage & WINED3DUSAGE_LEGACY_CUBEMAP))
102 continue;
103
104 gl_type = resource_types[i].gl_type;
105 if (base_type == WINED3D_GL_RES_TYPE_COUNT)
106 base_type = gl_type;
107
109 {
110 WARN("Format %s cannot be used for render targets.\n", debug_d3dformat(format->id));
111 continue;
112 }
114 && !(format->flags[gl_type] & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL)))
115 {
116 WARN("Format %s cannot be used for depth/stencil buffers.\n", debug_d3dformat(format->id));
117 continue;
118 }
121 && !(format->flags[gl_type] & WINED3DFMT_FLAG_FBO_ATTACHABLE))
122 {
123 WARN("Render target or depth stencil is not FBO attachable.\n");
124 continue;
125 }
126 if ((usage & WINED3DUSAGE_TEXTURE) && !(format->flags[gl_type] & WINED3DFMT_FLAG_TEXTURE))
127 {
128 WARN("Format %s cannot be used for texturing.\n", debug_d3dformat(format->id));
129 continue;
130 }
131 if (((width & (width - 1)) || (height & (height - 1)))
134 && gl_type == WINED3D_GL_RES_TYPE_TEX_2D)
135 {
136 TRACE("Skipping 2D texture type to try texture rectangle.\n");
137 tex_2d_ok = TRUE;
138 continue;
139 }
140 break;
141 }
142
143 if (base_type != WINED3D_GL_RES_TYPE_COUNT && i == ARRAY_SIZE(resource_types))
144 {
145 if (tex_2d_ok)
146 {
147 /* Non power of 2 texture and rectangle textures or renderbuffers do not work.
148 * Use 2D textures, the texture code will pad to a power of 2 size. */
150 }
151 else if (usage & WINED3DUSAGE_SCRATCH)
152 {
153 /* Needed for proper format information. */
154 gl_type = base_type;
155 }
156 else
157 {
158 WARN("Did not find a suitable GL resource type for resource type %s.\n",
161 }
162 }
163
164 if (base_type != WINED3D_GL_RES_TYPE_COUNT
167 {
168 UINT width_mask = format->block_width - 1;
169 UINT height_mask = format->block_height - 1;
170 if (width & width_mask || height & height_mask)
172 }
173
174 resource->ref = 1;
175 resource->device = device;
176 resource->type = type;
177 resource->gl_type = gl_type;
178 resource->format = format;
179 if (gl_type < WINED3D_GL_RES_TYPE_COUNT)
180 resource->format_flags = format->flags[gl_type];
181 resource->multisample_type = multisample_type;
182 resource->multisample_quality = multisample_quality;
183 resource->usage = usage;
184 resource->access = access;
185 resource->width = width;
186 resource->height = height;
187 resource->depth = depth;
188 resource->size = size;
189 resource->priority = 0;
190 resource->parent = parent;
191 resource->parent_ops = parent_ops;
192 resource->resource_ops = resource_ops;
193 resource->map_binding = WINED3D_LOCATION_SYSMEM;
194
195 if (size)
196 {
198 {
199 ERR("Failed to allocate system memory.\n");
200 return E_OUTOFMEMORY;
201 }
202 }
203 else
204 {
205 resource->heap_memory = NULL;
206 }
207
209 {
210 /* Check that we have enough video ram left */
212 {
214 {
215 ERR("Out of adapter memory\n");
218 }
220 }
221
223 }
224
225 return WINED3D_OK;
226}
UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device *device)
Definition: device.c:1298
void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource)
Definition: device.c:5081
static void resource_check_usage(DWORD usage)
Definition: resource.c:31
void wined3d_resource_free_sysmem(struct wined3d_resource *resource)
Definition: resource.c:504
BOOL wined3d_resource_allocate_sysmem(struct wined3d_resource *resource)
Definition: resource.c:487
const char * debug_d3dformat(enum wined3d_format_id format_id)
Definition: utils.c:3980
const char * wined3d_debug_resource_access(DWORD access)
Definition: utils.c:4200
r parent
Definition: btrfs.c:3010
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
#define WINED3D_RESOURCE_ACCESS_GPU
Definition: wined3d.h:55
#define WINED3DUSAGE_SCRATCH
Definition: wined3d.h:915
#define WINED3DERR_INVALIDCALL
Definition: wined3d.h:48
#define WINED3DERR_OUTOFVIDEOMEMORY
Definition: wined3d.h:47
@ WINED3D_GL_NORMALIZED_TEXRECT
Definition: wined3d_gl.h:214
@ ARB_TEXTURE_NON_POWER_OF_TWO
Definition: wined3d_gl.h:123
#define WINED3D_LOCATION_SYSMEM
#define WINED3DFMT_FLAG_RENDERTARGET
#define WINED3DFMT_FLAG_FBO_ATTACHABLE
wined3d_gl_resource_type
#define WINED3DFMT_FLAG_TEXTURE
#define WINED3DFMT_FLAG_BLOCKS
#define WINED3DFMT_FLAG_STENCIL
#define WINED3DFMT_FLAG_DEPTH
#define WINED3DFMT_FLAG_BLOCKS_NO_VERIFY

Referenced by buffer_init(), and wined3d_texture_init().

◆ resource_unload()

void resource_unload ( struct wined3d_resource resource)

Definition at line 257 of file resource.c.

258{
259 if (resource->map_count)
260 ERR("Resource %p is being unloaded while mapped.\n", resource);
261}

Referenced by buffer_unload(), and wined3d_texture_unload_gl_texture().

◆ sampler_texdim()

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

Definition at line 6212 of file utils.c.

6213{
6214 DWORD sampler = state_id - STATE_SAMPLER(0);
6215 DWORD mapped_stage = context->tex_unit_map[sampler];
6216
6217 /* No need to enable / disable anything here for unused samplers. The
6218 * tex_colorop handler takes care. Also no action is needed with pixel
6219 * shaders, or if tex_colorop will take care of this business. */
6220 if (mapped_stage == WINED3D_UNMAPPED_STAGE || mapped_stage >= context->gl_info->limits.textures)
6221 return;
6222 if (sampler >= context->lowest_disabled_stage)
6223 return;
6225 return;
6226
6227 texture_activate_dimensions(state->textures[sampler], context->gl_info);
6228}
void texture_activate_dimensions(const struct wined3d_texture *texture, const struct wined3d_gl_info *gl_info)
Definition: utils.c:6097

◆ set_tex_op_nvrc()

void set_tex_op_nvrc ( const struct wined3d_gl_info gl_info,
const struct wined3d_state state,
BOOL  is_alpha,
int  stage,
enum wined3d_texture_op  op,
DWORD  arg1,
DWORD  arg2,
DWORD  arg3,
INT  texture_idx,
DWORD  dst 
)

Definition at line 143 of file nvidia_texture_shader.c.

145{
146 struct tex_op_args tex_op_args = {{0}, {0}, {0}};
148 GLenum target = GL_COMBINER0_NV + stage;
149 GLenum output;
150
151 TRACE("stage %d, is_alpha %d, op %s, arg1 %#x, arg2 %#x, arg3 %#x, texture_idx %d\n",
152 stage, is_alpha, debug_d3dtop(op), arg1, arg2, arg3, texture_idx);
153
154 /* If a texture stage references an invalid texture unit the stage just
155 * passes through the result from the previous stage */
156 if (is_invalid_op(state, stage, op, arg1, arg2, arg3))
157 {
160 }
161
163 &tex_op_args.mapping[0], &tex_op_args.component_usage[0], texture_idx);
165 &tex_op_args.mapping[1], &tex_op_args.component_usage[1], texture_idx);
167 &tex_op_args.mapping[2], &tex_op_args.component_usage[2], texture_idx);
168
169
170 if(dst == WINED3DTA_TEMP) {
171 output = GL_SPARE1_NV;
172 } else {
173 output = GL_SPARE0_NV;
174 }
175
176 switch (op)
177 {
179 /* Only for alpha */
180 if (!is_alpha)
181 ERR("Shouldn't be called for WINED3D_TSS_COLOR_OP (WINED3DTOP_DISABLE).\n");
182 /* Input, prev_alpha*1 */
183 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
185 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
187
188 /* Output */
189 GL_EXTCALL(glCombinerOutputNV(target, portion, GL_SPARE0_NV, GL_DISCARD_NV,
191 break;
192
195 /* Input, arg*1 */
197 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
199 else
200 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
202 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
204
205 /* Output */
206 GL_EXTCALL(glCombinerOutputNV(target, portion, output, GL_DISCARD_NV,
208 break;
209
213 /* Input, arg1*arg2 */
214 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
216 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
218
219 /* Output */
221 GL_EXTCALL(glCombinerOutputNV(target, portion, output, GL_DISCARD_NV,
223 else if (op == WINED3D_TOP_MODULATE_2X)
224 GL_EXTCALL(glCombinerOutputNV(target, portion, output, GL_DISCARD_NV,
226 else if (op == WINED3D_TOP_MODULATE_4X)
227 GL_EXTCALL(glCombinerOutputNV(target, portion, output, GL_DISCARD_NV,
229 break;
230
231 case WINED3D_TOP_ADD:
234 /* Input, arg1*1+arg2*1 */
235 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
237 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
239 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
241 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
243
244 /* Output */
245 if (op == WINED3D_TOP_ADD)
248 else if (op == WINED3D_TOP_ADD_SIGNED)
251 else if (op == WINED3D_TOP_ADD_SIGNED_2X)
254 break;
255
257 /* Input, arg1*1+-arg2*1 */
258 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
260 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
262 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
264 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
266
267 /* Output */
270 break;
271
273 /* Input, arg1*1+(1-arg1)*arg2 */
274 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
276 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
278 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
280 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
282
283 /* Output */
286 break;
287
293 {
294 GLenum alpha_src = GL_PRIMARY_COLOR_NV;
296 alpha_src = d3dta_to_combiner_input(WINED3DTA_DIFFUSE, stage, texture_idx);
298 alpha_src = d3dta_to_combiner_input(WINED3DTA_TEXTURE, stage, texture_idx);
300 alpha_src = d3dta_to_combiner_input(WINED3DTA_TFACTOR, stage, texture_idx);
302 alpha_src = d3dta_to_combiner_input(WINED3DTA_TEXTURE, stage, texture_idx);
304 alpha_src = d3dta_to_combiner_input(WINED3DTA_CURRENT, stage, texture_idx);
305 else
306 FIXME("Unhandled texture op %s, shouldn't happen.\n", debug_d3dtop(op));
307
308 /* Input, arg1*alpha_src+arg2*(1-alpha_src) */
309 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
312 {
313 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
315 } else {
316 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
317 alpha_src, GL_UNSIGNED_IDENTITY_NV, GL_ALPHA));
318 }
319 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
321 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
322 alpha_src, GL_UNSIGNED_INVERT_NV, GL_ALPHA));
323
324 /* Output */
327 break;
328 }
329
331 /* Input, arg1_alpha*arg2_rgb+arg1_rgb*1 */
332 if (is_alpha)
333 ERR("Only supported for WINED3D_TSS_COLOR_OP (WINED3DTOP_MODULATEALPHA_ADDCOLOR).\n");
334 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
336 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
338 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
340 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
342
343 /* Output */
346 break;
347
349 /* Input, arg1_rgb*arg2_rgb+arg1_alpha*1 */
350 if (is_alpha)
351 ERR("Only supported for WINED3D_TSS_COLOR_OP (WINED3DTOP_MODULATECOLOR_ADDALPHA).\n");
352 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
354 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
356 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
358 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
360
361 /* Output */
364 break;
365
367 /* Input, (1-arg1_alpha)*arg2_rgb+arg1_rgb*1 */
368 if (is_alpha)
369 ERR("Only supported for WINED3D_TSS_COLOR_OP (WINED3DTOP_MODULATEINVALPHA_ADDCOLOR).\n");
370 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
372 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
374 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
376 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
378
379 /* Output */
382 break;
383
385 /* Input, (1-arg1_rgb)*arg2_rgb+arg1_alpha*1 */
386 if (is_alpha)
387 ERR("Only supported for WINED3D_TSS_COLOR_OP (WINED3DTOP_MODULATEINVCOLOR_ADDALPHA).\n");
388 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
390 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
392 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
394 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
396
397 /* Output */
400 break;
401
403 /* Input, arg1 . arg2 */
404 /* FIXME: DX7 uses a different calculation? */
405 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
407 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
409
410 /* Output */
411 GL_EXTCALL(glCombinerOutputNV(target, portion, output, GL_DISCARD_NV,
413 break;
414
416 /* Input, arg3*1+arg1*arg2 */
417 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
419 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
421 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
423 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
425
426 /* Output */
429 break;
430
431 case WINED3D_TOP_LERP:
432 /* Input, arg3*arg1+(1-arg3)*arg2 */
433 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
435 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
437 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_C_NV,
439 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_D_NV,
441
442 /* Output */
445 break;
446
449 if (!gl_info->supported[NV_TEXTURE_SHADER])
450 {
451 WARN("BUMPENVMAP requires GL_NV_texture_shader in this codepath\n");
452 break;
453 }
454
455 /* The bump map stage itself isn't exciting, just read the texture. But tell the next stage to
456 * perform bump mapping and source from the current stage. Pretty much a SELECTARG2.
457 * ARG2 is passed through unmodified(apps will most likely use D3DTA_CURRENT for arg2, arg1
458 * (which will most likely be D3DTA_TEXTURE) is available as a texture shader input for the
459 * next stage */
460 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_A_NV,
462 GL_EXTCALL(glCombinerInputNV(target, portion, GL_VARIABLE_B_NV,
464 /* Always pass through to CURRENT, ignore temp arg */
465 GL_EXTCALL(glCombinerOutputNV(target, portion, GL_SPARE0_NV, GL_DISCARD_NV,
467 break;
468
469 default:
470 FIXME("Unhandled texture op: stage %d, is_alpha %d, op %s (%#x), arg1 %#x, arg2 %#x, arg3 %#x, texture_idx %d.\n",
471 stage, is_alpha, debug_d3dtop(op), op, arg1, arg2, arg3, texture_idx);
472 }
473
474 checkGLcall("set_tex_op_nvrc()");
475}
const char * debug_d3dtop(enum wined3d_texture_op d3dtop)
Definition: utils.c:4589
#define GL_RGB
Definition: gl.h:502
#define GL_ZERO
Definition: gl.h:374
#define GL_ALPHA
Definition: gl.h:483
#define GL_SCALE_BY_TWO_NV
Definition: glext.h:3425
#define GL_COMBINER0_NV
Definition: glext.h:3443
#define GL_VARIABLE_D_NV
Definition: glext.h:3404
#define GL_VARIABLE_B_NV
Definition: glext.h:3402
#define GL_PRIMARY_COLOR_NV
Definition: glext.h:3410
#define GL_SPARE0_NV
Definition: glext.h:3412
#define GL_SIGNED_NEGATE_NV
Definition: glext.h:3424
#define GL_VARIABLE_C_NV
Definition: glext.h:3403
#define GL_SPARE1_NV
Definition: glext.h:3413
#define GL_UNSIGNED_IDENTITY_NV
Definition: glext.h:3417
#define GL_EXPAND_NORMAL_NV
Definition: glext.h:3419
#define GL_UNSIGNED_INVERT_NV
Definition: glext.h:3418
#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV
Definition: glext.h:3428
GLenum portion
Definition: glext.h:9031
#define GL_SCALE_BY_FOUR_NV
Definition: glext.h:3426
#define GL_DISCARD_NV
Definition: glext.h:3414
#define GL_VARIABLE_A_NV
Definition: glext.h:3401
static GLenum d3dta_to_combiner_input(DWORD d3dta, DWORD stage, INT texture_idx)
static GLenum invert_mapping(GLenum mapping)
static void get_src_and_opr_nvrc(DWORD stage, DWORD arg, BOOL is_alpha, GLenum *input, GLenum *mapping, GLenum *component_usage, INT texture_idx)
#define is_alpha(c)
Definition: main.cpp:20
GLenum component_usage[3]
#define WINED3DTA_TFACTOR
Definition: wined3d.h:870
#define WINED3DTA_DIFFUSE
Definition: wined3d.h:867
@ NV_TEXTURE_SHADER
Definition: wined3d_gl.h:198

Referenced by nvrc_colorop(), and tex_alphaop().

◆ 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 4203 of file wined3d_private.h.

4204{
4205 struct wined3d_shader_lconst *lconst;
4206
4207 if (shader->load_local_constsF)
4208 return FALSE;
4209
4210 LIST_FOR_EACH_ENTRY(lconst, &shader->constantsF, struct wined3d_shader_lconst, entry)
4211 {
4212 if (lconst->idx == reg)
4213 return TRUE;
4214 }
4215
4216 return FALSE;
4217}
static int reg
Definition: i386-dis.c:1290
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198

Referenced by shader_generate_arb_declarations(), and 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 1838 of file shader.c.

1839{
1840 DWORD map = 1u << max;
1841 map |= map - 1;
1842 map &= reg_maps->shader_version.major < 3 ? ~reg_maps->texcoord : ~reg_maps->input_registers;
1843
1844 return wined3d_log2i(map);
1845}
Definition: _map.h:48
static unsigned int wined3d_log2i(unsigned int x)
Definition: wined3d.h:2759

Referenced by find_arb_pshader().

◆ 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 2558 of file shader.c.

2561{
2562 struct wined3d_device *device = shader->device;
2563 const struct wined3d_shader_frontend *fe = shader->frontend;
2564 void *fe_data = shader->frontend_data;
2565 struct wined3d_shader_version shader_version;
2567 struct wined3d_shader_instruction ins;
2568 struct wined3d_shader_tex_mx tex_mx;
2570 const DWORD *ptr;
2571
2572 /* Initialize current parsing state. */
2573 tex_mx.current_row = 0;
2574 state.current_loop_depth = 0;
2575 state.current_loop_reg = 0;
2576 state.in_subroutine = FALSE;
2577
2578 ctx.shader = shader;
2579 ctx.gl_info = &device->adapter->gl_info;
2580 ctx.reg_maps = reg_maps;
2581 ctx.buffer = buffer;
2582 ctx.tex_mx = &tex_mx;
2583 ctx.state = &state;
2584 ctx.backend_data = backend_ctx;
2585 ins.ctx = &ctx;
2586
2587 fe->shader_read_header(fe_data, &ptr, &shader_version);
2588 if (start)
2589 ptr = start;
2590
2591 while (!fe->shader_is_end(fe_data, &ptr) && ptr != end)
2592 {
2593 /* Read opcode. */
2594 fe->shader_read_instruction(fe_data, &ptr, &ins);
2595
2596 /* Unknown opcode and its parameters. */
2597 if (ins.handler_idx == WINED3DSIH_TABLE_SIZE)
2598 {
2599 WARN("Encountered unrecognised or invalid instruction.\n");
2601 }
2602
2603 if (ins.predicate)
2604 FIXME("Predicates not implemented.\n");
2605
2606 /* Call appropriate function for output target */
2607 device->shader_backend->shader_handle_instruction(&ins);
2608 }
2609
2610 return WINED3D_OK;
2611}
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)

Referenced by shader_arb_generate_pshader(), shader_arb_generate_vshader(), shader_glsl_generate_compute_shader(), shader_glsl_generate_domain_shader(), shader_glsl_generate_geometry_shader(), shader_glsl_generate_hull_shader(), shader_glsl_generate_pshader(), shader_glsl_generate_shader_phase(), and shader_glsl_generate_vshader().

◆ shader_get_position_fixup()

static void shader_get_position_fixup ( const struct wined3d_context context,
const struct wined3d_state state,
float position_fixup 
)
inlinestatic

Definition at line 4181 of file wined3d_private.h.

4183{
4184 float center_offset;
4185
4186 if (context->d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER)
4187 center_offset = 63.0f / 64.0f;
4188 else
4189 center_offset = -1.0f / 64.0f;
4190
4191 position_fixup[0] = 1.0f;
4192 position_fixup[1] = 1.0f;
4193 position_fixup[2] = center_offset / state->viewport.width;
4194 position_fixup[3] = -center_offset / state->viewport.height;
4195
4196 if (context->render_offscreen)
4197 {
4198 position_fixup[1] *= -1.0f;
4199 position_fixup[3] *= -1.0f;
4200 }
4201}

Referenced by shader_arb_vs_local_constants(), and shader_glsl_load_constants().

◆ shader_glsl_validate_link()

void shader_glsl_validate_link ( const struct wined3d_gl_info gl_info,
GLuint  program 
)

Definition at line 577 of file glsl_shader.c.

578{
579 GLint tmp;
580
581 if (!TRACE_ON(d3d_shader) && !FIXME_ON(d3d_shader))
582 return;
583
584 GL_EXTCALL(glGetProgramiv(program, GL_LINK_STATUS, &tmp));
585 if (!tmp)
586 {
587 FIXME("Program %u link status invalid.\n", program);
589 }
590
592}
#define GL_LINK_STATUS
Definition: glext.h:448
static void shader_glsl_dump_program_source(const struct wined3d_gl_info *gl_info, GLuint program)
Definition: glsl_shader.c:525
void print_glsl_info_log(const struct wined3d_gl_info *gl_info, GLuint id, BOOL program)
Definition: glsl_shader.c:459

Referenced by draw_test_quad(), set_glsl_shader_program(), and shader_glsl_compile_compute_shader().

◆ shader_is_scalar()

static BOOL shader_is_scalar ( const struct wined3d_shader_register reg)
inlinestatic

Definition at line 4142 of file wined3d_private.h.

4143{
4144 switch (reg->type)
4145 {
4146 case WINED3DSPR_RASTOUT:
4147 /* oFog & oPts */
4148 if (reg->idx[0].offset)
4149 return TRUE;
4150 /* oPos */
4151 return FALSE;
4152
4153 case WINED3DSPR_DEPTHOUT: /* oDepth */
4156 case WINED3DSPR_CONSTBOOL: /* b# */
4157 case WINED3DSPR_LOOP: /* aL */
4158 case WINED3DSPR_PREDICATE: /* p0 */
4159 case WINED3DSPR_PRIMID: /* primID */
4160 return TRUE;
4161
4163 switch (reg->idx[0].offset)
4164 {
4165 case 0: /* vPos */
4166 return FALSE;
4167 case 1: /* vFace */
4168 return TRUE;
4169 default:
4170 return FALSE;
4171 }
4172
4174 return reg->immconst_type == WINED3D_IMMCONST_SCALAR;
4175
4176 default:
4177 return FALSE;
4178 }
4179}

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 377 of file shader.c.

378{
379 return !strcmp(semantic_name, shader_semantic_name_from_usage(usage));
380}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
static const char * shader_semantic_name_from_usage(enum wined3d_decl_usage usage)
Definition: shader.c:342

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

◆ shader_resource_view_generate_mipmaps()

void shader_resource_view_generate_mipmaps ( struct wined3d_shader_resource_view view)

Definition at line 851 of file view.c.

852{
854 unsigned int i, j, layer_count, level_count, base_level, max_level;
855 const struct wined3d_gl_info *gl_info;
856 struct wined3d_context *context;
857 struct gl_texture *gl_tex;
859 BOOL srgb;
860
861 TRACE("view %p.\n", view);
862
863 context = context_acquire(view->resource->device, NULL, 0);
864 gl_info = context->gl_info;
865 layer_count = view->desc.u.texture.layer_count;
866 level_count = view->desc.u.texture.level_count;
867 base_level = view->desc.u.texture.level_idx;
868 max_level = base_level + level_count - 1;
869
870 srgb = !!(texture->flags & WINED3D_TEXTURE_IS_SRGB);
872 for (i = 0; i < layer_count; ++i)
874
875 if (view->gl_view.name)
876 {
878 }
879 else
880 {
882 gl_info->gl_ops.gl.p_glTexParameteri(texture->target, GL_TEXTURE_BASE_LEVEL, base_level);
883 gl_info->gl_ops.gl.p_glTexParameteri(texture->target, GL_TEXTURE_MAX_LEVEL, max_level);
884 }
885
886 if (gl_info->supported[ARB_SAMPLER_OBJECTS])
887 GL_EXTCALL(glBindSampler(context->active_texture, 0));
889 if (context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL)
890 {
891 gl_info->gl_ops.gl.p_glTexParameteri(texture->target, GL_TEXTURE_SRGB_DECODE_EXT,
893 gl_tex->sampler_desc.srgb_decode = FALSE;
894 }
895
896 gl_info->fbo_ops.glGenerateMipmap(texture->target);
897 checkGLcall("glGenerateMipMap()");
898
899 for (i = 0; i < layer_count; ++i)
900 {
901 for (j = base_level + 1; j <= max_level; ++j)
902 {
905 }
906 }
907
908 if (!view->gl_view.name)
909 {
910 gl_tex->base_level = base_level;
911 gl_info->gl_ops.gl.p_glTexParameteri(texture->target, GL_TEXTURE_MAX_LEVEL, texture->level_count - 1);
912 }
913
915}
void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
Definition: texture.c:868
static void shader_resource_view_bind_and_dirtify(struct wined3d_shader_resource_view *view, struct wined3d_context *context)
Definition: view.c:834
#define GL_TEXTURE_BASE_LEVEL
Definition: gl.h:1503
#define GL_TEXTURE_MAX_LEVEL
Definition: gl.h:1504
#define location(file, line)
Definition: kmtest.h:18
struct wined3d_sampler_desc sampler_desc
unsigned int base_level
@ ARB_SAMPLER_OBJECTS
Definition: wined3d_gl.h:92
#define WINED3D_LOCATION_TEXTURE_SRGB
#define WINED3D_LOCATION_TEXTURE_RGB
static struct gl_texture * wined3d_texture_get_gl_texture(struct wined3d_texture *texture, BOOL srgb)
#define WINED3D_TEXTURE_IS_SRGB

Referenced by wined3d_cs_exec_generate_mipmaps().

◆ shader_vaddline()

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

Definition at line 464 of file shader.c.

465{
466 unsigned int rem;
467 int rc;
468
469 rem = buffer->buffer_size - buffer->content_size;
470 rc = vsnprintf(&buffer->buffer[buffer->content_size], rem, format, args);
471 if (rc < 0 /* C89 */ || (unsigned int)rc >= rem /* C99 */)
472 return rc;
473
474 buffer->content_size += rc;
475 return 0;
476}
#define vsnprintf
Definition: tif_win32.c:406

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

◆ state_alpha_test()

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

Definition at line 653 of file state.c.

654{
655 const struct wined3d_gl_info *gl_info = context->gl_info;
656 int glParm = 0;
657 float ref;
658 BOOL enable_ckey = FALSE;
659
660 TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
661
662 /* Find out if the texture on the first stage has a ckey set. The alpha
663 * state func reads the texture settings, even though alpha and texture
664 * are not grouped together. This is to avoid making a huge alpha +
665 * texture + texture stage + ckey block due to the hardly used
666 * WINED3D_RS_COLORKEYENABLE state(which is d3d <= 3 only). The texture
667 * function will call alpha in case it finds some texture + colorkeyenable
668 * combination which needs extra care. */
669 if (state->textures[0] && (state->textures[0]->async.color_key_flags & WINED3D_CKEY_SRC_BLT))
670 enable_ckey = TRUE;
671
672 if (enable_ckey || context->last_was_ckey)
674 context->last_was_ckey = enable_ckey;
675
676 if (state->render_states[WINED3D_RS_ALPHATESTENABLE]
677 || (state->render_states[WINED3D_RS_COLORKEYENABLE] && enable_ckey))
678 {
679 gl_info->gl_ops.gl.p_glEnable(GL_ALPHA_TEST);
680 checkGLcall("glEnable GL_ALPHA_TEST");
681 }
682 else
683 {
684 gl_info->gl_ops.gl.p_glDisable(GL_ALPHA_TEST);
685 checkGLcall("glDisable GL_ALPHA_TEST");
686 /* Alpha test is disabled, don't bother setting the params - it will happen on the next
687 * enable call
688 */
689 return;
690 }
691
692 if (state->render_states[WINED3D_RS_COLORKEYENABLE] && enable_ckey)
693 {
694 glParm = GL_NOTEQUAL;
695 ref = 0.0f;
696 }
697 else
698 {
699 ref = ((float)state->render_states[WINED3D_RS_ALPHAREF]) / 255.0f;
700 glParm = wined3d_gl_compare_func(state->render_states[WINED3D_RS_ALPHAFUNC]);
701 }
702 if (glParm)
703 {
704 gl_info->gl_ops.gl.p_glAlphaFunc(glParm, ref);
705 checkGLcall("glAlphaFunc");
706 }
707}
GLenum wined3d_gl_compare_func(enum wined3d_cmp_func f)
Definition: state.c:348
#define GL_NOTEQUAL
Definition: gl.h:298
#define GL_ALPHA_TEST
Definition: gl.h:366
Definition: send.c:48

◆ state_cleanup()

void state_cleanup ( struct wined3d_state state)

Definition at line 528 of file stateblock.c.

529{
530 unsigned int counter;
531
532 if (!(state->flags & WINED3D_STATE_NO_REF))
534
536 {
537 state->lights[counter] = NULL;
538 }
539
540 for (counter = 0; counter < LIGHTMAP_SIZE; ++counter)
541 {
542 struct list *e1, *e2;
543 LIST_FOR_EACH_SAFE(e1, e2, &state->light_map[counter])
544 {
546 list_remove(&light->entry);
548 }
549 }
550}
Definition: list.h:37
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
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
#define LIST_ENTRY(type)
Definition: queue.h:175
void state_unbind_resources(struct wined3d_state *state)
Definition: stateblock.c:429
#define WINED3D_STATE_NO_REF
#define MAX_ACTIVE_LIGHTS
#define LIGHTMAP_SIZE

Referenced by device_init(), wined3d_cs_create(), wined3d_cs_destroy(), wined3d_cs_exec_reset_state(), wined3d_device_decref(), wined3d_device_reset(), and wined3d_stateblock_decref().

◆ state_clipping()

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

Definition at line 709 of file state.c.

710{
711 unsigned int enable_mask;
712
713 if (use_vs(state) && !context->d3d_info->vs_clipping)
714 {
715 static BOOL warned;
716
717 /* The OpenGL spec says that clipping planes are disabled when using
718 * shaders. Direct3D planes aren't, so that is an issue. The MacOS ATI
719 * driver keeps clipping planes activated with shaders in some
720 * conditions I got sick of tracking down. The shader state handler
721 * disables all clip planes because of that - don't do anything here
722 * and keep them disabled. */
723 if (state->render_states[WINED3D_RS_CLIPPLANEENABLE] && !warned++)
724 FIXME("Clipping not supported with vertex shaders.\n");
725 return;
726 }
727
728 /* glEnable(GL_CLIP_PLANEx) doesn't apply to (ARB backend) vertex shaders.
729 * The enabled / disabled planes are hardcoded into the shader. Update the
730 * shader to update the enabled clipplanes. In case of fixed function, we
731 * need to update the clipping field from ffp_vertex_settings. */
732 context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX;
733
734 /* If enabling / disabling all
735 * TODO: Is this correct? Doesn't D3DRS_CLIPPING disable clipping on the viewport frustrum?
736 */
737 enable_mask = state->render_states[WINED3D_RS_CLIPPING] ?
738 state->render_states[WINED3D_RS_CLIPPLANEENABLE] : 0;
740}
void context_enable_clip_distances(struct wined3d_context *context, unsigned int enable_mask)
Definition: context.c:2414

Referenced by vertexdeclaration().

◆ state_fog_fragpart()

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

Definition at line 1131 of file state.c.

1132{
1133 const struct wined3d_gl_info *gl_info = context->gl_info;
1134 enum fogsource new_source;
1135 DWORD fogstart = state->render_states[WINED3D_RS_FOGSTART];
1136 DWORD fogend = state->render_states[WINED3D_RS_FOGEND];
1137
1138 TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
1139
1140 if (!state->render_states[WINED3D_RS_FOGENABLE])
1141 {
1142 /* No fog? Disable it, and we're done :-) */
1143 glDisableWINE(GL_FOG);
1144 checkGLcall("glDisable GL_FOG");
1145 return;
1146 }
1147
1148 /* Fog Rules:
1149 *
1150 * With fixed function vertex processing, Direct3D knows 2 different fog input sources.
1151 * It can use the Z value of the vertex, or the alpha component of the specular color.
1152 * This depends on the fog vertex, fog table and the vertex declaration. If the Z value
1153 * is used, fogstart, fogend and the equation type are used, otherwise linear fog with
1154 * start = 255, end = 0 is used. Obviously the msdn is not very clear on that.
1155 *
1156 * FOGTABLEMODE != NONE:
1157 * The Z value is used, with the equation specified, no matter what vertex type.
1158 *
1159 * FOGTABLEMODE == NONE, FOGVERTEXMODE != NONE, untransformed:
1160 * Per vertex fog is calculated using the specified fog equation and the parameters
1161 *
1162 * FOGTABLEMODE == NONE, FOGVERTEXMODE != NONE, transformed, OR
1163 * FOGTABLEMODE == NONE, FOGVERTEXMODE == NONE, untransformed:
1164 * Linear fog with start = 255.0, end = 0.0, input comes from the specular color
1165 *
1166 *
1167 * Rules for vertex fog with shaders:
1168 *
1169 * When mixing fixed function functionality with the programmable pipeline, D3D expects
1170 * the fog computation to happen during transformation while openGL expects it to happen
1171 * during rasterization. Also, prior to pixel shader 3.0 D3D handles fog blending after
1172 * the pixel shader while openGL always expects the pixel shader to handle the blending.
1173 * To solve this problem, WineD3D does:
1174 * 1) implement a linear fog equation and fog blending at the end of every pre 3.0 pixel
1175 * shader,
1176 * and 2) disables the fog computation (in either the fixed function or programmable
1177 * rasterizer) if using a vertex program.
1178 *
1179 * D3D shaders can provide an explicit fog coordinate. This fog coordinate is used with
1180 * D3DRS_FOGTABLEMODE==D3DFOG_NONE. The FOGVERTEXMODE is ignored, d3d always uses linear
1181 * fog with start=1.0 and end=0.0 in this case. This is similar to fog coordinates in
1182 * the specular color, a vertex shader counts as pretransformed geometry in this case.
1183 * There are some GL differences between specular fog coords and vertex shaders though.
1184 *
1185 * With table fog the vertex shader fog coordinate is ignored.
1186 *
1187 * If a fogtablemode and a fogvertexmode are specified, table fog is applied (with or
1188 * without shaders).
1189 */
1190
1191 /* DX 7 sdk: "If both render states(vertex and table fog) are set to valid modes,
1192 * the system will apply only pixel(=table) fog effects."
1193 */
1194 if (state->render_states[WINED3D_RS_FOGTABLEMODE] == WINED3D_FOG_NONE)
1195 {
1196 if (use_vs(state))
1197 {
1198 gl_info->gl_ops.gl.p_glFogi(GL_FOG_MODE, GL_LINEAR);
1199 checkGLcall("glFogi(GL_FOG_MODE, GL_LINEAR)");
1200 new_source = FOGSOURCE_VS;
1201 }
1202 else
1203 {
1204 switch (state->render_states[WINED3D_RS_FOGVERTEXMODE])
1205 {
1206 /* If processed vertices are used, fall through to the NONE case */
1207 case WINED3D_FOG_EXP:
1208 if (!context->last_was_rhw)
1209 {
1210 gl_info->gl_ops.gl.p_glFogi(GL_FOG_MODE, GL_EXP);
1211 checkGLcall("glFogi(GL_FOG_MODE, GL_EXP)");
1212 new_source = FOGSOURCE_FFP;
1213 break;
1214 }
1215 /* drop through */
1216
1217 case WINED3D_FOG_EXP2:
1218 if (!context->last_was_rhw)
1219 {
1220 gl_info->gl_ops.gl.p_glFogi(GL_FOG_MODE, GL_EXP2);
1221 checkGLcall("glFogi(GL_FOG_MODE, GL_EXP2)");
1222 new_source = FOGSOURCE_FFP;
1223 break;
1224 }
1225 /* drop through */
1226
1227 case WINED3D_FOG_LINEAR:
1228 if (!context->last_was_rhw)
1229 {
1230 gl_info->gl_ops.gl.p_glFogi(GL_FOG_MODE, GL_LINEAR);
1231 checkGLcall("glFogi(GL_FOG_MODE, GL_LINEAR)");
1232 new_source = FOGSOURCE_FFP;
1233 break;
1234 }
1235 /* drop through */
1236
1237 case WINED3D_FOG_NONE:
1238 /* Both are none? According to msdn the alpha channel of
1239 * the specular colour contains a fog factor. Set it in
1240 * draw_primitive_immediate_mode(). Same happens with
1241 * vertex fog on transformed vertices. */
1242 new_source = FOGSOURCE_COORD;
1243 gl_info->gl_ops.gl.p_glFogi(GL_FOG_MODE, GL_LINEAR);
1244 checkGLcall("glFogi(GL_FOG_MODE, GL_LINEAR)");
1245 break;
1246
1247 default:
1248 FIXME("Unexpected WINED3D_RS_FOGVERTEXMODE %#x.\n",
1249 state->render_states[WINED3D_RS_FOGVERTEXMODE]);
1250 new_source = FOGSOURCE_FFP; /* Make the compiler happy */
1251 }
1252 }
1253 } else {
1254 new_source = FOGSOURCE_FFP;
1255
1256 switch (state->render_states[WINED3D_RS_FOGTABLEMODE])
1257 {
1258 case WINED3D_FOG_EXP:
1259 gl_info->gl_ops.gl.p_glFogi(GL_FOG_MODE, GL_EXP);
1260 checkGLcall("glFogi(GL_FOG_MODE, GL_EXP)");
1261 break;
1262
1263 case WINED3D_FOG_EXP2:
1264 gl_info->gl_ops.gl.p_glFogi(GL_FOG_MODE, GL_EXP2);
1265 checkGLcall("glFogi(GL_FOG_MODE, GL_EXP2)");
1266 break;
1267
1268 case WINED3D_FOG_LINEAR:
1269 gl_info->gl_ops.gl.p_glFogi(GL_FOG_MODE, GL_LINEAR);
1270 checkGLcall("glFogi(GL_FOG_MODE, GL_LINEAR)");
1271 break;
1272
1273 case WINED3D_FOG_NONE: /* Won't happen */
1274 default:
1275 FIXME("Unexpected WINED3D_RS_FOGTABLEMODE %#x.\n",
1276 state->render_states[WINED3D_RS_FOGTABLEMODE]);
1277 }
1278 }
1279
1280 glEnableWINE(GL_FOG);
1281 checkGLcall("glEnable GL_FOG");
1282 if (new_source != context->fog_source || fogstart == fogend)
1283 {
1284 context->fog_source = new_source;
1286 }
1287}
void state_fogstartend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: state.c:1115
#define GL_EXP
Definition: gl.h:422
#define GL_LINEAR
Definition: gl.h:421
#define GL_EXP2
Definition: gl.h:423
#define GL_FOG
Definition: gl.h:414
#define GL_FOG_MODE
Definition: gl.h:415
fogsource

◆ state_fogcolor()

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

Definition at line 1289 of file state.c.

1290{
1291 const struct wined3d_gl_info *gl_info = context->gl_info;
1292 struct wined3d_color color;
1293
1295 gl_info->gl_ops.gl.p_glFogfv(GL_FOG_COLOR, &color.r);
1296 checkGLcall("glFog GL_FOG_COLOR");
1297}
#define GL_FOG_COLOR
Definition: gl.h:417
static void wined3d_color_from_d3dcolor(struct wined3d_color *wined3d_color, DWORD d3d_color)

◆ state_fogdensity()

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

Definition at line 1299 of file state.c.

1300{
1301 const struct wined3d_gl_info *gl_info = context->gl_info;
1302 union {
1303 DWORD d;
1304 float f;
1305 } tmpvalue;
1306
1307 tmpvalue.d = state->render_states[WINED3D_RS_FOGDENSITY];
1308 gl_info->gl_ops.gl.p_glFogfv(GL_FOG_DENSITY, &tmpvalue.f);
1309 checkGLcall("glFogf(GL_FOG_DENSITY, (float) Value)");
1310}
#define GL_FOG_DENSITY
Definition: gl.h:416

◆ state_fogstartend()

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

Definition at line 1115 of file state.c.

1116{
1117 const struct wined3d_gl_info *gl_info = context->gl_info;
1118 float fogstart, fogend;
1119
1120 get_fog_start_end(context, state, &fogstart, &fogend);
1121
1122 gl_info->gl_ops.gl.p_glFogf(GL_FOG_START, fogstart);
1123 checkGLcall("glFogf(GL_FOG_START, fogstart)");
1124 TRACE("Fog Start == %f\n", fogstart);
1125
1126 gl_info->gl_ops.gl.p_glFogf(GL_FOG_END, fogend);
1127 checkGLcall("glFogf(GL_FOG_END, fogend)");
1128 TRACE("Fog End == %f\n", fogend);
1129}
void get_fog_start_end(const struct wined3d_context *context, const struct wined3d_state *state, float *start, float *end)
Definition: utils.c:5179
#define GL_FOG_END
Definition: gl.h:420
#define GL_FOG_START
Definition: gl.h:419

Referenced by state_arbfp_fog(), and state_fog_fragpart().

◆ state_init()

void state_init ( struct wined3d_state state,
struct wined3d_fb_state fb,
const struct wined3d_gl_info gl_info,
const struct wined3d_d3d_info d3d_info,
DWORD  flags 
)

Definition at line 1310 of file stateblock.c.

1313{
1314 unsigned int i;
1315
1316 state->flags = flags;
1317 state->fb = fb;
1318
1319 for (i = 0; i < LIGHTMAP_SIZE; i++)
1320 {
1321 list_init(&state->light_map[i]);
1322 }
1323
1325 state_init_default(state, gl_info);
1326}
static void state_init_default(struct wined3d_state *state, const struct wined3d_gl_info *gl_info)
Definition: stateblock.c:1107

Referenced by stateblock_init().

◆ state_nop()

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

Definition at line 173 of file state.c.

174{
175 TRACE("%s: nop in current pipe config.\n", debug_d3dstate(state_id));
176}

◆ state_pointsprite()

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

Definition at line 1661 of file state.c.

1662{
1663 const struct wined3d_gl_info *gl_info = context->gl_info;
1664
1665 if (state->render_states[WINED3D_RS_POINTSPRITEENABLE])
1666 {
1667 gl_info->gl_ops.gl.p_glEnable(GL_POINT_SPRITE_ARB);
1668 checkGLcall("glEnable(GL_POINT_SPRITE_ARB)");
1669 }
1670 else
1671 {
1672 gl_info->gl_ops.gl.p_glDisable(GL_POINT_SPRITE_ARB);
1673 checkGLcall("glDisable(GL_POINT_SPRITE_ARB)");
1674 }
1675}

◆ state_pointsprite_w()

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

Definition at line 1648 of file state.c.

1649{
1650 static BOOL warned;
1651
1652 /* TODO: NV_POINT_SPRITE */
1653 if (!warned && state->render_states[WINED3D_RS_POINTSPRITEENABLE])
1654 {
1655 /* A FIXME, not a WARN because point sprites should be software emulated if not supported by HW */
1656 FIXME("Point sprites not supported\n");
1657 warned = TRUE;
1658 }
1659}

◆ state_shademode()

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

Definition at line 293 of file state.c.

294{
295 const struct wined3d_gl_info *gl_info = context->gl_info;
296
297 switch (state->render_states[WINED3D_RS_SHADEMODE])
298 {
300 gl_info->gl_ops.gl.p_glShadeModel(GL_FLAT);
301 checkGLcall("glShadeModel(GL_FLAT)");
302 break;
304 /* WINED3D_SHADE_PHONG in practice is the same as WINED3D_SHADE_GOURAUD
305 * in D3D. */
307 gl_info->gl_ops.gl.p_glShadeModel(GL_SMOOTH);
308 checkGLcall("glShadeModel(GL_SMOOTH)");
309 break;
310 default:
311 FIXME("Unrecognized shade mode %#x.\n",
312 state->render_states[WINED3D_RS_SHADEMODE]);
313 }
314}
#define GL_SMOOTH
Definition: gl.h:339
#define GL_FLAT
Definition: gl.h:338
@ WINED3D_SHADE_GOURAUD
Definition: wined3d.h:480
@ WINED3D_SHADE_PHONG
Definition: wined3d.h:481

◆ state_srgbwrite()

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

Definition at line 4988 of file state.c.

4989{
4990 const struct wined3d_gl_info *gl_info = context->gl_info;
4991
4992 TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
4993
4995 gl_info->gl_ops.gl.p_glEnable(GL_FRAMEBUFFER_SRGB);
4996 else
4997 gl_info->gl_ops.gl.p_glDisable(GL_FRAMEBUFFER_SRGB);
4998}

◆ state_unbind_resources()

void state_unbind_resources ( struct wined3d_state state)

Definition at line 429 of file stateblock.c.

430{
433 struct wined3d_vertex_declaration *decl;
434 struct wined3d_sampler *sampler;
435 struct wined3d_texture *texture;
436 struct wined3d_buffer *buffer;
437 struct wined3d_shader *shader;
438 unsigned int i, j;
439
440 if ((decl = state->vertex_declaration))
441 {
442 state->vertex_declaration = NULL;
444 }
445
446 for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i)
447 {
448 if ((texture = state->textures[i]))
449 {
450 state->textures[i] = NULL;
452 }
453 }
454
455 for (i = 0; i < WINED3D_MAX_STREAM_OUTPUT_BUFFERS; ++i)
456 {
457 if ((buffer = state->stream_output[i].buffer))
458 {
459 state->stream_output[i].buffer = NULL;
461 }
462 }
463
464 for (i = 0; i < MAX_STREAMS; ++i)
465 {
466 if ((buffer = state->streams[i].buffer))
467 {
468 state->streams[i].buffer = NULL;
470 }
471 }
472
473 if ((buffer = state->index_buffer))
474 {
475 state->index_buffer = NULL;
477 }
478
479 for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i)
480 {
481 if ((shader = state->shader[i]))
482 {
483 state->shader[i] = NULL;
485 }
486
487 for (j = 0; j < MAX_CONSTANT_BUFFERS; ++j)
488 {
489 if ((buffer = state->cb[i][j]))
490 {
491 state->cb[i][j] = NULL;
493 }
494 }
495
496 for (j = 0; j < MAX_SAMPLER_OBJECTS; ++j)
497 {
498 if ((sampler = state->sampler[i][j]))
499 {
500 state->sampler[i][j] = NULL;
502 }
503 }
504
505 for (j = 0; j < MAX_SHADER_RESOURCE_VIEWS; ++j)
506 {
507 if ((srv = state->shader_resource_view[i][j]))
508 {
509 state->shader_resource_view[i][j] = NULL;
511 }
512 }
513 }
514
515 for (i = 0; i < WINED3D_PIPELINE_COUNT; ++i)
516 {
517 for (j = 0; j < MAX_UNORDERED_ACCESS_VIEWS; ++j)
518 {
519 if ((uav = state->unordered_access_view[i][j]))
520 {
521 state->unordered_access_view[i][j] = NULL;
523 }
524 }
525 }
526}
ULONG CDECL wined3d_buffer_decref(struct wined3d_buffer *buffer)
Definition: buffer.c:791
ULONG CDECL wined3d_shader_decref(struct wined3d_shader *shader)
Definition: shader.c:3364
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
Definition: texture.c:1023
ULONG CDECL wined3d_unordered_access_view_decref(struct wined3d_unordered_access_view *view)
Definition: view.c:970
ULONG CDECL wined3d_shader_resource_view_decref(struct wined3d_shader_resource_view *view)
Definition: view.c:671
ULONG CDECL wined3d_sampler_decref(struct wined3d_sampler *sampler)
Definition: sampler.c:53
ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration)
#define WINED3D_MAX_STREAM_OUTPUT_BUFFERS
Definition: wined3d.h:1569
#define MAX_SAMPLER_OBJECTS
#define MAX_CONSTANT_BUFFERS
#define MAX_UNORDERED_ACCESS_VIEWS
#define MAX_SHADER_RESOURCE_VIEWS

Referenced by state_cleanup(), wined3d_device_reset(), and wined3d_device_uninit_3d().

◆ stateblock_init_contained_states()

void stateblock_init_contained_states ( struct wined3d_stateblock stateblock)

Definition at line 290 of file stateblock.c.

291{
292 const struct wined3d_d3d_info *d3d_info = &stateblock->device->adapter->d3d_info;
293 unsigned int i, j;
294
295 for (i = 0; i <= WINEHIGHEST_RENDER_STATE >> 5; ++i)
296 {
297 DWORD map = stateblock->changed.renderState[i];
298 for (j = 0; map; map >>= 1, ++j)
299 {
300 if (!(map & 1)) continue;
301
302 stateblock->contained_render_states[stateblock->num_contained_render_states] = (i << 5) | j;
303 ++stateblock->num_contained_render_states;
304 }
305 }
306
307 for (i = 0; i <= HIGHEST_TRANSFORMSTATE >> 5; ++i)
308 {
309 DWORD map = stateblock->changed.transform[i];
310 for (j = 0; map; map >>= 1, ++j)
311 {
312 if (!(map & 1)) continue;
313
314 stateblock->contained_transform_states[stateblock->num_contained_transform_states] = (i << 5) | j;
315 ++stateblock->num_contained_transform_states;
316 }
317 }
318
319 for (i = 0; i < d3d_info->limits.vs_uniform_count; ++i)
320 {
321 if (stateblock->changed.vs_consts_f[i])
322 {
323 stateblock->contained_vs_consts_f[stateblock->num_contained_vs_consts_f] = i;
324 ++stateblock->num_contained_vs_consts_f;
325 }
326 }
327
328 for (i = 0; i < WINED3D_MAX_CONSTS_I; ++i)
329 {
330 if (stateblock->changed.vertexShaderConstantsI & (1u << i))
331 {
332 stateblock->contained_vs_consts_i[stateblock->num_contained_vs_consts_i] = i;
333 ++stateblock->num_contained_vs_consts_i;
334 }
335 }
336
337 for (i = 0; i < WINED3D_MAX_CONSTS_B; ++i)
338 {
339 if (stateblock->changed.vertexShaderConstantsB & (1u << i))
340 {
341 stateblock->contained_vs_consts_b[stateblock->num_contained_vs_consts_b] = i;
342 ++stateblock->num_contained_vs_consts_b;
343 }
344 }
345
346 for (i = 0; i < d3d_info->limits.ps_uniform_count; ++i)
347 {
348 if (stateblock->changed.ps_consts_f[i])
349 {
350 stateblock->contained_ps_consts_f[stateblock->num_contained_ps_consts_f] = i;
351 ++stateblock->num_contained_ps_consts_f;
352 }
353 }
354
355 for (i = 0; i < WINED3D_MAX_CONSTS_I; ++i)
356 {
357 if (stateblock->changed.pixelShaderConstantsI & (1u << i))
358 {
359 stateblock->contained_ps_consts_i[stateblock->num_contained_ps_consts_i] = i;
360 ++stateblock->num_contained_ps_consts_i;
361 }
362 }
363
364 for (i = 0; i < WINED3D_MAX_CONSTS_B; ++i)
365 {
366 if (stateblock->changed.pixelShaderConstantsB & (1u << i))
367 {
368 stateblock->contained_ps_consts_b[stateblock->num_contained_ps_consts_b] = i;
369 ++stateblock->num_contained_ps_consts_b;
370 }
371 }
372
373 for (i = 0; i < MAX_TEXTURES; ++i)
374 {
375 DWORD map = stateblock->changed.textureState[i];
376
377 for(j = 0; map; map >>= 1, ++j)
378 {
379 if (!(map & 1)) continue;
380
381 stateblock->contained_tss_states[stateblock->num_contained_tss_states].stage = i;
382 stateblock->contained_tss_states[stateblock->num_contained_tss_states].state = j;
383 ++stateblock->num_contained_tss_states;
384 }
385 }
386
387 for (i = 0; i < MAX_COMBINED_SAMPLERS; ++i)
388 {
389 DWORD map = stateblock->changed.samplerState[i];
390
391 for (j = 0; map; map >>= 1, ++j)
392 {
393 if (!(map & 1)) continue;
394
395 stateblock->contained_sampler_states[stateblock->num_contained_sampler_states].stage = i;
396 stateblock->contained_sampler_states[stateblock->num_contained_sampler_states].state = j;
397 ++stateblock->num_contained_sampler_states;
398 }
399 }
400}
DWORD contained_vs_consts_f[WINED3D_MAX_VS_CONSTS_F]
unsigned int num_contained_sampler_states
struct wined3d_device * device
unsigned int num_contained_transform_states
DWORD contained_vs_consts_i[WINED3D_MAX_CONSTS_I]
unsigned int num_contained_vs_consts_i
DWORD contained_render_states[WINEHIGHEST_RENDER_STATE+1]
unsigned int num_contained_vs_consts_b
unsigned int num_contained_ps_consts_f
DWORD contained_transform_states[HIGHEST_TRANSFORMSTATE+1]
unsigned int num_contained_vs_consts_f
unsigned int num_contained_tss_states
unsigned int num_contained_ps_consts_b
struct StageState contained_tss_states[MAX_TEXTURES *(WINED3D_HIGHEST_TEXTURE_STATE+1)]
unsigned int num_contained_ps_consts_i
struct wined3d_saved_states changed
DWORD contained_ps_consts_i[WINED3D_MAX_CONSTS_I]
DWORD contained_vs_consts_b[WINED3D_MAX_CONSTS_B]
DWORD contained_ps_consts_f[WINED3D_MAX_PS_CONSTS_F]
struct StageState contained_sampler_states[MAX_COMBINED_SAMPLERS *WINED3D_HIGHEST_SAMPLER_STATE]
DWORD contained_ps_consts_b[WINED3D_MAX_CONSTS_B]
unsigned int num_contained_render_states
#define WINED3D_MAX_CONSTS_B
#define WINED3D_MAX_CONSTS_I

Referenced by stateblock_init(), and wined3d_device_end_stateblock().

◆ string_buffer_clear()

◆ string_buffer_free()

◆ string_buffer_get()

Definition at line 495 of file shader.c.

496{
498
499 if (list_empty(&list->list))
500 {
501 buffer = heap_alloc(sizeof(*buffer));
503 {
504 ERR("Couldn't allocate buffer for temporary string.\n");
506 return NULL;
507 }
508 }
509 else
510 {
512 list_remove(&buffer->entry);
513 }
515 return buffer;
516}
static int list_empty(struct list_entry *head)
Definition: list.h:58
list(size_type __n, const_reference __val=_STLP_DEFAULT_CONSTRUCTED(value_type), const allocator_type &__a=allocator_type())
Definition: _list.h:306
void string_buffer_clear(struct wined3d_string_buffer *buffer)
Definition: shader.c:422
BOOL string_buffer_init(struct wined3d_string_buffer *buffer)
Definition: shader.c:428
Definition: list.h:15

Referenced by set_glsl_shader_program(), shader_glsl_add_src_param_ext(), shader_glsl_atomic(), shader_glsl_generate_ffp_fragment_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_setup_vs3_output(), and shader_glsl_store_raw_structured().

◆ string_buffer_init()

BOOL string_buffer_init ( struct wined3d_string_buffer buffer)

Definition at line 428 of file shader.c.

429{
430 buffer->buffer_size = 32;
431 if (!(buffer->buffer = heap_alloc(buffer->buffer_size)))
432 {
433 ERR("Failed to allocate shader buffer memory.\n");
434 return FALSE;
435 }
436
438 return TRUE;
439}

Referenced by arbfp_gen_plain_shader(), find_arb_pshader(), find_arb_vshader(), gen_arbfp_ffp_shader(), gen_p8_shader(), gen_yuv_shader(), shader_glsl_alloc(), shader_trace_init(), and string_buffer_get().

◆ string_buffer_list_cleanup()

void string_buffer_list_cleanup ( struct wined3d_string_buffer_list list)

Definition at line 555 of file shader.c.

556{
557 struct wined3d_string_buffer *buffer, *buffer_next;
558
560 {
563 }
565}
void string_buffer_free(struct wined3d_string_buffer *buffer)
Definition: shader.c:441
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204

Referenced by shader_glsl_free().

◆ string_buffer_list_init()

void string_buffer_list_init ( struct wined3d_string_buffer_list list)

Definition at line 550 of file shader.c.

551{
553}

Referenced by shader_glsl_alloc().

◆ string_buffer_release()

◆ string_buffer_resize()

BOOL string_buffer_resize ( struct wined3d_string_buffer buffer,
int  rc 
)

Definition at line 446 of file shader.c.

447{
448 char *new_buffer;
449 unsigned int new_buffer_size = buffer->buffer_size * 2;
450
451 while (rc > 0 && (unsigned int)rc >= new_buffer_size - buffer->content_size)
452 new_buffer_size *= 2;
453 if (!(new_buffer = heap_realloc(buffer->buffer, new_buffer_size)))
454 {
455 ERR("Failed to grow buffer.\n");
456 buffer->buffer[buffer->content_size] = '\0';
457 return FALSE;
458 }
459 buffer->buffer = new_buffer;
460 buffer->buffer_size = new_buffer_size;
461 return TRUE;
462}

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,
  ... 
)

◆ surface_get_sub_resource()

static struct wined3d_texture_sub_resource * surface_get_sub_resource ( struct wined3d_surface surface)
inlinestatic

Definition at line 3380 of file wined3d_private.h.

3381{
3382 return &surface->container->sub_resources[surface_get_sub_resource_idx(surface)];
3383}

Referenced by arbfp_blitter_blit(), fb_copy_to_texture_hwstretch(), surface_load_renderbuffer(), and surface_load_texture().

◆ surface_get_sub_resource_idx()

◆ surface_load_fb_texture()

void surface_load_fb_texture ( struct wined3d_surface surface,
BOOL  srgb,
struct wined3d_context context 
)

Definition at line 1710 of file surface.c.

1711{
1712 unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface);
1713 struct wined3d_texture *texture = surface->container;
1714 struct wined3d_device *device = texture->resource.device;
1715 const struct wined3d_gl_info *gl_info;
1716 struct wined3d_context *context = old_ctx;
1717 struct wined3d_surface *restore_rt = NULL;
1718 unsigned int level;
1719 GLenum target;
1720
1721 restore_rt = context_get_rt_surface(old_ctx);
1722 if (restore_rt != surface)
1723 context = context_acquire(device, texture, sub_resource_idx);
1724 else
1725 restore_rt = NULL;
1726
1727 gl_info = context->gl_info;
1729
1732
1733 TRACE("Reading back offscreen render target %p.\n", surface);
1734
1735 if (wined3d_resource_is_offscreen(&texture->resource))
1736 gl_info->gl_ops.gl.p_glReadBuffer(context_get_offscreen_gl_buffer(context));
1737 else
1738 gl_info->gl_ops.gl.p_glReadBuffer(wined3d_texture_get_gl_buffer(texture));
1739 checkGLcall("glReadBuffer");
1740
1741 level = sub_resource_idx % texture->level_count;
1743 gl_info->gl_ops.gl.p_glCopyTexSubImage2D(target, level, 0, 0, 0, 0,
1746 checkGLcall("glCopyTexSubImage2D");
1747
1748 if (restore_rt)
1749 context_restore(context, restore_rt);
1750}
GLenum context_get_offscreen_gl_buffer(const struct wined3d_context *context)
Definition: context.c:2954
void context_restore(struct wined3d_context *context, struct wined3d_surface *restore)
Definition: context.c:1606
void device_invalidate_state(const struct wined3d_device *device, DWORD state)
Definition: device.c:5263
void wined3d_texture_prepare_texture(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
Definition: texture.c:1546
GLenum wined3d_texture_get_gl_buffer(const struct wined3d_texture *texture)
Definition: texture.c:51
GLint level
Definition: gl.h:1546
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)
static struct wined3d_surface * context_get_rt_surface(const struct wined3d_context *context)
static GLenum wined3d_texture_get_sub_resource_target(const struct wined3d_texture *texture, unsigned int sub_resource_idx)

Referenced by arbfp_blitter_blit(), and surface_load_texture().

◆ surface_load_location()

BOOL surface_load_location ( struct wined3d_surface surface,
struct wined3d_context context,
DWORD  location 
)

Definition at line 2630 of file surface.c.

2631{
2632 TRACE("surface %p, location %s.\n", surface, wined3d_debug_location(location));
2633
2634 switch (location)
2635 {
2639 return surface_load_sysmem(surface, context, location);
2640
2642 return surface_load_drawable(surface, context);
2643
2646 return surface_load_renderbuffer(surface, context, location);
2647
2650 return surface_load_texture(surface, context,
2652
2653 default:
2654 ERR("Don't know how to handle location %#x.\n", location);
2655 return FALSE;
2656 }
2657}
static BOOL surface_load_sysmem(struct wined3d_surface *surface, struct wined3d_context *context, DWORD dst_location)
Definition: surface.c:2326
static BOOL surface_load_texture(struct wined3d_surface *surface, struct wined3d_context *context, BOOL srgb)
Definition: surface.c:2421
static BOOL surface_load_renderbuffer(struct wined3d_surface *surface, struct wined3d_context *context, DWORD dst_location)
Definition: surface.c:2596
static BOOL surface_load_drawable(struct wined3d_surface *surface, struct wined3d_context *context)
Definition: surface.c:2374
const char * wined3d_debug_location(DWORD location)
Definition: utils.c:6396
#define WINED3D_LOCATION_BUFFER
#define WINED3D_LOCATION_RB_RESOLVED
#define WINED3D_LOCATION_USER_MEMORY
#define WINED3D_LOCATION_RB_MULTISAMPLE

Referenced by texture2d_load_location().

◆ surface_set_compatible_renderbuffer()

void surface_set_compatible_renderbuffer ( struct wined3d_surface surface,
const struct wined3d_rendertarget_info rt 
)

Definition at line 981 of file surface.c.

982{
983 unsigned int sub_resource_idx, width, height, level;
985 const struct wined3d_texture *texture;
986 const struct wined3d_gl_info *gl_info;
987 unsigned int src_width, src_height;
989
990 texture = surface->container;
991 gl_info = &texture->resource.device->adapter->gl_info;
992 sub_resource_idx = surface_get_sub_resource_idx(surface);
993 level = sub_resource_idx % texture->level_count;
994
995 if (rt && rt->resource->format->id != WINED3DFMT_NULL)
996 {
997 struct wined3d_texture *rt_texture;
998 unsigned int rt_level;
999
1000 if (rt->resource->type == WINED3D_RTYPE_BUFFER)
1001 {
1002 FIXME("Unsupported resource type %s.\n", debug_d3dresourcetype(rt->resource->type));
1003 return;
1004 }
1005 rt_texture = wined3d_texture_from_resource(rt->resource);
1006 rt_level = rt->sub_resource_idx % rt_texture->level_count;
1007
1008 width = wined3d_texture_get_level_pow2_width(rt_texture, rt_level);
1009 height = wined3d_texture_get_level_pow2_height(rt_texture, rt_level);
1010 }
1011 else
1012 {
1015 }
1016
1019
1020 /* A depth stencil smaller than the render target is not valid */
1021 if (width > src_width || height > src_height) return;
1022
1023 /* Remove any renderbuffer set if the sizes match */
1024 if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT]
1025 || (width == src_width && height == src_height))
1026 {
1027 surface->current_renderbuffer = NULL;
1028 return;
1029 }
1030
1031 /* Look if we've already got a renderbuffer of the correct dimensions */
1033 {
1034 if (entry->width == width && entry->height == height)
1035 {
1036 renderbuffer = entry->id;
1037 surface->current_renderbuffer = entry;
1038 break;
1039 }
1040 }
1041
1042 if (!renderbuffer)
1043 {
1044 gl_info->fbo_ops.glGenRenderbuffers(1, &renderbuffer);
1045 gl_info->fbo_ops.glBindRenderbuffer(GL_RENDERBUFFER, renderbuffer);
1046 gl_info->fbo_ops.glRenderbufferStorage(GL_RENDERBUFFER,
1047 texture->resource.format->glInternal, width, height);
1048
1049 entry = heap_alloc(sizeof(*entry));
1050 entry->width = width;
1051 entry->height = height;
1052 entry->id = renderbuffer;
1053 list_add_head(&surface->renderbuffers, &entry->entry);
1054
1055 surface->current_renderbuffer = entry;
1056 }
1057
1058 checkGLcall("set_compatible_renderbuffer");
1059}
GLuint renderbuffer
Definition: glext.h:6989
#define GL_RENDERBUFFER
Definition: glext.h:1733
struct wined3d_resource * resource
struct list renderbuffers
const struct wined3d_renderbuffer_entry * current_renderbuffer
@ ARB_FRAMEBUFFER_OBJECT
Definition: wined3d_gl.h:73

Referenced by context_find_fbo_entry().

◆ surface_translate_drawable_coords()

void surface_translate_drawable_coords ( const struct wined3d_surface surface,
HWND  window,
RECT rect 
)

Definition at line 2164 of file surface.c.

2165{
2166 struct wined3d_texture *texture = surface->container;
2167 POINT offset = {0, 0};
2168 UINT drawable_height;
2169 RECT windowsize;
2170
2171 if (!texture->swapchain)
2172 return;
2173
2174 if (texture == texture->swapchain->front_buffer)
2175 {
2178 }
2179
2180 GetClientRect(window, &windowsize);
2181 drawable_height = windowsize.bottom - windowsize.top;
2182
2183 rect->top = drawable_height - rect->top;
2184 rect->bottom = drawable_height - rect->bottom;
2185}
GLintptr offset
Definition: glext.h:5920
& rect
Definition: startmenu.cpp:1413
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 arbfp_blitter_blit(), ffp_blitter_blit(), and surface_blt_fbo().

◆ swapchain_destroy_contexts()

void swapchain_destroy_contexts ( struct wined3d_swapchain swapchain)

Definition at line 1079 of file swapchain.c.

1080{
1081 unsigned int i;
1082
1083 for (i = 0; i < swapchain->num_contexts; ++i)
1084 {
1085 context_destroy(swapchain->device, swapchain->context[i]);
1086 }
1087 heap_free(swapchain->context);
1088 swapchain->num_contexts = 0;
1089 swapchain->context = NULL;
1090}
unsigned int num_contexts

Referenced by wined3d_device_delete_opengl_contexts_cs(), and wined3d_swapchain_destroy_object().

◆ swapchain_get_backup_dc()

HDC swapchain_get_backup_dc ( struct wined3d_swapchain swapchain)

Definition at line 1107 of file swapchain.c.

1108{
1109 if (!swapchain->backup_dc)
1110 {
1111 TRACE("Creating the backup window for swapchain %p.\n", swapchain);
1112
1113 if (!(swapchain->backup_wnd = CreateWindowA(WINED3D_OPENGL_WINDOW_CLASS_NAME, "WineD3D fake window",
1114 WS_OVERLAPPEDWINDOW, 10, 10, 10, 10, NULL, NULL, NULL, NULL)))
1115 {
1116 ERR("Failed to create a window.\n");
1117 return NULL;
1118 }
1119
1120 if (!(swapchain->backup_dc = GetDC(swapchain->backup_wnd)))
1121 {
1122 ERR("Failed to get a DC.\n");
1123 DestroyWindow(swapchain->backup_wnd);
1124 swapchain->backup_wnd = NULL;
1125 return NULL;
1126 }
1127 }
1128
1129 return swapchain->backup_dc;
1130}
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WINED3D_OPENGL_WINDOW_CLASS_NAME
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4315
HDC WINAPI GetDC(_In_opt_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by context_create(), and context_set_gl_context().

◆ swapchain_get_context()

struct wined3d_context * swapchain_get_context ( struct wined3d_swapchain swapchain)

Definition at line 1092 of file swapchain.c.

1093{
1095 unsigned int i;
1096
1097 for (i = 0; i < swapchain->num_contexts; ++i)
1098 {
1099 if (swapchain->context[i]->tid == tid)
1100 return swapchain->context[i];
1101 }
1102
1103 /* Create a new context for the thread */
1104 return swapchain_create_context(swapchain);
1105}
static TfClientId tid
static struct wined3d_context * swapchain_create_context(struct wined3d_swapchain *swapchain)
Definition: swapchain.c:1049

Referenced by context_acquire().

◆ swapchain_update_draw_bindings()

void swapchain_update_draw_bindings ( struct wined3d_swapchain swapchain)

Definition at line 1132 of file swapchain.c.

1133{
1134 UINT i;
1135
1137
1138 for (i = 0; i < swapchain->desc.backbuffer_count; ++i)
1139 {
1140 wined3d_resource_update_draw_binding(&swapchain->back_buffers[i]->resource);
1141 }
1142}
void wined3d_resource_update_draw_binding(struct wined3d_resource *resource)
Definition: resource.c:568
struct wined3d_swapchain_desc desc

Referenced by context_validate_onscreen_formats(), swapchain_gl_present(), and wined3d_swapchain_resize_buffers().

◆ swapchain_update_swap_interval()

void swapchain_update_swap_interval ( struct wined3d_swapchain swapchain)

Definition at line 1144 of file swapchain.c.

1145{
1147}
void wined3d_cs_init_object(struct wined3d_cs *cs, void(*callback)(void *object), void *object)
Definition: cs.c:1890
static void wined3d_swapchain_update_swap_interval_cs(void *object)
Definition: swapchain.c:689

Referenced by wined3d_cs_exec_present(), and wined3d_device_reset().

◆ tex_alphaop()

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

Definition at line 3215 of file state.c.

3216{
3217 DWORD stage = (state_id - STATE_TEXTURESTAGE(0, 0)) / (WINED3D_HIGHEST_TEXTURE_STATE + 1);
3218 BOOL tex_used = context->fixed_function_usage_map & (1u << stage);
3219 DWORD mapped_stage = context->tex_unit_map[stage];
3220 const struct wined3d_gl_info *gl_info = context->gl_info;
3221 DWORD op, arg1, arg2, arg0;
3222
3223 TRACE("Setting alpha op for stage %d\n", stage);
3224 /* Do not care for enabled / disabled stages, just assign the settings. colorop disables / enables required stuff */
3225 if (mapped_stage != WINED3D_UNMAPPED_STAGE)
3226 {
3227 if (tex_used && mapped_stage >= gl_info->limits.textures)
3228 {
3229 FIXME("Attempt to enable unsupported stage!\n");
3230 return;
3231 }
3232 context_active_texture(context, gl_info, mapped_stage);
3233 }
3234
3235 op = state->texture_states[stage][WINED3D_TSS_ALPHA_OP];
3236 arg1 = state->texture_states[stage][WINED3D_TSS_ALPHA_ARG1];
3237 arg2 = state->texture_states[stage][WINED3D_TSS_ALPHA_ARG2];
3238 arg0 = state->texture_states[stage][WINED3D_TSS_ALPHA_ARG0];
3239
3240 if (state->render_states[WINED3D_RS_COLORKEYENABLE] && !stage && state->textures[0])
3241 {
3242 struct wined3d_texture *texture = state->textures[0];
3243 GLenum texture_dimensions = texture->target;
3244
3245 if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB)
3246 {
3247 if (texture->async.color_key_flags & WINED3D_CKEY_SRC_BLT && !texture->resource.format->alpha_size)
3248 {
3249 /* Color keying needs to pass alpha values from the texture through to have the alpha test work
3250 * properly. On the other hand applications can still use texture combiners apparently. This code
3251 * takes care that apps cannot remove the texture's alpha channel entirely.
3252 *
3253 * The fixup is required for Prince of Persia 3D(prison bars), while Moto racer 2 requires
3254 * D3DTOP_MODULATE to work on color keyed surfaces. Aliens vs Predator 1 uses color keyed textures
3255 * and alpha component of diffuse color to draw things like translucent text and perform other
3256 * blending effects.
3257 *
3258 * Aliens vs Predator 1 relies on diffuse alpha having an effect, so it cannot be ignored. To
3259 * provide the behavior expected by the game, while emulating the colorkey, diffuse alpha must be
3260 * modulated with texture alpha. OTOH, Moto racer 2 at some points sets alphaop/alphaarg to
3261 * SELECTARG/CURRENT, yet puts garbage in diffuse alpha (zeroes). This works on native, because the
3262 * game disables alpha test and alpha blending. Alpha test is overwritten by wine's for purposes of
3263 * color-keying though, so this will lead to missing geometry if texture alpha is modulated (pixels
3264 * fail alpha test). To get around this, ALPHABLENDENABLE state is checked: if the app enables alpha
3265 * blending, it can be expected to provide meaningful values in diffuse alpha, so it should be
3266 * modulated with texture alpha; otherwise, selecting diffuse alpha is ignored in favour of texture
3267 * alpha.
3268 *
3269 * What to do with multitexturing? So far no app has been found that uses color keying with
3270 * multitexturing */
3271 if (op == WINED3D_TOP_DISABLE)
3272 {
3275 }
3277 {
3278 if (state->render_states[WINED3D_RS_ALPHABLENDENABLE])
3279 {
3282 }
3283 else arg1 = WINED3DTA_TEXTURE;
3284 }
3286 {
3287 if (state->render_states[WINED3D_RS_ALPHABLENDENABLE])
3288 {
3291 }
3292 else arg2 = WINED3DTA_TEXTURE;
3293 }
3294 }
3295 }
3296 }
3297
3298 /* tex_alphaop is shared between the ffp and nvrc because the difference only comes down to
3299 * this if block here, and the other code(color keying, texture unit selection) are the same
3300 */
3301 TRACE("Setting alpha op for stage %d\n", stage);
3302 if (gl_info->supported[NV_REGISTER_COMBINERS])
3303 {
3304 set_tex_op_nvrc(gl_info, state, TRUE, stage, op, arg1, arg2, arg0,
3305 mapped_stage, state->texture_states[stage][WINED3D_TSS_RESULT_ARG]);
3306 }
3307 else
3308 {
3309 set_tex_op(gl_info, state, TRUE, stage, op, arg1, arg2, arg0);
3310 }
3311}
static void set_tex_op(const struct wined3d_gl_info *gl_info, const struct wined3d_state *state, BOOL isAlpha, int Stage, enum wined3d_texture_op op, DWORD arg1, DWORD arg2, DWORD arg3)
Definition: state.c:2103
void set_tex_op_nvrc(const struct wined3d_gl_info *gl_info, const struct wined3d_state *state, BOOL is_alpha, int stage, enum wined3d_texture_op op, DWORD arg1, DWORD arg2, DWORD arg3, INT texture_idx, DWORD dst)
@ NV_REGISTER_COMBINERS
Definition: wined3d_gl.h:194

◆ texture_activate_dimensions()

void texture_activate_dimensions ( const struct wined3d_texture texture,
const struct wined3d_gl_info gl_info 
)

Definition at line 6097 of file utils.c.

6098{
6099 if (texture)
6100 {
6101 switch (texture->target)
6102 {
6103 case GL_TEXTURE_1D:
6104 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D);
6105 checkGLcall("glDisable(GL_TEXTURE_2D)");
6106 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_3D);
6107 checkGLcall("glDisable(GL_TEXTURE_3D)");
6108 if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
6109 {
6110 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_CUBE_MAP_ARB);
6111 checkGLcall("glDisable(GL_TEXTURE_CUBE_MAP_ARB)");
6112 }
6113 if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
6114 {
6115 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_RECTANGLE_ARB);
6116 checkGLcall("glDisable(GL_TEXTURE_RECTANGLE_ARB)");
6117 }
6118 gl_info->gl_ops.gl.p_glEnable(GL_TEXTURE_1D);
6119 checkGLcall("glEnable(GL_TEXTURE_1D)");
6120 break;
6121 case GL_TEXTURE_2D:
6122 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_1D);
6123 checkGLcall("glDisable(GL_TEXTURE_1D)");
6124 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_3D);
6125 checkGLcall("glDisable(GL_TEXTURE_3D)");
6126 if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
6127 {
6128 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_CUBE_MAP_ARB);
6129 checkGLcall("glDisable(GL_TEXTURE_CUBE_MAP_ARB)");
6130 }
6131 if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
6132 {
6133 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_RECTANGLE_ARB);
6134 checkGLcall("glDisable(GL_TEXTURE_RECTANGLE_ARB)");
6135 }
6136 gl_info->gl_ops.gl.p_glEnable(GL_TEXTURE_2D);
6137 checkGLcall("glEnable(GL_TEXTURE_2D)");
6138 break;
6140 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_1D);
6141 checkGLcall("glDisable(GL_TEXTURE_1D)");
6142 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D);
6143 checkGLcall("glDisable(GL_TEXTURE_2D)");
6144 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_3D);
6145 checkGLcall("glDisable(GL_TEXTURE_3D)");
6146 if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
6147 {
6148 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_CUBE_MAP_ARB);
6149 checkGLcall("glDisable(GL_TEXTURE_CUBE_MAP_ARB)");
6150 }
6151 gl_info->gl_ops.gl.p_glEnable(GL_TEXTURE_RECTANGLE_ARB);
6152 checkGLcall("glEnable(GL_TEXTURE_RECTANGLE_ARB)");
6153 break;
6154 case GL_TEXTURE_3D:
6155 if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
6156 {
6157 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_CUBE_MAP_ARB);
6158 checkGLcall("glDisable(GL_TEXTURE_CUBE_MAP_ARB)");
6159 }
6160 if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
6161 {
6162 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_RECTANGLE_ARB);
6163 checkGLcall("glDisable(GL_TEXTURE_RECTANGLE_ARB)");
6164 }
6165 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_1D);
6166 checkGLcall("glDisable(GL_TEXTURE_1D)");
6167 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D);
6168 checkGLcall("glDisable(GL_TEXTURE_2D)");
6169 gl_info->gl_ops.gl.p_glEnable(GL_TEXTURE_3D);
6170 checkGLcall("glEnable(GL_TEXTURE_3D)");
6171 break;
6173 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_1D);
6174 checkGLcall("glDisable(GL_TEXTURE_1D)");
6175 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_2D);
6176 checkGLcall("glDisable(GL_TEXTURE_2D)");
6177 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_3D);
6178 checkGLcall("glDisable(GL_TEXTURE_3D)");
6179 if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
6180 {
6181 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_RECTANGLE_ARB);
6182 checkGLcall("glDisable(GL_TEXTURE_RECTANGLE_ARB)");
6183 }
6184 gl_info->gl_ops.gl.p_glEnable(GL_TEXTURE_CUBE_MAP_ARB);
6185 checkGLcall("glEnable(GL_TEXTURE_CUBE_MAP_ARB)");
6186 break;
6187 }
6188 }
6189 else
6190 {
6191 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_1D);
6192 checkGLcall("glDisable(GL_TEXTURE_1D)");
6193 gl_info->gl_ops.gl.p_glEnable(GL_TEXTURE_2D);
6194 checkGLcall("glEnable(GL_TEXTURE_2D)");
6195 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_3D);
6196 checkGLcall("glDisable(GL_TEXTURE_3D)");
6197 if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
6198 {
6199 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_CUBE_MAP_ARB);
6200 checkGLcall("glDisable(GL_TEXTURE_CUBE_MAP_ARB)");
6201 }
6202 if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
6203 {
6204 gl_info->gl_ops.gl.p_glDisable(GL_TEXTURE_RECTANGLE_ARB);
6205 checkGLcall("glDisable(GL_TEXTURE_RECTANGLE_ARB)");
6206 }
6207 /* Binding textures is done by samplers. A dummy texture will be bound */
6208 }
6209}

Referenced by nvrc_colorop(), sampler_texdim(), set_tex_op_atifs(), and tex_colorop().

◆ texture_from_resource()

static struct wined3d_texture * texture_from_resource ( struct wined3d_resource resource)
inlinestatic

Definition at line 3228 of file wined3d_private.h.

3229{
3231}

Referenced by context_bind_unordered_access_views(), context_generate_rt_mask_from_resource(), context_load_shader_resources(), context_load_unordered_access_resources(), context_resource_released(), device_clear_render_targets(), device_resource_released(), ffp_blitter_use_cpu_clear(), shader_resource_view_generate_mipmaps(), surface_cpu_blt_colour_fill(), texture_resource_decref(), texture_resource_incref(), texture_resource_preload(), texture_resource_sub_resource_map(), texture_resource_sub_resource_map_info(), texture_resource_sub_resource_unmap(), validate_resource_view(), wined3d_cs_exec_blt_sub_resource(), wined3d_device_clear_rendertarget_view(), wined3d_device_copy_resource(), wined3d_device_copy_sub_resource_region(), wined3d_device_resolve_sub_resource(), wined3d_device_update_sub_resource(), wined3d_render_target_view_cs_init(), wined3d_rendertarget_view_get_drawable_size(), wined3d_rendertarget_view_get_sub_resource_parent(), wined3d_rendertarget_view_get_surface(), wined3d_rendertarget_view_init(), wined3d_rendertarget_view_load_location(), wined3d_rendertarget_view_prepare_location(), wined3d_rendertarget_view_validate_location(), wined3d_resource_is_offscreen(), wined3d_resource_update_info(), wined3d_shader_resource_view_cs_init(), wined3d_shader_resource_view_generate_mipmaps(), wined3d_texture_from_resource(), wined3d_texture_unload(), wined3d_unordered_access_view_cs_init(), and wined3d_view_invalidate_location().

◆ transpose_matrix()

void transpose_matrix ( struct wined3d_matrix out,
const struct wined3d_matrix m 
)

Definition at line 5705 of file utils.c.

5706{
5707 struct wined3d_matrix temp;
5708 unsigned int i, j;
5709
5710 for (i = 0; i < 4; ++i)
5711 for (j = 0; j < 4; ++j)
5712 (&temp._11)[4 * j + i] = (&m->_11)[4 * i + j];
5713
5714 *out = temp;
5715}

Referenced by shader_glsl_clip_plane_uniform().

◆ use_indexed_vertex_blending()

static BOOL use_indexed_vertex_blending ( const struct wined3d_state state,
const struct wined3d_stream_info si 
)
inlinestatic

Definition at line 4381 of file wined3d_private.h.

4382{
4383 if (!state->render_states[WINED3D_RS_INDEXEDVERTEXBLENDENABLE])
4384 return FALSE;
4385
4386 if (state->render_states[WINED3D_RS_VERTEXBLEND] == WINED3D_VBF_DISABLE)
4387 return FALSE;
4388
4389 if (!(si->use_map & (1 << WINED3D_FFP_BLENDINDICES)) || !(si->use_map & (1 << WINED3D_FFP_BLENDWEIGHT)))
4390 return FALSE;
4391
4392 return TRUE;
4393}
@ WINED3D_VBF_DISABLE
Definition: wined3d.h:442

Referenced by draw_primitive(), software_vertex_blending(), and wined3d_ffp_get_vs_settings().

◆ use_ps()

◆ use_software_vertex_processing()

static BOOL use_software_vertex_processing ( const struct wined3d_device device)
inlinestatic

Definition at line 4395 of file wined3d_private.h.

4396{
4397 if (device->shader_backend != &glsl_shader_backend)
4398 return FALSE;
4399
4400 if (device->create_parms.flags & WINED3DCREATE_SOFTWARE_VERTEXPROCESSING)
4401 return TRUE;
4402
4403 if (!(device->create_parms.flags & WINED3DCREATE_MIXED_VERTEXPROCESSING))
4404 return FALSE;
4405
4406 return device->softwareVertexProcessing;
4407}
const struct wined3d_shader_backend_ops glsl_shader_backend
#define WINED3DCREATE_MIXED_VERTEXPROCESSING
Definition: wined3d.h:1013
#define WINED3DCREATE_SOFTWARE_VERTEXPROCESSING
Definition: wined3d.h:1011

Referenced by draw_primitive(), software_vertex_blending(), wined3d_device_get_device_caps(), and wined3d_ffp_get_vs_settings().

◆ use_vs()

◆ vshader_get_input()

BOOL vshader_get_input ( const struct wined3d_shader shader,
BYTE  usage_req,
BYTE  usage_idx_req,
unsigned int regnum 
)

Definition at line 3510 of file shader.c.

3512{
3513 WORD map = shader->reg_maps.input_registers;
3514 unsigned int i;
3515
3516 for (i = 0; map; map >>= 1, ++i)
3517 {
3518 if (!(map & 1)) continue;
3519
3520 if (match_usage(shader->u.vs.attributes[i].usage,
3521 shader->u.vs.attributes[i].usage_idx, usage_req, usage_idx_req))
3522 {
3523 *regnum = i;
3524 return TRUE;
3525 }
3526 }
3527 return FALSE;
3528}
static BOOL match_usage(BYTE usage1, BYTE usage_idx1, BYTE usage2, BYTE usage_idx2)
Definition: shader.c:3496
unsigned short WORD
Definition: ntddk_ex.h:93

Referenced by wined3d_stream_info_from_declaration().

◆ wined3d_adapter_init_format_info()

BOOL wined3d_adapter_init_format_info ( struct wined3d_adapter adapter,
struct wined3d_caps_gl_ctx ctx 
)

Definition at line 3803 of file utils.c.

3804{
3805 struct wined3d_gl_info *gl_info = &adapter->gl_info;
3806
3807 if (!init_format_base_info(gl_info)) return FALSE;
3808 if (!init_format_block_info(gl_info)) goto fail;
3809
3810 if (!ctx) /* WINED3D_NO3D */
3811 return TRUE;
3812
3813 if (!init_format_texture_info(adapter, gl_info)) goto fail;
3814 if (!init_format_vertex_info(gl_info)) goto fail;
3815
3816 apply_format_fixups(adapter, gl_info);
3818 init_format_filter_info(gl_info, adapter->driver_info.vendor);
3819 if (!init_typeless_formats(gl_info)) goto fail;
3822
3823 return TRUE;
3824
3825fail:
3826 heap_free(gl_info->formats);
3827 gl_info->formats = NULL;
3828 return FALSE;
3829}
static BOOL init_format_block_info(struct wined3d_gl_info *gl_info)
Definition: utils.c:1933
static void init_format_gen_mipmap_info(struct wined3d_gl_info *gl_info)
Definition: utils.c:3615
static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct wined3d_gl_info *gl_info)
Definition: utils.c:2923
static BOOL init_typeless_formats(struct wined3d_gl_info *gl_info)
Definition: utils.c:3557
static BOOL init_format_vertex_info(struct wined3d_gl_info *gl_info)
Definition: utils.c:3527
static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_gl_info *gl_info)
Definition: utils.c:3203
static void init_format_depth_bias_scale(struct wined3d_caps_gl_ctx *ctx, const struct wined3d_d3d_info *d3d_info)
Definition: utils.c:3773
static BOOL init_format_base_info(struct wined3d_gl_info *gl_info)
Definition: utils.c:1829
static void init_format_filter_info(struct wined3d_gl_info *gl_info, enum wined3d_pci_vendor vendor)
Definition: utils.c:3137
static void init_format_fbo_compat_info(struct wined3d_caps_gl_ctx *ctx)
Definition: utils.c:2532
struct wined3d_format * formats

Referenced by wined3d_adapter_init(), and wined3d_adapter_init_nogl().

◆ wined3d_arbfp_blitter_create()

void wined3d_arbfp_blitter_create ( struct wined3d_blitter **  next,
const struct wined3d_device device 
)

Definition at line 7915 of file arb_program_shader.c.

7916{
7917 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
7919
7920 if (device->shader_backend != &arb_program_shader_backend
7921 && device->shader_backend != &glsl_shader_backend)
7922 return;
7923
7924 if (!gl_info->supported[ARB_FRAGMENT_PROGRAM])
7925 return;
7926
7927 if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
7928 return;
7929
7930 if (!(blitter = heap_alloc(sizeof(*blitter))))
7931 {
7932 ERR("Failed to allocate blitter.\n");
7933 return;
7934 }
7935
7936 TRACE("Created blitter %p.\n", blitter);
7937
7938 blitter->blitter.ops = &arbfp_blitter_ops;
7939 blitter->blitter.next = *next;
7941 blitter->palette_texture = 0;
7942 *next = &blitter->blitter;
7943}
const struct wined3d_shader_backend_ops arb_program_shader_backend
static int arbfp_blit_type_compare(const void *key, const struct wine_rb_entry *entry)
static const struct wined3d_blitter_ops arbfp_blitter_ops
static unsigned __int64 next
Definition: rand_nt.c:6
struct wined3d_blitter blitter

Referenced by wined3d_device_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 6526 of file utils.c.

6527{
6528 SIZE_T max_capacity, new_capacity;
6529 void *new_elements;
6530
6531 if (count <= *capacity)
6532 return TRUE;
6533
6534 max_capacity = ~(SIZE_T)0 / size;
6535 if (count > max_capacity)
6536 return FALSE;
6537
6538 new_capacity = max(1, *capacity);
6539 while (new_capacity < count && new_capacity <= max_capacity / 2)
6540 new_capacity *= 2;
6541 if (new_capacity < count)
6542 new_capacity = count;
6543
6544 if (!*elements)
6545 new_elements = heap_alloc_zero(new_capacity * size);
6546 else
6547 new_elements = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, *elements, new_capacity * size);
6548 if (!new_elements)
6549 return FALSE;
6550
6551 *elements = new_elements;
6552 *capacity = new_capacity;
6553 return TRUE;
6554}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapReAlloc
Definition: compat.h:734
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
ULONG_PTR SIZE_T
Definition: typedefs.h:80

Referenced by buffer_invalidate_bo_range(), context_free_fence(), context_free_occlusion_query(), context_free_pipeline_statistics_query(), context_free_so_statistics_query(), context_free_timestamp_query(), shader_record_shader_phase(), shader_reg_maps_add_tgsm(), and wined3d_register_window().

◆ wined3d_bit_scan()

static int wined3d_bit_scan ( unsigned int x)
inlinestatic

Definition at line 4477 of file wined3d_private.h.

4478{
4479 int bit_offset = ffs(*x) - 1;
4480 *x ^= 1u << bit_offset;
4481 return bit_offset;
4482}
#define ffs
Definition: port.h:359

Referenced by context_apply_compute_state(), context_enable_clip_distances(), and find_draw_buffers_mask().

◆ 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 1195 of file buffer.c.

1197{
1198 struct wined3d_bo_address dst, src;
1199 struct wined3d_context *context;
1200 DWORD dst_location;
1201
1202 buffer_mark_used(dst_buffer);
1203 buffer_mark_used(src_buffer);
1204
1205 dst_location = wined3d_buffer_get_memory(dst_buffer, &dst, dst_buffer->locations);
1206 dst.addr += dst_offset;
1207
1208 wined3d_buffer_get_memory(src_buffer, &src, src_buffer->locations);
1209 src.addr += src_offset;
1210
1211 context = context_acquire(dst_buffer->resource.device, NULL, 0);
1213 &src, src_buffer->buffer_type_hint, size);
1215
1216 wined3d_buffer_invalidate_range(dst_buffer, ~dst_location, dst_offset, size);
1217}
DWORD wined3d_buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_bo_address *data, DWORD locations)
Definition: buffer.c:713
static void wined3d_buffer_invalidate_range(struct wined3d_buffer *buffer, DWORD location, unsigned int offset, unsigned int size)
Definition: buffer.c:113
static void buffer_mark_used(struct wined3d_buffer *buffer)
Definition: buffer.c:881
void context_copy_bo_address(struct wined3d_context *context, const struct wined3d_bo_address *dst, GLenum dst_binding, const struct wined3d_bo_address *src, GLenum src_binding, size_t size)
Definition: context.c:2846

Referenced by wined3d_cs_exec_blt_sub_resource().

◆ wined3d_buffer_get_memory()

DWORD wined3d_buffer_get_memory ( struct wined3d_buffer buffer,
struct wined3d_bo_address data,
DWORD  locations 
)

Definition at line 713 of file buffer.c.

715{
716 TRACE("buffer %p, data %p, locations %s.\n",
718
720 {
721 data->buffer_object = buffer->buffer_object;
722 data->addr = NULL;
724 }
726 {
727 data->buffer_object = 0;
728 data->addr = buffer->resource.heap_memory;
730 }
731
732 ERR("Unexpected locations %s.\n", wined3d_debug_location(locations));
733 data->buffer_object = 0;
734 data->addr = NULL;
735 return 0;
736}
GLsizei const GLint * locations
Definition: glext.h:10542

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

◆ 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 887 of file buffer.c.

889{
890 const struct wined3d_gl_info *gl_info = context->gl_info;
891 BOOL decl_changed = FALSE;
892
893 TRACE("buffer %p.\n", buffer);
894
895 if (buffer->resource.map_count)
896 {
897 WARN("Buffer is mapped, skipping preload.\n");
898 return;
899 }
900
902
903 /* TODO: Make converting independent from VBOs */
904 if (!(buffer->flags & WINED3D_BUFFER_USE_BO))
905 {
906 /* Not doing any conversion */
907 return;
908 }
909
911 {
912 ERR("Failed to prepare buffer location.\n");
913 return;
914 }
915
916 /* Reading the declaration makes only sense if we have valid state information
917 * (i.e., if this function is called during draws). */
918 if (state)
919 {
920 DWORD fixup_flags = 0;
921
922 if (!use_vs(state))
923 {
924 if (!gl_info->supported[ARB_VERTEX_ARRAY_BGRA] && !context->d3d_info->ffp_generic_attributes)
925 fixup_flags |= WINED3D_BUFFER_FIXUP_D3DCOLOR;
926 if (!context->d3d_info->xyzrhw)
927 fixup_flags |= WINED3D_BUFFER_FIXUP_XYZRHW;
928 }
929
930 decl_changed = buffer_find_decl(buffer, &context->stream_info, state, fixup_flags);
932 }
933
934 if (!decl_changed && !(buffer->flags & WINED3D_BUFFER_HASDESC && buffer_is_dirty(buffer)))
935 {
936 ++buffer->draw_count;
937 if (buffer->draw_count > VB_RESETDECLCHANGE)
938 buffer->decl_change_count = 0;
939 if (buffer->draw_count > VB_RESETFULLCONVS)
940 buffer->full_conversion_count = 0;
941 return;
942 }
943
944 /* If applications change the declaration over and over, reconverting all the time is a huge
945 * performance hit. So count the declaration changes and release the VBO if there are too many
946 * of them (and thus stop converting)
947 */
948 if (decl_changed)
949 {
950 ++buffer->decl_change_count;
951 buffer->draw_count = 0;
952
953 if (buffer->decl_change_count > VB_MAXDECLCHANGES
954 || (buffer->conversion_map && (buffer->resource.usage & WINED3DUSAGE_DYNAMIC)))
955 {
956 FIXME("Too many declaration changes or converting dynamic buffer, stopping converting.\n");
958 return;
959 }
960
961 /* The declaration changed, reload the whole buffer. */
962 WARN("Reloading buffer because of a vertex declaration change.\n");
964 }
965 else
966 {
967 /* However, it is perfectly fine to change the declaration every now and then. We don't want a game that
968 * changes it every minute drop the VBO after VB_MAX_DECL_CHANGES minutes. So count draws without
969 * decl changes and reset the decl change count after a specific number of them
970 */
971 if (buffer->conversion_map && buffer_is_fully_dirty(buffer))
972 {
973 ++buffer->full_conversion_count;
974 if (buffer->full_conversion_count > VB_MAXFULLCONVERSIONS)
975 {
976 FIXME("Too many full buffer conversions, stopping converting.\n");
978 return;
979 }
980 }
981 else
982 {
983 ++buffer->draw_count;
984 if (buffer->draw_count > VB_RESETDECLCHANGE)
985 buffer->decl_change_count = 0;
986 if (buffer->draw_count > VB_RESETFULLCONVS)
987 buffer->full_conversion_count = 0;
988 }
989 }
990
992 ERR("Failed to load buffer location.\n");
993}
#define WINED3D_BUFFER_FIXUP_D3DCOLOR
Definition: buffer.c:327
static BOOL buffer_is_fully_dirty(const struct wined3d_buffer *buffer)
Definition: buffer.c:95
static BOOL wined3d_buffer_prepare_location(struct wined3d_buffer *buffer, struct wined3d_context *context, DWORD location)
Definition: buffer.c:608
static BOOL buffer_is_dirty(const struct wined3d_buffer *buffer)
Definition: buffer.c:90
#define VB_RESETFULLCONVS
Definition: buffer.c:41
static void wined3d_buffer_drop_bo(struct wined3d_buffer *buffer)
Definition: buffer.c:767
#define VB_MAXFULLCONVERSIONS
Definition: buffer.c:40
#define VB_RESETDECLCHANGE
Definition: buffer.c:39
#define WINED3D_BUFFER_FIXUP_XYZRHW
Definition: buffer.c:328
#define WINED3D_BUFFER_HASDESC
Definition: buffer.c:32
static BOOL buffer_find_decl(struct wined3d_buffer *This, const struct wined3d_stream_info *si, const struct wined3d_state *state, DWORD fixup_flags)
Definition: buffer.c:368
static void buffer_invalidate_bo_range(struct wined3d_buffer *buffer, unsigned int offset, unsigned int size)
Definition: buffer.c:56
BOOL wined3d_buffer_load_location(struct wined3d_buffer *buffer, struct wined3d_context *context, DWORD location)
Definition: buffer.c:641
#define VB_MAXDECLCHANGES
Definition: buffer.c:38
#define WINED3D_BUFFER_USE_BO
Definition: buffer.c:33
@ ARB_VERTEX_ARRAY_BGRA
Definition: wined3d_gl.h:136

Referenced by buffer_resource_preload(), context_apply_draw_state(), context_load_shader_resources(), context_load_stream_output_buffers(), context_update_stream_info(), dispatch_compute(), and draw_primitive().

◆ wined3d_buffer_load_location()

BOOL wined3d_buffer_load_location ( struct wined3d_buffer buffer,
struct wined3d_context context,
DWORD  location 
)

Definition at line 641 of file buffer.c.

643{
644 const struct wined3d_gl_info *gl_info = context->gl_info;
645
646 TRACE("buffer %p, context %p, location %s.\n",
648
649 if (buffer->locations & location)
650 {
651 TRACE("Location (%#x) is already up to date.\n", location);
652 return TRUE;
653 }
654
655 if (!buffer->locations)
656 {
657 ERR("Buffer %p does not have any up to date location.\n", buffer);
660 }
661
662 TRACE("Current buffer location %s.\n", wined3d_debug_location(buffer->locations));
663
665 return FALSE;
666
667 if (buffer->locations & WINED3D_LOCATION_DISCARDED)
668 {
669 TRACE("Buffer previously discarded, nothing to do.\n");
672 return TRUE;
673 }
674
675 switch (location)
676 {
679 GL_EXTCALL(glGetBufferSubData(buffer->buffer_type_hint, 0, buffer->resource.size,
680 buffer->resource.heap_memory));
681 checkGLcall("buffer download");
682 break;
683
685 if (!buffer->conversion_map)
686 wined3d_buffer_upload_ranges(buffer, context, buffer->resource.heap_memory,
687 0, buffer->modified_areas, buffer->maps);
688 else
690 break;
691
692 default:
693 ERR("Invalid location %s.\n", wined3d_debug_location(location));
694 return FALSE;
695 }
696
698 if (buffer->resource.heap_memory && location == WINED3D_LOCATION_BUFFER
699 && !(buffer->resource.usage & WINED3DUSAGE_DYNAMIC))
701
702 return TRUE;
703}
static void wined3d_buffer_evict_sysmem(struct wined3d_buffer *buffer)
Definition: buffer.c:43
static void wined3d_buffer_upload_ranges(struct wined3d_buffer *buffer, struct wined3d_context *context, const void *data, unsigned int data_offset, unsigned int range_count, const struct wined3d_map_range *ranges)
Definition: buffer.c:535
static void buffer_bind(struct wined3d_buffer *buffer, struct wined3d_context *context)
Definition: buffer.c:136
static void wined3d_buffer_validate_location(struct wined3d_buffer *buffer, DWORD location)
Definition: buffer.c:101
static void buffer_conversion_upload(struct wined3d_buffer *buffer, struct wined3d_context *context)
Definition: buffer.c:552
void wined3d_buffer_invalidate_location(struct wined3d_buffer *buffer, DWORD location)
Definition: buffer.c:130
#define WINED3D_LOCATION_DISCARDED

Referenced by buffer_conversion_upload(), buffer_unload(), context_load_unordered_access_resources(), create_buffer_texture(), wined3d_buffer_load(), wined3d_buffer_load_location(), wined3d_buffer_load_sysmem(), wined3d_buffer_map(), wined3d_cs_exec_update_sub_resource(), wined3d_rendertarget_view_load_location(), and wined3d_unordered_access_view_clear_uint().

◆ wined3d_buffer_load_sysmem()

BYTE * wined3d_buffer_load_sysmem ( struct wined3d_buffer buffer,
struct wined3d_context context 
)

◆ wined3d_buffer_upload_data()

void wined3d_buffer_upload_data ( struct wined3d_buffer buffer,
struct wined3d_context context,
const struct wined3d_box box,
const void data 
)

Definition at line 1219 of file buffer.c.

1221{
1222 struct wined3d_map_range range;
1223
1224 if (box)
1225 {
1226 range.offset = box->left;
1227 range.size = box->right - box->left;
1228 }
1229 else
1230 {
1231 range.offset = 0;
1232 range.size = buffer->resource.size;
1233 }
1234
1236}
GLenum GLint * range
Definition: glext.h:7539

Referenced by wined3d_cs_exec_update_sub_resource().

◆ wined3d_caps_gl_ctx_test_viewport_subpixel_bits()

BOOL wined3d_caps_gl_ctx_test_viewport_subpixel_bits ( struct wined3d_caps_gl_ctx ctx)

Definition at line 3632 of file utils.c.

3633{
3634 static const struct wined3d_color red = {1.0f, 0.0f, 0.0f, 1.0f};
3635 const struct wined3d_gl_info *gl_info = ctx->gl_info;
3636 static const float offset = -63.0f / 128.0f;
3637 GLuint texture, fbo;
3638 DWORD readback[4];
3639 unsigned int i;
3640
3641 gl_info->gl_ops.gl.p_glGenTextures(1, &texture);
3642 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, texture);
3643 gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
3644 gl_info->gl_ops.gl.p_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, ARRAY_SIZE(readback), 1, 0,
3646 gl_info->fbo_ops.glGenFramebuffers(1, &fbo);
3647 gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
3648 gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
3650 checkGLcall("create resources");
3651
3652 gl_info->gl_ops.gl.p_glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
3653 gl_info->gl_ops.gl.p_glClear(GL_COLOR_BUFFER_BIT);
3654 GL_EXTCALL(glViewportIndexedf(0, offset, offset, 4.0f, 1.0f));
3656 checkGLcall("draw");
3657
3658 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, texture);
3659 gl_info->gl_ops.gl.p_glGetTexImage(GL_TEXTURE_2D, 0,
3661 checkGLcall("readback");
3662
3663 TRACE("Readback colors are 0x%08x, 0x%08x, 0x%08x, 0x%08x.\n",
3664 readback[0], readback[1], readback[2], readback[3]);
3665
3666 gl_info->gl_ops.gl.p_glDeleteTextures(1, &texture);
3667 gl_info->fbo_ops.glDeleteFramebuffers(1, &fbo);
3668 gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, 0);
3669 checkGLcall("delete resources");
3670
3671 for (i = 0; i < ARRAY_SIZE(readback); ++i)
3672 {
3673 if (readback[i] != 0xffff0000)
3674 return FALSE;
3675 }
3676 return TRUE;
3677}
static void draw_test_quad(struct wined3d_caps_gl_ctx *ctx, const struct wined3d_vec3 *geometry, const struct wined3d_color *color)
Definition: utils.c:2104
#define GL_RGBA8
Definition: gl.h:762
#define GL_BGRA
Definition: gl.h:1485
#define GL_UNSIGNED_INT_8_8_8_8_REV
Definition: gl.h:1495
#define red
Definition: linetest.c:67

Referenced by match_broken_viewport_subpixel_bits().

◆ wined3d_check_gl_call()

void wined3d_check_gl_call ( const struct wined3d_gl_info gl_info,
const char file,
unsigned int  line,
const char name 
)

Definition at line 1807 of file context.c.

1809{
1810 GLint err;
1811
1812 if (gl_info->supported[ARB_DEBUG_OUTPUT] || (err = gl_info->gl_ops.gl.p_glGetError()) == GL_NO_ERROR)
1813 {
1814 TRACE("%s call ok %s / %u.\n", name, file, line);
1815 return;
1816 }
1817
1818 do
1819 {
1820 ERR(">>>>>>> %s (%#x) from %s @ %s / %u.\n",
1822 err = gl_info->gl_ops.gl.p_glGetError();
1823 } while (err != GL_NO_ERROR);
1824}
const char * debug_glerror(GLenum error)
Definition: utils.c:4796
Definition: fci.c:127

◆ wined3d_clip_blit()

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

Definition at line 6458 of file utils.c.

6459{
6460 RECT orig = *clipped;
6461 float scale_x = (float)(orig.right - orig.left) / (float)(other->right - other->left);
6462 float scale_y = (float)(orig.bottom - orig.top) / (float)(other->bottom - other->top);
6463
6464 IntersectRect(clipped, clipped, clip_rect);
6465
6466 if (IsRectEmpty(clipped))
6467 {
6469 return FALSE;
6470 }
6471
6472 other->left += (LONG)((clipped->left - orig.left) / scale_x);
6473 other->top += (LONG)((clipped->top - orig.top) / scale_y);
6474 other->right -= (LONG)((orig.right - clipped->right) / scale_x);
6475 other->bottom -= (LONG)((orig.bottom - clipped->bottom) / scale_y);
6476
6477 return TRUE;
6478}
static BOOL clipped
Definition: input.c:1258
int other
Definition: msacm.c:1376
long LONG
Definition: pedump.c:60
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)

Referenced by swapchain_gl_present().

◆ wined3d_color_from_d3dcolor()

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

◆ wined3d_const_bo_address()

Definition at line 1485 of file wined3d_private.h.

1486{
1487 return (struct wined3d_const_bo_address *)data;
1488}

◆ wined3d_cpu_blitter_create()

struct wined3d_blitter * wined3d_cpu_blitter_create ( void  )

Definition at line 3983 of file surface.c.

3984{
3985 struct wined3d_blitter *blitter;
3986
3987 if (!(blitter = heap_alloc(sizeof(*blitter))))
3988 return NULL;
3989
3990 TRACE("Created blitter %p.\n", blitter);
3991
3992 blitter->ops = &cpu_blitter_ops;
3993 blitter->next = NULL;
3994
3995 return blitter;
3996}
static const struct wined3d_blitter_ops cpu_blitter_ops
Definition: surface.c:3976
struct wined3d_blitter * next
const struct wined3d_blitter_ops * ops

Referenced by wined3d_device_create_primary_opengl_context_cs(), and wined3d_device_init_gdi().

◆ wined3d_cs_create()

struct wined3d_cs * wined3d_cs_create ( struct wined3d_device device)

Definition at line 2828 of file cs.c.

2829{
2830 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
2831 struct wined3d_cs *cs;
2832
2833 if (!(cs = heap_alloc_zero(sizeof(*cs))))
2834 return NULL;
2835
2836 cs->ops = &wined3d_cs_st_ops;
2837 cs->device = device;
2838
2839 state_init(&cs->state, &cs->fb, gl_info, &device->adapter->d3d_info,
2841
2842 cs->data_size = WINED3D_INITIAL_CS_SIZE;
2843 if (!(cs->data = heap_alloc(cs->data_size)))
2844 goto fail;
2845
2848 {
2849 cs->ops = &wined3d_cs_mt_ops;
2850
2851 if (!(cs->event = CreateEventW(NULL, FALSE, FALSE, NULL)))
2852 {
2853 ERR("Failed to create command stream event.\n");
2854 heap_free(cs->data);
2855 goto fail;
2856 }
2857
2858 if (!(GetModuleHandleExW(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
2859 (const WCHAR *)wined3d_cs_run, &cs->wined3d_module)))
2860 {
2861 ERR("Failed to get wined3d module handle.\n");
2862 CloseHandle(cs->event);
2863 heap_free(cs->data);
2864 goto fail;
2865 }
2866
2867 if (!(cs->thread = CreateThread(NULL, 0, wined3d_cs_run, cs, 0, NULL)))
2868 {
2869 ERR("Failed to create wined3d command stream thread.\n");
2870 FreeLibrary(cs->wined3d_module);
2871 CloseHandle(cs->event);
2872 heap_free(cs->data);
2873 goto fail;
2874 }
2875 }
2876
2877 return cs;
2878
2879fail:
2880 state_cleanup(&cs->state);
2881 heap_free(cs);
2882 return NULL;
2883}
static DWORD WINAPI wined3d_cs_run(void *ctx)
Definition: cs.c:2761
static const struct wined3d_cs_ops wined3d_cs_st_ops
Definition: cs.c:2569
#define WINED3D_INITIAL_CS_SIZE
Definition: cs.c:25
static const struct wined3d_cs_ops wined3d_cs_mt_ops
Definition: cs.c:2716
#define CloseHandle
Definition: compat.h:739
#define FreeLibrary(x)
Definition: compat.h:748
PPEB Peb
Definition: dllmain.c:27
BOOL WINAPI GetModuleHandleExW(IN DWORD dwFlags, IN LPCWSTR lpwModuleName OPTIONAL, OUT HMODULE *phModule)
Definition: loader.c:866
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 cs
Definition: i386-dis.c:442
#define NtCurrentTeb
NTSYSAPI ULONG NTAPI RtlIsCriticalSectionLockedByThread(_In_ PRTL_CRITICAL_SECTION CriticalSection)
PVOID LoaderLock
Definition: ntddk_ex.h:295
struct wined3d_device * device
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:651
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by device_init().

◆ wined3d_cs_destroy()

void wined3d_cs_destroy ( struct wined3d_cs cs)

Definition at line 2885 of file cs.c.

2886{
2887 if (cs->thread)
2888 {
2890 CloseHandle(cs->thread);
2891 if (!CloseHandle(cs->event))
2892 ERR("Closing event failed.\n");
2893 }
2894
2895 state_cleanup(&cs->state);
2896 heap_free(cs->data);
2897 heap_free(cs);
2898}
static void wined3d_cs_emit_stop(struct wined3d_cs *cs)
Definition: cs.c:2449

Referenced by wined3d_device_decref().

◆ 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 2353 of file cs.c.

2355{
2357
2358 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
2360 op->texture = texture;
2361 op->layer = layer;
2362
2364
2365 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
2366}
@ WINED3D_CS_OP_ADD_DIRTY_TEXTURE_REGION
Definition: cs.c:72
GLenum GLuint GLint GLint layer
Definition: glext.h:7007

Referenced by wined3d_texture_add_dirty_region().

◆ wined3d_cs_emit_blt_sub_resource()

void wined3d_cs_emit_blt_sub_resource ( struct wined3d_cs cs,
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,
DWORD  flags,
const struct wined3d_blt_fx fx,
enum wined3d_texture_filter_type  filter 
)

Definition at line 2172 of file cs.c.

2176{
2178
2179 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
2181 op->dst_resource = dst_resource;
2182 op->dst_sub_resource_idx = dst_sub_resource_idx;
2183 op->dst_box = *dst_box;
2184 op->src_resource = src_resource;
2185 op->src_sub_resource_idx = src_sub_resource_idx;
2186 op->src_box = *src_box;
2187 op->flags = flags;
2188 if (fx)
2189 op->fx = *fx;
2190 else
2191 memset(&op->fx, 0, sizeof(op->fx));
2192 op->filter = filter;
2193
2195 if (src_resource)
2197
2198 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
2200 cs->ops->finish(cs, WINED3D_CS_QUEUE_DEFAULT);
2201}
@ WINED3D_CS_OP_BLT_SUB_RESOURCE
Definition: cs.c:70
struct wined3d_resource * dst_resource
Definition: cs.c:391
struct wined3d_box src_box
Definition: cs.c:396
struct wined3d_resource * src_resource
Definition: cs.c:394
unsigned int src_sub_resource_idx
Definition: cs.c:395
struct wined3d_box dst_box
Definition: cs.c:393
unsigned int dst_sub_resource_idx
Definition: cs.c:392
GLfixed fx
Definition: tritemp.h:484
#define WINED3D_BLT_SYNCHRONOUS
Definition: wined3d.h:1367

Referenced by wined3d_device_copy_resource(), wined3d_device_copy_sub_resource_region(), wined3d_device_update_texture(), and wined3d_texture_blt().

◆ wined3d_cs_emit_clear()

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

Definition at line 536 of file cs.c.

538{
539 unsigned int rt_count = cs->device->adapter->gl_info.limits.buffers;
540 const struct wined3d_state *state = &cs->device->state;
541 const struct wined3d_viewport *vp = &state->viewport;
542 struct wined3d_cs_clear *op;
543 unsigned int i;
544
545 op = cs->ops->require_space(cs, FIELD_OFFSET(struct wined3d_cs_clear, rects[rect_count]),
547 op->opcode = WINED3D_CS_OP_CLEAR;
548 op->flags = flags;
549 op->rt_count = rt_count;
550 op->fb = &cs->fb;
551 SetRect(&op->draw_rect, vp->x, vp->y, vp->x + vp->width, vp->y + vp->height);
552 if (state->render_states[WINED3D_RS_SCISSORTESTENABLE])
553 IntersectRect(&op->draw_rect, &op->draw_rect, &state->scissor_rect);
554 op->color = *color;
555 op->depth = depth;
556 op->stencil = stencil;
557 op->rect_count = rect_count;
558 memcpy(op->rects, rects, sizeof(*rects) * rect_count);
559
561 {
562 for (i = 0; i < rt_count; ++i)
563 {
564 if (state->fb->render_targets[i])
565 wined3d_resource_acquire(state->fb->render_targets[i]->resource);
566 }
567 }
569 wined3d_resource_acquire(state->fb->depth_stencil->resource);
570
571 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
572}
@ WINED3D_CS_OP_CLEAR
Definition: cs.c:31
unsigned int rt_count
Definition: cs.c:105
RECT rects[1]
Definition: cs.c:112
unsigned int rect_count
Definition: cs.c:111
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by wined3d_device_clear().

◆ wined3d_cs_emit_clear_rendertarget_view()

void wined3d_cs_emit_clear_rendertarget_view ( struct wined3d_cs cs,
struct wined3d_rendertarget_view view,
const RECT rect,
DWORD  flags,
const struct wined3d_color color,
float  depth,
DWORD  stencil 
)

Definition at line 574 of file cs.c.

576{
577 struct wined3d_cs_clear *op;
578 size_t size;
579
580 size = FIELD_OFFSET(struct wined3d_cs_clear, rects[1]) + sizeof(struct wined3d_fb_state);
581 op = cs->ops->require_space(cs, size, WINED3D_CS_QUEUE_DEFAULT);
582 op->fb = (void *)&op->rects[1];
583
584 op->opcode = WINED3D_CS_OP_CLEAR;
585 op->flags = flags;
587 {
588 op->rt_count = 1;
589 op->fb->render_targets[0] = view;
590 op->fb->depth_stencil = NULL;
591 op->color = *color;
592 }
593 else
594 {
595 op->rt_count = 0;
596 op->fb->render_targets[0] = NULL;
597 op->fb->depth_stencil = view;
598 op->depth = depth;
599 op->stencil = stencil;
600 }
601 SetRect(&op->draw_rect, 0, 0, view->width, view->height);
602 op->rect_count = 1;
603 op->rects[0] = *rect;
604
606
607 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
608}
size_t size
Definition: cs.c:1781

Referenced by wined3d_device_clear_rendertarget_view().

◆ wined3d_cs_emit_clear_unordered_access_view_uint()

void wined3d_cs_emit_clear_unordered_access_view_uint ( struct wined3d_cs cs,
struct wined3d_unordered_access_view view,
const struct wined3d_uvec4 clear_value 
)

Definition at line 2381 of file cs.c.

2383{
2385
2386 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
2388 op->view = view;
2389 op->clear_value = *clear_value;
2390
2391 wined3d_resource_acquire(view->resource);
2392
2393 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
2394}
@ WINED3D_CS_OP_CLEAR_UNORDERED_ACCESS_VIEW
Definition: cs.c:73
struct wined3d_unordered_access_view * view
Definition: cs.c:424
struct wined3d_uvec4 clear_value
Definition: cs.c:425

Referenced by wined3d_device_clear_unordered_access_view_uint().

◆ wined3d_cs_emit_copy_uav_counter()

void wined3d_cs_emit_copy_uav_counter ( struct wined3d_cs cs,
struct wined3d_buffer dst_buffer,
unsigned int  offset,
struct wined3d_unordered_access_view uav 
)

Definition at line 2410 of file cs.c.

2412{
2414
2415 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
2417 op->buffer = dst_buffer;
2418 op->offset = offset;
2419 op->view = uav;
2420
2421 wined3d_resource_acquire(&dst_buffer->resource);
2423
2424 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
2425}
@ WINED3D_CS_OP_COPY_UAV_COUNTER
Definition: cs.c:74
size_t offset
Definition: cs.c:1780
struct wined3d_resource * resource

Referenced by wined3d_device_copy_uav_counter().

◆ wined3d_cs_emit_dispatch()

void wined3d_cs_emit_dispatch ( struct wined3d_cs cs,
unsigned int  group_count_x,
unsigned int  group_count_y,
unsigned int  group_count_z 
)

Definition at line 738 of file cs.c.

740{
741 const struct wined3d_state *state = &cs->device->state;
742 struct wined3d_cs_dispatch *op;
743
744 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
745 op->opcode = WINED3D_CS_OP_DISPATCH;
746 op->parameters.indirect = FALSE;
747 op->parameters.u.direct.group_count_x = group_count_x;
748 op->parameters.u.direct.group_count_y = group_count_y;
749 op->parameters.u.direct.group_count_z = group_count_z;
750
752
753 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
754}
@ WINED3D_CS_OP_DISPATCH
Definition: cs.c:32
static void acquire_compute_pipeline_resources(const struct wined3d_state *state)
Definition: cs.c:731

Referenced by wined3d_device_dispatch_compute().

◆ wined3d_cs_emit_dispatch_indirect()

void wined3d_cs_emit_dispatch_indirect ( struct wined3d_cs cs,
struct wined3d_buffer buffer,
unsigned int  offset 
)

Definition at line 756 of file cs.c.

758{
759 const struct wined3d_state *state = &cs->device->state;
760 struct wined3d_cs_dispatch *op;
761
762 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
763 op->opcode = WINED3D_CS_OP_DISPATCH;
764 op->parameters.indirect = TRUE;
765 op->parameters.u.indirect.buffer = buffer;
766 op->parameters.u.indirect.offset = offset;
767
770
771 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
772}

Referenced by wined3d_device_dispatch_compute_indirect().

◆ wined3d_cs_emit_draw()

void wined3d_cs_emit_draw ( struct wined3d_cs cs,
GLenum  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 873 of file cs.c.

876{
877 const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info;
878 const struct wined3d_state *state = &cs->device->state;
879 struct wined3d_cs_draw *op;
880
881 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
882 op->opcode = WINED3D_CS_OP_DRAW;
883 op->primitive_type = primitive_type;
884 op->patch_vertex_count = patch_vertex_count;
885 op->parameters.indirect = FALSE;
886 op->parameters.u.direct.base_vertex_idx = base_vertex_idx;
887 op->parameters.u.direct.start_idx = start_idx;
888 op->parameters.u.direct.index_count = index_count;
889 op->parameters.u.direct.start_instance = start_instance;
890 op->parameters.u.direct.instance_count = instance_count;
891 op->parameters.indexed = indexed;
892
894
895 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
896}
@ WINED3D_CS_OP_DRAW
Definition: cs.c:33
static void acquire_graphics_pipeline_resources(const struct wined3d_state *state, BOOL indexed, const struct wined3d_gl_info *gl_info)
Definition: cs.c:839
GLint patch_vertex_count
Definition: cs.c:125
GLenum primitive_type
Definition: cs.c:124

Referenced by wined3d_device_draw_indexed_primitive(), wined3d_device_draw_indexed_primitive_instanced(), wined3d_device_draw_primitive(), and wined3d_device_draw_primitive_instanced().

◆ wined3d_cs_emit_draw_indirect()

void wined3d_cs_emit_draw_indirect ( struct wined3d_cs cs,
GLenum  primitive_type,
unsigned int  patch_vertex_count,
struct wined3d_buffer buffer,
unsigned int  offset,
BOOL  indexed 
)

Definition at line 898 of file cs.c.

900{
901 const struct wined3d_gl_info *gl_info = &cs->device->adapter->gl_info;
902 const struct wined3d_state *state = &cs->device->state;
903 struct wined3d_cs_draw *op;
904
905 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
906 op->opcode = WINED3D_CS_OP_DRAW;
907 op->primitive_type = primitive_type;
908 op->patch_vertex_count = patch_vertex_count;
909 op->parameters.indirect = TRUE;
910 op->parameters.u.indirect.buffer = buffer;
911 op->parameters.u.indirect.offset = offset;
912 op->parameters.indexed = indexed;
913
916
917 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
918}

Referenced by wined3d_device_draw_indexed_primitive_instanced_indirect(), and wined3d_device_draw_primitive_instanced_indirect().

◆ wined3d_cs_emit_flush()

void wined3d_cs_emit_flush ( struct wined3d_cs cs)

Definition at line 930 of file cs.c.

931{
932 struct wined3d_cs_flush *op;
933
934 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
935 op->opcode = WINED3D_CS_OP_FLUSH;
936
937 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
938 cs->queries_flushed = TRUE;
939}
@ WINED3D_CS_OP_FLUSH
Definition: cs.c:34

Referenced by wined3d_device_end_scene(), and wined3d_query_get_data().

◆ wined3d_cs_emit_generate_mipmaps()

void wined3d_cs_emit_generate_mipmaps ( struct wined3d_cs cs,
struct wined3d_shader_resource_view view 
)

Definition at line 2436 of file cs.c.

2437{
2439
2440 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
2442 op->view = view;
2443
2444 wined3d_resource_acquire(view->resource);
2445
2446 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
2447}
@ WINED3D_CS_OP_GENERATE_MIPMAPS
Definition: cs.c:75
struct wined3d_shader_resource_view * view
Definition: cs.c:439

Referenced by wined3d_shader_resource_view_generate_mipmaps().

◆ wined3d_cs_emit_preload_resource()

void wined3d_cs_emit_preload_resource ( struct wined3d_cs cs,
struct wined3d_resource resource 
)

Definition at line 1956 of file cs.c.

1957{
1959
1960 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1962 op->resource = resource;
1963
1965
1966 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1967}
@ WINED3D_CS_OP_PRELOAD_RESOURCE
Definition: cs.c:66
#define resource
Definition: kernel32.h:9

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,
DWORD  swap_interval,
DWORD  flags 
)

Definition at line 477 of file cs.c.

480{
481 struct wined3d_cs_present *op;
482 unsigned int i;
483 LONG pending;
484
485 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
486 op->opcode = WINED3D_CS_OP_PRESENT;
487 op->dst_window_override = dst_window_override;
488 op->swapchain = swapchain;
489 op->src_rect = *src_rect;
490 op->dst_rect = *dst_rect;
491 op->swap_interval = swap_interval;
492 op->flags = flags;
493
494 pending = InterlockedIncrement(&cs->pending_presents);
495
496 wined3d_resource_acquire(&swapchain->front_buffer->resource);
497 for (i = 0; i < swapchain->desc.backbuffer_count; ++i)
498 {
499 wined3d_resource_acquire(&swapchain->back_buffers[i]->resource);
500 }
501
502 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
503
504 /* Limit input latency by limiting the number of presents that we can get
505 * ahead of the worker thread. We have a constant limit here, but
506 * IDXGIDevice1 allows tuning this. */
507 while (pending > 1)
508 {
510 pending = InterlockedCompareExchange(&cs->pending_presents, 0, 0);
511 }
512}
#define InterlockedIncrement
Definition: armddk.h:53
@ WINED3D_CS_OP_PRESENT
Definition: cs.c:30
#define InterlockedCompareExchange
Definition: interlocked.h:104
HWND dst_window_override
Definition: cs.c:93
DWORD swap_interval
Definition: cs.c:97
RECT src_rect
Definition: cs.c:95
struct wined3d_swapchain * swapchain
Definition: cs.c:94
RECT dst_rect
Definition: cs.c:96
static void wined3d_pause(void)

Referenced by wined3d_swapchain_present().

◆ wined3d_cs_emit_query_issue()

void wined3d_cs_emit_query_issue ( struct wined3d_cs cs,
struct wined3d_query query,
DWORD  flags 
)

Definition at line 1934 of file cs.c.

1935{
1936 struct wined3d_cs_query_issue *op;
1937
1938 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1939 op->opcode = WINED3D_CS_OP_QUERY_ISSUE;
1940 op->query = query;
1941 op->flags = flags;
1942
1943 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1944 cs->queries_flushed = FALSE;
1945}
@ WINED3D_CS_OP_QUERY_ISSUE
Definition: cs.c:65
struct wined3d_query * query
Definition: cs.c:353

Referenced by wined3d_query_issue().

◆ wined3d_cs_emit_reset_state()

void wined3d_cs_emit_reset_state ( struct wined3d_cs cs)

Definition at line 1856 of file cs.c.

1857{
1858 struct wined3d_cs_reset_state *op;
1859
1860 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1861 op->opcode = WINED3D_CS_OP_RESET_STATE;
1862
1863 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1864}
@ WINED3D_CS_OP_RESET_STATE
Definition: cs.c:63

Referenced by wined3d_device_reset().

◆ wined3d_cs_emit_set_blend_state()

void wined3d_cs_emit_set_blend_state ( struct wined3d_cs cs,
struct wined3d_blend_state state 
)

Definition at line 1457 of file cs.c.

1458{
1460
1461 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1463 op->state = state;
1464
1465 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1466}
@ WINED3D_CS_OP_SET_BLEND_STATE
Definition: cs.c:51

Referenced by wined3d_device_set_blend_state().

◆ wined3d_cs_emit_set_clip_plane()

void wined3d_cs_emit_set_clip_plane ( struct wined3d_cs cs,
UINT  plane_idx,
const struct wined3d_vec4 plane 
)

Definition at line 1582 of file cs.c.

1583{
1585
1586 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1588 op->plane_idx = plane_idx;
1589 op->plane = *plane;
1590
1591 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1592}
@ WINED3D_CS_OP_SET_CLIP_PLANE
Definition: cs.c:57

Referenced by wined3d_device_set_clip_plane().

◆ 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 1657 of file cs.c.

1659{
1661
1662 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1664 op->texture = texture;
1665 op->flags = flags;
1666 if (color_key)
1667 {
1668 op->color_key = *color_key;
1669 op->set = 1;
1670 }
1671 else
1672 op->set = 0;
1673
1674 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1675}
@ WINED3D_CS_OP_SET_COLOR_KEY
Definition: cs.c:58
struct wined3d_color_key color_key
Definition: cs.c:226

Referenced by wined3d_texture_set_color_key().

◆ wined3d_cs_emit_set_constant_buffer()

void wined3d_cs_emit_set_constant_buffer ( struct wined3d_cs cs,
enum wined3d_shader_type  type,
UINT  cb_idx,
struct wined3d_buffer buffer 
)

Definition at line 1228 of file cs.c.

1230{
1232
1233 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1235 op->type = type;
1236 op->cb_idx = cb_idx;
1237 op->buffer = buffer;
1238
1239 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1240}
@ WINED3D_CS_OP_SET_CONSTANT_BUFFER
Definition: cs.c:45

Referenced by wined3d_device_set_constant_buffer().

◆ wined3d_cs_emit_set_depth_stencil_view()

void wined3d_cs_emit_set_depth_stencil_view ( struct wined3d_cs cs,
struct wined3d_rendertarget_view view 
)

Definition at line 1057 of file cs.c.

1058{
1060
1061 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1063 op->view = view;
1064
1065 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1066}
@ WINED3D_CS_OP_SET_DEPTH_STENCIL_VIEW
Definition: cs.c:39
struct wined3d_rendertarget_view * view
Definition: cs.c:163

Referenced by wined3d_device_set_depth_stencil_view().

◆ wined3d_cs_emit_set_index_buffer()

void wined3d_cs_emit_set_index_buffer ( struct wined3d_cs cs,
struct wined3d_buffer buffer,
enum wined3d_format_id  format_id,
unsigned int  offset 
)

Definition at line 1198 of file cs.c.

1200{
1202
1203 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1205 op->buffer = buffer;
1206 op->format_id = format_id;
1207 op->offset = offset;
1208
1209 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1210}
@ WINED3D_CS_OP_SET_INDEX_BUFFER
Definition: cs.c:44

Referenced by wined3d_device_set_index_buffer().

◆ wined3d_cs_emit_set_light()

void wined3d_cs_emit_set_light ( struct wined3d_cs cs,
const struct wined3d_light_info light 
)

Definition at line 1733 of file cs.c.

1734{
1735 struct wined3d_cs_set_light *op;
1736
1737 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1738 op->opcode = WINED3D_CS_OP_SET_LIGHT;
1739 op->light = *light;
1740
1741 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1742}
@ WINED3D_CS_OP_SET_LIGHT
Definition: cs.c:60

Referenced by wined3d_device_set_light().

◆ wined3d_cs_emit_set_light_enable()

void wined3d_cs_emit_set_light_enable ( struct wined3d_cs cs,
unsigned int  idx,
BOOL  enable 
)

Definition at line 1766 of file cs.c.

1767{
1769
1770 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1772 op->idx = idx;
1773 op->enable = enable;
1774
1775 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1776}
@ WINED3D_CS_OP_SET_LIGHT_ENABLE
Definition: cs.c:61
GLboolean enable
Definition: glext.h:11120

Referenced by wined3d_device_set_light_enable().

◆ wined3d_cs_emit_set_material()

void wined3d_cs_emit_set_material ( struct wined3d_cs cs,
const struct wined3d_material material 
)

Definition at line 1685 of file cs.c.

1686{
1688
1689 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1691 op->material = *material;
1692
1693 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1694}
@ WINED3D_CS_OP_SET_MATERIAL
Definition: cs.c:59
struct wined3d_material material
Definition: cs.c:313

Referenced by wined3d_device_set_material().

◆ wined3d_cs_emit_set_predication()

void wined3d_cs_emit_set_predication ( struct wined3d_cs cs,
struct wined3d_query predicate,
BOOL  value 
)

Definition at line 949 of file cs.c.

950{
952
953 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
955 op->predicate = predicate;
956 op->value = value;
957
958 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
959}
@ WINED3D_CS_OP_SET_PREDICATION
Definition: cs.c:35
struct wined3d_query * predicate
Definition: cs.c:137

Referenced by wined3d_device_set_predication().

◆ wined3d_cs_emit_set_rasterizer_state()

void wined3d_cs_emit_set_rasterizer_state ( struct wined3d_cs cs,
struct wined3d_rasterizer_state rasterizer_state 
)

Definition at line 1476 of file cs.c.

1478{
1480
1481 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1483 op->state = rasterizer_state;
1484
1485 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1486}
@ WINED3D_CS_OP_SET_RASTERIZER_STATE
Definition: cs.c:52

Referenced by wined3d_device_set_rasterizer_state().

◆ wined3d_cs_emit_set_render_state()

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

Definition at line 1496 of file cs.c.

1497{
1499
1500 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1502 op->state = state;
1503 op->value = value;
1504
1505 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1506}
@ WINED3D_CS_OP_SET_RENDER_STATE
Definition: cs.c:53

Referenced by wined3d_device_set_render_state().

◆ wined3d_cs_emit_set_rendertarget_view()

void wined3d_cs_emit_set_rendertarget_view ( struct wined3d_cs cs,
unsigned int  view_idx,
struct wined3d_rendertarget_view view 
)

Definition at line 1007 of file cs.c.

1009{
1011
1012 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1014 op->view_idx = view_idx;
1015 op->view = view;
1016
1017 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1018}
@ WINED3D_CS_OP_SET_RENDERTARGET_VIEW
Definition: cs.c:38
struct wined3d_rendertarget_view * view
Definition: cs.c:157

Referenced by wined3d_device_set_rendertarget_view().

◆ wined3d_cs_emit_set_sampler()

void wined3d_cs_emit_set_sampler ( struct wined3d_cs cs,
enum wined3d_shader_type  type,
UINT  sampler_idx,
struct wined3d_sampler sampler 
)

Definition at line 1411 of file cs.c.

1413{
1414 struct wined3d_cs_set_sampler *op;
1415
1416 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1417 op->opcode = WINED3D_CS_OP_SET_SAMPLER;
1418 op->type = type;
1419 op->sampler_idx = sampler_idx;
1420 op->sampler = sampler;
1421
1422 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1423}
@ WINED3D_CS_OP_SET_SAMPLER
Definition: cs.c:49

Referenced by wined3d_device_set_sampler().

◆ wined3d_cs_emit_set_sampler_state()

void wined3d_cs_emit_set_sampler_state ( struct wined3d_cs cs,
UINT  sampler_idx,
enum wined3d_sampler_state  state,
DWORD  value 
)

Definition at line 1538 of file cs.c.

1540{
1542
1543 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1545 op->sampler_idx = sampler_idx;
1546 op->state = state;
1547 op->value = value;
1548
1549 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1550}
@ WINED3D_CS_OP_SET_SAMPLER_STATE
Definition: cs.c:55

Referenced by wined3d_device_set_sampler_state(), and wined3d_texture_set_lod().

◆ wined3d_cs_emit_set_scissor_rect()

void wined3d_cs_emit_set_scissor_rect ( struct wined3d_cs cs,
const RECT rect 
)

Definition at line 988 of file cs.c.

989{
991
992 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
994 op->rect = *rect;
995
996 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
997}
@ WINED3D_CS_OP_SET_SCISSOR_RECT
Definition: cs.c:37

Referenced by wined3d_device_reset(), wined3d_device_set_rendertarget_view(), and wined3d_device_set_scissor_rect().

◆ wined3d_cs_emit_set_shader()

void wined3d_cs_emit_set_shader ( struct wined3d_cs cs,
enum wined3d_shader_type  type,
struct wined3d_shader shader 
)

Definition at line 1437 of file cs.c.

1438{
1439 struct wined3d_cs_set_shader *op;
1440
1441 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1442 op->opcode = WINED3D_CS_OP_SET_SHADER;
1443 op->type = type;
1444 op->shader = shader;
1445
1446 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1447}
@ WINED3D_CS_OP_SET_SHADER
Definition: cs.c:50

Referenced by wined3d_device_set_compute_shader(), wined3d_device_set_domain_shader(), wined3d_device_set_geometry_shader(), wined3d_device_set_hull_shader(), wined3d_device_set_pixel_shader(), and wined3d_device_set_vertex_shader().

◆ wined3d_cs_emit_set_shader_resource_view()

void wined3d_cs_emit_set_shader_resource_view ( struct wined3d_cs cs,
enum wined3d_shader_type  type,
UINT  view_idx,
struct wined3d_shader_resource_view view 
)

Definition at line 1352 of file cs.c.

1354{
1356
1357 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1359 op->type = type;
1360 op->view_idx = view_idx;
1361 op->view = view;
1362
1363 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1364}
@ WINED3D_CS_OP_SET_SHADER_RESOURCE_VIEW
Definition: cs.c:47
struct wined3d_shader_resource_view * view
Definition: cs.c:234

Referenced by wined3d_device_set_shader_resource_view().

◆ wined3d_cs_emit_set_stream_output()

void wined3d_cs_emit_set_stream_output ( struct wined3d_cs cs,
UINT  stream_idx,
struct wined3d_buffer buffer,
UINT  offset 
)

Definition at line 1166 of file cs.c.

1168{
1170
1171 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1173 op->stream_idx = stream_idx;
1174 op->buffer = buffer;
1175 op->offset = offset;
1176
1177 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1178}
@ WINED3D_CS_OP_SET_STREAM_OUTPUT
Definition: cs.c:43

Referenced by wined3d_device_set_stream_output().

◆ wined3d_cs_emit_set_stream_source()

void wined3d_cs_emit_set_stream_source ( struct wined3d_cs cs,
UINT  stream_idx,
struct wined3d_buffer buffer,
UINT  offset,
UINT  stride 
)

Definition at line 1107 of file cs.c.

1109{
1111
1112 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1114 op->stream_idx = stream_idx;
1115 op->buffer = buffer;
1116 op->offset = offset;
1117 op->stride = stride;
1118
1119 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1120}
@ WINED3D_CS_OP_SET_STREAM_SOURCE
Definition: cs.c:41
GLsizei stride
Definition: glext.h:5848

Referenced by wined3d_device_set_stream_source().

◆ wined3d_cs_emit_set_stream_source_freq()

void wined3d_cs_emit_set_stream_source_freq ( struct wined3d_cs cs,
UINT  stream_idx,
UINT  frequency,
UINT  flags 
)

Definition at line 1134 of file cs.c.

1135{
1137
1138 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1140 op->stream_idx = stream_idx;
1141 op->frequency = frequency;
1142 op->flags = flags;
1143
1144 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1145}
@ WINED3D_CS_OP_SET_STREAM_SOURCE_FREQ
Definition: cs.c:42
static LARGE_INTEGER * frequency
Definition: time.c:106

Referenced by wined3d_device_set_stream_source_freq().

◆ wined3d_cs_emit_set_texture()

void wined3d_cs_emit_set_texture ( struct wined3d_cs cs,
UINT  stage,
struct wined3d_texture texture 
)

Definition at line 1321 of file cs.c.

1322{
1323 struct wined3d_cs_set_texture *op;
1324
1325 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1326 op->opcode = WINED3D_CS_OP_SET_TEXTURE;
1327 op->stage = stage;
1328 op->texture = texture;
1329
1330 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1331}
@ WINED3D_CS_OP_SET_TEXTURE
Definition: cs.c:46

Referenced by wined3d_device_set_texture().

◆ wined3d_cs_emit_set_texture_state()

void wined3d_cs_emit_set_texture_state ( struct wined3d_cs cs,
UINT  stage,
enum wined3d_texture_stage_state  state,
DWORD  value 
)

Definition at line 1516 of file cs.c.

1518{
1520
1521 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1523 op->stage = stage;
1524 op->state = state;
1525 op->value = value;
1526
1527 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1528}
@ WINED3D_CS_OP_SET_TEXTURE_STATE
Definition: cs.c:54

Referenced by wined3d_device_set_texture_stage_state().

◆ wined3d_cs_emit_set_transform()

void wined3d_cs_emit_set_transform ( struct wined3d_cs cs,
enum wined3d_transform_state  state,
const struct wined3d_matrix matrix 
)

Definition at line 1561 of file cs.c.

1563{
1565
1566 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1568 op->state = state;
1569 op->matrix = *matrix;
1570
1571 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1572}
@ WINED3D_CS_OP_SET_TRANSFORM
Definition: cs.c:56
GLuint GLenum matrix
Definition: glext.h:9407

Referenced by wined3d_device_set_transform().

◆ wined3d_cs_emit_set_unordered_access_view()

void wined3d_cs_emit_set_unordered_access_view ( struct wined3d_cs cs,
enum wined3d_pipeline  pipeline,
unsigned int  view_idx,
struct wined3d_unordered_access_view view,
unsigned int  initial_count 
)

Definition at line 1385 of file cs.c.

1387{
1389
1390 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1392 op->pipeline = pipeline;
1393 op->view_idx = view_idx;
1394 op->view = view;
1395 op->initial_count = initial_count;
1396
1397 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1398}
@ WINED3D_CS_OP_SET_UNORDERED_ACCESS_VIEW
Definition: cs.c:48
enum wined3d_pipeline pipeline
Definition: cs.c:240
struct wined3d_unordered_access_view * view
Definition: cs.c:242

Referenced by wined3d_device_set_pipeline_unordered_access_view().

◆ wined3d_cs_emit_set_vertex_declaration()

void wined3d_cs_emit_set_vertex_declaration ( struct wined3d_cs cs,
struct wined3d_vertex_declaration declaration 
)

Definition at line 1076 of file cs.c.

1077{
1079
1080 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1082 op->declaration = declaration;
1083
1084 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1085}
@ WINED3D_CS_OP_SET_VERTEX_DECLARATION
Definition: cs.c:40
struct wined3d_vertex_declaration * declaration
Definition: cs.c:169

Referenced by wined3d_device_set_vertex_declaration().

◆ wined3d_cs_emit_set_viewport()

void wined3d_cs_emit_set_viewport ( struct wined3d_cs cs,
const struct wined3d_viewport viewport 
)

Definition at line 969 of file cs.c.

970{
972
973 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
975 op->viewport = *viewport;
976
977 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
978}
@ WINED3D_CS_OP_SET_VIEWPORT
Definition: cs.c:36
struct wined3d_viewport viewport
Definition: cs.c:144

Referenced by wined3d_device_reset(), wined3d_device_set_rendertarget_view(), and wined3d_device_set_viewport().

◆ wined3d_cs_emit_unload_resource()

void wined3d_cs_emit_unload_resource ( struct wined3d_cs cs,
struct wined3d_resource resource 
)

Definition at line 1978 of file cs.c.

1979{
1981
1982 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_DEFAULT);
1984 op->resource = resource;
1985
1987
1988 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
1989}
@ WINED3D_CS_OP_UNLOAD_RESOURCE
Definition: cs.c:67

Referenced by wined3d_device_delete_opengl_contexts_cs(), wined3d_device_evict_managed_resources(), and wined3d_texture_update_desc().

◆ wined3d_cs_emit_update_sub_resource()

void wined3d_cs_emit_update_sub_resource ( struct wined3d_cs cs,
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 2260 of file cs.c.

2263{
2265#if defined(STAGING_CSMT)
2266 size_t data_size, size;
2267
2268 if (resource->type != WINED3D_RTYPE_BUFFER && resource->format_flags & WINED3DFMT_FLAG_BLOCKS)
2269 goto no_async;
2270
2271 data_size = 0;
2272 switch (resource->type)
2273 {
2275 data_size += (box->back - box->front - 1) * slice_pitch;
2276 /* fall-through */
2278 data_size += (box->bottom - box->top - 1) * row_pitch;
2279 /* fall-through */
2281 data_size += (box->right - box->left) * resource->format->byte_count;
2282 break;
2284 data_size = box->right - box->left;
2285 break;
2286 case WINED3D_RTYPE_NONE:
2287 return;
2288 }
2289
2290 size = FIELD_OFFSET(struct wined3d_cs_update_sub_resource, copy_data[data_size]);
2291 if (!cs->ops->check_space(cs, size, WINED3D_CS_QUEUE_DEFAULT))
2292 goto no_async;
2293
2294 op = cs->ops->require_space(cs, size, WINED3D_CS_QUEUE_DEFAULT);
2296 op->resource = resource;
2297 op->sub_resource_idx = sub_resource_idx;
2298 op->box = *box;
2299 op->data.row_pitch = row_pitch;
2300 op->data.slice_pitch = slice_pitch;
2301 op->data.data = op->copy_data;
2302 memcpy(op->copy_data, data, data_size);
2303
2305
2306 cs->ops->submit(cs, WINED3D_CS_QUEUE_DEFAULT);
2307 return;
2308
2309no_async:
2311#endif /* STAGING_CSMT */
2312
2313 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_MAP);
2315 op->resource = resource;
2316 op->sub_resource_idx = sub_resource_idx;
2317 op->box = *box;
2318 op->data.row_pitch = row_pitch;
2319 op->data.slice_pitch = slice_pitch;
2320 op->data.data = data;
2321
2323
2324 cs->ops->submit(cs, WINED3D_CS_QUEUE_MAP);
2325#if !defined(STAGING_CSMT)
2326 /* The data pointer may go away, so we need to wait until it is read.
2327 * Copying the data may be faster if it's small. */
2328#endif /* STAGING_CSMT */
2329 cs->ops->finish(cs, WINED3D_CS_QUEUE_MAP);
2330}
@ WINED3D_CS_OP_UPDATE_SUB_RESOURCE
Definition: cs.c:71
struct wined3d_box box
Definition: cs.c:407
unsigned int sub_resource_idx
Definition: cs.c:406
static void wined3d_resource_wait_idle(struct wined3d_resource *resource)

Referenced by wined3d_device_update_sub_resource().

◆ wined3d_cs_init_object()

◆ wined3d_cs_map()

HRESULT wined3d_cs_map ( struct wined3d_cs cs,
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 2000 of file cs.c.

2002{
2003 struct wined3d_cs_map *op;
2004 HRESULT hr;
2005
2006 /* Mapping resources from the worker thread isn't an issue by itself, but
2007 * increasing the map count would be visible to applications. */
2009
2010 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_MAP);
2011 op->opcode = WINED3D_CS_OP_MAP;
2012 op->resource = resource;
2013 op->sub_resource_idx = sub_resource_idx;
2014 op->map_desc = map_desc;
2015 op->box = box;
2016 op->flags = flags;
2017 op->hr = &hr;
2018
2019 cs->ops->submit(cs, WINED3D_CS_QUEUE_MAP);
2020 cs->ops->finish(cs, WINED3D_CS_QUEUE_MAP);
2021
2022 return hr;
2023}
@ WINED3D_CS_OP_MAP
Definition: cs.c:68
unsigned int sub_resource_idx
Definition: cs.c:373
struct wined3d_map_desc * map_desc
Definition: cs.c:374
const struct wined3d_box * box
Definition: cs.c:375

◆ wined3d_cs_push_constants()

static void wined3d_cs_push_constants ( struct wined3d_cs cs,
enum wined3d_push_constants  p,
unsigned int  start_idx,
unsigned int  count,
const void constants 
)
inlinestatic

Definition at line 3677 of file wined3d_private.h.

3679{
3680 cs->ops->push_constants(cs, p, start_idx, count, constants);
3681}
GLfloat GLfloat p
Definition: glext.h:8902
constants
Definition: resource.c:29

◆ wined3d_cs_unmap()

HRESULT wined3d_cs_unmap ( struct wined3d_cs cs,
struct wined3d_resource resource,
unsigned int  sub_resource_idx 
)

Definition at line 2033 of file cs.c.

2034{
2035 struct wined3d_cs_unmap *op;
2036 HRESULT hr;
2037
2039
2040 op = cs->ops->require_space(cs, sizeof(*op), WINED3D_CS_QUEUE_MAP);
2041 op->opcode = WINED3D_CS_OP_UNMAP;
2042 op->resource = resource;
2043 op->sub_resource_idx = sub_resource_idx;
2044 op->hr = &hr;
2045
2046 cs->ops->submit(cs, WINED3D_CS_QUEUE_MAP);
2047 cs->ops->finish(cs, WINED3D_CS_QUEUE_MAP);
2048
2049 return hr;
2050}
@ WINED3D_CS_OP_UNMAP
Definition: cs.c:69
unsigned int sub_resource_idx
Definition: cs.c:384

◆ wined3d_debug_location()

const char * wined3d_debug_location ( DWORD  location)

Definition at line 6396 of file utils.c.

6397{
6398 struct debug_buffer buffer;
6399 const char *prefix = "";
6400 const char *suffix = "";
6401
6402 if (wined3d_popcount(location) > 16)
6403 {
6404 prefix = "~(";
6406 suffix = ")";
6407 }
6408
6410#define LOCATION_TO_STR(x) if (location & x) { debug_append(&buffer, #x, " | "); location &= ~x; }
6420#undef LOCATION_TO_STR
6421 if (location)
6422 FIXME("Unrecognized location flag(s) %#x.\n", location);
6423
6424 return wine_dbg_sprintf("%s%s%s", prefix, buffer.str, suffix);
6425}
#define LOCATION_TO_STR(x)
static unsigned int wined3d_popcount(unsigned int x)

Referenced by raw_blitter_blit(), surface_blt_fbo(), surface_convert_format(), surface_cpu_blt(), surface_cpu_blt_colour_fill(), surface_depth_blt_fbo(), surface_load_drawable(), surface_load_location(), surface_load_renderbuffer(), surface_load_sysmem(), texture1d_load_location(), texture3d_load_location(), texture_resource_sub_resource_map(), wined3d_buffer_get_memory(), wined3d_buffer_invalidate_range(), wined3d_buffer_load_location(), wined3d_buffer_prepare_location(), wined3d_buffer_validate_location(), wined3d_cs_exec_add_dirty_texture_region(), wined3d_cs_exec_blt_sub_resource(), wined3d_texture_get_memory(), wined3d_texture_invalidate_location(), wined3d_texture_load(), wined3d_texture_load_location(), wined3d_texture_prepare_location(), wined3d_texture_update_map_binding(), and wined3d_texture_validate_location().

◆ wined3d_debug_resource_access()

const char * wined3d_debug_resource_access ( DWORD  access)

Definition at line 4200 of file utils.c.

4201{
4202 struct debug_buffer buffer;
4203
4205#define ACCESS_TO_STR(x) if (access & x) { debug_append(&buffer, #x, " | "); access &= ~x; }
4210#undef ACCESS_TO_STR
4211 if (access)
4212 FIXME("Unrecognised access flag(s) %#x.\n", access);
4213
4214 return wine_dbg_sprintf("%s", buffer.str);
4215}
#define ACCESS_TO_STR(x)
#define WINED3D_RESOURCE_ACCESS_MAP_R
Definition: wined3d.h:57
#define WINED3D_RESOURCE_ACCESS_MAP_W
Definition: wined3d.h:58

Referenced by resource_init(), texture1d_init(), volumetexture_init(), wined3d_texture_init(), wined3d_texture_set_lod(), and wined3d_texture_unload().

◆ wined3d_dualblend_enabled()

static BOOL wined3d_dualblend_enabled ( const struct wined3d_state state,
const struct wined3d_gl_info gl_info 
)
inlinestatic

Definition at line 2874 of file wined3d_private.h.

2875{
2876 if (!state->fb->render_targets[0]) return FALSE;
2877 if (!state->render_states[WINED3D_RS_ALPHABLENDENABLE]) return FALSE;
2878 if (!gl_info->supported[ARB_BLEND_FUNC_EXTENDED]) return FALSE;
2879
2880#define IS_DUAL_SOURCE_BLEND(x) ((x) >= WINED3D_BLEND_SRC1COLOR && (x) <= WINED3D_BLEND_INVSRC1ALPHA)
2881 if (IS_DUAL_SOURCE_BLEND(state->render_states[WINED3D_RS_SRCBLEND])) return TRUE;
2882 if (IS_DUAL_SOURCE_BLEND(state->render_states[WINED3D_RS_DESTBLEND])) return TRUE;
2883 if (IS_DUAL_SOURCE_BLEND(state->render_states[WINED3D_RS_SRCBLENDALPHA])) return TRUE;
2884 if (IS_DUAL_SOURCE_BLEND(state->render_states[WINED3D_RS_DESTBLENDALPHA])) return TRUE;
2885#undef IS_DUAL_SOURCE_BLEND
2886
2887 return FALSE;
2888}
@ ARB_BLEND_FUNC_EXTENDED
Definition: wined3d_gl.h:46
#define IS_DUAL_SOURCE_BLEND(x)

Referenced by find_draw_buffers_mask(), find_ps_compile_args(), set_glsl_shader_program(), and state_blend().

◆ wined3d_dxtn_free()

void wined3d_dxtn_free ( void  )

Definition at line 515 of file dxtn.c.

516{
517 if (txc_dxtn_handle)
519}
static void * txc_dxtn_handle
Definition: dxtn.c:26
int wine_dlclose(void *handle, char *error, size_t errorsize)
Definition: loader.c:58

Referenced by wined3d_dll_destroy().

◆ wined3d_dxtn_init()

BOOL wined3d_dxtn_init ( void  )

Definition at line 461 of file dxtn.c.

462{
463 static const char *soname[] =
464 {
465#ifdef SONAME_LIBTXC_DXTN
467#endif
468#ifdef __APPLE__
469 "libtxc_dxtn.dylib",
470 "libtxc_dxtn_s2tc.dylib",
471#endif
472 "libtxc_dxtn.so",
473 "libtxc_dxtn_s2tc.so.0"
474 };
475 int i;
476
477 for (i = 0; i < sizeof(soname)/sizeof(soname[0]); i++)
478 {
479 txc_dxtn_handle = wine_dlopen(soname[i], RTLD_NOW, NULL, 0);
480 if (txc_dxtn_handle) break;
481 }
482
483 if (!txc_dxtn_handle)
484 {
485 FIXME("Wine cannot find the txc_dxtn library, DXTn software support unavailable.\n");
486 return FALSE;
487 }
488
489 #define LOAD_FUNCPTR(f) \
490 if (!(p##f = wine_dlsym(txc_dxtn_handle, #f, NULL, 0))) \
491 { \
492 ERR("Can't find symbol %s , DXTn software support unavailable.\n", #f); \
493 goto error; \
494 }
495
500
501 #undef LOAD_FUNCPTR
502 return TRUE;
503
504error:
507 return FALSE;
508}
void tx_compress_dxtn(GLint srccomps, GLint width, GLint height, const GLubyte *srcPixData, GLenum destFormat, GLubyte *dest, GLint dstRowStride)
void fetch_2d_texel_rgba_dxt3(GLint srcRowStride, const GLubyte *pixdata, GLint i, GLint j, GLvoid *texel)
void fetch_2d_texel_rgba_dxt1(GLint srcRowStride, const GLubyte *pixdata, GLint i, GLint j, GLvoid *texel)
void fetch_2d_texel_rgba_dxt5(GLint srcRowStride, const GLubyte *pixdata, GLint i, GLint j, GLvoid *texel)
#define LOAD_FUNCPTR(f)
void * wine_dlopen(const char *filename, int flag, char *error, size_t errorsize)
Definition: loader.c:53
#define RTLD_NOW
Definition: port.h:100
#define SONAME_LIBTXC_DXTN
Definition: config.h:1269

Referenced by wined3d_dll_init().

◆ wined3d_extract_bits()

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

Definition at line 4484 of file wined3d_private.h.

4486{
4487 const unsigned int word_bit_count = sizeof(*bitstream) * CHAR_BIT;
4488 const unsigned int idx = offset / word_bit_count;
4489 const unsigned int shift = offset % word_bit_count;
4490 DWORD mask = (1u << count) - 1;
4491 DWORD ret;
4492
4493 ret = (bitstream[idx] >> shift) & mask;
4494 if (shift + count > word_bit_count)
4495 {
4496 const unsigned int extracted_bit_count = word_bit_count - shift;
4497 const unsigned int remaining_bit_count = count - extracted_bit_count;
4498 mask = (1u << remaining_bit_count) - 1;
4499 ret |= (bitstream[idx + 1] & mask) << extracted_bit_count;
4500 }
4501 return ret;
4502}
GLenum GLint GLuint mask
Definition: glext.h:6028

Referenced by shader_generate_arb_declarations(), and wined3d_extract_interpolation_mode().

◆ wined3d_fbo_blitter_create()

void wined3d_fbo_blitter_create ( struct wined3d_blitter **  next,
const struct wined3d_gl_info gl_info 
)

Definition at line 2734 of file surface.c.

2735{
2736 struct wined3d_blitter *blitter;
2737
2738 if ((wined3d_settings.offscreen_rendering_mode != ORM_FBO) || !gl_info->fbo_ops.glBlitFramebuffer)
2739 return;
2740
2741 if (!(blitter = heap_alloc(sizeof(*blitter))))
2742 return;
2743
2744 TRACE("Created blitter %p.\n", blitter);
2745
2746 blitter->ops = &fbo_blitter_ops;
2747 blitter->next = *next;
2748 *next = blitter;
2749}
static const struct wined3d_blitter_ops fbo_blitter_ops
Definition: surface.c:2727

Referenced by wined3d_device_create_primary_opengl_context_cs().

◆ wined3d_fence_create()

HRESULT wined3d_fence_create ( struct wined3d_device device,
struct wined3d_fence **  fence 
)

Definition at line 303 of file query.c.

304{
305 const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
306 struct wined3d_fence *object;
307 HRESULT hr;
308
309 TRACE("device %p, fence %p.\n", device, fence);
310
311 if (!(object = heap_alloc_zero(sizeof(*object))))
312 return E_OUTOFMEMORY;
313
314 if (FAILED(hr = wined3d_fence_init(object, gl_info)))
315 {
316 heap_free(object);
317 return hr;
318 }
319
320 TRACE("Created fence %p.\n", object);
321 *fence = object;
322
323 return WINED3D_OK;
324}
static HRESULT wined3d_fence_init(struct wined3d_fence *fence, const struct wined3d_gl_info *gl_info)
Definition: query.c:292

Referenced by buffer_sync_apple().

◆ wined3d_fence_destroy()

void wined3d_fence_destroy ( struct wined3d_fence fence)

Definition at line 286 of file query.c.

287{
288 wined3d_fence_free(fence);
289 heap_free(fence);
290}
static void wined3d_fence_free(struct wined3d_fence *fence)
Definition: query.c:280

Referenced by buffer_destroy_buffer_object(), and buffer_sync_apple().

◆ wined3d_fence_issue()

void wined3d_fence_issue ( struct wined3d_fence fence,
const struct wined3d_device device 
)

Definition at line 244 of file query.c.

245{
246 struct wined3d_context *context = NULL;
247 const struct wined3d_gl_info *gl_info;
248
249 if (fence->context && !(context = context_reacquire(device, fence->context))
250 && !fence->context->gl_info->supported[ARB_SYNC])
251 context_free_fence(fence);
252 if (!context)
254 gl_info = context->gl_info;
255 if (!fence->context)
257
258 if (gl_info->supported[ARB_SYNC])
259 {
260 if (fence->object.sync)
261 GL_EXTCALL(glDeleteSync(fence->object.sync));
262 checkGLcall("glDeleteSync");
263 fence->object.sync = GL_EXTCALL(glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0));
264 checkGLcall("glFenceSync");
265 }
266 else if (gl_info->supported[APPLE_FENCE])
267 {
268 GL_EXTCALL(glSetFenceAPPLE(fence->object.id));
269 checkGLcall("glSetFenceAPPLE");
270 }
271 else if (gl_info->supported[NV_FENCE])
272 {
273 GL_EXTCALL(glSetFenceNV(fence->object.id, GL_ALL_COMPLETED_NV));
274 checkGLcall("glSetFenceNV");
275 }
276
278}
void context_free_fence(struct wined3d_fence *fence)
Definition: context.c:904
void context_alloc_fence(struct wined3d_context *context, struct wined3d_fence *fence)
Definition: context.c:863
struct wined3d_context * context_reacquire(const struct wined3d_device *device, struct wined3d_context *context)
Definition: context.c:4305
#define GL_SYNC_GPU_COMMANDS_COMPLETE
Definition: glext.h:1923
#define GL_ALL_COMPLETED_NV
Definition: glext.h:3621

Referenced by draw_primitive(), and wined3d_event_query_ops_issue().

◆ wined3d_fence_wait()

enum wined3d_fence_result wined3d_fence_wait ( const struct wined3d_fence fence,
const struct wined3d_device device 
)

Definition at line 169 of file query.c.

171{
172 const struct wined3d_gl_info *gl_info;
173 struct wined3d_context *context;
175
176 TRACE("fence %p, device %p.\n", fence, device);
177
178 if (!fence->context)
179 {
180 TRACE("Fence not issued.\n");
182 }
183 gl_info = fence->context->gl_info;
184
185 if (!(context = context_reacquire(device, fence->context)))
186 {
187 /* A glFinish does not reliably wait for draws in other contexts. The caller has
188 * to find its own way to cope with the thread switch
189 */
190 if (!gl_info->supported[ARB_SYNC])
191 {
192 WARN("Fence finished from wrong thread.\n");
194 }
196 }
197 gl_info = context->gl_info;
198
199 if (gl_info->supported[ARB_SYNC])
200 {
201 /* Timeouts near 0xffffffffffffffff may immediately return GL_TIMEOUT_EXPIRED,
202 * possibly because macOS internally adds some slop to the timer. To avoid this,
203 * we use a large number that isn't near the point of overflow (macOS 10.12.5).
204 */
205 GLenum gl_ret = GL_EXTCALL(glClientWaitSync(fence->object.sync,
207 checkGLcall("glClientWaitSync");
208
209 switch (gl_ret)
210 {
214 break;
215
216 /* We don't expect a timeout for a ~292 year wait */
217 default:
218 ERR("glClientWaitSync returned %#x.\n", gl_ret);
220 }
221 }
222 else if (context->gl_info->supported[APPLE_FENCE])
223 {
224 GL_EXTCALL(glFinishFenceAPPLE(fence->object.id));
225 checkGLcall("glFinishFenceAPPLE");
227 }
228 else if (context->gl_info->supported[NV_FENCE])
229 {
230 GL_EXTCALL(glFinishFenceNV(fence->object.id));
231 checkGLcall("glFinishFenceNV");
233 }
234 else
235 {
236 ERR("Fence created without GL support.\n");
238 }
239
241 return ret;
242}
#define GL_ALREADY_SIGNALED
Definition: glext.h:1926
#define GL_CONDITION_SATISFIED
Definition: glext.h:1928
#define GL_SYNC_FLUSH_COMMANDS_BIT
Definition: glext.h:1930
uint64_t GLuint64
Definition: glext.h:5568
wined3d_fence_result

Referenced by buffer_sync_apple().

◆ wined3d_ffp_blitter_create()

void wined3d_ffp_blitter_create ( struct wined3d_blitter **  next,
const struct wined3d_gl_info gl_info 
)

Definition at line 3170 of file surface.c.

3171{
3172 struct wined3d_blitter *blitter;
3173
3174 if (!(blitter = heap_alloc(sizeof(*blitter))))
3175 return;
3176
3177 TRACE("Created blitter %p.\n", blitter);
3178
3179 blitter->ops = &ffp_blitter_ops;
3180 blitter->next = *next;
3181 *next = blitter;
3182}
static const struct wined3d_blitter_ops ffp_blitter_ops
Definition: surface.c:3163

Referenced by wined3d_device_create_primary_opengl_context_cs().

◆ 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 6230 of file utils.c.

6231{
6232 const struct ffp_frag_settings *ka = key;
6233 const struct ffp_frag_settings *kb = &WINE_RB_ENTRY_VALUE(entry, const struct ffp_frag_desc, entry)->settings;
6234
6235 return memcmp(ka, kb, sizeof(*ka));
6236}
Definition: copy.c:22

Referenced by arbfp_alloc(), atifs_alloc(), and glsl_fragment_pipe_alloc().

◆ wined3d_ffp_get_vs_settings()

void wined3d_ffp_get_vs_settings ( const struct wined3d_context context,
const struct wined3d_state state,
struct wined3d_ffp_vs_settings settings 
)

Definition at line 6238 of file utils.c.

6240{
6241 const struct wined3d_stream_info *si = &context->stream_info;
6242 const struct wined3d_gl_info *gl_info = context->gl_info;
6243 const struct wined3d_d3d_info *d3d_info = context->d3d_info;
6244 unsigned int coord_idx, i;
6245
6246 memset(settings, 0, sizeof(*settings));
6247
6248 if (si->position_transformed)
6249 {
6250 settings->transformed = 1;
6251 settings->point_size = state->gl_primitive_type == GL_POINTS;
6252 settings->per_vertex_point_size = !!(si->use_map & 1u << WINED3D_FFP_PSIZE);
6253 if (!state->render_states[WINED3D_RS_FOGENABLE])
6254 settings->fog_mode = WINED3D_FFP_VS_FOG_OFF;
6255 else if (state->render_states[WINED3D_RS_FOGTABLEMODE] != WINED3D_FOG_NONE)
6257 else
6259
6260 for (i = 0; i < MAX_TEXTURES; ++i)
6261 {
6262 coord_idx = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
6263 if (coord_idx < MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx))))
6264 settings->texcoords |= 1u << i;
6265 settings->texgen[i] = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
6266 }
6267 if (d3d_info->limits.varying_count >= wined3d_max_compat_varyings(gl_info))
6268 settings->texcoords = (1u << MAX_TEXTURES) - 1;
6269
6270 if (d3d_info->emulated_flatshading)
6271 settings->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT;
6272 else
6273 settings->flatshading = FALSE;
6274
6275 settings->swizzle_map = si->swizzle_map;
6276
6277 return;
6278 }
6279
6280 switch (state->render_states[WINED3D_RS_VERTEXBLEND])
6281 {
6286 settings->vertexblends = state->render_states[WINED3D_RS_VERTEXBLEND];
6287 break;
6288 default:
6289 FIXME("Unsupported vertex blending: %d\n", state->render_states[WINED3D_RS_VERTEXBLEND]);
6290 break;
6291 }
6292
6294 {
6296 settings->sw_blending = 1;
6297 else
6298 settings->vb_indices = 1;
6299 }
6300
6301 settings->clipping = state->render_states[WINED3D_RS_CLIPPING]
6302 && state->render_states[WINED3D_RS_CLIPPLANEENABLE];
6303 settings->normal = !!(si->use_map & (1u << WINED3D_FFP_NORMAL));
6304 settings->normalize = settings->normal && state->render_states[WINED3D_RS_NORMALIZENORMALS];
6305 settings->lighting = !!state->render_states[WINED3D_RS_LIGHTING];
6306 settings->localviewer = !!state->render_states[WINED3D_RS_LOCALVIEWER];
6307 settings->point_size = state->gl_primitive_type == GL_POINTS;
6308 settings->per_vertex_point_size = !!(si->use_map & 1u << WINED3D_FFP_PSIZE);
6309
6310 if (state->render_states[WINED3D_RS_COLORVERTEX] && (si->use_map & (1u << WINED3D_FFP_DIFFUSE)))
6311 {
6312 settings->diffuse_source = state->render_states[WINED3D_RS_DIFFUSEMATERIALSOURCE];
6313 settings->emissive_source = state->render_states[WINED3D_RS_EMISSIVEMATERIALSOURCE];
6314 settings->ambient_source = state->render_states[WINED3D_RS_AMBIENTMATERIALSOURCE];
6315 settings->specular_source = state->render_states[WINED3D_RS_SPECULARMATERIALSOURCE];
6316 }
6317 else
6318 {
6319 settings->diffuse_source = WINED3D_MCS_MATERIAL;
6320 settings->emissive_source = WINED3D_MCS_MATERIAL;
6321 settings->ambient_source = WINED3D_MCS_MATERIAL;
6322 settings->specular_source = WINED3D_MCS_MATERIAL;
6323 }
6324
6325 for (i = 0; i < MAX_TEXTURES; ++i)
6326 {
6327 coord_idx = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
6328 if (coord_idx < MAX_TEXTURES && (si->use_map & (1u << (WINED3D_FFP_TEXCOORD0 + coord_idx))))
6329 settings->texcoords |= 1u << i;
6330 settings->texgen[i] = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
6331 }
6332 if (d3d_info->limits.varying_count >= wined3d_max_compat_varyings(gl_info))
6333 settings->texcoords = (1u << MAX_TEXTURES) - 1;
6334
6335 for (i = 0; i < MAX_ACTIVE_LIGHTS; ++i)
6336 {
6337 if (!state->lights[i])
6338 continue;
6339
6340 switch (state->lights[i]->OriginalParms.type)
6341 {
6343 ++settings->point_light_count;
6344 break;
6345 case WINED3D_LIGHT_SPOT:
6346 ++settings->spot_light_count;
6347 break;
6349 ++settings->directional_light_count;
6350 break;
6352 ++settings->parallel_point_light_count;
6353 break;
6354 default:
6355 FIXME("Unhandled light type %#x.\n", state->lights[i]->OriginalParms.type);
6356 break;
6357 }
6358 }
6359
6360 if (!state->render_states[WINED3D_RS_FOGENABLE])
6361 settings->fog_mode = WINED3D_FFP_VS_FOG_OFF;
6362 else if (state->render_states[WINED3D_RS_FOGTABLEMODE] != WINED3D_FOG_NONE)
6363 {
6365
6366 if (state->transforms[WINED3D_TS_PROJECTION]._14 == 0.0f
6367 && state->transforms[WINED3D_TS_PROJECTION]._24 == 0.0f
6368 && state->transforms[WINED3D_TS_PROJECTION]._34 == 0.0f
6369 && state->transforms[WINED3D_TS_PROJECTION]._44 == 1.0f)
6370 settings->ortho_fog = 1;
6371 }
6372 else if (state->render_states[WINED3D_RS_FOGVERTEXMODE] == WINED3D_FOG_NONE)
6374 else if (state->render_states[WINED3D_RS_RANGEFOGENABLE])
6376 else
6378
6379 if (d3d_info->emulated_flatshading)
6380 settings->flatshading = state->render_states[WINED3D_RS_SHADEMODE] == WINED3D_SHADE_FLAT;
6381 else
6382 settings->flatshading = FALSE;
6383
6384 settings->swizzle_map = si->swizzle_map;
6385}
@ WINED3D_MCS_MATERIAL
Definition: wined3d.h:512
@ WINED3D_LIGHT_SPOT
Definition: wined3d.h:63
@ WINED3D_LIGHT_PARALLELPOINT
Definition: wined3d.h:65
@ WINED3D_LIGHT_POINT
Definition: wined3d.h:62
@ WINED3D_LIGHT_DIRECTIONAL
Definition: wined3d.h:64
@ WINED3D_VBF_1WEIGHTS
Definition: wined3d.h:443
@ WINED3D_VBF_3WEIGHTS
Definition: wined3d.h:445
@ WINED3D_VBF_2WEIGHTS
Definition: wined3d.h:444

Referenced by 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 6387 of file utils.c.

6388{
6389 const struct wined3d_ffp_vs_settings *ka = key;
6391 const struct wined3d_ffp_vs_desc, entry)->settings;
6392
6393 return memcmp(ka, kb, sizeof(*ka));
6394}

Referenced by glsl_vertex_pipe_vp_alloc().

◆ 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 3876 of file utils.c.

3878{
3879 /* For block based formats, pitch means the amount of bytes to the next
3880 * row of blocks rather than the next row of pixels. */
3882 {
3883 unsigned int row_block_count = (width + format->block_width - 1) / format->block_width;
3884 unsigned int slice_block_count = (height + format->block_height - 1) / format->block_height;
3885 *row_pitch = row_block_count * format->block_byte_count;
3886 *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1);
3887 *slice_pitch = *row_pitch * slice_block_count;
3888 }
3889 else
3890 {
3891 *row_pitch = format->byte_count * width; /* Bytes / row */
3892 *row_pitch = (*row_pitch + alignment - 1) & ~(alignment - 1);
3893 *slice_pitch = *row_pitch * height;
3894 }
3895
3897 {
3898 /* The D3D format requirements make sure that the resulting format is an integer again */
3899 *slice_pitch *= format->height_scale.numerator;
3900 *slice_pitch /= format->height_scale.denominator;
3901 }
3902
3903 TRACE("Returning row pitch %u, slice pitch %u.\n", *row_pitch, *slice_pitch);
3904}
#define WINED3DFMT_FLAG_HEIGHT_SCALE

Referenced by surface_download_data(), surface_load_texture(), wined3d_calculate_format_pitch(), wined3d_format_calculate_size(), wined3d_surface_upload_data(), wined3d_texture_get_pitch(), and wined3d_texture_update_desc().

◆ 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 3906 of file utils.c.

3908{
3909 unsigned int row_pitch, slice_pitch;
3910
3911 if (format->id == WINED3DFMT_UNKNOWN)
3912 return 0;
3913
3915 return width * height * depth * format->byte_count;
3916
3917 wined3d_format_calculate_pitch(format, alignment, width, height, &row_pitch, &slice_pitch);
3918
3919 return slice_pitch * depth;
3920}
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:3876
#define WINED3DFMT_FLAG_BROKEN_PITCH

Referenced by wined3d_texture_init(), and wined3d_texture_update_desc().

◆ wined3d_format_convert_from_float()

DWORD wined3d_format_convert_from_float ( const struct wined3d_format format,
const struct wined3d_color color 
)

Definition at line 5227 of file utils.c.

5228{
5229 static const struct
5230 {
5232 struct wined3d_vec4 mul;
5233 struct wined3d_uvec4 shift;
5234 }
5235 float_conv[] =
5236 {
5237 {WINED3DFMT_B8G8R8A8_UNORM, { 255.0f, 255.0f, 255.0f, 255.0f}, {16, 8, 0, 24}},
5238 {WINED3DFMT_B8G8R8X8_UNORM, { 255.0f, 255.0f, 255.0f, 255.0f}, {16, 8, 0, 24}},
5239 {WINED3DFMT_B8G8R8_UNORM, { 255.0f, 255.0f, 255.0f, 255.0f}, {16, 8, 0, 24}},
5240 {WINED3DFMT_B5G6R5_UNORM, { 31.0f, 63.0f, 31.0f, 0.0f}, {11, 5, 0, 0}},
5241 {WINED3DFMT_B5G5R5A1_UNORM, { 31.0f, 31.0f, 31.0f, 1.0f}, {10, 5, 0, 15}},
5242 {WINED3DFMT_B5G5R5X1_UNORM, { 31.0f, 31.0f, 31.0f, 1.0f}, {10, 5, 0, 15}},
5243 {WINED3DFMT_R8_UNORM, { 255.0f, 0.0f, 0.0f, 0.0f}, { 0, 0, 0, 0}},
5244 {WINED3DFMT_A8_UNORM, { 0.0f, 0.0f, 0.0f, 255.0f}, { 0, 0, 0, 0}},
5245 {WINED3DFMT_B4G4R4A4_UNORM, { 15.0f, 15.0f, 15.0f, 15.0f}, { 8, 4, 0, 12}},
5246 {WINED3DFMT_B4G4R4X4_UNORM, { 15.0f, 15.0f, 15.0f, 15.0f}, { 8, 4, 0, 12}},
5247 {WINED3DFMT_B2G3R3_UNORM, { 7.0f, 7.0f, 3.0f, 0.0f}, { 5, 2, 0, 0}},
5248 {WINED3DFMT_R8G8B8A8_UNORM, { 255.0f, 255.0f, 255.0f, 255.0f}, { 0, 8, 16, 24}},
5249 {WINED3DFMT_R8G8B8X8_UNORM, { 255.0f, 255.0f, 255.0f, 255.0f}, { 0, 8, 16, 24}},
5250 {WINED3DFMT_B10G10R10A2_UNORM, { 1023.0f, 1023.0f, 1023.0f, 3.0f}, {20, 10, 0, 30}},
5251 {WINED3DFMT_R10G10B10A2_UNORM, { 1023.0f, 1023.0f, 1023.0f, 3.0f}, { 0, 10, 20, 30}},
5252 {WINED3DFMT_P8_UINT, { 0.0f, 0.0f, 0.0f, 255.0f}, { 0, 0, 0, 0}},
5253 {WINED3DFMT_S1_UINT_D15_UNORM, { 32767.0f, 0.0f, 0.0f, 0.0f}, { 0, 0, 0, 0}},
5254 {WINED3DFMT_D16_UNORM, { 65535.0f, 0.0f, 0.0f, 0.0f}, { 0, 0, 0, 0}},
5255 };
5256 static const struct
5257 {
5259 struct wined3d_dvec4 mul;
5260 struct wined3d_uvec4 shift;
5261 }
5262 double_conv[] =
5263 {
5264 {WINED3DFMT_D24_UNORM_S8_UINT, { 16777215.0, 1.0, 0.0, 0.0}, {8, 0, 0, 0}},
5265 {WINED3DFMT_X8D24_UNORM, { 16777215.0, 0.0, 0.0, 0.0}, {0, 0, 0, 0}},
5266 {WINED3DFMT_D32_UNORM, {4294967295.0, 0.0, 0.0, 0.0}, {0, 0, 0, 0}},
5267 };
5268 unsigned int i;
5269 DWORD ret;
5270
5271 TRACE("Converting color %s to format %s.\n", debug_color(color), debug_d3dformat(format->id));
5272
5273 for (i = 0; i < ARRAY_SIZE(float_conv); ++i)
5274 {
5275 if (format->id != float_conv[i].format_id)
5276 continue;
5277
5278 ret = ((DWORD)((color->r * float_conv[i].mul.x) + 0.5f)) << float_conv[i].shift.x;
5279 ret |= ((DWORD)((color->g * float_conv[i].mul.y) + 0.5f)) << float_conv[i].shift.y;
5280 ret |= ((DWORD)((color->b * float_conv[i].mul.z) + 0.5f)) << float_conv[i].shift.z;
5281 ret |= ((DWORD)((color->a * float_conv[i].mul.w) + 0.5f)) << float_conv[i].shift.w;
5282
5283 TRACE("Returning 0x%08x.\n", ret);
5284
5285 return ret;
5286 }
5287
5288 for (i = 0; i < ARRAY_SIZE(double_conv); ++i)
5289 {
5290 if (format->id != double_conv[i].format_id)
5291 continue;
5292
5293 ret = ((DWORD)((color->r * double_conv[i].mul.x) + 0.5)) << double_conv[i].shift.x;
5294 ret |= ((DWORD)((color->g * double_conv[i].mul.y) + 0.5)) << double_conv[i].shift.y;
5295 ret |= ((DWORD)((color->b * double_conv[i].mul.z) + 0.5)) << double_conv[i].shift.z;
5296 ret |= ((DWORD)((color->a * double_conv[i].mul.w) + 0.5)) << double_conv[i].shift.w;
5297
5298 TRACE("Returning 0x%08x.\n", ret);
5299
5300 return ret;
5301 }
5302
5303 FIXME("Conversion for format %s not implemented.\n", debug_d3dformat(format->id));
5304
5305 return 0;
5306}
const char * debug_color(const struct wined3d_color *color)
Definition: utils.c:3948
#define mul(aa, bb)
Definition: mvAesAlg.c:25
wined3d_format_id
Definition: wined3d.h:106

Referenced by surface_cpu_blt_colour_fill().

◆ 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 1046 of file utils.c.

1048{
1049 const struct wined3d_format *format = texture->resource.format;
1050 unsigned int i;
1051
1052 static const struct
1053 {
1054 enum wined3d_format_id src_format;
1055 struct wined3d_color_key_conversion conversion;
1056 }
1057 color_key_info[] =
1058 {
1064 };
1065 static const struct wined3d_color_key_conversion convert_p8 =
1066 {
1068 };
1069
1070 if (need_alpha_ck && (texture->async.flags & WINED3D_TEXTURE_ASYNC_COLOR_KEY))
1071 {
1072 for (i = 0; i < ARRAY_SIZE(color_key_info); ++i)
1073 {
1074 if (color_key_info[i].src_format == format->id)
1075 return &color_key_info[i].conversion;
1076 }
1077
1078 FIXME("Color-keying not supported with format %s.\n", debug_d3dformat(format->id));
1079 }
1080
1081 /* FIXME: This should check if the blitter backend can do P8 conversion,
1082 * instead of checking for ARB_fragment_program. */
1083 if (format->id == WINED3DFMT_P8_UINT
1084 && !(texture->resource.device->adapter->gl_info.supported[ARB_FRAGMENT_PROGRAM]
1085 && texture->swapchain && texture == texture->swapchain->front_buffer))
1086 return &convert_p8;
1087
1088 return NULL;
1089}
static void convert_p8_uint_b8g8r8a8_unorm(const BYTE *src, unsigned int src_pitch, BYTE *dst, unsigned int dst_pitch, unsigned int width, unsigned int height, const struct wined3d_palette *palette, const struct wined3d_color_key *color_key)
Definition: utils.c:898
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_palette *palette, const struct wined3d_color_key *color_key)
Definition: utils.c:1001
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_palette *palette, const struct wined3d_color_key *color_key)
Definition: utils.c:980
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_palette *palette, const struct wined3d_color_key *color_key)
Definition: utils.c:1024
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_palette *palette, const struct wined3d_color_key *color_key)
Definition: utils.c:934
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_palette *palette, const struct wined3d_color_key *color_key)
Definition: utils.c:957
#define WINED3D_TEXTURE_ASYNC_COLOR_KEY

Referenced by surface_load_texture(), texture2d_prepare_texture(), and wined3d_surface_blt().

◆ 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 5321 of file utils.c.

5323{
5324 struct wined3d_color slop;
5325
5326 switch (format->id)
5327 {
5346 slop.r = 0.5f / ((1u << format->red_size) - 1);
5347 slop.g = 0.5f / ((1u << format->green_size) - 1);
5348 slop.b = 0.5f / ((1u << format->blue_size) - 1);
5349 slop.a = 0.5f / ((1u << format->alpha_size) - 1);
5350
5351 float_colors[0].r = color_to_float(key->color_space_low_value, format->red_size, format->red_offset)
5352 - slop.r;
5353 float_colors[0].g = color_to_float(key->color_space_low_value, format->green_size, format->green_offset)
5354 - slop.g;
5355 float_colors[0].b = color_to_float(key->color_space_low_value, format->blue_size, format->blue_offset)
5356 - slop.b;
5357 float_colors[0].a = color_to_float(key->color_space_low_value, format->alpha_size, format->alpha_offset)
5358 - slop.a;
5359
5360 float_colors[1].r = color_to_float(key->color_space_high_value, format->red_size, format->red_offset)
5361 + slop.r;
5362 float_colors[1].g = color_to_float(key->color_space_high_value, format->green_size, format->green_offset)
5363 + slop.g;
5364 float_colors[1].b = color_to_float(key->color_space_high_value, format->blue_size, format->blue_offset)
5365 + slop.b;
5366 float_colors[1].a = color_to_float(key->color_space_high_value, format->alpha_size, format->alpha_offset)
5367 + slop.a;
5368 break;
5369
5370 case WINED3DFMT_P8_UINT:
5371 float_colors[0].r = 0.0f;
5372 float_colors[0].g = 0.0f;
5373 float_colors[0].b = 0.0f;
5374 float_colors[0].a = (key->color_space_low_value - 0.5f) / 255.0f;
5375
5376 float_colors[1].r = 0.0f;
5377 float_colors[1].g = 0.0f;
5378 float_colors[1].b = 0.0f;
5379 float_colors[1].a = (key->color_space_high_value + 0.5f) / 255.0f;
5380 break;
5381
5382 default:
5383 ERR("Unhandled color key to float conversion for format %s.\n", debug_d3dformat(format->id));
5384 }
5385}
static float color_to_float(DWORD color, DWORD size, DWORD offset)
Definition: utils.c:5308

Referenced by arbfp_blit_set(), color_key_arbfp(), and shader_glsl_load_color_key_constant().

◆ 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 3863 of file utils.c.

3865{
3866 unsigned int i;
3867
3869 {
3870 if (typeless_depth_stencil_formats[i].typeless_id == resource_format_id)
3871 return typeless_depth_stencil_formats[i].depth_view_id == view_format_id;
3872 }
3873 return FALSE;
3874}
static const struct wined3d_typeless_format_depth_stencil_info typeless_depth_stencil_formats[]
Definition: utils.c:293

Referenced by wined3d_shader_resource_view_cs_init().

◆ wined3d_format_is_typeless()

static BOOL wined3d_format_is_typeless ( const struct wined3d_format format)
inlinestatic

Definition at line 4376 of file wined3d_private.h.

4377{
4378 return format->id == format->typeless_id && format->id != WINED3DFMT_UNKNOWN;
4379}

Referenced by validate_resource_view(), wined3d_device_resolve_sub_resource(), and wined3d_get_format().

◆ wined3d_formats_are_srgb_variants()

BOOL wined3d_formats_are_srgb_variants ( enum wined3d_format_id  format1,
enum wined3d_format_id  format2 
)

Definition at line 3922 of file utils.c.

3923{
3924 unsigned int i;
3925
3926 for (i = 0; i < ARRAY_SIZE(format_srgb_info); ++i)
3927 {
3928 if (format1 == format_srgb_info[i].srgb_format_id)
3929 return format2 == format_srgb_info[i].base_format_id;
3930 if (format1 == format_srgb_info[i].base_format_id)
3931 return format2 == format_srgb_info[i].srgb_format_id;
3932 }
3933 return FALSE;
3934}
static const struct wined3d_format_srgb_info format_srgb_info[]
Definition: utils.c:1739

Referenced by validate_resource_view().

◆ wined3d_from_cs()

static void wined3d_from_cs ( const struct wined3d_cs cs)
inlinestatic

Definition at line 4531 of file wined3d_private.h.

4532{
4533 if (cs->thread)
4534 assert(cs->thread_id == GetCurrentThreadId());
4535}
#define assert(x)
Definition: debug.h:53

Referenced by context_acquire(), context_create(), context_destroy(), context_reacquire(), device_invalidate_state(), and wined3d_cs_queue_is_empty().

◆ wined3d_ftoa()

void wined3d_ftoa ( float  value,
char s 
)

Definition at line 6429 of file utils.c.

6430{
6431 int idx = 1;
6432
6433 if (copysignf(1.0f, value) < 0.0f)
6434 ++idx;
6435
6436 /* Be sure to allocate a buffer of at least 17 characters for the result
6437 as sprintf may return a 3 digit exponent when using the MSVC runtime
6438 instead of a 2 digit exponent. */
6439 sprintf(s, "%.8e", value);
6440 if (isfinite(value))
6441 s[idx] = '.';
6442}
float __cdecl copysignf(float, float)
#define isfinite(x)
Definition: mingw_math.h:91
#define sprintf(buf, format,...)
Definition: sprintf.c:55
Definition: pdh_main.c:94

Referenced by shader_arb_append_imm_vec4(), shader_arb_generate_pshader(), shader_arb_generate_vshader(), shader_glsl_append_imm_vec4(), and shader_glsl_get_register_name().

◆ wined3d_get_format()

const struct wined3d_format * wined3d_get_format ( const struct wined3d_gl_info gl_info,
enum wined3d_format_id  format_id,
unsigned int  resource_usage 
)

Definition at line 3831 of file utils.c.

3833{
3834 const struct wined3d_format *format;
3836 unsigned int i;
3837
3838 if (idx == -1)
3839 {
3840 FIXME("Can't find format %s (%#x) in the format lookup table.\n",
3842 return &gl_info->formats[get_format_idx(WINED3DFMT_UNKNOWN)];
3843 }
3844
3845 format = &gl_info->formats[idx];
3846
3848 {
3850 {
3852 return &gl_info->formats[WINED3D_FORMAT_COUNT + i];
3853 }
3854
3855 FIXME("Cannot find depth/stencil typeless format %s (%#x).\n",
3857 return &gl_info->formats[get_format_idx(WINED3DFMT_UNKNOWN)];
3858 }
3859
3860 return format;
3861}
#define WINED3D_FORMAT_COUNT
Definition: utils.c:70
static int get_format_idx(enum wined3d_format_id format_id)
Definition: utils.c:1750
enum wined3d_format_id typeless_id
static BOOL wined3d_format_is_typeless(const struct wined3d_format *format)

Referenced by append_decl_element(), buffer_init(), context_create(), surface_load_texture(), texture2d_prepare_texture(), texture_init(), validate_resource_view(), vertexdeclaration_init(), wined3d_calculate_format_pitch(), wined3d_check_depth_stencil_match(), wined3d_check_device_format(), wined3d_check_device_multisample_type(), wined3d_enum_adapter_modes(), wined3d_get_adapter_mode_count(), wined3d_set_adapter_display_mode(), wined3d_swapchain_apply_sample_count_override(), wined3d_swapchain_cs_init(), wined3d_texture_create(), wined3d_texture_init(), and wined3d_texture_update_desc().

◆ wined3d_gl_compare_func()

GLenum wined3d_gl_compare_func ( enum wined3d_cmp_func  f)

Definition at line 348 of file state.c.

349{
350 switch (f)
351 {
353 return GL_NEVER;
354 case WINED3D_CMP_LESS:
355 return GL_LESS;
357 return GL_EQUAL;
359 return GL_LEQUAL;
361 return GL_GREATER;
363 return GL_NOTEQUAL;
365 return GL_GEQUAL;
367 return GL_ALWAYS;
368 default:
369 if (!f)
370 WARN("Unrecognized compare function %#x.\n", f);
371 else
372 FIXME("Unrecognized compare function %#x.\n", f);
373 return GL_NONE;
374 }
375}
#define GL_NEVER
Definition: gl.h:293
#define GL_ALWAYS
Definition: gl.h:300
#define GL_LESS
Definition: gl.h:294
#define GL_LEQUAL
Definition: gl.h:296
#define GL_GEQUAL
Definition: gl.h:299
#define GL_GREATER
Definition: gl.h:297
#define GL_EQUAL
Definition: gl.h:295
GLfloat f
Definition: glext.h:7540
@ WINED3D_CMP_GREATER
Definition: wined3d.h:456
@ WINED3D_CMP_LESSEQUAL
Definition: wined3d.h:455
@ WINED3D_CMP_NOTEQUAL
Definition: wined3d.h:457
@ WINED3D_CMP_LESS
Definition: wined3d.h:453
@ WINED3D_CMP_EQUAL
Definition: wined3d.h:454
@ WINED3D_CMP_GREATEREQUAL
Definition: wined3d.h:458
@ WINED3D_CMP_NEVER
Definition: wined3d.h:452

Referenced by alpha_test_arbfp(), glsl_fragment_pipe_alpha_test_func(), state_alpha_test(), state_stencil(), state_zfunc(), and wined3d_sampler_cs_init().

◆ wined3d_gl_limits_get_texture_unit_range()

void wined3d_gl_limits_get_texture_unit_range ( const struct wined3d_gl_limits gl_limits,
enum wined3d_shader_type  shader_type,
unsigned int base,
unsigned int count 
)

Definition at line 6498 of file utils.c.

6500{
6501 unsigned int i;
6502
6504 {
6505 if (gl_limits->combined_samplers == gl_limits->graphics_samplers)
6506 *base = 0;
6507 else
6508 *base = gl_limits->graphics_samplers;
6510 return;
6511 }
6512
6513 *base = 0;
6514 for (i = 0; i < WINED3D_SHADER_TYPE_GRAPHICS_COUNT; ++i)
6515 {
6516 *count = gl_limits->samplers[i];
6517 if (i == shader_type)
6518 return;
6519 *base += *count;
6520 }
6521
6522 ERR("Unrecognized shader type %#x.\n", shader_type);
6523 *count = 0;
6524}
unsigned int samplers[WINED3D_SHADER_TYPE_COUNT]
unsigned int graphics_samplers
unsigned int combined_samplers

Referenced by context_create(), and context_get_tex_unit_mapping().

◆ wined3d_gl_limits_get_uniform_block_range()

void wined3d_gl_limits_get_uniform_block_range ( const struct wined3d_gl_limits gl_limits,
enum wined3d_shader_type  shader_type,
unsigned int base,
unsigned int count 
)

Definition at line 6480 of file utils.c.

6482{
6483 unsigned int i;
6484
6485 *base = 0;
6486 for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i)
6487 {
6488 *count = gl_limits->uniform_blocks[i];
6489 if (i == shader_type)
6490 return;
6491 *base += *count;
6492 }
6493
6494 ERR("Unrecognized shader type %#x.\n", shader_type);
6495 *count = 0;
6496}
unsigned int uniform_blocks[WINED3D_SHADER_TYPE_COUNT]

Referenced by shader_generate_glsl_declarations(), shader_glsl_init_uniform_block_bindings(), and state_cb().

◆ wined3d_gl_mag_filter()

static GLenum wined3d_gl_mag_filter ( enum wined3d_texture_filter_type  mag_filter)
inlinestatic

Definition at line 300 of file wined3d_private.h.

301{
302 return magLookup[mag_filter];
303}
const GLenum magLookup[]
Definition: directx.c:299

Referenced by draw_textured_quad(), fb_copy_to_texture_hwstretch(), wined3d_sampler_cs_init(), and wined3d_texture_apply_sampler_desc().

◆ wined3d_gl_min_mip_filter()

static GLenum wined3d_gl_min_mip_filter ( enum wined3d_texture_filter_type  min_filter,
enum wined3d_texture_filter_type  mip_filter 
)
inlinestatic

Definition at line 305 of file wined3d_private.h.

307{
308 return minMipLookup[min_filter].mip[mip_filter];
309}
const struct min_lookup minMipLookup[]
Definition: directx.c:291

Referenced by draw_textured_quad(), fb_copy_to_texture_hwstretch(), wined3d_sampler_cs_init(), and wined3d_texture_apply_sampler_desc().

◆ wined3d_init()

HRESULT wined3d_init ( struct wined3d wined3d,
DWORD  flags 
)

Definition at line 6820 of file directx.c.

6821{
6822 BOOL ret;
6823
6824 wined3d->ref = 1;
6825 wined3d->flags = flags;
6826
6827 TRACE("Initializing adapters.\n");
6828
6829 if (flags & WINED3D_NO3D)
6831 else
6833 if (!ret)
6834 {
6835 WARN("Failed to initialize adapter.\n");
6836 return E_FAIL;
6837 }
6839
6840 return WINED3D_OK;
6841}
static BOOL wined3d_adapter_init(struct wined3d_adapter *adapter, UINT ordinal, DWORD wined3d_creation_flags)
Definition: directx.c:6646
static BOOL wined3d_adapter_init_nogl(struct wined3d_adapter *adapter, UINT ordinal)
Definition: directx.c:6784
#define WINED3D_NO3D
Definition: wined3d.h:1316

Referenced by wined3d_create().

◆ wined3d_insert_bits()

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

Definition at line 4504 of file wined3d_private.h.

4506{
4507 const unsigned int word_bit_count = sizeof(*bitstream) * CHAR_BIT;
4508 const unsigned int idx = offset / word_bit_count;
4509 const unsigned int shift = offset % word_bit_count;
4510 DWORD mask = (1u << count) - 1;
4511
4512 bitstream[idx] |= (bits & mask) << shift;
4513 if (shift + count > word_bit_count)
4514 {
4515 const unsigned int inserted_bit_count = word_bit_count - shift;
4516 const unsigned int remaining_bit_count = count - inserted_bit_count;
4517 mask = (1u << remaining_bit_count) - 1;
4518 bitstream[idx + 1] |= (bits >> inserted_bit_count) & mask;
4519 }
4520}
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_max_compat_varyings()

unsigned int wined3d_max_compat_varyings ( const struct wined3d_gl_info gl_info)

Definition at line 5744 of file utils.c.

5745{
5746 /* On core profile we have to also count diffuse and specular colors and the
5747 * fog coordinate. */
5748 return gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] ? MAX_TEXTURES * 4 : (MAX_TEXTURES + 2) * 4 + 1;
5749}

Referenced by find_ps_compile_args(), gen_ffp_frag_op(), glsl_fragment_pipe_vdecl(), glsl_fragment_pipe_vs(), glsl_vertex_pipe_vdecl(), shader_glsl_generate_ffp_vertex_shader(), shader_glsl_generate_vs3_rasterizer_input_setup(), and wined3d_ffp_get_vs_settings().

◆ wined3d_not_from_cs()

static void wined3d_not_from_cs ( struct wined3d_cs cs)
inlinestatic

Definition at line 4537 of file wined3d_private.h.

4538{
4539 assert(cs->thread_id != GetCurrentThreadId());
4540}

Referenced by device_resource_add(), device_resource_remove(), wined3d_cs_map(), and wined3d_cs_unmap().

◆ wined3d_pause()

static void wined3d_pause ( void  )
inlinestatic

Definition at line 372 of file wined3d_private.h.

373{
374#ifdef __REACTOS__
375 Sleep(0);
376#else
377#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
378 __asm__ __volatile__( "rep;nop" : : : "memory" );
379#endif
380#endif
381}
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tmov %rdx, %rbp\n" "\tjmp *%rax\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790

Referenced by wined3d_cs_emit_present(), wined3d_cs_mt_finish(), and wined3d_resource_wait_idle().

◆ wined3d_popcount()

static unsigned int wined3d_popcount ( unsigned int  x)
inlinestatic

Definition at line 361 of file wined3d_private.h.

362{
363#ifdef HAVE___BUILTIN_POPCOUNT
364 return __builtin_popcount(x);
365#else
366 x -= x >> 1 & 0x55555555;
367 x = (x & 0x33333333) + (x >> 2 & 0x33333333);
368 return ((x + (x >> 4)) & 0x0f0f0f0f) * 0x01010101 >> 24;
369#endif
370}

Referenced by set_glsl_shader_program(), shader_generate_arb_declarations(), shader_generate_glsl_declarations(), shader_get_registers_used(), shader_glsl_gen_sample_c_lz(), shader_glsl_generate_clip_or_cull_distances(), wined3d_check_device_multisample_type(), wined3d_debug_location(), and wined3d_texture_create().

◆ wined3d_raw_blitter_create()

void wined3d_raw_blitter_create ( struct wined3d_blitter **  next,
const struct wined3d_gl_info gl_info 
)

Definition at line 2871 of file surface.c.

2872{
2873 struct wined3d_blitter *blitter;
2874
2875 if (!gl_info->supported[ARB_COPY_IMAGE])
2876 return;
2877
2878 if (!(blitter = heap_alloc(sizeof(*blitter))))
2879 return;
2880
2881 TRACE("Created blitter %p.\n", blitter);
2882
2883 blitter->ops = &raw_blitter_ops;
2884 blitter->next = *next;
2885 *next = blitter;
2886}
static const struct wined3d_blitter_ops raw_blitter_ops
Definition: surface.c:2864
@ ARB_COPY_IMAGE
Definition: wined3d_gl.h:54

Referenced by wined3d_device_create_primary_opengl_context_cs().

◆ wined3d_register_window()

BOOL wined3d_register_window ( HWND  window,
struct wined3d_device device 
)

Definition at line 432 of file wined3d_main.c.

433{
434 struct wined3d_wndproc *entry;
435
437
439 {
441 WARN("Window %p is already registered with wined3d.\n", window);
442 return TRUE;
443 }
444
445 if (!wined3d_array_reserve((void **)&wndproc_table.entries, &wndproc_table.size,
446 wndproc_table.count + 1, sizeof(*entry)))
447 {
449 ERR("Failed to grow table.\n");
450 return FALSE;
451 }
452
453 entry = &wndproc_table.entries[wndproc_table.count++];
454 entry->window = window;
455 entry->unicode = IsWindowUnicode(window);
456 /* Set a window proc that matches the window. Some applications (e.g. NoX)
457 * replace the window proc after we've set ours, and expect to be able to
458 * call the previous one (ours) directly, without using CallWindowProc(). */
459 if (entry->unicode)
461 else
463 entry->device = device;
464
466
467 return TRUE;
468}
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
struct wined3d_device * device
Definition: wined3d_main.c:39
#define GWLP_WNDPROC
Definition: treelist.c:66
static struct wined3d_wndproc * wined3d_find_wndproc(HWND window)
Definition: wined3d_main.c:388
static struct wined3d_wndproc_table wndproc_table
Definition: wined3d_main.c:49
static void wined3d_wndproc_mutex_lock(void)
Definition: wined3d_main.c:378
static void wined3d_wndproc_mutex_unlock(void)
Definition: wined3d_main.c:383
#define SetWindowLongPtrA
Definition: winuser.h:5345
BOOL WINAPI IsWindowUnicode(_In_ HWND)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2906
#define SetWindowLongPtrW
Definition: winuser.h:5346

Referenced by wined3d_device_acquire_focus_window().

◆ wined3d_release_dc()

void wined3d_release_dc ( HWND  window,
HDC  dc 
)

Definition at line 6444 of file utils.c.

6445{
6446 /* You'd figure ReleaseDC() would fail if the DC doesn't match the window.
6447 * However, that's not what actually happens, and there are user32 tests
6448 * that confirm ReleaseDC() with the wrong window is supposed to succeed.
6449 * So explicitly check that the DC belongs to the window, since we want to
6450 * avoid releasing a DC that belongs to some other window if the original
6451 * window was already destroyed. */
6452 if (WindowFromDC(dc) != window)
6453 WARN("DC %p does not belong to window %p.\n", dc, window);
6454 else if (!ReleaseDC(window, dc))
6455 ERR("Failed to release device context %p, last error %#x.\n", dc, GetLastError());
6456}
static const WCHAR dc[]
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HWND WINAPI WindowFromDC(_In_ HDC hDC)

Referenced by context_create(), context_destroy_gl_resources(), context_update_window(), swapchain_cleanup(), and wined3d_caps_gl_ctx_destroy().

◆ wined3d_rendertarget_view_get_drawable_size()

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

Definition at line 404 of file view.c.

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

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

◆ wined3d_rendertarget_view_get_surface()

static struct wined3d_surface * wined3d_rendertarget_view_get_surface ( const struct wined3d_rendertarget_view view)
inlinestatic

Definition at line 3773 of file wined3d_private.h.

3775{
3776 struct wined3d_texture *texture;
3777
3778 if (!view || view->resource->type != WINED3D_RTYPE_TEXTURE_2D)
3779 return NULL;
3780
3781 texture = texture_from_resource(view->resource);
3782
3783 return texture->sub_resources[view->sub_resource_idx].u.surface;
3784}

Referenced by context_apply_clear_state(), context_state_fb(), device_clear_render_targets(), find_draw_buffers_mask(), surface_blt_special(), swapchain_gl_present(), and wined3d_cs_exec_set_depth_stencil_view().

◆ wined3d_rendertarget_view_invalidate_location()

void wined3d_rendertarget_view_invalidate_location ( struct wined3d_rendertarget_view view,
DWORD  location 
)

Definition at line 505 of file view.c.

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

Referenced by draw_primitive().

◆ wined3d_rendertarget_view_load_location()

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

Definition at line 466 of file view.c.

468{
469 struct wined3d_resource *resource = view->resource;
470 unsigned int i, sub_resource_idx, layer_count;
471 struct wined3d_texture *texture;
472
473 if (resource->type == WINED3D_RTYPE_BUFFER)
474 {
476 return;
477 }
478
480 sub_resource_idx = view->sub_resource_idx;
481 layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? view->layer_count : 1;
482 for (i = 0; i < layer_count; ++i, sub_resource_idx += texture->level_count)
484}

Referenced by draw_primitive().

◆ wined3d_rendertarget_view_prepare_location()

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

Definition at line 446 of file view.c.

448{
449 struct wined3d_resource *resource = view->resource;
450 unsigned int i, sub_resource_idx, layer_count;
451 struct wined3d_texture *texture;
452
453 if (resource->type == WINED3D_RTYPE_BUFFER)
454 {
455 FIXME("Not implemented for resources %s.\n", debug_d3dresourcetype(resource->type));
456 return;
457 }
458
460 sub_resource_idx = view->sub_resource_idx;
461 layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? view->layer_count : 1;
462 for (i = 0; i < layer_count; ++i, sub_resource_idx += texture->level_count)
464}

Referenced by draw_primitive().

◆ wined3d_rendertarget_view_validate_location()

void wined3d_rendertarget_view_validate_location ( struct wined3d_rendertarget_view view,
DWORD  location 
)

Definition at line 486 of file view.c.

487{
488 struct wined3d_resource *resource = view->resource;
489 unsigned int i, sub_resource_idx, layer_count;
490 struct wined3d_texture *texture;
491
492 if (resource->type == WINED3D_RTYPE_BUFFER)
493 {
494 FIXME("Not implemented for resources %s.\n", debug_d3dresourcetype(resource->type));
495 return;
496 }
497
499 sub_resource_idx = view->sub_resource_idx;
500 layer_count = resource->type != WINED3D_RTYPE_TEXTURE_3D ? view->layer_count : 1;
501 for (i = 0; i < layer_count; ++i, sub_resource_idx += texture->level_count)
503}

Referenced by draw_primitive().

◆ wined3d_resource_access_is_managed()

◆ wined3d_resource_acquire()

◆ wined3d_resource_allocate_sysmem()

BOOL wined3d_resource_allocate_sysmem ( struct wined3d_resource resource)

Definition at line 487 of file resource.c.

488{
489 void **p;
490 SIZE_T align = RESOURCE_ALIGNMENT - 1 + sizeof(*p);
491 void *mem;
492
493 if (!(mem = heap_alloc_zero(resource->size + align)))
494 return FALSE;
495
496 p = (void **)(((ULONG_PTR)mem + align) & ~(RESOURCE_ALIGNMENT - 1)) - 1;
497 *p = mem;
498
499 resource->heap_memory = ++p;
500
501 return TRUE;
502}
int align(int length, int align)
Definition: dsound8.c:36
Definition: mem.c:156
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define RESOURCE_ALIGNMENT

Referenced by resource_init(), wined3d_buffer_prepare_location(), and wined3d_texture_prepare_location().

◆ wined3d_resource_decref()

static ULONG wined3d_resource_decref ( struct wined3d_resource resource)
inlinestatic

Definition at line 3085 of file wined3d_private.h.

3086{
3087 return resource->resource_ops->resource_decref(resource);
3088}

Referenced by wined3d_rendertarget_view_decref(), wined3d_shader_resource_view_decref(), and wined3d_unordered_access_view_decref().

◆ wined3d_resource_free_sysmem()

void wined3d_resource_free_sysmem ( struct wined3d_resource resource)

Definition at line 504 of file resource.c.

505{
506 void **p = resource->heap_memory;
507
508 if (!p)
509 return;
510
511 heap_free(*(--p));
512 resource->heap_memory = NULL;
513}

Referenced by resource_init(), texture1d_init(), volumetexture_init(), wined3d_buffer_evict_sysmem(), wined3d_resource_destroy_object(), wined3d_texture_evict_sysmem(), and wined3d_texture_update_desc().

◆ wined3d_resource_gl_legacy_map_flags()

GLenum wined3d_resource_gl_legacy_map_flags ( DWORD  d3d_flags)

Definition at line 532 of file resource.c.

533{
534 switch (d3d_flags & (WINED3D_MAP_READ | WINED3D_MAP_WRITE))
535 {
536 case WINED3D_MAP_READ:
537 return GL_READ_ONLY_ARB;
538
540 return GL_WRITE_ONLY_ARB;
541
542 default:
543 return GL_READ_WRITE_ARB;
544 }
545}
#define GL_WRITE_ONLY_ARB
Definition: glext.h:1501
#define GL_READ_WRITE_ARB
Definition: glext.h:1502
#define GL_READ_ONLY_ARB
Definition: glext.h:1500

Referenced by context_map_bo_address().

◆ wined3d_resource_gl_map_flags()

GLbitfield wined3d_resource_gl_map_flags ( DWORD  d3d_flags)

Definition at line 515 of file resource.c.

516{
517 GLbitfield ret = 0;
518
519 if (d3d_flags & WINED3D_MAP_WRITE)
521 if (d3d_flags & WINED3D_MAP_READ)
523
524 if (d3d_flags & WINED3D_MAP_DISCARD)
526 if (d3d_flags & WINED3D_MAP_NOOVERWRITE)
528
529 return ret;
530}
#define GL_MAP_READ_BIT
Definition: glext.h:1793
#define GL_MAP_FLUSH_EXPLICIT_BIT
Definition: glext.h:1797
#define GL_MAP_UNSYNCHRONIZED_BIT
Definition: glext.h:1798
#define GL_MAP_WRITE_BIT
Definition: glext.h:1794
#define GL_MAP_INVALIDATE_BUFFER_BIT
Definition: glext.h:1796
#define WINED3D_MAP_DISCARD
Definition: wined3d.h:935
#define WINED3D_MAP_NOOVERWRITE
Definition: wined3d.h:934

Referenced by context_map_bo_address(), and wined3d_buffer_map().

◆ wined3d_resource_incref()

static ULONG wined3d_resource_incref ( struct wined3d_resource resource)
inlinestatic

Definition at line 3080 of file wined3d_private.h.

3081{
3082 return resource->resource_ops->resource_incref(resource);
3083}

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

◆ wined3d_resource_is_offscreen()

BOOL wined3d_resource_is_offscreen ( struct wined3d_resource resource)

Definition at line 547 of file resource.c.

548{
549 struct wined3d_swapchain *swapchain;
550
551 /* Only 2D texture resources can be onscreen. */
553 return TRUE;
554
555 /* Not on a swapchain - must be offscreen */
556 if (!(swapchain = texture_from_resource(resource)->swapchain))
557 return TRUE;
558
559 /* The front buffer is always onscreen */
560 if (resource == &swapchain->front_buffer->resource)
561 return FALSE;
562
563 /* If the swapchain is rendered to an FBO, the backbuffer is
564 * offscreen, otherwise onscreen */
565 return swapchain->render_to_fbo;
566}

Referenced by arbfp_blitter_blit(), context_apply_clear_state(), context_create(), context_setup_target(), fb_copy_to_texture_direct(), fb_copy_to_texture_hwstretch(), read_from_framebuffer(), surface_load_drawable(), surface_load_fb_texture(), surface_load_texture(), texture1d_prepare_texture(), texture2d_prepare_texture(), wined3d_resource_update_draw_binding(), wined3d_surface_blt(), and wined3d_surface_upload_data().

◆ wined3d_resource_release()

◆ wined3d_resource_update_draw_binding()

void wined3d_resource_update_draw_binding ( struct wined3d_resource resource)

Definition at line 568 of file resource.c.

569{
571 {
572 resource->draw_binding = WINED3D_LOCATION_DRAWABLE;
573 }
574 else if (resource->multisample_type)
575 {
576 const struct wined3d_gl_info *gl_info = &resource->device->adapter->gl_info;
579 else
581 }
582 else if (resource->gl_type == WINED3D_GL_RES_TYPE_RB)
583 {
585 }
586 else
587 {
589 }
590}

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

◆ wined3d_resource_wait_idle()

static void wined3d_resource_wait_idle ( struct wined3d_resource resource)
inlinestatic

Definition at line 3683 of file wined3d_private.h.

3684{
3685 const struct wined3d_cs *cs = resource->device->cs;
3686
3687 if (!cs->thread || cs->thread_id == GetCurrentThreadId())
3688 return;
3689
3690 while (InterlockedCompareExchange(&resource->access_count, 0, 0))
3691 wined3d_pause();
3692}

Referenced by buffer_init(), wined3d_cs_emit_update_sub_resource(), wined3d_device_update_sub_resource(), wined3d_resource_map(), wined3d_texture_cleanup_sync(), wined3d_texture_decref(), wined3d_texture_set_lod(), and wined3d_texture_update_desc().

◆ wined3d_sampler_bind()

void wined3d_sampler_bind ( struct wined3d_sampler sampler,
unsigned int  unit,
struct wined3d_texture texture,
const struct wined3d_context context 
)

Definition at line 184 of file sampler.c.

186{
187 const struct wined3d_gl_info *gl_info = context->gl_info;
188
189 if (gl_info->supported[ARB_SAMPLER_OBJECTS])
190 {
191 GL_EXTCALL(glBindSampler(unit, sampler->name));
192 checkGLcall("bind sampler");
193 }
194 else if (texture)
195 {
197 }
198 else
199 {
200 ERR("Could not apply sampler state.\n");
201 }
202
203 if (texture)
204 texture_apply_base_level(texture, &sampler->desc, gl_info);
205}
void wined3d_texture_apply_sampler_desc(struct wined3d_texture *texture, const struct wined3d_sampler_desc *sampler_desc, const struct wined3d_context *context)
Definition: texture.c:896
static void texture_apply_base_level(struct wined3d_texture *texture, const struct wined3d_sampler_desc *desc, const struct wined3d_gl_info *gl_info)
Definition: sampler.c:158

Referenced by sampler(), and wined3d_shader_resource_view_bind().

◆ wined3d_sanitize_cmp_func()

static enum wined3d_cmp_func wined3d_sanitize_cmp_func ( enum wined3d_cmp_func  func)
inlinestatic

Definition at line 293 of file wined3d_private.h.

294{
295 if (func < WINED3D_CMP_NEVER || func > WINED3D_CMP_ALWAYS)
296 return WINED3D_CMP_ALWAYS;
297 return func;
298}
GLenum func
Definition: glext.h:6028

Referenced by find_ps_compile_args(), and gen_ffp_frag_op().

◆ wined3d_shader_instruction_has_texel_offset()

static BOOL wined3d_shader_instruction_has_texel_offset ( const struct wined3d_shader_instruction ins)
inlinestatic

Definition at line 1246 of file wined3d_private.h.

1247{
1248 return ins->texel_offset.u || ins->texel_offset.v || ins->texel_offset.w;
1249}
struct wined3d_shader_texel_offset texel_offset

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

◆ wined3d_shader_resource_view_bind()

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

Definition at line 807 of file view.c.

809{
810 const struct wined3d_gl_info *gl_info = context->gl_info;
811 struct wined3d_texture *texture;
812
814
815 if (view->gl_view.name)
816 {
817 context_bind_texture(context, view->gl_view.target, view->gl_view.name);
819 return;
820 }
821
822 if (view->resource->type == WINED3D_RTYPE_BUFFER)
823 {
824 FIXME("Buffer shader resources not supported.\n");
825 return;
826 }
827
831}
void wined3d_texture_bind(struct wined3d_texture *texture, struct wined3d_context *context, BOOL srgb)
Definition: texture.c:729
void wined3d_sampler_bind(struct wined3d_sampler *sampler, unsigned int unit, struct wined3d_texture *texture, const struct wined3d_context *context)
Definition: sampler.c:184

Referenced by context_bind_shader_resources().

◆ wined3d_state_enable_light()

void wined3d_state_enable_light ( struct wined3d_state state,
const struct wined3d_d3d_info d3d_info,
struct wined3d_light_info light_info,
BOOL  enable 
)

Definition at line 582 of file stateblock.c.

584{
585 unsigned int light_count, i;
586
587 if (!(light_info->enabled = enable))
588 {
589 if (light_info->glIndex == -1)
590 {
591 TRACE("Light already disabled, nothing to do.\n");
592 return;
593 }
594
595 state->lights[light_info->glIndex] = NULL;
596 light_info->glIndex = -1;
597 return;
598 }
599
600 if (light_info->glIndex != -1)
601 {
602 TRACE("Light already enabled, nothing to do.\n");
603 return;
604 }
605
606 /* Find a free light. */
607 light_count = d3d_info->limits.active_light_count;
608 for (i = 0; i < light_count; ++i)
609 {
610 if (state->lights[i])
611 continue;
612
613 state->lights[i] = light_info;
614 light_info->glIndex = i;
615 return;
616 }
617
618 /* Our tests show that Windows returns D3D_OK in this situation, even with
619 * D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE devices.
620 * This is consistent among ddraw, d3d8 and d3d9. GetLightEnable returns
621 * TRUE * as well for those lights.
622 *
623 * TODO: Test how this affects rendering. */
624 WARN("Too many concurrently active lights.\n");
625}

Referenced by wined3d_cs_exec_set_light_enable(), and wined3d_device_set_light_enable().

◆ wined3d_state_get_light()

struct wined3d_light_info * wined3d_state_get_light ( const struct wined3d_state state,
unsigned int  idx 
)

Definition at line 567 of file stateblock.c.

568{
569 struct wined3d_light_info *light_info;
570 unsigned int hash_idx;
571
572 hash_idx = LIGHTMAP_HASHFUNC(idx);
573 LIST_FOR_EACH_ENTRY(light_info, &state->light_map[hash_idx], struct wined3d_light_info, entry)
574 {
575 if (light_info->OriginalIndex == idx)
576 return light_info;
577 }
578
579 return NULL;
580}
#define LIGHTMAP_HASHFUNC(x)

Referenced by wined3d_cs_exec_set_light(), wined3d_cs_exec_set_light_enable(), wined3d_device_get_light(), wined3d_device_get_light_enable(), wined3d_device_set_light(), and wined3d_device_set_light_enable().

◆ 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_gl_info gl_info,
const struct wined3d_d3d_info d3d_info 
)

Definition at line 3523 of file context.c.

3526{
3527 /* We need to deal with frequency data! */
3528 struct wined3d_vertex_declaration *declaration = state->vertex_declaration;
3529 BOOL generic_attributes = d3d_info->ffp_generic_attributes;
3530 BOOL use_vshader = use_vs(state);
3531 unsigned int i;
3532
3533 stream_info->use_map = 0;
3534 stream_info->swizzle_map = 0;
3535 stream_info->position_transformed = 0;
3536
3537 if (!declaration)
3538 return;
3539
3540 stream_info->position_transformed = declaration->position_transformed;
3541
3542 /* Translate the declaration into strided data. */
3543 for (i = 0; i < declaration->element_count; ++i)
3544 {
3545 const struct wined3d_vertex_declaration_element *element = &declaration->elements[i];
3546 const struct wined3d_stream_state *stream = &state->streams[element->input_slot];
3547 BOOL stride_used;
3548 unsigned int idx;
3549
3550 TRACE("%p Element %p (%u of %u).\n", declaration->elements,
3551 element, i + 1, declaration->element_count);
3552
3553 if (!stream->buffer)
3554 continue;
3555
3556 TRACE("offset %u input_slot %u usage_idx %d.\n", element->offset, element->input_slot, element->usage_idx);
3557
3558 if (use_vshader)
3559 {
3560 if (element->output_slot == WINED3D_OUTPUT_SLOT_UNUSED)
3561 {
3562 stride_used = FALSE;
3563 }
3564 else if (element->output_slot == WINED3D_OUTPUT_SLOT_SEMANTIC)
3565 {
3566 /* TODO: Assuming vertexdeclarations are usually used with the
3567 * same or a similar shader, it might be worth it to store the
3568 * last used output slot and try that one first. */
3569 stride_used = vshader_get_input(state->shader[WINED3D_SHADER_TYPE_VERTEX],
3570 element->usage, element->usage_idx, &idx);
3571 }
3572 else
3573 {
3574 idx = element->output_slot;
3575 stride_used = TRUE;
3576 }
3577 }
3578 else
3579 {
3580 if (!generic_attributes && !element->ffp_valid)
3581 {
3582 WARN("Skipping unsupported fixed function element of format %s and usage %s.\n",
3583 debug_d3dformat(element->format->id), debug_d3ddeclusage(element->usage));
3584 stride_used = FALSE;
3585 }
3586 else
3587 {
3588 stride_used = fixed_get_input(element->usage, element->usage_idx, &idx);
3589 }
3590 }
3591
3592 if (stride_used)
3593 {
3594 TRACE("Load %s array %u [usage %s, usage_idx %u, "
3595 "input_slot %u, offset %u, stride %u, format %s, class %s, step_rate %u].\n",
3596 use_vshader ? "shader": "fixed function", idx,
3597 debug_d3ddeclusage(element->usage), element->usage_idx, element->input_slot,
3598 element->offset, stream->stride, debug_d3dformat(element->format->id),
3599 debug_d3dinput_classification(element->input_slot_class), element->instance_data_step_rate);
3600
3601 stream_info->elements[idx].format = element->format;
3602 stream_info->elements[idx].data.buffer_object = 0;
3603 stream_info->elements[idx].data.addr = (BYTE *)NULL + stream->offset + element->offset;
3604 stream_info->elements[idx].stride = stream->stride;
3605 stream_info->elements[idx].stream_idx = element->input_slot;
3607 {
3608 stream_info->elements[idx].divisor = 1;
3609 }
3610 else if (element->input_slot_class == WINED3D_INPUT_PER_INSTANCE_DATA)
3611 {
3612 stream_info->elements[idx].divisor = element->instance_data_step_rate;
3613 if (!element->instance_data_step_rate)
3614 FIXME("Instance step rate 0 not implemented.\n");
3615 }
3616 else
3617 {
3618 stream_info->elements[idx].divisor = 0;
3619 }
3620
3621 if (!gl_info->supported[ARB_VERTEX_ARRAY_BGRA]
3622 && element->format->id == WINED3DFMT_B8G8R8A8_UNORM)
3623 {
3624 stream_info->swizzle_map |= 1u << idx;
3625 }
3626 stream_info->use_map |= 1u << idx;
3627 }
3628 }
3629}
static BOOL fixed_get_input(BYTE usage, BYTE usage_idx, unsigned int *regnum)
Definition: context.c:3494
BOOL vshader_get_input(const struct wined3d_shader *shader, BYTE usage_req, BYTE usage_idx_req, unsigned int *regnum)
Definition: shader.c:3510
const char * debug_d3dinput_classification(enum wined3d_input_classification classification)
Definition: utils.c:4315
const char * debug_d3ddeclusage(enum wined3d_decl_usage usage)
Definition: utils.c:4289
Definition: parse.h:23
#define WINED3DSTREAMSOURCE_INSTANCEDATA
Definition: wined3d.h:1003
#define WINED3D_OUTPUT_SLOT_UNUSED
Definition: wined3d.h:1567
#define WINED3D_OUTPUT_SLOT_SEMANTIC
Definition: wined3d.h:1566

Referenced by context_update_stream_info(), and wined3d_device_process_vertices().

◆ wined3d_surface_blt()

HRESULT wined3d_surface_blt ( struct wined3d_surface dst_surface,
const RECT dst_rect,
struct wined3d_surface src_surface,
const RECT src_rect,
DWORD  flags,
const struct wined3d_blt_fx blt_fx,
enum wined3d_texture_filter_type  filter 
)

Definition at line 3998 of file surface.c.

4001{
4002 struct wined3d_box dst_box = {dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, 0, 1};
4003 struct wined3d_box src_box = {src_rect->left, src_rect->top, src_rect->right, src_rect->bottom, 0, 1};
4004 unsigned int dst_sub_resource_idx = surface_get_sub_resource_idx(dst_surface);
4005 unsigned int src_sub_resource_idx = surface_get_sub_resource_idx(src_surface);
4006 struct wined3d_texture_sub_resource *src_sub_resource, *dst_sub_resource;
4007 struct wined3d_texture *dst_texture = dst_surface->container;
4008 struct wined3d_texture *src_texture = src_surface->container;
4009 struct wined3d_device *device = dst_texture->resource.device;
4010 struct wined3d_swapchain *src_swapchain, *dst_swapchain;
4011 const struct wined3d_color_key *colour_key = NULL;
4012 DWORD dst_location, valid_locations;
4013 DWORD src_ds_flags, dst_ds_flags;
4014 struct wined3d_context *context;
4015 enum wined3d_blit_op blit_op;
4016 BOOL scale, convert, resolve;
4017
4018 static const DWORD simple_blit = WINED3D_BLT_SRC_CKEY
4022
4023 TRACE("dst_surface %p, dst_rect %s, src_surface %p, src_rect %s, flags %#x, fx %p, filter %s.\n",
4024 dst_surface, wine_dbgstr_rect(dst_rect), src_surface, wine_dbgstr_rect(src_rect),
4026 TRACE("Usage is %s.\n", debug_d3dusage(dst_texture->resource.usage));
4027
4028 if (fx)
4029 {
4030 TRACE("fx %#x.\n", fx->fx);
4031 TRACE("dst_color_key {0x%08x, 0x%08x}.\n",
4032 fx->dst_color_key.color_space_low_value,
4033 fx->dst_color_key.color_space_high_value);
4034 TRACE("src_color_key {0x%08x, 0x%08x}.\n",
4035 fx->src_color_key.color_space_low_value,
4036 fx->src_color_key.color_space_high_value);
4037 }
4038
4039 if (!fx || !(fx->fx))
4040 flags &= ~WINED3D_BLT_FX;
4041
4042 /* WINED3D_BLT_DO_NOT_WAIT appeared in DX7. */
4044 {
4045 static unsigned int once;
4046
4047 if (!once++)
4048 FIXME("Can't handle WINED3D_BLT_DO_NOT_WAIT flag.\n");
4049 }
4050
4052
4053 if (!device->d3d_initialized)
4054 {
4055 WARN("D3D not initialized, using fallback.\n");
4056 goto cpu;
4057 }
4058
4059 /* We want to avoid invalidating the sysmem location for converted
4060 * surfaces, since otherwise we'd have to convert the data back when
4061 * locking them. */
4062 if (dst_texture->flags & WINED3D_TEXTURE_CONVERTED || dst_texture->resource.format->conv_byte_count
4064 {
4065 WARN_(d3d_perf)("Converted surface, using CPU blit.\n");
4066 goto cpu;
4067 }
4068
4069 if (flags & ~simple_blit)
4070 {
4071 WARN_(d3d_perf)("Using fallback for complex blit (%#x).\n", flags);
4072 goto fallback;
4073 }
4074
4075 src_swapchain = src_texture->swapchain;
4076 dst_swapchain = dst_texture->swapchain;
4077
4078 /* This isn't strictly needed. FBO blits for example could deal with
4079 * cross-swapchain blits by first downloading the source to a texture
4080 * before switching to the destination context. We just have this here to
4081 * not have to deal with the issue, since cross-swapchain blits should be
4082 * rare. */
4083 if (src_swapchain && dst_swapchain && src_swapchain != dst_swapchain)
4084 {
4085 FIXME("Using fallback for cross-swapchain blit.\n");
4086 goto fallback;
4087 }
4088
4089 scale = src_rect->right - src_rect->left != dst_rect->right - dst_rect->left
4090 || src_rect->bottom - src_rect->top != dst_rect->bottom - dst_rect->top;
4091 convert = src_texture->resource.format->id != dst_texture->resource.format->id;
4092 resolve = src_texture->resource.multisample_type != dst_texture->resource.multisample_type;
4093
4094 dst_ds_flags = dst_texture->resource.format_flags
4096 src_ds_flags = src_texture->resource.format_flags
4098
4099 if (src_ds_flags || dst_ds_flags)
4100 {
4101 TRACE("Depth/stencil blit.\n");
4102
4103 if (dst_texture->resource.access & WINED3D_RESOURCE_ACCESS_GPU)
4104 dst_location = dst_texture->resource.draw_binding;
4105 else
4106 dst_location = dst_texture->resource.map_binding;
4107
4108 context = context_acquire(device, dst_texture, dst_sub_resource_idx);
4109 valid_locations = device->blitter->ops->blitter_blit(device->blitter,
4111 src_surface, src_texture->resource.draw_binding, src_rect,
4112 dst_surface, dst_location, dst_rect, NULL, filter);
4114
4115 wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, valid_locations);
4116 wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~valid_locations);
4117
4118 return WINED3D_OK;
4119 }
4120
4121 TRACE("Colour blit.\n");
4122
4123 dst_sub_resource = &dst_texture->sub_resources[dst_sub_resource_idx];
4124 src_sub_resource = &src_texture->sub_resources[src_sub_resource_idx];
4125
4126 /* In principle this would apply to depth blits as well, but we don't
4127 * implement those in the CPU blitter at the moment. */
4128 if ((dst_sub_resource->locations & dst_texture->resource.map_binding)
4129 && (src_sub_resource->locations & src_texture->resource.map_binding))
4130 {
4131 if (scale)
4132 TRACE("Not doing sysmem blit because of scaling.\n");
4133 else if (convert)
4134 TRACE("Not doing sysmem blit because of format conversion.\n");
4135 else
4136 goto cpu;
4137 }
4138
4141 {
4142 colour_key = &fx->src_color_key;
4144 }
4145 else if (flags & WINED3D_BLT_SRC_CKEY)
4146 {
4147 colour_key = &src_texture->async.src_blt_color_key;
4149 }
4150 else if (flags & WINED3D_BLT_ALPHA_TEST)
4151 {
4153 }
4154 else if ((src_sub_resource->locations & surface_simple_locations)
4155 && !(dst_sub_resource->locations & surface_simple_locations))
4156 {
4157 /* Upload */
4158 if (scale)
4159 TRACE("Not doing upload because of scaling.\n");
4160 else if (convert)
4161 TRACE("Not doing upload because of format conversion.\n");
4162 else if (dst_texture->resource.format->conv_byte_count)
4163 TRACE("Not doing upload because the destination format needs conversion.\n");
4164 else
4165 {
4166 POINT dst_point = {dst_rect->left, dst_rect->top};
4167
4168 if (SUCCEEDED(surface_upload_from_surface(dst_surface, &dst_point, src_surface, src_rect)))
4169 {
4170 if (!wined3d_resource_is_offscreen(&dst_texture->resource))
4171 {
4172 context = context_acquire(device, dst_texture, dst_sub_resource_idx);
4173 wined3d_texture_load_location(dst_texture, dst_sub_resource_idx,
4174 context, dst_texture->resource.draw_binding);
4176 }
4177 return WINED3D_OK;
4178 }
4179 }
4180 }
4181 else if (dst_swapchain && dst_swapchain->back_buffers
4182 && dst_texture == dst_swapchain->front_buffer
4183 && src_texture == dst_swapchain->back_buffers[0])
4184 {
4185 /* Use present for back -> front blits. The idea behind this is that
4186 * present is potentially faster than a blit, in particular when FBO
4187 * blits aren't available. Some ddraw applications like Half-Life and
4188 * Prince of Persia 3D use Blt() from the backbuffer to the
4189 * frontbuffer instead of doing a Flip(). D3d8 and d3d9 applications
4190 * can't blit directly to the frontbuffer. */
4191 enum wined3d_swap_effect swap_effect = dst_swapchain->desc.swap_effect;
4192
4193 TRACE("Using present for backbuffer -> frontbuffer blit.\n");
4194
4195 /* Set the swap effect to COPY, we don't want the backbuffer to become
4196 * undefined. */
4197 dst_swapchain->desc.swap_effect = WINED3D_SWAP_EFFECT_COPY;
4198 wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, 0, 0);
4199 dst_swapchain->desc.swap_effect = swap_effect;
4200
4201 return WINED3D_OK;
4202 }
4203 else if ((flags & WINED3D_BLT_RAW) || (!scale && !convert && !resolve))
4204 {
4205 blit_op = WINED3D_BLIT_OP_RAW_BLIT;
4206 }
4207
4208 if (dst_texture->resource.access & WINED3D_RESOURCE_ACCESS_GPU)
4209 dst_location = dst_texture->resource.draw_binding;
4210 else
4211 dst_location = dst_texture->resource.map_binding;
4212
4213 context = context_acquire(device, dst_texture, dst_sub_resource_idx);
4214 valid_locations = device->blitter->ops->blitter_blit(device->blitter, blit_op, context,
4215 src_surface, src_texture->resource.draw_binding, src_rect,
4216 dst_surface, dst_location, dst_rect, colour_key, filter);
4218
4219 wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, valid_locations);
4220 wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~valid_locations);
4221
4222 return WINED3D_OK;
4223
4224fallback:
4225 /* Special cases for render targets. */
4226 if (SUCCEEDED(surface_blt_special(dst_surface, dst_rect, src_surface, src_rect, flags, fx, filter)))
4227 return WINED3D_OK;
4228
4229cpu:
4230 return surface_cpu_blt(dst_texture, dst_sub_resource_idx, &dst_box,
4231 src_texture, src_sub_resource_idx, &src_box, flags, fx, filter);
4232}
static const DWORD surface_simple_locations
Definition: surface.c:36
static HRESULT surface_blt_special(struct wined3d_surface *dst_surface, const RECT *dst_rect, struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
Definition: surface.c:2187
static HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, struct wined3d_surface *src_surface, const RECT *src_rect)
Definition: surface.c:927
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, DWORD flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
Definition: surface.c:3298
const char * debug_d3dusage(DWORD usage)
Definition: utils.c:4217
const struct wined3d_color_key_conversion * wined3d_format_get_color_key_conversion(const struct wined3d_texture *texture, BOOL need_alpha_ck)
Definition: utils.c:1046
const char * debug_d3dtexturefiltertype(enum wined3d_texture_filter_type filter_type)
Definition: utils.c:4539
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
#define SUCCEEDED(hr)
Definition: intsafe.h:50
int convert
Definition: msacm.c:1374
struct wined3d_swapchain * swapchain
struct wined3d_texture::wined3d_texture_async async
HRESULT CDECL wined3d_swapchain_present(struct wined3d_swapchain *swapchain, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, DWORD swap_interval, DWORD flags)
Definition: swapchain.c:152
#define WINED3D_BLT_ALPHA_TEST
Definition: wined3d.h:1368
wined3d_swap_effect
Definition: wined3d.h:524
@ WINED3D_SWAP_EFFECT_COPY
Definition: wined3d.h:529
#define WINED3D_BLT_SRC_CKEY
Definition: wined3d.h:1362
#define WINED3D_BLT_SRC_CKEY_OVERRIDE
Definition: wined3d.h:1363
#define WINED3D_BLT_DO_NOT_WAIT
Definition: wined3d.h:1365
#define WINED3D_BLT_WAIT
Definition: wined3d.h:1364
#define WINED3D_BLT_RAW
Definition: wined3d.h:1366
#define WINED3D_TEXTURE_CONVERTED
wined3d_blit_op

Referenced by wined3d_cs_exec_blt_sub_resource().

◆ wined3d_surface_upload_data()

void wined3d_surface_upload_data ( struct wined3d_surface surface,
const struct wined3d_gl_info gl_info,
const struct wined3d_format format,
const RECT src_rect,
UINT  src_pitch,
const POINT dst_point,
BOOL  srgb,
const struct wined3d_const_bo_address data 
)

Definition at line 779 of file surface.c.

782{
783 unsigned int sub_resource_idx = surface_get_sub_resource_idx(surface);
784 struct wined3d_texture *texture = surface->container;
785 UINT update_w = src_rect->right - src_rect->left;
786 UINT update_h = src_rect->bottom - src_rect->top;
787 unsigned int level, layer;
789
790 TRACE("surface %p, gl_info %p, format %s, src_rect %s, src_pitch %u, dst_point %s, srgb %#x, data {%#x:%p}.\n",
791 surface, gl_info, debug_d3dformat(format->id), wine_dbgstr_rect(src_rect), src_pitch,
792 wine_dbgstr_point(dst_point), srgb, data->buffer_object, data->addr);
793
794 if (texture->sub_resources[sub_resource_idx].map_count)
795 {
796 WARN("Uploading a surface that is currently mapped, setting WINED3D_TEXTURE_PIN_SYSMEM.\n");
798 }
799
801 {
802 update_h *= format->height_scale.numerator;
803 update_h /= format->height_scale.denominator;
804 }
805
806 if (data->buffer_object)
807 {
808 GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, data->buffer_object));
809 checkGLcall("glBindBuffer");
810 }
811
813 level = sub_resource_idx % texture->level_count;
814 layer = sub_resource_idx / texture->level_count;
815
817 {
818 unsigned int dst_row_pitch, dst_slice_pitch;
819 const BYTE *addr = data->addr;
821
822 addr += (src_rect->top / format->block_height) * src_pitch;
823 addr += (src_rect->left / format->block_width) * format->block_byte_count;
824
825 if (srgb)
826 internal = format->glGammaInternal;
827 else if (texture->resource.usage & WINED3DUSAGE_RENDERTARGET
829 internal = format->rtInternal;
830 else
831 internal = format->glInternal;
832
833 wined3d_format_calculate_pitch(format, 1, update_w, update_h, &dst_row_pitch, &dst_slice_pitch);
834
835 TRACE("Uploading compressed data, target %#x, level %u, layer %u, x %d, y %d, w %u, h %u, "
836 "format %#x, image_size %#x, addr %p.\n",
837 target, level, layer, dst_point->x, dst_point->y,
838 update_w, update_h, internal, dst_slice_pitch, addr);
839
840 if (dst_row_pitch == src_pitch)
841 {
843 {
844 GL_EXTCALL(glCompressedTexSubImage3D(target, level, dst_point->x, dst_point->y,
845 layer, update_w, update_h, 1, internal, dst_slice_pitch, addr));
846 }
847 else
848 {
849 GL_EXTCALL(glCompressedTexSubImage2D(target, level, dst_point->x, dst_point->y,
850 update_w, update_h, internal, dst_slice_pitch, addr));
851 }
852 }
853 else
854 {
855 UINT row_count = (update_h + format->block_height - 1) / format->block_height;
856 UINT row, y;
857
858 /* glCompressedTexSubImage2D() ignores pixel store state, so we
859 * can't use the unpack row length like for glTexSubImage2D. */
860 for (row = 0, y = dst_point->y; row < row_count; ++row)
861 {
863 {
865 layer, update_w, format->block_height, 1, internal, dst_row_pitch, addr));
866 }
867 else
868 {
870 update_w, format->block_height, internal, dst_row_pitch, addr));
871 }
872
873 y += format->block_height;
874 addr += src_pitch;
875 }
876 }
877 checkGLcall("Upload compressed surface data");
878 }
879 else
880 {
881 const BYTE *addr = data->addr;
882
883 addr += src_rect->top * src_pitch;
884 addr += src_rect->left * format->byte_count;
885
886 TRACE("Uploading data, target %#x, level %u, layer %u, x %d, y %d, w %u, h %u, "
887 "format %#x, type %#x, addr %p.\n",
888 target, level, layer, dst_point->x, dst_point->y,
889 update_w, update_h, format->glFormat, format->glType, addr);
890
891 gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ROW_LENGTH, src_pitch / format->byte_count);
893 {
894 GL_EXTCALL(glTexSubImage3D(target, level, dst_point->x, dst_point->y,
895 layer, update_w, update_h, 1, format->glFormat, format->glType, addr));
896 }
897 else
898 {
899 gl_info->gl_ops.gl.p_glTexSubImage2D(target, level, dst_point->x, dst_point->y,
900 update_w, update_h, format->glFormat, format->glType, addr);
901 }
902 gl_info->gl_ops.gl.p_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
903 checkGLcall("Upload surface data");
904 }
905
906 if (data->buffer_object)
907 {
908 GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
909 checkGLcall("glBindBuffer");
910 }
911
913 gl_info->gl_ops.gl.p_glFlush();
914
916 {
917 struct wined3d_device *device = texture->resource.device;
918 unsigned int i;
919
920 for (i = 0; i < device->context_count; ++i)
921 {
922 context_surface_update(device->contexts[i], surface);
923 }
924 }
925}
ios_base &_STLP_CALL internal(ios_base &__s)
Definition: _ios_base.h:311
static const char * wine_dbgstr_point(const POINT *ppt)
Definition: atltest.h:138
void context_surface_update(struct wined3d_context *context, const struct wined3d_surface *surface)
Definition: context.c:1110
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
GLAPI void GLAPIENTRY glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)
GLAPI void GLAPIENTRY glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
GLAPI void GLAPIENTRY glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
#define GL_UNPACK_ROW_LENGTH
Definition: gl.h:634
GLenum const GLvoid * addr
Definition: glext.h:9621
#define GL_PIXEL_UNPACK_BUFFER
Definition: glext.h:477
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define WINED3D_TEXTURE_PIN_SYSMEM
#define WINED3D_QUIRK_FBO_TEX_UPDATE
#define WINED3DFMT_FLAG_COMPRESSED

Referenced by surface_convert_format(), surface_load_texture(), surface_upload_from_surface(), and texture2d_upload_data().

◆ wined3d_swapchain_activate()

void wined3d_swapchain_activate ( struct wined3d_swapchain swapchain,
BOOL  activate 
)

Definition at line 1149 of file swapchain.c.

1150{
1151 struct wined3d_device *device = swapchain->device;
1152 BOOL filter_messages = device->filter_messages;
1153
1154 /* This code is not protected by the wined3d mutex, so it may run while
1155 * wined3d_device_reset is active. Testing on Windows shows that changing
1156 * focus during resets and resetting during focus change events causes
1157 * the application to crash with an invalid memory access. */
1158
1159 device->filter_messages = !(device->wined3d->flags & WINED3D_FOCUS_MESSAGES);
1160
1161 if (activate)
1162 {
1163 if (!(device->create_parms.flags & WINED3DCREATE_NOWINDOWCHANGES))
1164 {
1165 /* The d3d versions do not agree on the exact messages here. D3d8 restores
1166 * the window but leaves the size untouched, d3d9 sets the size on an
1167 * invisible window, generates messages but doesn't change the window
1168 * properties. The implementation follows d3d9.
1169 *
1170 * Guild Wars 1 wants a WINDOWPOSCHANGED message on the device window to
1171 * resume drawing after a focus loss. */
1172 SetWindowPos(swapchain->device_window, NULL, 0, 0,
1173 swapchain->desc.backbuffer_width, swapchain->desc.backbuffer_height,
1175 }
1176
1177 if (device->wined3d->flags & WINED3D_RESTORE_MODE_ON_ACTIVATE)
1178 {
1180 device->adapter->ordinal, &swapchain->d3d_mode)))
1181 ERR("Failed to set display mode.\n");
1182 }
1183 }
1184 else
1185 {
1187 device->adapter->ordinal, NULL)))
1188 ERR("Failed to set display mode.\n");
1189
1190 swapchain->reapply_mode = TRUE;
1191
1192 if (!(device->create_parms.flags & WINED3DCREATE_NOWINDOWCHANGES)
1193 && IsWindowVisible(swapchain->device_window))
1195 }
1196
1197 device->filter_messages = filter_messages;
1198}
struct wined3d_display_mode original_mode d3d_mode
HRESULT CDECL wined3d_set_adapter_display_mode(struct wined3d *wined3d, UINT adapter_idx, const struct wined3d_display_mode *mode)
Definition: directx.c:4840
#define WINED3D_RESTORE_MODE_ON_ACTIVATE
Definition: wined3d.h:1319
#define WINED3DCREATE_NOWINDOWCHANGES
Definition: wined3d.h:1017
#define WINED3D_FOCUS_MESSAGES
Definition: wined3d.h:1320
#define SWP_NOACTIVATE
Definition: winuser.h:1242
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SW_MINIMIZE
Definition: winuser.h:776
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOZORDER
Definition: winuser.h:1247
BOOL WINAPI IsWindowVisible(_In_ HWND)

Referenced by device_process_message().

◆ wined3d_texture_apply_sampler_desc()

void wined3d_texture_apply_sampler_desc ( struct wined3d_texture texture,
const struct wined3d_sampler_desc sampler_desc,
const struct wined3d_context context 
)

Definition at line 896 of file texture.c.

898{
899 const struct wined3d_gl_info *gl_info = context->gl_info;
900 GLenum target = texture->target;
901 struct gl_texture *gl_tex;
902 DWORD state;
903
904 TRACE("texture %p, sampler_desc %p, context %p.\n", texture, sampler_desc, context);
905
907
908 state = sampler_desc->address_u;
909 if (state != gl_tex->sampler_desc.address_u)
910 {
911 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_WRAP_S,
913 gl_tex->sampler_desc.address_u = state;
914 }
915
916 state = sampler_desc->address_v;
917 if (state != gl_tex->sampler_desc.address_v)
918 {
919 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_WRAP_T,
921 gl_tex->sampler_desc.address_v = state;
922 }
923
924 state = sampler_desc->address_w;
925 if (state != gl_tex->sampler_desc.address_w)
926 {
927 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_WRAP_R,
929 gl_tex->sampler_desc.address_w = state;
930 }
931
932 if (memcmp(gl_tex->sampler_desc.border_color, sampler_desc->border_color,
933 sizeof(gl_tex->sampler_desc.border_color)))
934 {
935 gl_info->gl_ops.gl.p_glTexParameterfv(target, GL_TEXTURE_BORDER_COLOR, &sampler_desc->border_color[0]);
936 memcpy(gl_tex->sampler_desc.border_color, sampler_desc->border_color,
937 sizeof(gl_tex->sampler_desc.border_color));
938 }
939
940 state = sampler_desc->mag_filter;
941 if (state != gl_tex->sampler_desc.mag_filter)
942 {
943 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_MAG_FILTER, wined3d_gl_mag_filter(state));
944 gl_tex->sampler_desc.mag_filter = state;
945 }
946
947 if (sampler_desc->min_filter != gl_tex->sampler_desc.min_filter
948 || sampler_desc->mip_filter != gl_tex->sampler_desc.mip_filter)
949 {
950 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_MIN_FILTER,
951 wined3d_gl_min_mip_filter(sampler_desc->min_filter, sampler_desc->mip_filter));
952 gl_tex->sampler_desc.min_filter = sampler_desc->min_filter;
953 gl_tex->sampler_desc.mip_filter = sampler_desc->mip_filter;
954 }
955
956 state = sampler_desc->max_anisotropy;
957 if (state != gl_tex->sampler_desc.max_anisotropy)
958 {
960 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_MAX_ANISOTROPY, state);
961 else
962 WARN("Anisotropic filtering not supported.\n");
963 gl_tex->sampler_desc.max_anisotropy = state;
964 }
965
966 if (!sampler_desc->srgb_decode != !gl_tex->sampler_desc.srgb_decode
967 && (context->d3d_info->wined3d_creation_flags & WINED3D_SRGB_READ_WRITE_CONTROL)
969 {
970 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT,
972 gl_tex->sampler_desc.srgb_decode = sampler_desc->srgb_decode;
973 }
974
975 if (!sampler_desc->compare != !gl_tex->sampler_desc.compare)
976 {
977 if (sampler_desc->compare)
979 else
980 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_COMPARE_MODE_ARB, GL_NONE);
981 gl_tex->sampler_desc.compare = sampler_desc->compare;
982 }
983
984 checkGLcall("Texture parameter application");
985
986 if (gl_info->supported[EXT_TEXTURE_LOD_BIAS])
987 {
988 gl_info->gl_ops.gl.p_glTexEnvf(GL_TEXTURE_FILTER_CONTROL_EXT,
990 checkGLcall("glTexEnvf(GL_TEXTURE_LOD_BIAS_EXT, ...)");
991 }
992}
#define GL_TEXTURE_BORDER_COLOR
Definition: gl.h:656
#define GL_TEXTURE_WRAP_R
Definition: gl.h:1518
#define GL_DECODE_EXT
Definition: glext.h:5290
#define GL_TEXTURE_COMPARE_MODE_ARB
Definition: glext.h:1371
#define GL_TEXTURE_LOD_BIAS_EXT
Definition: glext.h:3362
#define GL_COMPARE_R_TO_TEXTURE_ARB
Definition: glext.h:1373
#define GL_TEXTURE_FILTER_CONTROL_EXT
Definition: glext.h:3361
GLint wrap_lookup[WINED3D_TADDRESS_MIRROR_ONCE - WINED3D_TADDRESS_WRAP+1]
#define GL_TEXTURE_MAX_ANISOTROPY
Definition: wgl.h:4357
@ WINED3D_TADDRESS_WRAP
Definition: wined3d.h:639
@ ARB_TEXTURE_FILTER_ANISOTROPIC
Definition: wined3d_gl.h:117
@ EXT_TEXTURE_LOD_BIAS
Definition: wined3d_gl.h:178

Referenced by wined3d_sampler_bind().

◆ wined3d_texture_bind()

void wined3d_texture_bind ( struct wined3d_texture texture,
struct wined3d_context context,
BOOL  srgb 
)

Definition at line 729 of file texture.c.

731{
732 const struct wined3d_gl_info *gl_info = context->gl_info;
733 const struct wined3d_format *format = texture->resource.format;
734 const struct color_fixup_desc fixup = format->color_fixup;
735 struct gl_texture *gl_tex;
737
738 TRACE("texture %p, context %p, srgb %#x.\n", texture, context, srgb);
739
741 srgb = FALSE;
742
743 /* sRGB mode cache for preload() calls outside drawprim. */
744 if (srgb)
746 else
747 texture->flags &= ~WINED3D_TEXTURE_IS_SRGB;
748
750 target = texture->target;
751
752 if (gl_tex->name)
753 {
755 return;
756 }
757
758 gl_info->gl_ops.gl.p_glGenTextures(1, &gl_tex->name);
759 checkGLcall("glGenTextures");
760 TRACE("Generated texture %d.\n", gl_tex->name);
761
762 if (!gl_tex->name)
763 {
764 ERR("Failed to generate a texture name.\n");
765 return;
766 }
767
768 /* Initialise the state of the texture object to the OpenGL defaults, not
769 * the wined3d defaults. */
770 gl_tex->sampler_desc.address_u = WINED3D_TADDRESS_WRAP;
771 gl_tex->sampler_desc.address_v = WINED3D_TADDRESS_WRAP;
772 gl_tex->sampler_desc.address_w = WINED3D_TADDRESS_WRAP;
773 memset(gl_tex->sampler_desc.border_color, 0, sizeof(gl_tex->sampler_desc.border_color));
774 gl_tex->sampler_desc.mag_filter = WINED3D_TEXF_LINEAR;
775 gl_tex->sampler_desc.min_filter = WINED3D_TEXF_POINT; /* GL_NEAREST_MIPMAP_LINEAR */
776 gl_tex->sampler_desc.mip_filter = WINED3D_TEXF_LINEAR; /* GL_NEAREST_MIPMAP_LINEAR */
777 gl_tex->sampler_desc.lod_bias = 0.0f;
778 gl_tex->sampler_desc.min_lod = -1000.0f;
779 gl_tex->sampler_desc.max_lod = 1000.0f;
780 gl_tex->sampler_desc.max_anisotropy = 1;
781 gl_tex->sampler_desc.compare = FALSE;
782 gl_tex->sampler_desc.comparison_func = WINED3D_CMP_LESSEQUAL;
783 if (context->gl_info->supported[EXT_TEXTURE_SRGB_DECODE])
784 gl_tex->sampler_desc.srgb_decode = TRUE;
785 else
786 gl_tex->sampler_desc.srgb_decode = srgb;
787 gl_tex->base_level = 0;
789
791
792 /* For a new texture we have to set the texture levels after binding the
793 * texture. Beware that texture rectangles do not support mipmapping, but
794 * set the maxmiplevel if we're relying on the partial
795 * GL_ARB_texture_non_power_of_two emulation with texture rectangles.
796 * (I.e., do not care about cond_np2 here, just look for
797 * GL_TEXTURE_RECTANGLE_ARB.) */
799 {
800 TRACE("Setting GL_TEXTURE_MAX_LEVEL to %u.\n", texture->level_count - 1);
801 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, texture->level_count - 1);
802 checkGLcall("glTexParameteri(target, GL_TEXTURE_MAX_LEVEL, texture->level_count)");
803 }
804
806 {
807 /* Cubemaps are always set to clamp, regardless of the sampler state. */
808 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
809 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
810 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
811 }
812
814 {
815 /* Conditinal non power of two textures use a different clamping
816 * default. If we're using the GL_WINE_normalized_texrect partial
817 * driver emulation, we're dealing with a GL_TEXTURE_2D texture which
818 * has the address mode set to repeat - something that prevents us
819 * from hitting the accelerated codepath. Thus manually set the GL
820 * state. The same applies to filtering. Even if the texture has only
821 * one mip level, the default LINEAR_MIPMAP_LINEAR filter causes a SW
822 * fallback on macos. */
823 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
824 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
825 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
826 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
827 checkGLcall("glTexParameteri");
828 gl_tex->sampler_desc.address_u = WINED3D_TADDRESS_CLAMP;
829 gl_tex->sampler_desc.address_v = WINED3D_TADDRESS_CLAMP;
830 gl_tex->sampler_desc.mag_filter = WINED3D_TEXF_POINT;
831 gl_tex->sampler_desc.min_filter = WINED3D_TEXF_POINT;
832 gl_tex->sampler_desc.mip_filter = WINED3D_TEXF_NONE;
833 }
834
836 {
837 gl_info->gl_ops.gl.p_glTexParameteri(target, GL_DEPTH_TEXTURE_MODE_ARB, GL_INTENSITY);
838 checkGLcall("glTexParameteri(GL_DEPTH_TEXTURE_MODE_ARB, GL_INTENSITY)");
839 }
840
841 if (!is_identity_fixup(fixup) && can_use_texture_swizzle(gl_info, format))
842 {
843 static const GLenum swizzle_source[] =
844 {
845 GL_ZERO, /* CHANNEL_SOURCE_ZERO */
846 GL_ONE, /* CHANNEL_SOURCE_ONE */
847 GL_RED, /* CHANNEL_SOURCE_X */
848 GL_GREEN, /* CHANNEL_SOURCE_Y */
849 GL_BLUE, /* CHANNEL_SOURCE_Z */
850 GL_ALPHA, /* CHANNEL_SOURCE_W */
851 };
852 struct
853 {
854 GLint x, y, z, w;
855 }
856 swizzle;
857
858 swizzle.x = swizzle_source[fixup.x_source];
859 swizzle.y = swizzle_source[fixup.y_source];
860 swizzle.z = swizzle_source[fixup.z_source];
861 swizzle.w = swizzle_source[fixup.w_source];
862 gl_info->gl_ops.gl.p_glTexParameteriv(target, GL_TEXTURE_SWIZZLE_RGBA, &swizzle.x);
863 checkGLcall("glTexParameteriv(GL_TEXTURE_SWIZZLE_RGBA)");
864 }
865}
static void wined3d_texture_set_dirty(struct wined3d_texture *texture)
Definition: texture.c:154
#define GL_INTENSITY
Definition: gl.h:747
#define GL_BLUE
Definition: gl.h:482
#define GL_RED
Definition: gl.h:480
#define GL_NEAREST
Definition: gl.h:678
#define GL_ONE
Definition: gl.h:375
#define GL_GREEN
Definition: gl.h:481
#define GL_DEPTH_TEXTURE_MODE_ARB
Definition: glext.h:1367
GLuint GLenum swizzle
Definition: glext.h:9511
#define GL_TEXTURE_SWIZZLE_RGBA
Definition: glext.h:2032
GLdouble GLdouble z
Definition: glext.h:5874
@ WINED3D_TADDRESS_CLAMP
Definition: wined3d.h:641
@ ARB_DEPTH_TEXTURE
Definition: wined3d_gl.h:59
#define WINED3D_TEXTURE_COND_NP2
static BOOL is_identity_fixup(struct color_fixup_desc fixup)
static BOOL needs_separate_srgb_gl_texture(const struct wined3d_context *context, const struct wined3d_texture *texture)

Referenced by sampler(), wined3d_shader_resource_view_bind(), and wined3d_texture_bind_and_dirtify().

◆ wined3d_texture_bind_and_dirtify()

void wined3d_texture_bind_and_dirtify ( struct wined3d_texture texture,
struct wined3d_context context,
BOOL  srgb 
)

Definition at line 868 of file texture.c.

870{
871 /* We don't need a specific texture unit, but after binding the texture
872 * the current unit is dirty. Read the unit back instead of switching to
873 * 0, this avoids messing around with the state manager's GL states. The
874 * current texture unit should always be a valid one.
875 *
876 * To be more specific, this is tricky because we can implicitly be
877 * called from sampler() in state.c. This means we can't touch anything
878 * other than whatever happens to be the currently active texture, or we
879 * would risk marking already applied sampler states dirty again. */
880 if (context->active_texture < ARRAY_SIZE(context->rev_tex_unit_map))
881 {
882 DWORD active_sampler = context->rev_tex_unit_map[context->active_texture];
883 if (active_sampler != WINED3D_UNMAPPED_STAGE)
885 }
886 /* FIXME: Ideally we'd only do this when touching a binding that's used by
887 * a shader. */
890
892}
#define STATE_GRAPHICS_SHADER_RESOURCE_BINDING
#define STATE_COMPUTE_SHADER_RESOURCE_BINDING

Referenced by shader_resource_view_generate_mipmaps(), surface_convert_format(), surface_load_fb_texture(), surface_load_sysmem(), surface_load_texture(), surface_upload_from_surface(), texture1d_load_location(), texture1d_prepare_texture(), texture1d_srgb_transfer(), texture2d_prepare_texture(), texture3d_load_location(), texture3d_prepare_texture(), texture3d_srgb_transfer(), wined3d_cs_exec_blt_sub_resource(), and wined3d_cs_exec_update_sub_resource().

◆ wined3d_texture_check_box_dimensions()

HRESULT wined3d_texture_check_box_dimensions ( const struct wined3d_texture texture,
unsigned int  level,
const struct wined3d_box box 
)

Definition at line 1128 of file texture.c.

1130{
1131 const struct wined3d_format *format = texture->resource.format;
1132 unsigned int width_mask, height_mask, width, height, depth;
1133
1137
1138 if (box->left >= box->right || box->right > width
1139 || box->top >= box->bottom || box->bottom > height
1140 || box->front >= box->back || box->back > depth)
1141 {
1142 WARN("Box %s is invalid.\n", debug_box(box));
1143 return WINEDDERR_INVALIDRECT;
1144 }
1145
1146 if (texture->resource.format_flags & WINED3DFMT_FLAG_BLOCKS)
1147 {
1148 /* This assumes power of two block sizes, but NPOT block sizes would
1149 * be silly anyway.
1150 *
1151 * This also assumes that the format's block depth is 1. */
1152 width_mask = format->block_width - 1;
1153 height_mask = format->block_height - 1;
1154
1155 if ((box->left & width_mask) || (box->top & height_mask)
1156 || (box->right & width_mask && box->right != width)
1157 || (box->bottom & height_mask && box->bottom != height))
1158 {
1159 WARN("Box %s is misaligned for %ux%u blocks.\n",
1160 debug_box(box), format->block_width, format->block_height);
1162 }
1163 }
1164
1165 return WINED3D_OK;
1166}
const char * debug_box(const struct wined3d_box *box)
Definition: utils.c:3939
#define WINEDDERR_INVALIDRECT
Definition: wined3d.h:52
static unsigned int wined3d_texture_get_level_depth(const struct wined3d_texture *texture, unsigned int level)

Referenced by texture_resource_sub_resource_map(), wined3d_device_clear_rendertarget_view(), wined3d_device_copy_sub_resource_region(), and wined3d_texture_blt().

◆ wined3d_texture_get_gl_buffer()

GLenum wined3d_texture_get_gl_buffer ( const struct wined3d_texture texture)

Definition at line 51 of file texture.c.

52{
53 const struct wined3d_swapchain *swapchain = texture->swapchain;
54
55 TRACE("texture %p.\n", texture);
56
57 if (!swapchain)
58 {
59 ERR("Texture %p is not part of a swapchain.\n", texture);
60 return GL_NONE;
61 }
62
63 if (texture == swapchain->front_buffer)
64 {
65 TRACE("Returning GL_FRONT.\n");
66 return GL_FRONT;
67 }
68
69 if (texture == swapchain->back_buffers[0])
70 {
71 TRACE("Returning GL_BACK.\n");
72 return GL_BACK;
73 }
74
75 FIXME("Higher back buffer, returning GL_BACK.\n");
76 return GL_BACK;
77}
#define GL_FRONT
Definition: gl.h:270

Referenced by arbfp_blitter_blit(), context_generate_rt_mask_from_resource(), fb_copy_to_texture_direct(), fb_copy_to_texture_hwstretch(), ffp_blitter_blit(), read_from_framebuffer(), surface_blt_fbo(), and surface_load_fb_texture().

◆ wined3d_texture_get_gl_texture()

static struct gl_texture * wined3d_texture_get_gl_texture ( struct wined3d_texture texture,
BOOL  srgb 
)
inlinestatic

Definition at line 3250 of file wined3d_private.h.

3252{
3253 return srgb ? &texture->texture_srgb : &texture->texture_rgb;
3254}

Referenced by shader_resource_view_generate_mipmaps(), texture_apply_base_level(), wined3d_texture_apply_sampler_desc(), and wined3d_texture_bind().

◆ wined3d_texture_get_level_depth()

◆ wined3d_texture_get_level_height()

◆ wined3d_texture_get_level_pow2_height()

◆ wined3d_texture_get_level_pow2_width()

◆ wined3d_texture_get_level_width()

◆ wined3d_texture_get_memory()

void wined3d_texture_get_memory ( struct wined3d_texture texture,
unsigned int  sub_resource_idx,
struct wined3d_bo_address data,
DWORD  locations 
)

Definition at line 285 of file texture.c.

287{
288 struct wined3d_texture_sub_resource *sub_resource;
289
290 TRACE("texture %p, sub_resource_idx %u, data %p, locations %s.\n",
291 texture, sub_resource_idx, data, wined3d_debug_location(locations));
292
293 sub_resource = &texture->sub_resources[sub_resource_idx];
295 {
296 data->addr = NULL;
297#if !defined(STAGING_CSMT)
298 data->buffer_object = sub_resource->buffer_object;
299#else /* STAGING_CSMT */
300 data->buffer_object = sub_resource->buffer->name;
301#endif /* STAGING_CSMT */
302 return;
303 }
305 {
306 data->addr = texture->user_memory;
307 data->buffer_object = 0;
308 return;
309 }
311 {
312 data->addr = texture->resource.heap_memory;
313 data->addr += sub_resource->offset;
314 data->buffer_object = 0;
315 return;
316 }
317
318 ERR("Unexpected locations %s.\n", wined3d_debug_location(locations));
319 data->addr = NULL;
320 data->buffer_object = 0;
321}
char * name
Definition: compiler.c:66

Referenced by read_from_framebuffer(), surface_convert_format(), surface_cpu_blt(), surface_cpu_blt_colour_fill(), surface_download_data(), surface_load_texture(), surface_upload_from_surface(), texture2d_create_dc(), texture2d_destroy_dc(), texture_resource_sub_resource_map(), texture_resource_sub_resource_unmap(), wined3d_cs_exec_blt_sub_resource(), and wined3d_texture_copy_sysmem_location().

◆ wined3d_texture_get_sub_resource_target()

static GLenum wined3d_texture_get_sub_resource_target ( const struct wined3d_texture texture,
unsigned int  sub_resource_idx 
)
inlinestatic

Definition at line 3233 of file wined3d_private.h.

3235{
3236 static const GLenum cube_targets[] =
3237 {
3244 };
3245
3246 return texture->resource.usage & WINED3DUSAGE_LEGACY_CUBEMAP
3247 ? cube_targets[sub_resource_idx / texture->level_count] : texture->target;
3248}
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB
Definition: glext.h:1237
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB
Definition: glext.h:1232
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB
Definition: glext.h:1234
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB
Definition: glext.h:1235
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB
Definition: glext.h:1236
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB
Definition: glext.h:1233

Referenced by context_set_fbo_key_for_render_target(), fb_copy_to_texture_direct(), fb_copy_to_texture_hwstretch(), surface_download_data(), surface_load_fb_texture(), texture1d_download_data(), texture1d_prepare_texture(), texture1d_upload_data(), texture2d_get_blt_info(), wined3d_surface_upload_data(), and wined3d_texture_allocate_gl_mutable_storage().

◆ wined3d_texture_get_texture_name()

static GLuint wined3d_texture_get_texture_name ( const struct wined3d_texture texture,
const struct wined3d_context context,
BOOL  srgb 
)
inlinestatic

Definition at line 4449 of file wined3d_private.h.

4451{
4453 ? texture->texture_srgb.name : texture->texture_rgb.name;
4454}

Referenced by context_bind_unordered_access_views(), context_set_fbo_key_for_render_target(), create_texture_view(), and raw_blitter_blit().

◆ wined3d_texture_invalidate_location()

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

Definition at line 159 of file texture.c.

161{
162 struct wined3d_texture_sub_resource *sub_resource;
163 DWORD previous_locations;
164
165 TRACE("texture %p, sub_resource_idx %u, location %s.\n",
166 texture, sub_resource_idx, wined3d_debug_location(location));
167
170
171 sub_resource = &texture->sub_resources[sub_resource_idx];
172 previous_locations = sub_resource->locations;
173 sub_resource->locations &= ~location;
174 if (previous_locations != WINED3D_LOCATION_SYSMEM && sub_resource->locations == WINED3D_LOCATION_SYSMEM)
175 ++texture->sysmem_count;
176
177 TRACE("New locations flags are %s.\n", wined3d_debug_location(sub_resource->locations));
178
179 if (!sub_resource->locations)
180 ERR("Sub-resource %u of texture %p does not have any up to date location.\n",
181 sub_resource_idx, texture);
182}

Referenced by context_setup_target(), device_clear_render_targets(), fb_copy_to_texture_direct(), fb_copy_to_texture_hwstretch(), raw_blitter_blit(), shader_resource_view_generate_mipmaps(), surface_convert_format(), surface_cpu_blt(), surface_cpu_blt_colour_fill(), surface_upload_from_surface(), swapchain_blit(), swapchain_gl_present(), swapchain_init(), texture1d_load_location(), texture2d_create_dc(), texture_init(), texture_resource_sub_resource_map(), wined3d_cs_exec_add_dirty_texture_region(), wined3d_cs_exec_blt_sub_resource(), wined3d_cs_exec_update_sub_resource(), wined3d_surface_blt(), wined3d_swapchain_rotate(), wined3d_texture_force_reload(), wined3d_texture_load(), wined3d_texture_load_location(), wined3d_texture_remove_buffer_object(), wined3d_texture_unload(), wined3d_texture_update_desc(), and wined3d_view_invalidate_location().

◆ wined3d_texture_load()

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

Definition at line 1066 of file texture.c.

1068{
1069 UINT sub_count = texture->level_count * texture->layer_count;
1070 const struct wined3d_d3d_info *d3d_info = context->d3d_info;
1071 DWORD flag;
1072 UINT i;
1073
1074 TRACE("texture %p, context %p, srgb %#x.\n", texture, context, srgb);
1075
1077 srgb = FALSE;
1078
1079 if (srgb)
1081 else
1083
1084 if (!d3d_info->shader_color_key
1085 && (!(texture->async.flags & WINED3D_TEXTURE_ASYNC_COLOR_KEY)
1086 != !(texture->async.color_key_flags & WINED3D_CKEY_SRC_BLT)
1087 || (texture->async.flags & WINED3D_TEXTURE_ASYNC_COLOR_KEY
1088 && !color_key_equal(&texture->async.gl_color_key, &texture->async.src_blt_color_key))))
1089 {
1090 unsigned int sub_count = texture->level_count * texture->layer_count;
1091 unsigned int i;
1092
1093 TRACE("Reloading because of color key value change.\n");
1094 for (i = 0; i < sub_count; i++)
1095 {
1096 if (!wined3d_texture_load_location(texture, i, context, texture->resource.map_binding))
1097 ERR("Failed to load location %s.\n", wined3d_debug_location(texture->resource.map_binding));
1098 else
1099 wined3d_texture_invalidate_location(texture, i, ~texture->resource.map_binding);
1100 }
1101
1102 texture->async.gl_color_key = texture->async.src_blt_color_key;
1103 }
1104
1105 if (texture->flags & flag)
1106 {
1107 TRACE("Texture %p not dirty, nothing to do.\n", texture);
1108 return;
1109 }
1110
1111 /* Reload the surfaces if the texture is marked dirty. */
1112 for (i = 0; i < sub_count; ++i)
1113 {
1116 ERR("Failed to load location (srgb %#x).\n", srgb);
1117 }
1118 texture->flags |= flag;
1119}
static BOOL color_key_equal(const struct wined3d_color_key *c1, struct wined3d_color_key *c2)
Definition: texture.c:1059
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

Referenced by arbfp_blitter_blit(), context_apply_blit_state(), context_load_shader_resources(), context_load_unordered_access_resources(), context_preload_texture(), context_setup_target(), fb_copy_to_texture_direct(), fb_copy_to_texture_hwstretch(), ffp_blitter_blit(), and texture_resource_preload().

◆ wined3d_texture_load_location()

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

Definition at line 229 of file texture.c.

231{
232 static const DWORD sysmem_locations = WINED3D_LOCATION_SYSMEM | WINED3D_LOCATION_USER_MEMORY
234 DWORD current = texture->sub_resources[sub_resource_idx].locations;
235 BOOL ret;
236
237 TRACE("texture %p, sub_resource_idx %u, context %p, location %s.\n",
238 texture, sub_resource_idx, context, wined3d_debug_location(location));
239
240 TRACE("Current resource location %s.\n", wined3d_debug_location(current));
241
242 if (current & location)
243 {
244 TRACE("Location %s is already up to date.\n", wined3d_debug_location(location));
245 return TRUE;
246 }
247
248 if (WARN_ON(d3d))
249 {
251 if ((texture->resource.access & required_access) != required_access)
252 WARN("Operation requires %#x access, but texture only has %#x.\n",
253 required_access, texture->resource.access);
254 }
255
257 {
258 TRACE("Sub-resource previously discarded, nothing to do.\n");
260 return FALSE;
263 return TRUE;
264 }
265
266 if (!current)
267 {
268 ERR("Sub-resource %u of texture %p does not have any up to date location.\n",
269 sub_resource_idx, texture);
271 return wined3d_texture_load_location(texture, sub_resource_idx, context, location);
272 }
273
274 if ((location & sysmem_locations) && (current & sysmem_locations))
276 else
277 ret = texture->texture_ops->texture_load_location(texture, sub_resource_idx, context, location);
278
279 if (ret)
281
282 return ret;
283}
static DWORD wined3d_resource_access_from_location(DWORD location)
Definition: texture.c:79
static BOOL wined3d_texture_copy_sysmem_location(struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_context *context, DWORD location)
Definition: texture.c:184
struct task_struct * current
Definition: linux.c:32

Referenced by context_validate_onscreen_formats(), cpu_blitter_blit(), device_clear_render_targets(), raw_blitter_blit(), shader_resource_view_generate_mipmaps(), surface_blt_fbo(), surface_convert_format(), surface_cpu_blt(), surface_cpu_blt_colour_fill(), surface_depth_blt_fbo(), surface_load_drawable(), surface_load_sysmem(), surface_load_texture(), surface_upload_from_surface(), swapchain_gl_frontbuffer_updated(), swapchain_gl_present(), texture2d_create_dc(), texture_resource_sub_resource_map(), wined3d_cs_exec_add_dirty_texture_region(), wined3d_cs_exec_blt_sub_resource(), wined3d_cs_exec_update_sub_resource(), wined3d_rendertarget_view_load_location(), wined3d_surface_blt(), wined3d_swapchain_rotate(), wined3d_texture_load(), wined3d_texture_load_location(), wined3d_texture_unload(), and wined3d_texture_update_map_binding().

◆ wined3d_texture_prepare_location()

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

Definition at line 1605 of file texture.c.

1607{
1608 switch (location)
1609 {
1611 if (texture->resource.heap_memory)
1612 return TRUE;
1613
1615 {
1616 ERR("Failed to allocate system memory.\n");
1617 return FALSE;
1618 }
1619 return TRUE;
1620
1622 if (!texture->user_memory)
1623 ERR("Map binding is set to WINED3D_LOCATION_USER_MEMORY but surface->user_memory is NULL.\n");
1624 return TRUE;
1625
1627#if !defined(STAGING_CSMT)
1628 wined3d_texture_prepare_buffer_object(texture, sub_resource_idx, context->gl_info);
1629#else /* STAGING_CSMT */
1631#endif /* STAGING_CSMT */
1632 return TRUE;
1633
1636 return TRUE;
1637
1640 return TRUE;
1641
1644 ERR("Texture %p does not have a drawable.\n", texture);
1645 return TRUE;
1646
1649 return TRUE;
1650
1653 return TRUE;
1654
1655 default:
1656 ERR("Invalid location %s.\n", wined3d_debug_location(location));
1657 return FALSE;
1658 }
1659}
static void wined3d_texture_prepare_buffer_object(struct wined3d_texture *texture, unsigned int sub_resource_idx, const struct wined3d_gl_info *gl_info)
Definition: texture.c:1497
static void wined3d_texture_prepare_rb(struct wined3d_texture *texture, const struct wined3d_gl_info *gl_info, BOOL multisample)
Definition: texture.c:1568

Referenced by device_clear_render_targets(), raw_blitter_blit(), surface_blt_fbo(), surface_depth_blt_fbo(), surface_load_sysmem(), texture1d_load_location(), texture3d_load_location(), texture_resource_sub_resource_map(), wined3d_rendertarget_view_prepare_location(), wined3d_texture_copy_sysmem_location(), wined3d_texture_load_location(), and wined3d_texture_update_desc().

◆ wined3d_texture_prepare_texture()

void wined3d_texture_prepare_texture ( struct wined3d_texture texture,
struct wined3d_context context,
BOOL  srgb 
)

Definition at line 1546 of file texture.c.

1547{
1549 const struct wined3d_d3d_info *d3d_info = context->d3d_info;
1550
1551 if (!d3d_info->shader_color_key
1552 && !(texture->async.flags & WINED3D_TEXTURE_ASYNC_COLOR_KEY)
1553 != !(texture->async.color_key_flags & WINED3D_CKEY_SRC_BLT))
1554 {
1556
1557 if (texture->async.color_key_flags & WINED3D_CKEY_SRC_BLT)
1559 }
1560
1561 if (texture->flags & alloc_flag)
1562 return;
1563
1564 texture->texture_ops->texture_prepare_texture(texture, context, srgb);
1565 texture->flags |= alloc_flag;
1566}
static void wined3d_texture_force_reload(struct wined3d_texture *texture)
Definition: texture.c:1531
#define WINED3D_TEXTURE_RGB_ALLOCATED
#define WINED3D_TEXTURE_SRGB_ALLOCATED

Referenced by create_texture_view(), surface_convert_format(), surface_load_fb_texture(), surface_load_texture(), surface_upload_from_surface(), wined3d_cs_exec_blt_sub_resource(), wined3d_cs_exec_update_sub_resource(), and wined3d_texture_prepare_location().

◆ wined3d_texture_set_map_binding()

void wined3d_texture_set_map_binding ( struct wined3d_texture texture,
DWORD  map_binding 
)

Definition at line 468 of file texture.c.

469{
470 texture->update_map_binding = map_binding;
471 if (!texture->resource.map_count)
473}
static void wined3d_texture_update_map_binding(struct wined3d_texture *texture)
Definition: texture.c:437

Referenced by surface_load_texture().

◆ wined3d_texture_set_swapchain()

void wined3d_texture_set_swapchain ( struct wined3d_texture texture,
struct wined3d_swapchain swapchain 
)

Definition at line 722 of file texture.c.

723{
724 texture->swapchain = swapchain;
726}

Referenced by swapchain_cleanup(), and swapchain_init().

◆ wined3d_texture_upload_data()

void wined3d_texture_upload_data ( struct wined3d_texture texture,
unsigned int  sub_resource_idx,
const struct wined3d_context context,
const struct wined3d_box box,
const struct wined3d_const_bo_address data,
unsigned int  row_pitch,
unsigned int  slice_pitch 
)

Definition at line 1696 of file texture.c.

1699{
1700 texture->texture_ops->texture_upload_data(texture, sub_resource_idx,
1701 context, box, data, row_pitch, slice_pitch);
1702}

Referenced by wined3d_cs_exec_blt_sub_resource(), and wined3d_cs_exec_update_sub_resource().

◆ wined3d_texture_validate_location()

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

Definition at line 135 of file texture.c.

137{
138 struct wined3d_texture_sub_resource *sub_resource;
139 DWORD previous_locations;
140
141 TRACE("texture %p, sub_resource_idx %u, location %s.\n",
142 texture, sub_resource_idx, wined3d_debug_location(location));
143
144 sub_resource = &texture->sub_resources[sub_resource_idx];
145 previous_locations = sub_resource->locations;
146 sub_resource->locations |= location;
147 if (previous_locations == WINED3D_LOCATION_SYSMEM && location != WINED3D_LOCATION_SYSMEM
148 && !--texture->sysmem_count)
150
151 TRACE("New locations flags are %s.\n", wined3d_debug_location(sub_resource->locations));
152}
static void wined3d_texture_evict_sysmem(struct wined3d_texture *texture)
Definition: texture.c:109

Referenced by device_clear_render_targets(), fb_copy_to_texture_direct(), fb_copy_to_texture_hwstretch(), raw_blitter_blit(), shader_resource_view_generate_mipmaps(), surface_convert_format(), surface_upload_from_surface(), swapchain_blit(), swapchain_gl_present(), swapchain_init(), texture1d_load_location(), texture_init(), texture_resource_sub_resource_map(), wined3d_cs_exec_blt_sub_resource(), wined3d_cs_exec_set_depth_stencil_view(), wined3d_cs_exec_update_sub_resource(), wined3d_rendertarget_view_validate_location(), wined3d_surface_blt(), wined3d_swapchain_rotate(), wined3d_texture_load_location(), wined3d_texture_unload(), and wined3d_texture_update_desc().

◆ wined3d_unordered_access_view_clear_uint()

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

Definition at line 1004 of file view.c.

1006{
1007 const struct wined3d_gl_info *gl_info = context->gl_info;
1008 const struct wined3d_format *format;
1009 struct wined3d_resource *resource;
1010 struct wined3d_buffer *buffer;
1011 unsigned int offset, size;
1012
1013 resource = view->resource;
1014 if (resource->type != WINED3D_RTYPE_BUFFER)
1015 {
1016 FIXME("Not implemented for %s resources.\n", debug_d3dresourcetype(resource->type));
1017 return;
1018 }
1019
1020 if (!gl_info->supported[ARB_CLEAR_BUFFER_OBJECT])
1021 {
1022 FIXME("OpenGL implementation does not support ARB_clear_buffer_object.\n");
1023 return;
1024 }
1025
1026 format = view->format;
1030 {
1031 FIXME("Not implemented for format %s.\n", debug_d3dformat(format->id));
1032 return;
1033 }
1034
1038
1040 context_bind_bo(context, buffer->buffer_type_hint, buffer->buffer_object);
1041 GL_EXTCALL(glClearBufferSubData(buffer->buffer_type_hint, format->glInternal,
1042 offset, size, format->glFormat, format->glType, clear_value));
1043 checkGLcall("clear unordered access view");
1044}
static void get_buffer_view_range(const struct wined3d_buffer *buffer, const struct wined3d_view_desc *desc, const struct wined3d_format *view_format, unsigned int *offset, unsigned int *size)
Definition: view.c:272
void wined3d_unordered_access_view_invalidate_location(struct wined3d_unordered_access_view *view, DWORD location)
Definition: view.c:998
@ ARB_CLEAR_BUFFER_OBJECT
Definition: wined3d_gl.h:47

Referenced by wined3d_cs_exec_clear_unordered_access_view().

◆ wined3d_unordered_access_view_copy_counter()

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

Definition at line 1063 of file view.c.

1065{
1066 struct wined3d_bo_address dst, src;
1067 DWORD dst_location;
1068
1069 if (!view->counter_bo)
1070 return;
1071
1072 dst_location = wined3d_buffer_get_memory(buffer, &dst, buffer->locations);
1073 dst.addr += offset;
1074
1075 src.buffer_object = view->counter_bo;
1076 src.addr = NULL;
1077
1078 context_copy_bo_address(context, &dst, buffer->buffer_type_hint,
1080
1082}
#define GL_ATOMIC_COUNTER_BUFFER
Definition: glext.h:2297

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,
DWORD  location 
)

Definition at line 998 of file view.c.

1000{
1002}

Referenced by context_load_unordered_access_resources(), and wined3d_unordered_access_view_clear_uint().

◆ wined3d_unordered_access_view_set_counter()

void wined3d_unordered_access_view_set_counter ( struct wined3d_unordered_access_view view,
unsigned int  value 
)

Definition at line 1046 of file view.c.

1048{
1049 const struct wined3d_gl_info *gl_info;
1050 struct wined3d_context *context;
1051
1052 if (!view->counter_bo)
1053 return;
1054
1055 context = context_acquire(view->resource->device, NULL, 0);
1056 gl_info = context->gl_info;
1057 GL_EXTCALL(glBindBuffer(GL_ATOMIC_COUNTER_BUFFER, view->counter_bo));
1058 GL_EXTCALL(glBufferSubData(GL_ATOMIC_COUNTER_BUFFER, 0, sizeof(value), &value));
1059 checkGLcall("set atomic counter");
1061}

Referenced by wined3d_cs_exec_set_unordered_access_view().

◆ wined3d_unregister_window()

void wined3d_unregister_window ( HWND  window)

Definition at line 470 of file wined3d_main.c.

471{
472 struct wined3d_wndproc *entry, *last;
474
476
478 {
480 ERR("Window %p is not registered with wined3d.\n", window);
481 return;
482 }
483
484 if (entry->unicode)
485 {
488 {
489 entry->device = NULL;
491 WARN("Not unregistering window %p, window proc %#lx doesn't match wined3d window proc %p.\n",
493 return;
494 }
495
497 }
498 else
499 {
502 {
503 entry->device = NULL;
505 WARN("Not unregistering window %p, window proc %#lx doesn't match wined3d window proc %p.\n",
507 return;
508 }
509
511 }
512
513 last = &wndproc_table.entries[--wndproc_table.count];
514 if (entry != last) *entry = *last;
515
517}
static UINT UINT last
Definition: font.c:45
#define GetWindowLongPtrW
Definition: winuser.h:4829
#define GetWindowLongPtrA
Definition: winuser.h:4828

Referenced by device_process_message(), and wined3d_device_release_focus_window().

Variable Documentation

◆ COLOR_FIXUP_IDENTITY

◆ DECLSPEC_HIDDEN

int DECLSPEC_HIDDEN

Definition at line 288 of file wined3d_private.h.