Skip to content

Commit

Permalink
sokol_gfx.h d3d11: fix compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Oct 30, 2023
1 parent 2093942 commit f841f54
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions sokol_gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -18303,7 +18303,7 @@ SOKOL_API_IMPL const void* sg_d3d11_device_context(void) {
#endif
}

SOKOL_GFX_API_IMPL sg_d3d11_buffer_info sg_d3d11_query_buffer_info(sg_buffer buf_id) {
SOKOL_API_IMPL sg_d3d11_buffer_info sg_d3d11_query_buffer_info(sg_buffer buf_id) {
SOKOL_ASSERT(_sg.valid);
sg_d3d11_buffer_info res;
_sg_clear(&res, sizeof(res));
Expand All @@ -18312,11 +18312,13 @@ SOKOL_GFX_API_IMPL sg_d3d11_buffer_info sg_d3d11_query_buffer_info(sg_buffer buf
if (buf) {
res.buf = (void*) buf->d3d11.buf;
}
#else
_SOKOL_UNUSED(buf_id);
#endif
return res;
}

SOKOL_GFX_API_IMPL sg_d3d11_image_info sg_d3d11_query_image_info(sg_image img_id) {
SOKOL_API_IMPL sg_d3d11_image_info sg_d3d11_query_image_info(sg_image img_id) {
SOKOL_ASSERT(_sg.valid);
sg_d3d11_image_info res;
_sg_clear(&res, sizeof(res));
Expand All @@ -18328,11 +18330,13 @@ SOKOL_GFX_API_IMPL sg_d3d11_image_info sg_d3d11_query_image_info(sg_image img_id
res.res = (void*) img->d3d11.res;
res.srv = (void*) img->d3d11.srv;
}
#else
_SOKOL_UNUSED(img_id);
#endif
return res;
}

SOKOL_GFX_API_IMPL sg_d3d11_sampler_info sg_d3d11_query_sampler_info(sg_sampler smp_id) {
SOKOL_API_IMPL sg_d3d11_sampler_info sg_d3d11_query_sampler_info(sg_sampler smp_id) {
SOKOL_ASSERT(_sg.valid);
sg_d3d11_sampler_info res;
_sg_clear(&res, sizeof(res));
Expand All @@ -18341,11 +18345,13 @@ SOKOL_GFX_API_IMPL sg_d3d11_sampler_info sg_d3d11_query_sampler_info(sg_sampler
if (smp) {
res.smp = (void*) smp->d3d11.smp;
}
#else
_SOKOL_UNUSED(smp_id);
#endif
return res;
}

SOKOL_GFX_API_IMPL sg_d3d11_shader_info sg_d3d11_query_shader_info(sg_shader shd_id) {
SOKOL_API_IMPL sg_d3d11_shader_info sg_d3d11_query_shader_info(sg_shader shd_id) {
SOKOL_ASSERT(_sg.valid);
sg_d3d11_shader_info res;
_sg_clear(&res, sizeof(res));
Expand All @@ -18359,11 +18365,13 @@ SOKOL_GFX_API_IMPL sg_d3d11_shader_info sg_d3d11_query_shader_info(sg_shader shd
res.vs = (void*) shd->d3d11.vs;
res.fs = (void*) shd->d3d11.fs;
}
#else
_SOKOL_UNUSED(shd_id);
#endif
return res;
}

SOKOL_GFX_API_IMPL sg_d3d11_pipeline_info sg_d3d11_query_pipeline_info(sg_pipeline pip_id) {
SOKOL_API_IMPL sg_d3d11_pipeline_info sg_d3d11_query_pipeline_info(sg_pipeline pip_id) {
SOKOL_ASSERT(_sg.valid);
sg_d3d11_pipeline_info res;
_sg_clear(&res, sizeof(res));
Expand All @@ -18375,23 +18383,27 @@ SOKOL_GFX_API_IMPL sg_d3d11_pipeline_info sg_d3d11_query_pipeline_info(sg_pipeli
res.dss = pip->d3d11.dss;
res.bs = pip->d3d11.bs;
}
#else
_SOKOL_UNUSED(pip_id);
#endif
return res;
}

SOKOL_GFX_API_IMPL sg_d3d11_pass_info sg_d3d11_query_pass_info(sg_pass pass_id) {
SOKOL_API_IMPL sg_d3d11_pass_info sg_d3d11_query_pass_info(sg_pass pass_id) {
SOKOL_ASSERT(_sg.valid);
sg_d3d11_pass_info res;
_sg_clear(&res, sizeof(res));
#if defined(SOKOL_D3D11)
const _sg_pass_t* pass = _sg_lookup_pass(&_sg.pools, pass_id.id);
if (pass) {
for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) {
res.color_rtv[i] = pass->d3d11.color_atts[i].rtv;
res.resolve_rtv[i] = pass->d3d11.resolve_attrs[i].rtv;
res.color_rtv[i] = pass->d3d11.color_atts[i].view.rtv;
res.resolve_rtv[i] = pass->d3d11.resolve_atts[i].view.rtv;
}
res.dsv = pass->d3d11.ds_att.dsv;
res.dsv = pass->d3d11.ds_att.view.dsv;
}
#else
_SOKOL_UNUSED(pass_id);
#endif
return res;
}
Expand Down

0 comments on commit f841f54

Please sign in to comment.