这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/bufferoffsets/main.odin
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ init :: proc "c" () {
data = { ptr = &vertices, size = size_of(vertices ) },
})
state.bind.index_buffer = sg.make_buffer({
type = .INDEXBUFFER,
usage = { index_buffer = true },
data = { ptr = &indices, size = size_of(indices) },
})

Expand Down
2 changes: 1 addition & 1 deletion examples/cube/main.odin
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ init :: proc "c" () {
22, 21, 20, 23, 22, 20,
}
state.bind.index_buffer = sg.make_buffer({
type = .INDEXBUFFER,
usage = { index_buffer = true },
data = { ptr = &indices, size = size_of(indices) },
})

Expand Down
4 changes: 2 additions & 2 deletions examples/instancing-compute/main.odin
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ init :: proc "c" () {

// a zero-initialized storage buffer for the particle state
sbuf := sg.make_buffer({
type = .STORAGEBUFFER,
usage = { storage_buffer = true },
size = MAX_PARTICLES * size_of(Particle),
label = "particle-buffer",
})
Expand Down Expand Up @@ -86,7 +86,7 @@ init :: proc "c" () {
5, 1, 2, 5, 2, 3, 5, 3, 4, 5, 4, 1,
}
state.display.bind.index_buffer = sg.make_buffer({
type = .INDEXBUFFER,
usage = { index_buffer = true },
data = { ptr = &indices, size = size_of(indices) },
label = "geometry-ibuf",
})
Expand Down
4 changes: 2 additions & 2 deletions examples/instancing/main.odin
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ init :: proc "c" () {
5, 1, 2, 5, 2, 3, 5, 3, 4, 5, 4, 1,
}
state.bind.index_buffer = sg.make_buffer({
type = .INDEXBUFFER,
usage = { index_buffer = true },
data = { ptr = &indices, size = size_of(indices) },
})

// empty, dynamic instance-data vertex buffer, goes into vertex-buffer-slot 1
state.bind.vertex_buffers[1] = sg.make_buffer({
size = MAX_PARTICLES * size_of(m.vec3),
usage = .STREAM,
usage = { stream_update = true },
})

// a shader and pipeline object
Expand Down
4 changes: 2 additions & 2 deletions examples/mrt/main.odin
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ create_offscreen_attachments :: proc (width, height: i32) {

// create offscreen rendertarget images and pass
color_img_desc := sg.Image_Desc {
render_target = true,
usage = { render_attachment = true },
width = width,
height = height,
sample_count = OFFSCREEN_SAMPLE_COUNT,
Expand Down Expand Up @@ -149,7 +149,7 @@ init :: proc "c" () {
22, 21, 20, 23, 22, 20,
}
cube_ibuf := sg.make_buffer({
type = .INDEXBUFFER,
usage = { index_buffer = true },
data = { ptr = &cube_indices, size = size_of(cube_indices) },
})

Expand Down
2 changes: 1 addition & 1 deletion examples/noninterleaved/main.odin
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ init :: proc "c" () {
22, 21, 20, 23, 22, 20,
}
ibuf := sg.make_buffer({
type = .INDEXBUFFER,
usage = { index_buffer = true },
data = { ptr = &indices, size = size_of(indices) },
})

Expand Down
2 changes: 1 addition & 1 deletion examples/offscreen/main.odin
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ init :: proc "c" () {

// a render pass with one color- and one depth-attachment image
img_desc := sg.Image_Desc {
render_target = true,
usage = { render_attachment = true },
width = 256,
height = 256,
pixel_format = .RGBA8,
Expand Down
2 changes: 1 addition & 1 deletion examples/quad/main.odin
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ init :: proc "c" () {
// an index buffer
indices := [?]u16 { 0, 1, 2, 0, 2, 3 }
state.bind.index_buffer = sg.make_buffer({
type = .INDEXBUFFER,
usage = { index_buffer = true },
data = { ptr = &indices, size = size_of(indices) },
})

Expand Down
2 changes: 1 addition & 1 deletion examples/sgl-context/main.odin
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ init :: proc "c" () {

// create an offscreen render target texture, pass, and pass_action
state.offscreen.img = sg.make_image({
render_target = true,
usage = { render_attachment = true },
width = OFFSCREEN_WIDTH,
height = OFFSCREEN_HEIGHT,
pixel_format = OFFSCREEN_PIXELFORMAT,
Expand Down
2 changes: 1 addition & 1 deletion examples/texcube/main.odin
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ init :: proc "c" () {
22, 21, 20, 23, 22, 20,
}
state.bind.index_buffer = sg.make_buffer({
type = .INDEXBUFFER,
usage = { index_buffer = true },
data = { ptr = &indices, size = size_of(indices) },
})

Expand Down
4 changes: 2 additions & 2 deletions examples/vertexpull/main.odin
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ init :: proc "c" () {
{ pos = { 1.0, 1.0, -1.0 }, color = { 1.0, 0.0, 0.5, 1.0} },
}
state.bind.storage_buffers[SBUF_ssbo] = sg.make_buffer({
type = .STORAGEBUFFER,
usage = { storage_buffer = true },
data = { ptr = &vertices, size = size_of(vertices) },
})

Expand All @@ -83,7 +83,7 @@ init :: proc "c" () {
22, 21, 20, 23, 22, 20,
}
state.bind.index_buffer = sg.make_buffer({
type = .INDEXBUFFER,
usage = { index_buffer = true },
data = { ptr = &indices, size = size_of(indices) },
})

Expand Down
15 changes: 8 additions & 7 deletions sokol/c/sokol_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -6624,19 +6624,20 @@ _SOKOL_PRIVATE void _sapp_d3d11_create_device_and_swapchain(void) {
#if defined(SOKOL_DEBUG)
create_flags |= D3D11_CREATE_DEVICE_DEBUG;
#endif
D3D_FEATURE_LEVEL feature_level;
D3D_FEATURE_LEVEL requested_feature_levels[] = { D3D_FEATURE_LEVEL_11_1, D3D_FEATURE_LEVEL_11_0 };
D3D_FEATURE_LEVEL result_feature_level;
HRESULT hr = D3D11CreateDeviceAndSwapChain(
NULL, /* pAdapter (use default) */
D3D_DRIVER_TYPE_HARDWARE, /* DriverType */
NULL, /* Software */
create_flags, /* Flags */
NULL, /* pFeatureLevels */
0, /* FeatureLevels */
requested_feature_levels, /* pFeatureLevels */
2, /* FeatureLevels */
D3D11_SDK_VERSION, /* SDKVersion */
sc_desc, /* pSwapChainDesc */
&_sapp.d3d11.swap_chain, /* ppSwapChain */
&_sapp.d3d11.device, /* ppDevice */
&feature_level, /* pFeatureLevel */
&result_feature_level, /* pFeatureLevel */
&_sapp.d3d11.device_context); /* ppImmediateContext */
_SOKOL_UNUSED(hr);
#if defined(SOKOL_DEBUG)
Expand All @@ -6657,13 +6658,13 @@ _SOKOL_PRIVATE void _sapp_d3d11_create_device_and_swapchain(void) {
D3D_DRIVER_TYPE_HARDWARE, /* DriverType */
NULL, /* Software */
create_flags, /* Flags */
NULL, /* pFeatureLevels */
0, /* FeatureLevels */
requested_feature_levels, /* pFeatureLevels */
2, /* FeatureLevels */
D3D11_SDK_VERSION, /* SDKVersion */
sc_desc, /* pSwapChainDesc */
&_sapp.d3d11.swap_chain, /* ppSwapChain */
&_sapp.d3d11.device, /* ppDevice */
&feature_level, /* pFeatureLevel */
&result_feature_level, /* pFeatureLevel */
&_sapp.d3d11.device_context); /* ppImmediateContext */
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions sokol/c/sokol_debugtext.h
Original file line number Diff line number Diff line change
Expand Up @@ -4251,8 +4251,8 @@ static void _sdtx_init_context(sdtx_context ctx_id, const sdtx_context_desc_t* i
sg_buffer_desc vbuf_desc;
_sdtx_clear(&vbuf_desc, sizeof(vbuf_desc));
vbuf_desc.size = vbuf_size;
vbuf_desc.type = SG_BUFFERTYPE_VERTEXBUFFER;
vbuf_desc.usage = SG_USAGE_STREAM;
vbuf_desc.usage.vertex_buffer = true;
vbuf_desc.usage.stream_update = true;
vbuf_desc.label = "sdtx-vbuf";
ctx->vbuf = sg_make_buffer(&vbuf_desc);
SOKOL_ASSERT(SG_INVALID_ID != ctx->vbuf.id);
Expand Down
Loading