MCPcopy Create free account
hub / github.com/RenderKit/embree / updateBuffer

Method updateBuffer

kernels/common/scene_line_segments.cpp:142–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140 }
141
142 void LineSegments::updateBuffer(RTCBufferType type, unsigned int slot)
143 {
144 if (type == RTC_BUFFER_TYPE_INDEX)
145 {
146 if (slot != 0)
147 throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot");
148 segments.setModified();
149 }
150 else if (type == RTC_BUFFER_TYPE_VERTEX)
151 {
152 if (slot >= vertices.size())
153 throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot");
154 vertices[slot].setModified();
155 }
156 else if (type == RTC_BUFFER_TYPE_NORMAL)
157 {
158 if (slot >= normals.size())
159 throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot");
160 normals[slot].setModified();
161 }
162 else if (type == RTC_BUFFER_TYPE_VERTEX_ATTRIBUTE)
163 {
164 if (slot >= vertexAttribs.size())
165 throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot");
166 vertexAttribs[slot].setModified();
167 }
168 else if (type == RTC_BUFFER_TYPE_FLAGS)
169 {
170 if (slot != 0)
171 throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "invalid buffer slot");
172 flags.setModified();
173 }
174 else
175 {
176 throw_RTCError(RTC_ERROR_INVALID_ARGUMENT, "unknown buffer type");
177 }
178
179 Geometry::update();
180 }
181
182 void LineSegments::setTessellationRate(float N) {
183 tessellationRate = clamp((int)N,1,16);

Callers

nothing calls this directly

Calls 2

setModifiedMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected