d3d10core: Implement d3d10_device_VSSetConstantBuffers().
This commit is contained in:
parent
521c439d30
commit
ae5e15319e
|
@ -117,8 +117,19 @@ static ULONG STDMETHODCALLTYPE d3d10_device_Release(ID3D10Device *iface)
|
||||||
static void STDMETHODCALLTYPE d3d10_device_VSSetConstantBuffers(ID3D10Device *iface,
|
static void STDMETHODCALLTYPE d3d10_device_VSSetConstantBuffers(ID3D10Device *iface,
|
||||||
UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers)
|
UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers)
|
||||||
{
|
{
|
||||||
FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n",
|
struct d3d10_device *device = impl_from_ID3D10Device(iface);
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
TRACE("iface %p, start_slot %u, buffer_count %u, buffers %p.\n",
|
||||||
iface, start_slot, buffer_count, buffers);
|
iface, start_slot, buffer_count, buffers);
|
||||||
|
|
||||||
|
for (i = 0; i < buffer_count; ++i)
|
||||||
|
{
|
||||||
|
struct d3d10_buffer *buffer = unsafe_impl_from_ID3D10Buffer(buffers[i]);
|
||||||
|
|
||||||
|
wined3d_device_set_vs_cb(device->wined3d_device, start_slot + i,
|
||||||
|
buffer ? buffer->wined3d_buffer : NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void STDMETHODCALLTYPE d3d10_device_PSSetShaderResources(ID3D10Device *iface,
|
static void STDMETHODCALLTYPE d3d10_device_PSSetShaderResources(ID3D10Device *iface,
|
||||||
|
|
|
@ -2532,6 +2532,45 @@ struct wined3d_shader * CDECL wined3d_device_get_vertex_shader(const struct wine
|
||||||
return device->stateBlock->state.vertex_shader;
|
return device->stateBlock->state.vertex_shader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CDECL wined3d_device_set_vs_cb(struct wined3d_device *device, UINT idx, struct wined3d_buffer *buffer)
|
||||||
|
{
|
||||||
|
struct wined3d_buffer *prev;
|
||||||
|
|
||||||
|
TRACE("device %p, idx %u, buffer %p.\n", device, idx, buffer);
|
||||||
|
|
||||||
|
if (idx >= MAX_CONSTANT_BUFFERS)
|
||||||
|
{
|
||||||
|
WARN("Invalid constant buffer index %u.\n", idx);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
prev = device->updateStateBlock->state.vs_cb[idx];
|
||||||
|
device->updateStateBlock->state.vs_cb[idx] = buffer;
|
||||||
|
|
||||||
|
if (device->isRecordingState)
|
||||||
|
{
|
||||||
|
if (buffer)
|
||||||
|
wined3d_buffer_incref(buffer);
|
||||||
|
if (prev)
|
||||||
|
wined3d_buffer_decref(prev);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (prev != buffer)
|
||||||
|
{
|
||||||
|
if (buffer)
|
||||||
|
{
|
||||||
|
InterlockedIncrement(&buffer->resource.bind_count);
|
||||||
|
wined3d_buffer_incref(buffer);
|
||||||
|
}
|
||||||
|
if (prev)
|
||||||
|
{
|
||||||
|
InterlockedDecrement(&prev->resource.bind_count);
|
||||||
|
wined3d_buffer_decref(prev);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device,
|
HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device,
|
||||||
UINT start_register, const BOOL *constants, UINT bool_count)
|
UINT start_register, const BOOL *constants, UINT bool_count)
|
||||||
{
|
{
|
||||||
|
|
|
@ -521,6 +521,15 @@ void stateblock_unbind_resources(struct wined3d_stateblock *stateblock)
|
||||||
wined3d_shader_decref(shader);
|
wined3d_shader_decref(shader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < MAX_CONSTANT_BUFFERS; ++i)
|
||||||
|
{
|
||||||
|
if ((buffer = state->vs_cb[i]))
|
||||||
|
{
|
||||||
|
state->vs_cb[i] = NULL;
|
||||||
|
wined3d_buffer_decref(buffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((shader = state->geometry_shader))
|
if ((shader = state->geometry_shader))
|
||||||
{
|
{
|
||||||
state->geometry_shader = NULL;
|
state->geometry_shader = NULL;
|
||||||
|
|
|
@ -140,6 +140,7 @@
|
||||||
@ cdecl wined3d_device_set_vertex_declaration(ptr ptr)
|
@ cdecl wined3d_device_set_vertex_declaration(ptr ptr)
|
||||||
@ cdecl wined3d_device_set_vertex_shader(ptr ptr)
|
@ cdecl wined3d_device_set_vertex_shader(ptr ptr)
|
||||||
@ cdecl wined3d_device_set_viewport(ptr ptr)
|
@ cdecl wined3d_device_set_viewport(ptr ptr)
|
||||||
|
@ cdecl wined3d_device_set_vs_cb(ptr long ptr)
|
||||||
@ cdecl wined3d_device_set_vs_consts_b(ptr long ptr long)
|
@ cdecl wined3d_device_set_vs_consts_b(ptr long ptr long)
|
||||||
@ cdecl wined3d_device_set_vs_consts_f(ptr long ptr long)
|
@ cdecl wined3d_device_set_vs_consts_f(ptr long ptr long)
|
||||||
@ cdecl wined3d_device_set_vs_consts_i(ptr long ptr long)
|
@ cdecl wined3d_device_set_vs_consts_i(ptr long ptr long)
|
||||||
|
|
|
@ -162,6 +162,7 @@ void wined3d_rb_free(void *ptr) DECLSPEC_HIDDEN;
|
||||||
#define MAX_COMBINED_SAMPLERS (MAX_FRAGMENT_SAMPLERS + MAX_VERTEX_SAMPLERS)
|
#define MAX_COMBINED_SAMPLERS (MAX_FRAGMENT_SAMPLERS + MAX_VERTEX_SAMPLERS)
|
||||||
#define MAX_ACTIVE_LIGHTS 8
|
#define MAX_ACTIVE_LIGHTS 8
|
||||||
#define MAX_CLIPPLANES WINED3DMAXUSERCLIPPLANES
|
#define MAX_CLIPPLANES WINED3DMAXUSERCLIPPLANES
|
||||||
|
#define MAX_CONSTANT_BUFFERS 15
|
||||||
|
|
||||||
struct min_lookup
|
struct min_lookup
|
||||||
{
|
{
|
||||||
|
@ -2299,6 +2300,7 @@ struct wined3d_state
|
||||||
GLenum gl_primitive_type;
|
GLenum gl_primitive_type;
|
||||||
|
|
||||||
struct wined3d_shader *vertex_shader;
|
struct wined3d_shader *vertex_shader;
|
||||||
|
struct wined3d_buffer *vs_cb[MAX_CONSTANT_BUFFERS];
|
||||||
BOOL vs_consts_b[MAX_CONST_B];
|
BOOL vs_consts_b[MAX_CONST_B];
|
||||||
INT vs_consts_i[MAX_CONST_I * 4];
|
INT vs_consts_i[MAX_CONST_I * 4];
|
||||||
float *vs_consts_f;
|
float *vs_consts_f;
|
||||||
|
|
|
@ -2244,6 +2244,7 @@ void __cdecl wined3d_device_set_vertex_declaration(struct wined3d_device *device
|
||||||
struct wined3d_vertex_declaration *declaration);
|
struct wined3d_vertex_declaration *declaration);
|
||||||
void __cdecl wined3d_device_set_vertex_shader(struct wined3d_device *device, struct wined3d_shader *shader);
|
void __cdecl wined3d_device_set_vertex_shader(struct wined3d_device *device, struct wined3d_shader *shader);
|
||||||
void __cdecl wined3d_device_set_viewport(struct wined3d_device *device, const struct wined3d_viewport *viewport);
|
void __cdecl wined3d_device_set_viewport(struct wined3d_device *device, const struct wined3d_viewport *viewport);
|
||||||
|
void __cdecl wined3d_device_set_vs_cb(struct wined3d_device *device, UINT idx, struct wined3d_buffer *buffer);
|
||||||
HRESULT __cdecl wined3d_device_set_vs_consts_b(struct wined3d_device *device,
|
HRESULT __cdecl wined3d_device_set_vs_consts_b(struct wined3d_device *device,
|
||||||
UINT start_register, const BOOL *constants, UINT bool_count);
|
UINT start_register, const BOOL *constants, UINT bool_count);
|
||||||
HRESULT __cdecl wined3d_device_set_vs_consts_f(struct wined3d_device *device,
|
HRESULT __cdecl wined3d_device_set_vs_consts_f(struct wined3d_device *device,
|
||||||
|
|
Loading…
Reference in New Issue